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

RE: Pattern Question

Subject: RE: Pattern Question
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 28 Mar 2003 15:07:39 -0000
RE:  Pattern Question
> 
> This should be a relatively easy question but I just want to 
> confirm what I
> am thinking. What is the difference in the following patterns? Is my
> assessment of the first two correct?
> 
> 
> 1. <xsl:template match="/"> =Matches Root Element

No, it matches the root node. The root node is not an element.

> 2. <xsl:template match="*|@"> =Matches all element nodes or 
> attributes.

Almost, but you meant match="*|@*"

> 3. <xsl:template match="@*|node()"> = Not exactly sure how 
> this pattern
> behaves. Appears to match all nodes or child nodes?

It matches all nodes except root nodes and namespace nodes. The @*
matches attributes; the node() (which is short for child::node())
matches nodes that are children of something, which embraces all
elements, text nodes, comments, and processing-instructions.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 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.