Page 1 of 1

validation with relative pathes in schemaLocation

Posted: Fri Sep 12, 2003 1:22 pm
by dehnhardt
I have several xml-files which I validate with schemas that are local (on my harddisk).
When I add a relative path to the schema,
(eg. xsi:noNamespaceSchemaLocation="file:../schema/reportDefinition.xsd")
the validation fails with the error:
- [ reportDefinitions.xml] E cvc-elt.1: Cannot find the declaration of element '<rootelement>'.
It wolud be nice, when the working-directory where set to the directory of the file which is currently edited / validated.

BTW, the schema is found by oxygen: When I click 'open external schema', the right schema is opened.

Greetings
Holger

Posted: Fri Sep 12, 2003 6:16 pm
by george
Dear Holger,

Please do not use file when you specify a relative location. Imagine that you publish your documents on a web server, there you have http instead of file and I guess you expect the relative reference to work also there. Try with

Code: Select all

xsi:noNamespaceSchemaLocation="../schema/reportDefinition.xsd"
and it should work.

Best Regards,
George

Posted: Mon Sep 15, 2003 11:00 am
by dehnhardt
Thank you! It works. Mayby a topic for faq?
Holger
george wrote:Dear Holger,

Please do not use file when you specify a relative location. Imagine that you publish your documents on a web server, there you have http instead of file and I guess you expect the relative reference to work also there. Try with

Code: Select all

xsi:noNamespaceSchemaLocation="../schema/reportDefinition.xsd"
and it should work.

Best Regards,
George