XSD-Question: importing Schemas with same namespace

S

Sascha Kerschhofer

Hi,
is it against the spec to import two external schemas with the same
namespace into one main schema?
e.g
<xs:import namespace="http://myCompany.com/formating"
schemaLocation="srt3.xsd"/>
<xs:import namespace="http://myCompany.com/formating"
schemaLocation="srt1.xsd"/>

Saxon seems to have a problem with this. MSXML and .NET accept it. Realy
can't find any rule in the schema spec against this.
Any help is appreciated.

Sascha
 
P

Priscilla Walmsley

Hi,

This is not disallowed by the XML Schema spec (provided that the
_importing_ schema document has a different target namespace from the
two imported schema documents).

However, the schemaLocation attribute on an import is just a "hint".
Processors are free to ignore it, and they often do ignore the
schemaLocation on second import of the same namespace.

You could create an intermediate schema document that includes the other
two, then import this intermediate schema document into your main schema
document.

Hope that helps,
Priscilla
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,281
Latest member
Pedroaciny

Latest Threads

Top