|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: [xsd] Schema in multiple documents
Hello Chizzolini, I'm trying to use XML Schema(XSD) too. There are many ways to define a schema with XSD. the following URL is the article about 'how to avoid the pitfalls'. http://www.kohsuke.org/xmlschema/XMLSchemaDOsAndDONTs.html That maybe help you. And also, there are many practical XSDs. As I know, it seems the best practice is as following sample. http://www.rosettanet.org/PIP7C7 (download zip file, then extract and find root xsd file in 'XML/Interchange' directory) That is the standarized xml based message schema about notifing of Semiconductor Test Data. That design is 'Modular based'. I think that is a good sample for designing XSD. Regards, Masaaki KOGA On Wed, 15 Dec 2004 12:50:06 +0100 Chizzolini Stefano <chist@c...> wrote: > 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 > > ----------------------------------------------------------------- > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an > initiative of OASIS <http://www.oasis-open.org> > > The list archives are at http://lists.xml.org/archives/xml-dev/ > > To subscribe or unsubscribe from this list use the subscription > manager: <http://www.oasis-open.org/mlmanage/index.php> > > > > -- > No virus found in this incoming message. > Checked by AVG Anti-Virus. > Version: 7.0.289 / Virus Database: 265.5.0 - Release Date: 2004/12/09 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.296 / Virus Database: 265.5.4 - Release Date: 2004/12/15
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








