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

Re: Conditional Import of stylesheet depending on pass

Subject: Re: Conditional Import of stylesheet depending on passed Parampossible?
From: Mike Brown <mike@xxxxxxxx>
Date: Tue, 27 Aug 2002 12:28:51 -0600 (MDT)
f conditional
William Reilly wrote:
> COMMAND LINE (exploded for legibility)
>  C:\jakarta-tomcat-4.0.3\webapps\ROOT\mlnmdev>
>  java
>  org.apache.xalan.xslt.Process
>  -IN BusinessML\2002-07-16-0_summary.xml
>  -XSL xsl\ct11_press_release_summary.xslt
>  -OUT StructureML\2002-07-16-0_summary.xml
>  -PARAM environment WINDOWS
   
As others mentioned, you can't do conditional imports within XSLT. No one told
what you could do, though. Obviously you are relying on the user to know what
the underlying platform is, in order to set $environment. Well, instead of
setting $environment to 'WINDOWS', the user could just invoke a
Windows-specific stylesheet that sets $path to what it needs to be for
Windows, and then imports the generic stylesheet, which tries (but fails, due
to lower import precedence) to set $path to the Unix one. If they're not on
Windows, they can just invoke the generic stylesheet. It might be worth
writing a wrapper that invokes Xalan via JAXP; the wrapper can choose the
right stylesheet. If you need to do multiple transforms, you'll want the 
wrapper anyway, so you can recycle the compiled stylesheets and avoid JVM 
startup overhead.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

 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.