Page 1 of 1

Validate fails with local file schemaLocation imports

Posted: Sat Aug 27, 2005 8:13 pm
by acronce
Hi all,

I'm working with a set of xsd and xml files that are checked into source control. I work from multiple machines, where the path to the files differs. The problem is that "Validate Document" fails if I specify relative paths in schemaLocation imports. Note that I'm using Oxygen 6.1 under Mac OS X 10.4.2 (Tiger).

I've posted an example for download here:

http://homepage.mac.com/WebObjects/File ... estxml.zip

If you try to perform a "Validate Document" operation on test.xml, you get an error because foo.xsd cannot include bar.xsd.

If I change foo.xsd to have an absolute path to bar.xsd, it works. But what I want is to specify a relative path so that I can move the files around without having to edit the import path.

Thanks in advance for any suggestions.

Posted: Mon Aug 29, 2005 8:19 am
by Radu
Hi Allen,

Try removing the "file:" prefix before the relative locations in all the files like:

"http://www.test.com file:foo.xsd" => "http://www.test.com foo.xsd"
"file:bar.xsd" => "bar.xsd"

Regards, Radu.

Posted: Tue Aug 30, 2005 5:44 pm
by acronce
Thanks Radu! That seems to work.

Posted: Thu Sep 01, 2005 10:39 am
by george
Hi Allen,

Just a comment: you should not specify the protocol when you write a relative location, imagine that you move your file to a webserver and access them through HTTP, then the "file" protocol will be clearly wrong in this context.

Best Regards,
George

Posted: Thu Sep 01, 2005 4:25 pm
by acronce
george wrote:Just a comment: you should not specify the protocol when you write a relative location, imagine that you move your file to a webserver and access them through HTTP, then the "file" protocol will be clearly wrong in this context.
Thanks for the clarification George. Originally I didn't understand that you cannot specify the protocol in a relative location.

But currently we only use relative locations for schema development. When we post our final schemas we always use full path http.

I suppose we could consider using relative partial paths for both development and our final post. Maybe that way the developmental schemas would be identical to the posted ones.