|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Fwd: Built-in *@ vs. node()
Hi,
> <?xml version="1.0" encoding="iso-8859-1"?>
> <xsl:stylesheet
> version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="xml" encoding="iso-8859-1" indent="yes"/>
>
> <xsl:template match="node()">
> <xsl:copy>
> <xsl:apply-templates select="@*"/>
> <xsl:apply-templates/>
> </xsl:copy>
> </xsl:template>
>
> </xsl:stylesheet>
>
> It doesnt copy attribute nodes and i dont know why it doesnt. It
> matches the default attribute template which i thought would be
> overriden by <xsl:template match="node()">
Nope, because "node()" pattern uses the child axis, and while attributes are nodes, they are accessible only using the "attribute" axis or abbreviation "@" . Thus use
<xsl:template match="@*|node()">
...
Cheers,
Jarno
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








