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

RE: <xsl:include> href

Subject: RE: <xsl:include> href
From: "Dylan Walsh" <Dylan.Walsh@xxxxxxxxxx>
Date: Thu, 3 May 2001 14:03:21 +0100
xsltprocessor xsl include
Make sure you set the System ID so the parser can resolve URLs relative
to that SystemID. See the JavaDocs.

> -----Original Message-----
> From:	Anthony Ikeda [SMTP:anthony.ikeda@xxxxxxxxxxxxxxxxxxx]
> Sent:	Wednesday, May 02, 2001 3:17 AM
> To:	XSLT
> Subject:	 <xsl:include> href
> 
> I've been working on using XSL stylesheets for a while now and created
> my
> own class to deal with the transfrmations with Xalan. I've decided
> that I
> want to use includes or imports but I'm having a few difficulties:
> 
> Using include demands an adsolute URL. If I use a relative URL, I get
> the
> following error:
> 
>     SystemId Unknown; Line 0; Column 0; Transform error:
>     javax.xml.transform.TransformerException: SAX Exception
> 
> My transformation code is:
> 
> /**
>  * Xml String used to transform.
>  */
>   public String xmlStr = new String();
> /**
>  * XSL String used for transformations.
>  */
>   public String xslStr = new String();
> 
>   public void transformText(PrintWriter out, String xslFileIn, String
> xmlString){
>     ...
>       XSLTProcessor xsltprocessor =
> XSLTProcessorFactory.getProcessor();
>       StringReader strrdXML = new StringReader(xmlStr);
>       StringReader strrdXSL = new StringReader(xslStr);
> 
>       xsltprocessor.process(new XSLTInputSource(strrdXML), new
> XSLTInputSource(strrdXSL), new XSLTResultTarget(out));
>     ...
>   }
> 
> I'm calling this class from a servlet.
> 
> My xsl is:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:param name="status">OK</xsl:param>
> <xsl:include href="styles.xsl"/>
> 
> If I add the absolute URL then it works fine, but I don't want to have
> to
> manually update this each time I use my software on a different
> webserver.
> 
> How can I avoid this?
> 
> Cheers,
> Anthony Ikeda
> Web Application Developer,
> Proxima Technology Pty. Ltd.
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

 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.