validation with relative pathes in schemaLocation

Are you missing a feature? Request its implementation here.
dehnhardt
Posts: 2
Joined: Fri Sep 12, 2003 12:58 pm

validation with relative pathes in schemaLocation

Post 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
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post 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
dehnhardt
Posts: 2
Joined: Fri Sep 12, 2003 12:58 pm

Post 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
Post Reply