Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Can XSD do "by reference" >Thread Next - Re: When to make a new vocabulary... Re: Maintaining a subset of a schemaTo: webb.roberts@----.------.--- Date: 8/8/2007 4:58:00 PM Didn't Georgia Tech produce some sort of schema subtype building/verifying tool for the GJXDM monster? Is it publicly available for use or cannibalization? Cheers Jack >From: Webb Roberts <webb.roberts@g...> >To: Boris Kolpackov <boris@c...> >CC: Andy Den Tandt <andydt@e...>, <xmlschema-dev@w...> >Subject: Re: Maintaining a subset of a schema >Date: Fri, 3 Aug 2007 10:28:53 -0400 > > >Boris Kolpackov wrote: >>I don't think there is a way to achieve what you want without >>syntactic changes to your XML documents except for maintaining >>two separate schemas (perhaps you can factor out and reuse some >>common types that are the same for both vocabularies). Or maybe >>you could use the redefine construct (I personally prefer to >>stay away from that beast). > >I've found that it is pretty straightforward to create a subset schema set >with a little XSLT. Copy most things, and tweak or remove certain >constructs. It's one more thing to maintain, but it works quite well. You >can write them from a "what to remove" perspective, or from a "what to >keep" perspective, depending upon your needs. > >>If you are willing to change your XML vocabulary then you can >>can use XML Schema polymorphism (either xsi:type or substitution >>groups). You would define a base type for the 'b' element (say, >>b_base_t) which does not contain the 'v' attribute. Then you would >>define b_t by adding the 'v' attribute to b_base_t. Using the >>xsi:type approach your first XML document would look like this: > >The problem with this approach is that the resultant schema does not >require the substitution be made. The substituted elements are additional >options provided by the schema set. > >If you're willing to rewrite your instances, element substitution can be >enforced through complex type restriction, but enforcing such constraints >propagates through the schema set. > >An additional option is to create substitutable components, and transform >the original schema such that the base components are made abstract, which >means you _have_ to do _some_ substitution. > >Good luck, >Webb > >-- >Webb Roberts >Georgia Tech Research Institute > _________________________________________________________________ Windows Live Hotmail is the next generation of MSN Hotmail. It’s fast, simple, and safer than ever and best of all – it’s still free. Try it today! www.newhotmail.ca?icid=WLHMENCA146 From Adam.Fortuno@M... Thu Aug 09 15:04:56 2007 Received: from wiggum.w3.org ([128.30.52 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
