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
I have two nodes like this:
<Block> <nodeId> 2009 </nodeId> <nodeId> 2010 </nodeId </Block> <News> <nodeId> 2009 </nodeId> </News>
I would like to find whether Block and News have intersection in their children or not. For example for this sample I want to get true which means these two nodes have intersection. I really prefer to get this with one XSL (XPath) expression.
Regards,
Nami
I'm going to assume that there is some sort of root elemnt around the shown xml. In that case, this should do the trick:
<xsl:variable name="exists" select="root/Block/nodeId = root/News/nodeId" /> <xsl:value-of select="$exists"/>
Using the = operator will return true if there are matching nodes in the two node sets.
http://zvon.org/comp/r/ref-XPath_1.html#Expressions~%3D
Thanx a lot. Simple nice solution.
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.
Continue discussion
Intersection of two nodes in umbraco with XSLT
Hi
I have two nodes like this:
I would like to find whether Block and News have intersection in their children or not. For example for this sample I want to get true which means these two nodes have intersection. I really prefer to get this with one XSL (XPath) expression.
Regards,
Nami
I'm going to assume that there is some sort of root elemnt around the shown xml. In that case, this should do the trick:
Using the = operator will return true if there are matching nodes in the two node sets.
http://zvon.org/comp/r/ref-XPath_1.html#Expressions~%3D
Thanx a lot. Simple nice solution.
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.