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

Re: Re: Comparing two xml documents

Subject: Re: Re: Comparing two xml documents
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 12 Mar 2003 21:05:21 -0700 (MST)
comparing two xml doc
Robert P. J. Day wrote:
> On Wed, 12 Mar 2003, Ragulf Pickaxe wrote:
> 
> > What is the differenct between:
> > <xsl:template match="*">
> > 
> > and
> > 
> > <xsl:template match="node()">
> 
> i went through this grief recently.  as i read it, "*" will
> match any element, while node() will match any of
> 
> 1) elements
> 2) comments
> 3) processing instructions
> 4) text nodes
> 
> is this about right?

Yes.

To be pedantic, '*' matches any node that is of the 'principal node type' for
the given axis. The default axis is 'child', so match="*" really means
match="child::*". The principal node type for the child axis is element, so
yes, "*" matches any element node.

The attribute and namespace axes have a different principal node type, so for
example "attribute::*" or its shorthand "@*" both match any attribute node.

node() matches any node at all, but match="node()" means
match="child::node()", so it only matches nodes that can be children, which is
all node types other than attribute, namespace, and root. So yeah, you got it.

Mike

-- 
  Mike J. Brown   |  http://skew.org/~mike/resume/
  Denver, CO, USA |  http://skew.org/xml/

 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.