[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: <xsl:include> href
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|