|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: how to store attribute value?
Vinoth Palaniappan wrote:
I have a xml document as: <myroot root_attribute="test_val"> <a1/> <a1/> </myroot> While processing the node "a1" using XSL, i need to access the value of attribute "root_attribute" of it's parent. That's very simple and straightforward - just say that you want value of attribite of parent element: <xsl:template match="a1"> <xsl:value-of select="../@root_attribute"/> <!-- Or the same in nonsimplified syntax --> <xsl:value-of select="parent::*/attribute::root_attribute"/> </xsl:template> That's what XPath expresions are for.How can i access the attribute of some node in the template match of another node? -- Oleg Tkachenko Multiconn International, Israel 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








