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

Re: need to match every element node

Subject: Re: need to match every element node
From: David_N_Bertoni@xxxxxxxxx
Date: Fri, 6 Apr 2001 22:25:04 -0700
for each match every node
Hi Steve,

I think you're confusing matching a node and selecting a set of nodes.

A template rule can have a pattern that can match every element node in a
document.  The easiest way to write that pattern is:

   <xsl:template match="*"/>

When you say "layer after layer," you are describing the method by which
the processor walks the source tree recursively, selecting source tree
nodes for processing.

If you want to select every node in a document and do something with each
node, you can use xsl:for-each:

   <xsl:template match="/">
       <xsl:for-each select="//*">
         <do-something/>
       </xsl:for-each>
   </xsl:template>

However, unless you have some reason to do the latter, the former is
usually more efficient.

Dave



                                                                                                                                                
                    "Steve Renshaw"                                                                                                             
                    <renshaw_steve@xxxxxxxxxxx>        To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                                  
                    Sent by:                           cc:     (bcc: David N Bertoni/CAM/Lotus)                                                 
                    owner-xsl-list@xxxxxxxxxxxx        Subject:      need to match every element node                                      
                    rytech.com                                                                                                                  
                                                                                                                                                
                                                                                                                                                
                    04/06/2001 04:54 PM                                                                                                         
                    Please respond to xsl-list                                                                                                  
                                                                                                                                                
                                                                                                                                                




Ho do you match every element node in one match? The
template below process
every element node layer after layer but I need it in done one sinlge match

only

<xsl:template match="/|*">
      <do-something/>
      <xsl:apply-templates/>
</xsl:template>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list






 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.