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

Re: XSLT Processing Model Questions

Subject: Re: XSLT Processing Model Questions
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 15 Apr 2002 08:44:18 +0100
Re:  XSLT Processing Model Questions
> First: I'm viewing the source-tree serialization given in section
> D.1. This is what is leading me to believe this. 

The template 

<xsl:template match="doc/title">
  <h1>
    <xsl:apply-templates/>
  </h1>
</xsl:template>

Matches the title element:

<title>Document Title</title>

and produces a <h1> element in the output, the apply-templates there
matches the children of the title element, which is the text node
Document Title
and produces an identical text node as the child of h1.

Why do you think that the apply-templates is generating siblings of h1?

The next sibling is the <h2>chapter title</h2>
which comes about as the 
apply-templates
in the template for doc  causes templates to be applied to the <chapter?
element after the title element. There is no template supplied for
chapter so the default template will be used, which applies templates to
the children of that element, so then th etemplate matching


<xsl:template match="chapter/title">
  <h2>
    <xsl:apply-templates/>
  </h2>
</xsl:template>

fires and produces the h2.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 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.