$currentPage/*[@isDoc] gets the first node as it's just going down the levels until it finds what we are looking for and then stops. But notice that you can also use this selection in a for-each like this:
<xsl:for-each select="$currentPage/*[@isDoc]">
Which would run through each of the childnodes under the current page.
Get a property from the first child
Hi! I'm creating a xslt that takes one property from the page itself, and if it's not set, searches for that property in its first child...
I got this, but seems to be wrong:
What am I missing? (Umbraco 4.6.1)
Hi AValor.
Could you try this:
Does that help?
/Kim A
Thank you so much! It worked like a charm!
I'm new in all this Umbraco universe and still get confused about understanding and building XPATH strings...
By the way, where I can get info about the new XSLT schema? I'm getting crazy mixing documentation about xlst and not knowing if it's valid or not...
For example, I don't understand why $currentPage/* gets the first child...
Great to hear!
You can see the following wiki entry on a little more info on the new XML schema: http://our.umbraco.org/wiki/reference/xslt/45-xml-schema
$currentPage/*[@isDoc] gets the first node as it's just going down the levels until it finds what we are looking for and then stops. But notice that you can also use this selection in a for-each like this:
Which would run through each of the childnodes under the current page.
/Kim A
is working on a reply...