xsl-list
[Top] [All Lists]

Re: [xsl] question about identity transform

2006-10-31 13:24:14
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: Allerød/Vårø 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(_at_)CraneSoftwrights(_dot_)com
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--