Remove Default URI Resolver

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove Default URI Resolver

Alan-14
    Is it possible to remove the default URI resolver?

    Last I checked it didn't seem possible. If it is I'll go read
    the code and figure it out for myself.

    Basically, I want control over doc-available . If my special
    protocol in my URI resolver says the doc is not available, it
    shouldn't go asking the system URI resolver, which throws an
    exception when it doesn't know the protocol.

    Cheers.

--
Alan Gutierrez - [hidden email]
    - http://engrm.com/blogometer/index.html
    - http://engrm.com/blogometer/rss.2.0.xml


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Remove Default URI Resolver

Owen Rees
--On 21 September 2005 16:34 -0400 Alan wrote:

>     Basically, I want control over doc-available . If my special
>     protocol in my URI resolver says the doc is not available, it
>     shouldn't go asking the system URI resolver, which throws an
>     exception when it doesn't know the protocol.

You can add handlers for your own protocols - see
<http://java.sun.com/developer/onlineTraining/protocolhandlers/>

I don't know if it will do what you want, but if you are using a
non-standard URL scheme it is worth taking a look at it.


--
Owen Rees
Hewlett Packard Laboratories, Bristol, UK




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: Remove Default URI Resolver

Michael Kay
In reply to this post by Alan-14
JAXP specifies that when the user-defined URIResolver returns null, the
system default URIResolver should be called. But admittedly, it doesn't take
into account XSLT 2.0 requirements (and thus, doc-available).

I think that doc-available() should fail only if you pass a
syntactically-invalid URI, not if you pass a URI that has valid syntax but
uses an unregistered URI scheme ("protocol"). Perhaps Saxon needs to be more
discriminating in its handling of different Java exceptions: I'll look into
it.

Michael Kay
http://www.saxonica.com/



> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Alan
> Sent: 21 September 2005 21:35
> To: Saxon List
> Subject: [saxon] Remove Default URI Resolver
>
>     Is it possible to remove the default URI resolver?
>
>     Last I checked it didn't seem possible. If it is I'll go read
>     the code and figure it out for myself.
>
>     Basically, I want control over doc-available . If my special
>     protocol in my URI resolver says the doc is not available, it
>     shouldn't go asking the system URI resolver, which throws an
>     exception when it doesn't know the protocol.
>
>     Cheers.
>
> --
> Alan Gutierrez - [hidden email]
>     - http://engrm.com/blogometer/index.html
>     - http://engrm.com/blogometer/rss.2.0.xml
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App
> Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Remove Default URI Resolver

Colin Paul Adams
>>>>> "Michael" == Michael Kay <[hidden email]> writes:

    Michael> I think that doc-available() should fail only if you pass
    Michael> a syntactically-invalid URI, not if you pass a URI that
    Michael> has valid syntax but uses an unregistered URI scheme
    Michael> ("protocol").

In the later case it should return false.
In the former case, then error FODC0005 is correct.
--
Colin Adams
Preston Lancashire


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Remove Default URI Resolver

Alan-14
In reply to this post by Michael Kay
* Michael Kay <[hidden email]> [2005-09-22 09:00]:

> JAXP specifies that when the user-defined URIResolver returns
> null, the system default URIResolver should be called. But
> admittedly, it doesn't take into account XSLT 2.0 requirements
> (and thus, doc-available).

    I'm already dancing around JAXP to work with Saxon.
   
    The functionality in Saxon is more important to my applications
    that handful of Java method calls I use to invoke Saxon. My
    applications are XSLT 2.0 applications first and foremost.

> I think that doc-available() should fail only if you pass a
> syntactically-invalid URI, not if you pass a URI that has valid
> syntax but uses an unregistered URI scheme ("protocol"). Perhaps
> Saxon needs to be more discriminating in its handling of different
> Java exceptions: I'll look into it.

    Thanks for looking into it.

    There is a matter of perforance. If a resource is not available
    in my custom protocol, and I return false, that's a lot faster
    than raising and catching an exception.

    I'm not sure what I'm suggesting, yet.

--
Alan Gutierrez - [hidden email]
    - http://engrm.com/blogometer/index.html
    - http://engrm.com/blogometer/rss.2.0.xml


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Remove Default URI Resolver

Alan-14
In reply to this post by Owen Rees
* Owen Rees <[hidden email]> [2005-09-22 04:07]:

> --On 21 September 2005 16:34 -0400 Alan wrote:
>
> >    Basically, I want control over doc-available . If my special
> >    protocol in my URI resolver says the doc is not available, it
> >    shouldn't go asking the system URI resolver, which throws an
> >    exception when it doesn't know the protocol.
>
> You can add handlers for your own protocols - see
> <http://java.sun.com/developer/onlineTraining/protocolhandlers/>
>
> I don't know if it will do what you want, but if you are using a
> non-standard URL scheme it is worth taking a look at it.

    Owen

    To my mind, it kind of defeats the purpose of defining a URI
    Resolver iface in JAXP, if you have to go and implement java.net
    protocol handers anyway.

    Without doing any research here, mind you, the problem with
    using java.net protocol handlers, is that an XML URI resolver
    will return XML, and can return an XML document.

    Perhaps the java.net URI resolvers have facilities for returning
    objects, but I'm assuming that they are geared towards returning
    streams, and that JAXP implemenations are expecting 'text/xml' streams.

    My resolvers can return cached documents.

    I'm also assuming that the java.net protocol handlers are a lot
    more complex since they are generic.
   
    I may be misunderstanding, I'm writing this without doing much
    reading. This article, though appears to discuss streams
    exclusively.

    Cheers.

--
Alan Gutierrez - [hidden email]
    - http://engrm.com/blogometer/index.html
    - http://engrm.com/blogometer/rss.2.0.xml


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

Re: Remove Default URI Resolver

Owen Rees
--On 22 September 2005 09:47 -0400 Alan wrote:

>     I may be misunderstanding, I'm writing this without doing much
>     reading. This article, though appears to discuss streams
>     exclusively.

The protocol handlers operate at a much lower level than the JAXP
functions. This is either good or bad depending what you are trying to do.

A custom protocol handler can happily sit underneath Saxon, dealing with
any uses of those custom URLs without Saxon knowing anything about it, but
down at that level the handler can't do anything XML specific.

--
Owen Rees
Hewlett Packard Laboratories, Bristol, UK




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: Remove Default URI Resolver

Michael Kay
In reply to this post by Alan-14
I'm proposing to add a marker interface to meet this requirement: if the
user-supplied URIResolver implements NonDelegatingURIResolver, then when it
returns null, the standard URI resolver won't be called.

Dead easy to code - the only difficulty is where to document the feature!

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Alan
> Sent: 21 September 2005 21:35
> To: Saxon List
> Subject: [saxon] Remove Default URI Resolver
>
>     Is it possible to remove the default URI resolver?
>
>     Last I checked it didn't seem possible. If it is I'll go read
>     the code and figure it out for myself.
>
>     Basically, I want control over doc-available . If my special
>     protocol in my URI resolver says the doc is not available, it
>     shouldn't go asking the system URI resolver, which throws an
>     exception when it doesn't know the protocol.
>
>     Cheers.
>
> --
> Alan Gutierrez - [hidden email]
>     - http://engrm.com/blogometer/index.html
>     - http://engrm.com/blogometer/rss.2.0.xml
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App
> Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help