|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: access attribute in the parent element.
The abbreviated syntax to refer to the parent node is ".." [In case you're interested, the full function is "from-parent(node())"] To specify the attribute "first" use "@first". Stringing them together with a "/" and substituting it in the select statement gives: <xsl:template match="COUNTRY">
<xsl:value-of select="../@first"/>
</xsl:template>This returns "john" when I tested it on Cocoon using: <NAME first="john" last="mike">
<COUNTRY></COUNTRY>
</NAME>If you want to get the attribute from the root instead, use <xsl:value-of select="//@first"/> Hope that helps, -- Willy At 06:32 PM 6/20/00 -0700, you wrote: How can i get the value of an attribute from a parent element/from an element in the top of the hirarchy. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








