[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Fwd: Built-in *@ vs. node()

Subject: Fwd: Built-in *@ vs. node()
From: Janning Vygen <vygen@xxxxxx>
Date: Wed, 16 Oct 2002 17:05:42 +0200
 Fwd: Built-in *@ vs. node()
Hi all,

my very small Stylsheet:

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

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

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
priority"

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 :-)

regards,
janning

--
Planwerk 6 /websolutions
Herzogstraße 86
40215 Düsseldorf

fon 0211-6015919
fax 0211-6015917
http://www.planwerk6.de

-------------------------------------------------------

-- 
Planwerk 6 /websolutions
Herzogstraße 86
40215 Düsseldorf

fon 0211-6015919
fax 0211-6015917
http://www.planwerk6.de

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.