[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

[xsd] Schema in multiple documents

  • To: xml-dev@l...
  • Subject: [xsd] Schema in multiple documents
  • From: Chizzolini Stefano <chist@c...>
  • Date: Wed, 15 Dec 2004 12:50:06 +0100

xsd multiple documents
Hi all

I'm defining a schema (via XML Schema) stretched over multiple documents,
but I feel quite unsure about the best strategy to reference its definitions
each other across the file boundaries.
What I need is a clean method to enable the reuse of components.

As I know, there are mainly two constructs from the XSD namespace for this
purpose:
- include element: same target namespace as the including document;
- import element: any target namespace.
(I chose the include element as it seems to fit my case).

My headache comes when I try to establish WHICH document references WHAT
ELSE.

For example (the target namespace is the same for all the documents):
- document A contains common types (it could be considered the main document
for the target namespace);
- document B contains derived types;
- document C contains other basic (non-derived) types;
- documents FF are future extensions of the target namespace.
Document A should be reused by B and FF.

Should I:
- include A inside B and FF, whilst C inside A? This way all the common
components are centrally referenced by A, while any extension document (B or
FF) has just to care about referencing the main document (A). This should
improve the referential consistency and smooth expandability, but forces any
instance document to reference the location of a specific "leaf" schema
document (I say, B or FF) as the main document (A) isn't aware about any
extension document (it has just references to basic component documents like
C)!
- include A inside B and FF, whilst B and FF and C inside A? This way any
instance document could reference just the main document (A) and use all the
derived types at a time, but the references across the schema documents
would be multiplied and would cause circular references (is it legal? may it
affect the validator performance?). As another side effect, the main
document should be updated any time an extension document is created.

Which solution do you think that's better?
Is there another (better) approach?

Thanks for the tips!

Stefano

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.