This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
default template (was:RE: text() and not())
- From: "Andrew Welch" <andrew at thebristoldirectory dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 8 Jan 2002 14:36:37 -0000
- Subject: default template (was:RE: [xsl] text() and not())
- Reply-to: xsl-list at lists dot mulberrytech dot com
>but again, if you don't want titles it is far more common to have a
>template matching title that does nothing rather than matching on title,
>doing the default template which recurses on to the text nodes and then
>having a template that does not copy those text nodes. Doing it this way
>just makes things far more complicated than you need.
>
>David
Sorry David, I still dont understand... but because the way I am doing it is
poor I want to do it the way you are saying.
I have a stylesheet (prob. very common) that looks something like:
<xsl:template match="/">
<html>
...
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
Then follows a load of templates to deal with the interesting parts of the
XML file. As I understand, <xsl:apply-templates/> will read through the
source xml and look for templates in the stylesheet to process them with.
(push-processing right?) If it encounters an element that doesnt have a
matching template, it will invoke a default template depending on the type
of element (atribute, comment etc) it has encountered. In which case, I
have to include my own template to do nothing, to override the default one.
So, I guess Im asking what do I use instead of <xsl:apply-templates/> within
the <xsl:template match="/"> template to stop the default template being
invoked?
andrew
===
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list