[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] how to store attribute value?
Hi all, 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. I tried to do in the following way, but could not have a value-of construct within variable construct. <xsl:template match="myroot"> <xsl:variable name="test_var" select="<xsl:value-of select="@root_attribute"/>"></xsl:variable> <xsl:for-each select="child::*"> <xsl:apply-templates select="*"></xsl:apply-templates> </xsl:for-each> </xsl:template> <xsl:template match="a1"> <xsl:copy-of select="$test_var"/> </xsl:template> How can i access the attribute of some node in the template match of another node? Any help is appreciated. ____________________________________________________________________________ ___________ Vinoth iDEN OMC Software, GSG Motorola, India voice: 91-040-3308090 extn:3208 ____________________________________________________________________________ ___________ 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
|