OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Relative URLs using the file scheme?

[ Lists Home | Date Index | Thread Index ]
  • To: Xml-Dev <xml-dev@lists.xml.org>
  • Subject: Relative URLs using the file scheme?
  • From: Eddie Robertsson <erobertsson@allette.com.au>
  • 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

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: 

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:

Hi Eddie. Is a string of the form "file:myDir/myFile" really a relative 
I'm not sure it is; the hostname isn't mentioned at the very least. 
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! :)

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.




News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS