This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Apply templates + "match all" template
- From: "Hunsberger, Peter" <Peter dot Hunsberger at stjude dot org>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 27 Jun 2002 09:14:28 -0500
- Subject: RE: [xsl] Apply templates + "match all" template
- Reply-to: xsl-list at lists dot mulberrytech dot com
You also need a template to do something with the list other than throw it
away. Add:
<xsl:template match="list">
whatever...
<xsl:copy-of select="."/>
</xsl:template>
Then you likely want to change the select to:
<xsl:apply-templates select="*"/>
since the match will select the nodes you want and it sounds like you'll
eventually want to match other nodes in a generic fashion also...
-----Original Message-----
From: Gustaf Liljegren [mailto:gustaf.liljegren@xml.se]
Sent: Thursday, June 27, 2002 9:13 AM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] Apply templates + "match all" template
Hello all,
I'm making a map from one DTD to another, a pure XSLT task for once. Since
I've not yet dealt with the whole source DTD, I have this template at the
end:
<xsl:template match="*"/>
The only thing I have done so far are lists and inline content, so in the
root node match I write:
<xsl:template match="/">
<doc>
<xsl:apply-templates select="list"/>
</doc>
</xsl:template>
I thought this would make the lists appear and nothing else, but the only
thing I get is:
<?xml version="1.0" encoding="iso-8859-1"?><doc/>
If I remove both the select="list" and <xsl:template match="*"/> I get the
lists, but also all the other content with no markup.
Gustaf
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list