[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

switching designs in xsl

Subject: switching designs in xsl
From: "Kloeck, Erwin" <Erwin.Kloeck@xxxxxx>
Date: Mon, 15 Dec 2003 15:59:58 +0100
id designs
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.