|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: <xsl:include> using relative paths and Saxon 8
> It's likely you'll need to call setSystemId() on the
> StreamSource, or on the TransformerHandler (if you are using
> either of them).
Err... okay - will look into this.
> If not, post the part of your code that loads the stylesheet.
Here's an outline of what I'm doing
- - - - - - - - - - - - - - - - - - - - - - - - - - -
URL url = new URL(xsltUrl);
URLConnection urlConn = url.openConnection();
InputStream is = urlConn.getInputStream();
Source xslSource = new StreamSource(is);
TransformerFactory transFact =
TransformerFactory.newInstance();
Templates templates = transFact.newTemplates(xslSource);
Transformer transformer = templates.newTransformer();
<snip>
DocumentSource source = new DocumentSource(getDocument());
DocumentResult result = new DocumentResult();
try {
transformer.transform(source, result);
if (DEBUG) {
System.out.println("transformer.transform()
succeeded");
}
}
catch (TransformerException ex) {
// transformation failed somehow - should log this
if (DEBUG) {
System.out.println("transformer.transform()
failed");
}
}
// should I have a finally block?
this.transformedDocument = result.getDocument();
- - - - - - - - - - - - - - - - - - - - - - - - - - -
|
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
|

Cart








