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

Re: seriously trivial question about processing the ro

Subject: Re: seriously trivial question about processing the root element
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 20 Mar 2003 09:57:20 +0000
Re:  seriously trivial question about processing the ro
Hi Robert,

> more than one book i've been reading has presented examples of
> processing an XML document whose document element is, say, <doc>,
> with:
>
>   <xsl:template match="/">
>    <xsl:apply-templates select="doc"/>
>   </xsl:template>
>
>   <xsl:template match="doc">
>    ....etc etc ...

The pattern that I tend to use is:

<xsl:template match="/">
  <xsl:apply-templates select="doc" mode="html" />
</xsl:template>

<xsl:template match="doc" mode="html">
  ...
</xsl:template>

In other words, I use the template matching the root node to start
processing using a particular mode. This arrangement makes it easy to
combine stylesheets. As Ken said, it also specifies the document
element of the documents that you expect to be working with.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.