Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
i've a macro with a variabile that contain 3 data row called "test" and a for each.
<xsl:variable name="test" select="umbraco.library:GetXmlNodeById(1091)//umbNewsArticle [string(visibileInHomePage) = '1' and string(numeroPubblicazione) =$currentPage/numeroPubblicazione]" /> <xsl:for-each select="$test ">
if i ask the node name of the data row all works fine but when i call a info contained in it
<xsl:value-of select="$test/settore" />
the macro display 3 time the first row value.
how can i resolve this?
there is a book where i can study this things?
thank you
nico
Hi Nico,
Try removing the $test from the 'select':
<xsl:value-of select="settore" />
Reason is that once you are inside the for-each loop, you already have the context of the $test variable, so don't need to reference it again.
If you want to learn more about XSLT, you could try the W3Schools tutorials? http://www.w3schools.com/xsl/
... or if you are from more of a C# background, then take a look at Razor?
Cheers, Lee.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
for each return always the firts value
Hi all,
i've a macro with a variabile that contain 3 data row called "test" and a for each.
<xsl:variable name="test"
select="umbraco.library:GetXmlNodeById(1091)//umbNewsArticle
[string(visibileInHomePage) = '1' and string(numeroPubblicazione) =$currentPage/numeroPubblicazione]" />
<xsl:for-each select="$test ">
if i ask the node name of the data row all works fine but when i call a info contained in it
<xsl:value-of select="$test/settore" />
the macro display 3 time the first row value.
how can i resolve this?
there is a book where i can study this things?
thank you
nico
Hi Nico,
Try removing the $test from the 'select':
Reason is that once you are inside the for-each loop, you already have the context of the $test variable, so don't need to reference it again.
If you want to learn more about XSLT, you could try the W3Schools tutorials? http://www.w3schools.com/xsl/
... or if you are from more of a C# background, then take a look at Razor?
Cheers, Lee.
is working on a reply...