xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Pattern Question


Subject: RE: [xsl] Pattern Question
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 28 Mar 2003 15:07:39 -0000

> 
> 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
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor