Subject: RE: apply one XSLT stylesheet to another one ?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 27 Nov 2006 19:00:22 -0000
|
> Is it possible to modify one XSLT stylesheet (A) with another
> (B) to create a new one (C), I guess it is!
Yes, it is possible.
> Would be great if
> someone of you could help me, a tiny example would be more
> than great.
Here's a tiny example:
<xsl:stylesheet...
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="xsl:template[@match]">
<xsl:copy>
<xsl:attribute name="priority" select="10">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
This adds a priority="10" attribute to any xsl:template with a match
attribute that does not already have a priority.
Michael Kay
http://www.saxonica.com/
|