Re: [xsl] Fwd: Built-in *@ vs. node()

Subject: Re: [xsl] Fwd: Built-in *@ vs. node()
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 16 Oct 2002 17:24:40 +0200
Janning Vygen wrote:
Hi all,

my very small Stylsheet:

<?xml version="1.0" encoding="iso-8859-1"?>
 <xsl:output method="xml" encoding="iso-8859-1" indent="yes"/>

<xsl:template match="node()">
      <xsl:apply-templates select="@*"/>


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()">

In my XML Book "In a nutshell" it says:
"node() matches all nodes regardless of type: attribute,

Error: node() matches text(), comment(), processing-instruction(), *, but neither attributes nor namespaces.

So change it to

<xsl:template match="node() | @*">



and later in the same book about xsl:template it says:
"templates witch match patterns that just have a node test (*,@*, node()...) have priority -0.5" like built-in templates, but "they
[built-in templates] are also imported before all other templates,
and thus never override any explicit template rule, regardless of

so all attributes are selected by <xsl:apply-templates select="@*"/>
and because they match node() and <xsl:template match="node()"> has
 same priority as built-in <xsl:template match="text()|@*"> BUT it
 has higher import precedence.

So it should match and xsl:copy with attribute should create an
 attribute with same name and value as the source document (Kay, XSLT
 2nd edition p. 193)

But it doesnt work with xsltproc neither with saxon

Can anyone push me in the right direction to solve my problem (or how to read my books :-)



System Development
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409

VIRBUS hat jetzt als erster deutscher Softwarehersteller die Zertifizierung für den 3D Secure-Authentifizierungsstandard "Verified by Visa" erhalten. Details unter

XSL-List info and archive:

Current Thread