Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Maintaining a subset of a schema

From: "Paul Kiel" <paul@-----------.--->
To: "'Webb Roberts'" <webb.roberts@----.------.--->, "'Boris Kolpackov'" <boris@-------------.--->
Date: 8/7/2007 8:05:00 AM
>> 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.

I'll second this.  I had even gone to the step of web form to input
constraints, autocreate xslt via schematron, then autocreate an xsd with
that subset.  Because schema is so complex, I could only have it work on
real simple use cases (like "make this element required instead of
optional").   But for simple cases it worked (at least it did a few years
ago when I did it).

Paul Kiel



=====================================================
W. Paul Kiel
xmlHelpline.com Consulting
paul@x...
work: 919-846-0224
cell: 919-449-8801
website: http://www.xmlhelpline.com
Your helpline for data integration solutions.
=====================================================

-----Original Message-----
From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...] On
Behalf Of Webb Roberts
Sent: Friday, August 03, 2007 10:29 AM
To: Boris Kolpackov
Cc: Andy Den Tandt; xmlschema-dev@w...
Subject: Re: Maintaining a subset of a schema


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





From Rich.Adili@x... Wed Aug 08 04:39:52 2007
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org w


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent