|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: accessing attributes at different nodes
Hi All, Ive sorted this by discovering finally the <xsl:variable> command. Thanks Karen -----Original Message----- From: Clifford, Karen [mailto:Karen.Clifford@xxxxxxxxxxxx] Sent: Friday, September 20, 2002 2:59 PM To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' Subject: accessing attributes at different nodes Hi there, I have an accessing question.....my xml file is similar to the following: <sect1> <sect2 attrA = 'a' /> <sect2 attrA = '2' /> <sect2 attrA = 'ab' /> <sect3> <sect4> <sect5> Value</sect5> <sect5 attr1='ab' attr2='cd'> Value</sect5> .................etc.............. I am in a section of XSL code beginning with.... <xsl:template match="sect5"> Within this code I must do.... If sect5 contains attr1 and attr2 then Create a html attribute for each <sect2> check if attrA=attr1 or attr2 if so then attrA is the attribute value <xsl:template match="sect5"> <xsl:if test="@attr1 and @attr2"> <xsl:attribute name="temp"> <xsl:for-each select="../../../sect2"> <xsl:if test="@attrA = @attr1 or @attr2"> ****Problem Here***** <xsl:value-of select="@attrA"> My problem is that the <xsl:for-each select="../../../colspec"> is puts <sect2> as the context node and I am unable to access the attr1 attribute. Im a newbie so I dont really know how to access this yet....Ive tried //attr1 and putting in the whole path (and a number of other crazy things). Any pointers would be appreciated. Thanks Karen XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list 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








