[Home] [By Thread] [By Date] [Recent Entries]
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
|

Cart



