[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Correlation between two xml trees

Subject: Re: Correlation between two xml trees
From: Antonio Fiol <fiol@xxxxxxxxxx>
Date: Thu, 06 Jun 2002 14:00:43 +0200
correlation between two companies


<xsl:template match="z:row">
<data>
<xsl:variable name="data" select="."/>
<xsl:for-each select="$outputdef/root/column">
<xsl:element name="{@tagname}">
<xsl:value-of select="$data/@*[name()=current()/@dbcolumn]"/>
</xsl:element>
</xsl:for-each>
</data>
</xsl:template>



I understand the use of the xsl:variable,


Probably you have not fully understood (catching that was difficult to me) that what you are assigning to the variable "data" is the node-set specified by ".".

but the rest of the expression
is still baffling to me:

select="$data/@*[name()=current()/@dbcolumn]"


Then you are selecting:

all (*) the attributes (@) of the node contained in $data whose name() equals the dbcolumn attribute (@) of current() node.

current() node is the way you have to refer to the node that was current "outside the [ ]", as referring to "." inside the [ ] you mean the node you are testing for inclusion on the result.

HTH.


Antonio Fiol




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.