RE: Re: Re: XPath Expression

Thanks John,

I was always curious why the XSLT identity transform specified "node() |
@*" if node() matches attributes.  I think your explanation solves the mystery.

Hi Ed, 

One more question, is node() in XPath supposed to match attributes?  When

I read XPath, it seems like it should but my experience with XSLT makes

it seem like node() matches all node types but attributes.  

node() will match anything, but the problem is that it will only match nodes
on the axis being used. The axes for elements (child, descendant, ancestor,
parent, etc.) purposefully exclude attributes and namespaces.  However,
if you are on an attribute or namespace axis, then node() matches the nodes
on that axis.  So, node() is kind of useless on these axes because the axes
don't contain multiple types of nodes.


Ed Simon
XMLsec Inc.

Interested in XML Security Training and Consulting services?  Visit "".

Received on Thursday, 2 August 2001 15:02:19 UTC