Is it possible to split an xml schema in two separate files

Simon

Usenet Archive
Joined
Jan 30, 2000
Messages
412
Reaction score
0
I want to split a xml schema in two xml schema files where the first file has general schemas and the other part has specific schemas. The general schema can the be used by other schemas (written in other files) which uses the same elements. Is this possible to do?
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Simon said:
I want to split a xml schema in two xml schema files where the first file has general schemas and the other part has specific schemas. The general schema can the be used by other schemas (written in other files) which uses the same elements. Is this possible to do?

With the XSD schema language you an write schema modules and include them with xs:include:
<http://www.w3.org/TR/xmlschema-0/#element-include>

If you define elements or attributes in different namespaces then you are even required to to have one module for each target namespace where you then use xs:import to import the schema for one target namespace into the schema for a second target namespace:
<http://www.w3.org/TR/xmlschema-0/#import>
 

usenet

Usenet Archive
Joined
Aug 10, 2000
Messages
1,105
Reaction score
0
I want to split a xml schema in two xml schema files where the first file has general schemas and the other part has specific schemas. The general schema can the be used by other schemas (written in other files) which uses the same elements. Is this possible to do?

It's most certainly possible if the two schemas define the contents for two different namespaces.

It's a bit more of an issue if the two (or more) schema files specify the contents of a single namespace. This is because the namespace URI typically is associated with a single file (although the URI does not necessarily resolve to the schema file).

It has been suggested that in this case, the two schema files should be included (using xs:include) into a third schema file with the same namespace. The third schema file then becomes the 'master' file that is intended to be the reference point for the namespace.

HTH (and makes sense!),

Pete.
 

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

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,244
Members
248,133
Latest member
DujonT

Latest Threads

Top