|
Subject: RE: [xsl] default template ? From: "Ludwig, Michael" <Michael.Ludwig@xxxxxxxxxxxx> Date: Mon, 27 Sep 2010 17:40:33 +0200 |
> I was wondering how an XSL Stylesheet can be done to treat
> all nodes in an XML file if a template doesn't fit.
Two examples. The copy template:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
A (warning) message template:
<xsl:template match="@*|node()">
<xsl:message>
<xsl:value-of select="concat( '# ', name(), ' ' )"/>
<xsl:apply-templates select="@*|node()"/>
</xsl:message>
</xsl:template>
You can think up your own default action.
Default matching is:
<xsl:template match="@*|node()">
Michael
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] default template ?, Fabien Tillier | Thread | RE: [xsl] default template ?, Fabien Tillier |
| [xsl] default template ?, Fabien Tillier | Date | Re: [xsl] default template ?, Andrew Welch |
| Month |