M
Marco
Hi All,
this is a sample of my XML doc:
<nodo>
<nodo1>
<nodo11 aa="10">21</nodo11>
<nodo12>41</nodo12>
<nodo13>61</nodo13>
<nodo14>71</nodo14>
<nodo15>marco</nodo15>
</nodo1>
<nodo1>
<nodo11 aa="10">21</nodo11>
<nodo12>92</nodo12>
<nodo13>12</nodo13>
<nodo14>42</nodo14>
<nodo15>carla</nodo15>
</nodo1>
<nodo1>
<nodo11 aa="13">21</nodo11>
<nodo12>43</nodo12>
<nodo13>53</nodo13>
<nodo14>3</nodo14>
<nodo15>antonio</nodo15>
</nodo1>
<info>
<ordinamento>ascending</ordinamento>
<campo>nodo14</campo>
</info>
</nodo>
and this my XSL.. that NOT work like I want !!! :-(
<xsl:variable name="ordinamento">
<xsl:value-of select="info/ordinamento"/>
</xsl:variable>
<xsl:variable name="campo">
<xsl:value-of select="info/campo"/>
</xsl:variable>
<xsl:when test=" $campo = 'nodo12' ">
<xsl:for-each select="nodo1">
<xsl:sort select="X.??.X.??.X" order="{$ordinamento}" data-type="number" />
<xsl:call-template name="writeData"/>
</xsl:for-each>
</xsl:when>
My idea is to make DINAMIC order !
I've two variable: ordinamento to take the type
and campo to choose the node to SORT !!!
Good. But there is a "little" problem...
<xsl:sort select="$campo"... --> DON'T WORK
<xsl:sort select="{$campo}" --> DON'T WORK
but for the order.. I use order="{$ordinamento}"
WHY ?!?!?!?
Anyone can help ME !!!
Thanks
Bye
this is a sample of my XML doc:
<nodo>
<nodo1>
<nodo11 aa="10">21</nodo11>
<nodo12>41</nodo12>
<nodo13>61</nodo13>
<nodo14>71</nodo14>
<nodo15>marco</nodo15>
</nodo1>
<nodo1>
<nodo11 aa="10">21</nodo11>
<nodo12>92</nodo12>
<nodo13>12</nodo13>
<nodo14>42</nodo14>
<nodo15>carla</nodo15>
</nodo1>
<nodo1>
<nodo11 aa="13">21</nodo11>
<nodo12>43</nodo12>
<nodo13>53</nodo13>
<nodo14>3</nodo14>
<nodo15>antonio</nodo15>
</nodo1>
<info>
<ordinamento>ascending</ordinamento>
<campo>nodo14</campo>
</info>
</nodo>
and this my XSL.. that NOT work like I want !!! :-(
<xsl:variable name="ordinamento">
<xsl:value-of select="info/ordinamento"/>
</xsl:variable>
<xsl:variable name="campo">
<xsl:value-of select="info/campo"/>
</xsl:variable>
<xsl:when test=" $campo = 'nodo12' ">
<xsl:for-each select="nodo1">
<xsl:sort select="X.??.X.??.X" order="{$ordinamento}" data-type="number" />
<xsl:call-template name="writeData"/>
</xsl:for-each>
</xsl:when>
My idea is to make DINAMIC order !
I've two variable: ordinamento to take the type
and campo to choose the node to SORT !!!
Good. But there is a "little" problem...
<xsl:sort select="$campo"... --> DON'T WORK
<xsl:sort select="{$campo}" --> DON'T WORK
but for the order.. I use order="{$ordinamento}"
WHY ?!?!?!?
Anyone can help ME !!!
Thanks
Bye