![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - How to manage multiple XSL files that are nearly identical? [Thread Next] Re: How to manage multiple XSL files that are nearly identical?To: NULL Date: 8/6/2008 2:11:00 PM
Siegfried Heintze wrote:
> So here is the XSL question:
> Is there a way I can pass a parameter (or something) so it will generate a
> page tag, windows tag, or canvas tag so I don't have to maintain three
> otherwise identical XSL files?
You can write stylesheet modules and compose them using xsl:include or
xsl:import, see http://www.w3.org/TR/xslt#section-Combining-Stylesheets
That might already suffice to avoid having three huge, nearly identical
stylesheets, instead you would simply put the identical part into a huge
module and then write three other small ones that include or import the
module.
If you want to work with a parameter then that is also possible, you can
define a global parameter (e.g. root-name) in your stylesheet e.g.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="root-name" select="'window'"/>
<xsl:template match="/">
<xsl:element name="{$root-name}">
...
</xsl:element>
</xsl:template>
...
</xsl:stylesheet>
and then you would use a (processor specific) way to set the parameter
root-name to e.g. 'window' or 'page' before you run the transformation.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
