This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
<xsl:include> and Oracle java classes
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] <xsl:include> and Oracle java classes
- From: "Ellis, Graham" <graham dot ellis at actfs dot co dot uk>
- Date: Thu, 1 Mar 2001 17:59:45 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
I'm writing a Java app that selects data from our Oracle database, formats
it into XML then uses the Oracle 'XSLStylesheet' and 'XSLProcessor' classes
to load a stylesheet and transform the XML.
Unfortunately it fails on the first <xsl:include> - I assume because the
main stylesheet is loaded as an InputStream, and the included stylesheets
are still files on the disk.
Is there a way for the Oracle classes to load stylesheets referenced by
<xsl:include>?
Here's a snippet of the java which might make things clearer (it is mostly a
direct copy from Steve Muench's book and the samples supplied with
JDeveloper 3.1):
// get the stylesheet
String theXSL = "mt565.xsl"
InputStream xslStream = Object.class.getResourceAsStream("/" + theXSL);
XSLStylesheet transform = new XSLStylesheet (xslStream, null);
XSLProcessor processor = new XSLProcessor();
DocumentFragment df = processor.processXSL(transform, theXMLDoc);
Here's the first few lines of mt565.xsl:
<xsl:stylesheet version="1.0" xmlns:xsl =
"http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*"/>
<xsl:output method="text" encoding="UTF-8"/>
<xsl:decimal-format name="SWIFT" decimal-separator=","/>
<xsl:include href="swift_include.xsl"/>
...
at which point the following error is generated:
oracle.xml.parser.v2.XSLException: XSL-1002: Error while processing include
XSL file (no protocol: swift_include.xsl).
Thanks for any help you can give
Graham Ellis
ACT Financial Systems
* Tel: +44 (0) 20 7250 1990
* Fax: +44 (0) 20 7553 4713
* Email: graham.ellis@actfs.co.uk
* http://www.actfs.co.uk
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list