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

Re: document() function

Subject: Re: document() function
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Tue, 20 Aug 2002 17:24:18 -0400
thomas pietschmann
[J.Pietschmann]

> Thomas B. Passin wrote:
> > prevent it.  Otherwise, it may be the syntax of the file: URL.  Try some
of
> > the normal variations, like
> >
> > file:///c:\servers\mserver\ojamc2vpt1_part.xsd
> > file:c:\servers\mserver\ojamc2vpt1_part.xsd
> > file:c:/servers/mserver/ojamc2vpt1_part.xsd
> >
> > There is some ambiguity in the RFC about the exact form of file: URLs,
> > leading to different interpretions, and different processors can require
> > different forms.  The form you used works on some processors, but I
forget
> > what works with which.
>
> It should be noted that all of the forms above adress
> different locations. The component separator for
> file: URLs is "/", not "\".

It is if the URL is considered transparent, but if it is to be considered
opaque then the server gets do decide how to decode it, and the use of "/"
is not required.  The RFC does not say whether the file: scheme is supposed
to use transparent or opaque URLs, and there have been several different
interpretations as well as outright errors (like allowing file:c:) in actual
implementations.  Sometimes an application will accept one thing from the
command line and another in the document() function, too.  That is why you
have to try various forms if you think you might be having this problem.

> Which actually doesn't
> matter if the whole stuff is passed down to the OS
> routines, but still...

But you can not always be sure where the URL gets parsed, and it is not
always by the OS.

> BTW from within applications, Windows accepts both
> "/" and "\" as directory separators.

Windows Explorer does for local files, but try to use a network host name on
an NT network with forward slashes and you will find it does not work.  For
example, try to open a file using the standard Windows file open dialog on a
computer named "computer_a" using "\\computer_a\" and it will work, but not
if you use "//computer_a/".  Windows is not consistent about forward vs.
reverse slashes.

> Furthermore the last two forms are formally relative
> URLs (despite being absolute file system paths) and
> could be accidentally passed to an URI resolver.
>

Some libraries insist on that form anyway.

> Bottom line: the original form is preferable in
> any case and should also work for every major XSL
> processor.
>

"Should" and "actually does" are not always the same, especially in the case
of "file:" URLs.  For example, Sablotron 0.70 requires "file://", not
file:///, although "file://" is clearly an error by any interpretation.  I
think that "file:\\\" is rarely required but it is well to try it if all
else fails to work.  Actually, there is a good degree of tolerance for
variant forms these days, especially among the major processors (probably,
as you say, because the OS accepts several variations), but depending on the
library in use you may get unlucky.

Cheers,

Tom P


 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.