xsl-list
[Top] [All Lists]

RE: <xsl:include> using relative paths and Saxon 8

2006-01-20 09:48:52


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();

        - - - - - - - - - - - - - - - - - - - - - - - - - - - 




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--