I am trying to retrieve an alias value from three nodes under a parent node but, I am getting confused because I can't find the solution to the problem.
- The XSLT that I am using to retrieve the data from the nodes.
<xsl:value-of select="//clientLog"/> <!-- I want to get the clientLogo alias from the child node --> </xsl:attribute> </img> </li> </xsl:if> </xsl:for-each> </ul> </xsl:template>
Inside a for-each statement, the so-called "current node" in XSLT is the one currently being processed, so your XPaths in here just need to be relative to that node, so if you need a property you just call it by name:
Problems retrieving data from a child node.
Greetings,
I am trying to retrieve an alias value from three nodes under a parent node but, I am getting confused because I can't find the solution to the problem.
- The XSLT that I am using to retrieve the data from the nodes.
<xsl:variable name="identifier" select="/macro/id"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<ul>
<xsl:attribute name="id">
<xsl:value-of select="$identifier"/>
</xsl:attribute>
<xsl:for-each select="$currentPage//*">
<xsl:if test="@nodeName != ''">
<li>
<img>
<xsl:attribute name="src">
<xsl:value-of select="//clientLog"/> <!-- I want to get the clientLogo alias from the child node -->
</xsl:attribute>
</img>
</li>
</xsl:if>
</xsl:for-each>
</ul>
</xsl:template>
Can anybody help please?
Thanks beforehand.
Regards,
Eduardo Macho
Hi Eduardo,
Inside a for-each statement, the so-called "current node" in XSLT is the one currently being processed, so your XPaths in here just need to be relative to that node, so if you need a property you just call it by name:
- or if you're using v.4.0:
/Chriztian
Hi Chriztian,
Thank you very much, your answer helped me.
Regards,
Eduardo
is working on a reply...