You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users-fr@cocoon.apache.org by Laurent Perez <ha...@gmail.com> on 2005/03/10 10:08:34 UTC

jx:forEach et nodes invalides ?

Hello

Je n'arrive pas à expliquer un comportement étrange de jx:forEach :

En utilisant :

<items>
<jx:forEach var="it" select="${items}">
<z>${it.foo}</z>
</jx:forEach>
</items>

et en transformant le résultat avec :

<xsl:for-each select="/items/z">
<i><xsl:value-of select="."/></i>
</xsl:for-each>

... je n'obtient rien du tout, car le <z> généré dans le forEach est
apparemment vu comme du texte, et pas comme un vrai noeud. Si je sors
<z>zzz</z> de la boucle, alors j'ai bien un <i>property foo</i> généré
en sortie.

est-ce un comportement normal du forEach ?

merci :)

Laurent

---------------------------------------------------------------------
Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/
Pour vous desinscrire : mailto:users-fr-unsubscribe@cocoon.apache.org
Autres commandes : mailto:users-fr-help@cocoon.apache.org


Re: jx:forEach et nodes invalides ?

Posted by Laurent Perez <ha...@gmail.com>.
> Qu'est-ce que tu obtiens si tu mets un <map:serialize type="xml"/> juste
> après le générateur ?

En fait, j'ai réglé le problème, il n'y a effectivement pas de bugs
dans le jxtemplate, un sendPage() invalide m'avait échappé.. l'erreur
est humaine :)

laurent

---------------------------------------------------------------------
Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/
Pour vous desinscrire : mailto:users-fr-unsubscribe@cocoon.apache.org
Autres commandes : mailto:users-fr-help@cocoon.apache.org


Re: jx:forEach et nodes invalides ?

Posted by Sylvain Wallez <sy...@apache.org>.
Laurent Perez wrote:

>Hello
>
>Je n'arrive pas à expliquer un comportement étrange de jx:forEach :
>
>En utilisant :
>
><items>
><jx:forEach var="it" select="${items}">
><z>${it.foo}</z>
></jx:forEach>
></items>
>
>et en transformant le résultat avec :
>
><xsl:for-each select="/items/z">
><i><xsl:value-of select="."/></i>
></xsl:for-each>
>
>... je n'obtient rien du tout, car le <z> généré dans le forEach est
>apparemment vu comme du texte, et pas comme un vrai noeud. Si je sors
><z>zzz</z> de la boucle, alors j'ai bien un <i>property foo</i> généré
>en sortie.
>
>est-ce un comportement normal du forEach ?
>  
>

Pas du tout :-)

Qu'est-ce que tu obtiens si tu mets un <map:serialize type="xml"/> juste 
après le générateur ?

Je vois aussi que la XSL contient un XPath absolu (/items/z). Est-ce que 
<items> est l'élément racine produit par le template ?

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


---------------------------------------------------------------------
Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/
Pour vous desinscrire : mailto:users-fr-unsubscribe@cocoon.apache.org
Autres commandes : mailto:users-fr-help@cocoon.apache.org