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

RE: <xsl:include> and Oracle java classes

Subject: RE: <xsl:include> and Oracle java classes
From: "Ellis, Graham" <graham.ellis@xxxxxxxxxxx>
Date: Fri, 2 Mar 2001 14:41:25 -0000
xsl include classpath
Thanks Steve, this worked perfectly. However, once I deployed the classes
and the stylesheets as stored procedures on the database the code failed to
find the main stylesheet. So - should I put the stylesheets outside the
database, or can it be done with the stylesheets deployed?

Graham Ellis
ACT Financial Systems

*	Tel:       +44 (0) 20 7250 1990
*	Fax:      +44 (0) 20 7553 4713
*	Email:  graham.ellis@xxxxxxxxxxx
*	http://www.actfs.co.uk


> ----------
> From: 	Steve Muench[SMTP:Steve.Muench@xxxxxxxxxx]
> Reply To: 	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Sent: 	01 March 2001 22:36
> To: 	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: 	Re:  <xsl:include> and Oracle java classes
> 
> | 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>?
> 
> Sure. Load the stylesheet from a resource URL instead of
> as an InputStream. The input stream approach works when
> the stylesheet has no relative stylesheets it needs to
> read, but by using a resource URL, all of the relative
> references are handled for you.
> 
> Here a sample. Assumes the "Sample.xsl" stylesheet and
> the "SampleHelper.xsl" stylesheet which the former
> includes via <xsl:include> are at the the same level
> of directory hierarchy in your CLASSPATH as the current class.
> 
> import oracle.xml.parser.v2.*;
> import java.net.URL;
> public class TransformExample {
>   public static void main( String[] arg ) throws Throwable {
>     DOMParser theParser = new DOMParser();
>     theParser.parse(new java.io.StringReader("<x/>"));
>     XMLDocument source = theParser.getDocument();
>     // Resource "Sample.xsl" does <xsl:include href="SampleHelper.xsl"/>
>     URL url = TransformExample.class.getResource("Sample.xsl");
>     XSLStylesheet transform = new XSLStylesheet(url,url);
>     XSLProcessor proc = new XSLProcessor();
>     proc.processXSL(transform,source,System.out);
>   }
> }
> 
> ______________________________________________________________
> Steve Muench, Lead XML Evangelist & Consulting Product Manager
> BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
> Author "Building Oracle XML Applications", O'Reilly
> http://www.oreilly.com/catalog/orxmlapp/
> 
> 
> 
>  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.