Re: [xsl] question about identity transform

Subject: Re: [xsl] question about identity transform
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 31 Oct 2006 15:23:39 -0500
At 2006-10-31 11:39 -0800, Bill French wrote:
I've used the identity transform many times to
do useful things and have often wondered about
the match pattern. Why is the match pattern

"node() | @*"

rather than simply "node()"? Aren't attributes returned by node()?

Not when the axis is omitted ... the omission of the axis in an XPath expression is the abbreviation for the child:: axis, and there are no attributes along the child axis.

The XPath expression "node()" has a node test,
but the axis is omitted, so the fully expanded
version of this address is "child::node()".  No attributes found there.

The "@" is an abbreviation for "attribute::" so
"@*" expands to "attribute::*" which is why that works.

I hope this helps.

. . . . . . . . . . Ken

--
UBL/XSLT/XSL-FO training: Allerxd/Verx Denmark 2006-11-13,17,20/24
UBL International 2006  2006-11-13/17 http://www.ublconference.com
World-wide corporate, govt. & user group UBL, XSL, & XML training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread