|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] switching designs in xsl
Hi,
I do some xsl:fo formatting that depends on the value of an element <design-id value="design-001" />. I keep the xsl stylesheets for each design in a separate directory 'design-001'. Currently, I import all designs in my start xsl and then switch according to the value of the design-id. This works but has the disadvantage that all templates, attribute-sets etc have to be globally distinct, which I do by prefixing them with a
design-marker, e.g. 'd001-'. This strikes me as not very elegant. What would be a more clever way to do this? I append my top stylesheet, to give people an idea what I am doing.
Thanks for your help.
Erwin
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:include href="design-001/d001-format-complete.xsl" />
<xsl:include href="design-002/d002-format-complete.xsl" />
<xsl:template match="/">
<xsl:variable name="design-id" select="/printobject/design-id/@value"/>
<xsl:choose>
<xsl:when test="$design-id = 'design-001'">
<xsl:call-template name="d001-format-complete"/>
</xsl:when>
<xsl:when test="$design-id = 'design-002'">
<xsl:call-template name="d002-format-complete"/>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
..............................
Erwin Kloeck
Produktentwicklung
Oestreicher + Wagner
Medientechnik GmbH
Frankenthaler Strasse 20
D-81539 Muenchen
Fon +49 (0)89-68961 216
Fax +49 (0)89-68961 271
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








