This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xalan-java xslt node value
- From: Trevor Nash <tcn at melvaig dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 16 Sep 2002 17:33:32 +0100
- Subject: Re: [xsl] xalan-java xslt node value
- Organization: Melvaig Software Engineering Limited
- References: <002601c259ad$dbccedd0$117dd618@WPTF7SWB11>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Read up on 'built-in templates'.
There is a default behaviour in XSLT that essentially says 'unless you
tell me differently, I will do the following:
for an element or root node, I will process each child
for a text node, I will copy the text to the output.'
(Its actually slightly more complicated than that, but thats the
important bit).
So,
><xsl:template match="/">
> <xsl:apply-templates/>
></xsl:template>
is not necessary, the XSLT processor will do that by default
>How can I prevent the sports-title value from being included in my output?
You also need
<xsl:template match="sports-title" />
(note the '/' which makes this an empty template)
to tell the processor explicitly not to do anything with the
sports-title elements.
Another method is to match one of the higher level elements and do an
apply-templates to process only the elements you actually want, rather
than leave the processor to look at all of them.
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email
Melvaig Software Engineering Limited
voice: +44 (0) 1445 771 271
email: tcn@melvaig.co.uk
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list