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

Re: setURIResolver

Subject: Re: setURIResolver
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Fri, 18 Nov 2005 11:42:24 +0000
seturiresolver
> :: Using Xalan
>
> I have created a URI Resolver to take notice of a specific URI scheme
> defined for internal use in a specific application context.
>
> The resolver is associated with the Transformer like this :-
>
>    transformer.setURIResolver(objResolver);
>
> For Xalan, this causes the resolver to be called when the document()
> function is encountered (AFAIK include and import use a resolver associated
> with the TransformerFactory).
>
> All of this works satisfactorily. However in some cases I want to use my
> custom URI Resolver and in others the default. For example if I had this in
> my XSLT :-
>
> <xsl:variable name="inboundXML" select="document('wbimb:NBA')"/>
> <xsl:variable name="docFile" select="document('OddsAndEvens_NoNS.xml')"/>
>
> .. the custom URI resolver should take care of the first, and the default
> resolver the second.
>
> At the moment in my custom URI resolver, if the scheme does not match what
> this resolver is interested in I just return null :-
>
> if (href.startsWith("wbimb:")) {
>
>     ... do stuff related to the custom URI resolver
>
> } else {
>
>   return null;
> }
>
> I had expected this NOT to work for the second case above, that is, when I
> expect the default resolver to be used. But it does ... ??

Are you sure it's using the resolver in the second case?  If the
processor can locate the document itself it won't go to the
resolver...  I'm pretty sure returning null in a custom resolver
doesn't then invoke the default resolver.

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.