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

Re: parametric xsl element values

Subject: Re: parametric xsl element values
From: David Allouche <david@xxxxxxxxxxxxxxxx>
Date: Mon, 21 Aug 2000 16:25:04 -0200 (GMT+2)
parametric import xsl
> I am trying to make the value of xsl:include parametric and come from the 
> xml data.  First the well, is it possible? if yes, how?

This is not possible not parametrize the <xsl:import> or <xsl:include>
elements anyhow.

If you want to apply different stylesheets depending on document content,
you can use modes.

For example, if you want to apply style1.xsl or style2.xsl from style.xsl,
you could define all templates in style1.xsl with mode="style1" (and use
the mode attribute too in all call-template and apply-templates) and all
templates in style2.xsl with mode="style2".

Then, you could have a style.xsl styelsheet that contains:

<xsl:include href="style1.xsl"/>
<xsl:include href="style2.xsl"/>

<xsl:template match="some pattern">
  <xsl:choose>
    <xsl:when test="some test">
      <xsl:apply-templates select="." mode="style1"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates select="." mode="style2"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

That is just to give you the picture, adapt this what your are actually
doing.

There may be a better way to do this, but this this is my solution.

Hope this helps.

                             -- David --


 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.