|
-
ADO, XML accessing a parent node's row context from a child node attributes???
Hi All
Extract of style sheet, I do not seem to understand how to refernce a parent
node when I processing the
inner <xsl:for-each select='@*'>, I want to fill the HREf with the orderID
that is in the <xsl:for-each select='z:row'>
outer loop I thought that preceeding a filter with ".." allow access to the
parent node values eg.
<xsl:value-of select="..['@OrderID']" /> would return in the current row
context the value of the orderid
associated with the "OrderNUmber"
<xsl:template match="xml/rs:data">
<xsl:for-each select='z:row'>
<tr>
<xsl:for-each select='@*'>
<td nowrap="nowrap" class='Cell'>
<xsl:choose>
<xsl:when test=".[nodeName()='OrderNumber']">
<a>
<xsl:attribute name="HREF">Order.asp?OrderID=<xsl:value-of
select="..['@OrderID']" />
</xsl:attribute>
<xsl:value-of match='.'/>
</a>
</xsl:when>
</xsl:choose>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</xsl:template>
Extract of xml ado data looks like
<rs:data>
<z:row OrderNumber='71826' OrderID='71826' ...bunch of other fields />
</rs:data>
</xml>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks