|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using a template to transform a node attribute
> As written, this template matches an element node, so the attribute tag > would need to be wrapped in an element, as you indicate. The template was perfectly valid as it stood. The element that contains the attribute in the result tree does not have to be generated by the same template as generates the attribute. <xsl:template match="/report/version[@id]"> <xsl:attribute name="id">bar</xsl:attribute> </xsl:template> <xsl:template match="/report/version/@id"> <xsl:attribute name="id">bar</xsl:attribute> </xsl:template> Both have the same status. If they are triggerd by an apply-templates in a context such as <foo> <xsl:apply-templates select=",,,,, Then they are OK, and add an id attribute to foo. If they are triggered by a context such as <foo> some text <xsl:apply-templates select=",,,,, then they are an error as you can't add attribute after the text node has been added. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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








