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

S

Simon

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?
 
M

Martin Honnen

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>
 
U

usenet

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.
--
=============================================
Pete Cordell
Codalogic Ltd
for XML Schema to C++ data binding visit
http://www.codalogic.com/lmx/
=============================================
 

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
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top