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

RE: Problem with saxon7, Transformer and URIResolver

Subject: RE: Problem with saxon7, Transformer and URIResolver
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 8 Apr 2005 13:13:38 +0100
transformer uriresolver
The URIResolver on the Transformer is used for resolving run-time URIs, such
as those in the document() function. For compile-time URIs, such as
xsl:include, you need to set a URIResolver on the TransformerFactory. By the
time you create your Transformer the stylesheet has already been compiled,
and all xsl:includes and xsl:imports have already been resolved.

Michael Kay

> -----Original Message-----
> From: Olaf Meske [mailto:omeske@xxxxxxxxxxx] 
> Sent: 08 April 2005 13:02
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Problem with saxon7, Transformer and URIResolver 
> Hello,
> I try to use a customized / wrapped URIResolver with saxon7, 
> to change 
> an additional style sheet imported with
> <xsl:include href="myspecial.xsl" />
> to resolve this "myspecial.xsl" to some other url.
> I created the Transformer with:
> =========
> TransformerFactory tFactory = TransformerFactory.newInstance();
> transformer = tFactory.newTransformer(new StreamSource("./main.xsl"));
> // this main.xsl contains the xsl:include
> URIResolver resolver = transformer.getURIResolver();
> URIResolver newRes = new MyURIResolver(resolver, ...);
> transformer.setURIResolver(newRes);
> [...]
> // now invoking some xml file with transformer ...
> I wonder why my wrapped URIResolver (MyURIResolver) will never be 
> invoked to resolve the xsl:include.
> Do I have to set the URIResolver *before* setting the 
> main.xsl for the 
> Transformer? And when I have to, how can I do it?
> Regards,
> Olaf
> -- 
> Olaf Meske
> www.softcare.de

Current Thread


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.
First Name
Last Name
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.