Subject: Re: [xsl] import, xslt 2.1 From: Dave Pawson <davep@xxxxxxxxxxxxx> Date: Mon, 15 Mar 2010 08:44:51 +0000 |
On 15/03/10 04:52, Max Toro wrote:You can use a custom URIResolver to load xsl imports/includes. -- Max
I used an Oasis catalog in the end. Same effect, less work :-)
On the conditional import, Andrew gave me the following solution, may be of use to others and explain how use-when works.
I'm on Linux, so my shell is bash. OS environmental variables are set using set varname=value
to use this idea, I want to set an OS environmental variable, copy that to a Java System Property (sort of an environmental variable where the environment is Java?) then pass that into the stylesheet.
java -cp $cp:. -Df=$f net.sf.saxon.Transform \ -x org.apache.xml.resolver.tools.ResolvingXMLReader \ -y org.apache.xml.resolver.tools.ResolvingXMLReader \ -r org.apache.xml.resolver.tools.CatalogResolver -o $3 $1 $2
f is the OS env var passed into the java executable using -Df=$f, which assigns the system property 'f' to the env var f then in the stylesheet I use
<xsl:import href="/sgml/test/junit.xsl" use-when="system-property('f')='true'" />
-- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] import, xslt 2.1, Dave Pawson | Thread | RE: [xsl] import, xslt 2.1, Michael Kay |
RE: [xsl] How would you like a new , Michael Kay | Date | Re: [xsl] How would you like a new , ac |
Month |