I've just upgraded a site to 4.5.1 and as I'm getting used to the new schema I used the add value-of functionto make sure it was correct. So I got this returned:
<xsl:value-of select="leftContentLink"/>
Thinking this would work, but nothing was being returned, so i modified it to do
My Question is surely if your using the "Insert value-of" into your xslt it should append the $currentPage to the beginning of the alias? Just like in version 4.0.3 does with data?
There is no difference how the XSLT/XPath selects the nodeset between v4.0.x and v4.5 - the only thing that matters is the context.
Usually when you need to output any of the property data (which was "data[@alias='propertyAlias']" in the legacy XML schema), you were usually in a for-each loop (or apply-templates) - so the current() node had the context. The same still applied to the new v4.5 XML schema.
For example, you can loop through the content nodes - and the context of the node is within the loop, so it doesn't need to be prefixed with anything.
<xsl:for-each select="$currentPage/*[@isDoc]">
<xsl:value-of select="propertyAlias" /><!-- this used to be data[@alias='propertyAlias'] -->
</xsl:for-each>
The reason why "leftContentLink" doesn't work on its own, is because there is no context to the data/value. Whereas when you use "$currentPage/leftContentLink", the XSLT knows to look-up the value from "$currentPage".
Getting value in xslt from node in 4.5.1
Hi All,
I've just upgraded a site to 4.5.1 and as I'm getting used to the new schema I used the add value-of functionto make sure it was correct. So I got this returned:
Thinking this would work, but nothing was being returned, so i modified it to do
And it works, hay-presto!!
My Question is surely if your using the "Insert value-of" into your xslt it should append the $currentPage to the beginning of the alias? Just like in version 4.0.3 does with data?
Thanks
Tom
Hi Tom,
There is no difference how the XSLT/XPath selects the nodeset between v4.0.x and v4.5 - the only thing that matters is the context.
Usually when you need to output any of the property data (which was "data[@alias='propertyAlias']" in the legacy XML schema), you were usually in a for-each loop (or apply-templates) - so the current() node had the context. The same still applied to the new v4.5 XML schema.
For example, you can loop through the content nodes - and the context of the node is within the loop, so it doesn't need to be prefixed with anything.
<xsl:for-each select="$currentPage/*[@isDoc]"> <xsl:value-of select="propertyAlias" /><!-- this used to be data[@alias='propertyAlias'] --> </xsl:for-each>The reason why "leftContentLink" doesn't work on its own, is because there is no context to the data/value. Whereas when you use "$currentPage/leftContentLink", the XSLT knows to look-up the value from "$currentPage".
Cheers, Lee.
Thanks for clearing that up Lee, makes more sense now
Cheers
Tom
Just tell xslt where to start.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.