This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSLT Processing Model Questions
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 15 Apr 2002 08:44:18 +0100
- Subject: Re: [xsl] XSLT Processing Model Questions
- References: <EFEGIOPKGBEGIGJHBLNFCEFJCLAA.dietrich@ganx4.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> 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