This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Newbie question--applying templates, selecting paragraphs
- From: Joerg Heinicke <joerg dot heinicke at gmx dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 23 May 2002 21:34:16 +0200
- Subject: Re: [xsl] Newbie question--applying templates, selecting paragraphs
- References: <113A7A0D1F47D511B92E00D0B7E03DAB0235B522@pmail02.vikingfreight.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello Kathryn,
> ---------------------- XSL file-----------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>
> <xsl:output method="xml" encoding="UTF-8"/>
>
> <!-- Match the root node -->
> <xsl:template match="*">
> <xsl:apply-templates select="*"/>
> </xsl:template>
here is a little error. It has to be <xsl:template match="/">. But this
template is not explicitely needed, you can remove it.
> <!-- Handle any node not yet matched -->
> <xsl:template match="*|@*|text()|comment()">
> <xsl:copy>
> <xsl:apply-templates
> select="*|@*|text()|comment()"/>
> </xsl:copy>
> </xsl:template>
>
> </xsl:stylesheet>
> ---------------------- XSL file-----------------------------------
This stylesheet copies "all and everything". If you add other templates
mathcing on <div>, with a special predicate and do nothing in these
templates, those <div>s won't be copied.
example:
<xsl:template match="div[@class='mgronly']">
<!-- 'mgronly' div's won't be copied -->
</xsl:template>
Regards,
Joerg
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list