[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Context in nested loop
On 28.07.2017 16:30, Joseph L. Casale jcasale@xxxxxxxxxxxxxxxxx wrote:
Its schema is exactly the same as the sample XML, itbs a similar document So you have <xsl:for-each select="/root/nodeA/nodeB"> <xsl:variable name="name" select="@name"/> <xsl:for-each select="@*"> <xsl:variable name="attr" select="local-name()"/> <xsl:if test="name()!='name'"> <xsl:message> <xsl:value-of select="$document/root/nodeA/nodeB[@name=$name]/@*[local-name()=$attr]" /> </xsl:message> </xsl:if> </xsl:for-each> </xsl:for-each> and of course the inner variable can be avoided with <xsl:for-each select="/root/nodeA/nodeB"> <xsl:variable name="name" select="@name"/> <xsl:for-each select="@*"> <xsl:if test="name()!='name'"> <xsl:message> <xsl:value-of select="$document/root/nodeA/nodeB[@name=$name]/@*[local-name()=local-name(current())]" /> </xsl:message> </xsl:if> </xsl:for-each> </xsl:for-each> and the outer with <xsl:for-each select="/root/nodeA/nodeB"> <xsl:for-each select="@*"> <xsl:if test="name()!='name'"> <xsl:message> <xsl:value-of select="$document/root/nodeA/nodeB[@name=current()/../@name]/@*[local-name()=local-name(current())]" /> </xsl:message> </xsl:if> </xsl:for-each> </xsl:for-each> if I am not mistaken.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|