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

Relative URLs using the file scheme?

  • To: Xml-Dev <xml-dev@l...>
  • Subject: Relative URLs using the file scheme?
  • From: Eddie Robertsson <erobertsson@a...>
  • Date: Wed, 16 Oct 2002 09:39:36 +1000
  • User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826

file scheme
Hi all,

I've run into a problem using Xerces (2.2.0) for W3C XML Schema 
validation when it comes to specifying relative paths to the schema 
document. Here is the scenario:

I have an XML document located in the following location: C:\Files\test.xml
and the W3C XML Schema file is in the following location: 
C:\Files\Schemas\test.xsd

In the older versions of Xerces (pre 2.1.0) the following schema 
locations would all work in test.xml:

(absolute) xsi:noNamespaceSchemaLocation="C:\Files\Schemas\test.xsd"
(relative) xsi:noNamespaceSchemaLocation="Schemas\test.xsd"
(absolute) xsi:noNamespaceSchemaLocation="file:///C:/Files/Schemas/test.xsd"

In the new version of Xerces (2.2.0) only the following works:

(absolute) xsi:noNamespaceSchemaLocation="file:///C:/Files/Schemas/test.xsd"

Now, the problem is that in the newer versions of Xerces you can no 
longer specify the schema location using system dependant paths and 
instead this location must be specified as a URL. This is fine as long 
as the location is an absolute path but how do I specify a relative path 
using the file URL (URI?) scheme?

This problem was originally caught by one of our clients who had 
previously used the following as a relative URL:

(relative) xsi:noNamespaceSchemaLocation="file:Schemas/test.xsd"

Apparently this relative URL works in both Xalan and Saxon but not in 
Xerces. When reporting this to Xerces i got the following response:

-------------------------8<--------------------------------------------------
Hi Eddie. Is a string of the form "file:myDir/myFile" really a relative 
URI?
I'm not sure it is; the hostname isn't mentioned at the very least. 
Shouldn't
it be "file:///./myDir/myFile"?

For now, I'll mark this invalid; please close the bug if this works and you
agree. If not, please help enrich my understanding of relative URI 
syntax! :)
--------------------------8<-------------------------------------------------

So, this would suggest that the following should work but unfortunately 
it doesn't:

(relative) xsi:noNamespaceSchemaLocation="file:///./Schemas/test.xsd"

I've tried checking the specs for how the relative URL file schema 
should be specified but I can't seem to figure out how this is done.

Suggestions?

Cheers,
/Eddie


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.