Thanks for this information. However, please note that Saxon 7.8 does
not have any built-in XML parser, or even a default choice of parser. It
uses whichever parser your Java environment is configured to provide.
For most people, that will be Crimson, but that's your choice, not
Saxon's.
I find the phrase "the URI of the resource" in the erratum that you
quote a little strange. Since when is resource required to have only one
URI?
Michael Kay
> -----Original Message-----
> From: saxon-help-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
> [mailto:saxon-help-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx]
> On Behalf Of
> Elliotte Harold
> Sent: 23 November 2003 22:09
> To: saxon-help-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
> Subject: [saxon] Base URIs of redirected documents
>
>
> There appears to be a bug in Saxon 7.8's bundled XML parser
> with respect
> to the base URI of documents loaded from a redirected URL.
> For example,
> consider http://www.ibiblio.org/xml/redirecttest.xml. This document
> redirects to http://www.ibiblio.org/xml/redirected/target.xml. If the
> document references an external DTD in its document type declaration,
> Saxon attempts to load it from the original URI rather than the
> document's actual base URI.
>
> You can verify this by applying any stylesheet to
> http://www.ibiblio.org/xml/redirecttest.xml. For example,
>
> [elharo-pcVu8ycTT4Q@xxxxxxxxxxxxxxxx elharo]$ java -classpaxon.Transform
> http://www.ibiblio.org/xml/redirecttest.xml test.xsl
> Error on line 1 of http://www.ibiblio.org/xml/redirecttest.xml:
> Error reported by XML parser: External entity not found:
> "http://www.ibiblio.org/xml/redirected.dtd".
> Transformation failed: Run-time errors were reported
>
> The problem goes away if you use Xerces 2.6 as the parser.
> This version
> of Xerces correctly sets the base URI (earlier versions did not):
>
> [elharo-pcVu8ycTT4Q@xxxxxxxxxxxxxxxx elharo]$ java -classpath
> /opt/xml/saxon-7.8/saxon7.jar:./XOM/lib/xercesImpl.jar
> net.sf.saxon.Transform -x org.apache.xerces.parsers.SAXParser
> http://www.ibiblio.org/xml/redirecttest.xml test.xsl
> <?xml version="1.0" encoding="UTF-8"?>root
>
> This is behavior is in keeping with erratum E43 to the second
> edition of
> XML, which states:
>
> Attempts to retrieve the resource identified by a URI may be
> redirected
> at the parser level (for example, in an entity resolver) or below (at
> the protocol level, for example, via an HTTP |Location:|
> header). In the
> absence of additional information outside the scope of this
> specification within the resource, the base URI of a resource
> is always
> the URI of the actual resource returned. In other words, it
> is the URI
> of the resource retrieved after all redirection has occurred.
>
> This also affects pure host URLs with no path such as
> http://www.cafeconleche.org. They are redirected to
> http://www.cafeconleche.org/. However, Saxon attempts to load the DTD
> from http://www.cafeconleche.orgDTD/ rather than
> http://www.cafeconleche.org/DTD/.
>
> --
> Elliotte Rusty Harold
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us
> help YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> saxon-help mailing list
> saxon-help-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/s> axon-help
>
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|