W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2007

Maintaining a subset of a schema

From: Andy Den Tandt <andydt@enfocus.be>
Date: Thu, 02 Aug 2007 14:29:42 +0200
Message-ID: <46B1CE36.6000303@enfocus.be>
To: xmlschema-dev@w3.org

I have an application which produces an XML log/report for which I have 
a schema. These XML files contain lots of info/detail.
The schema is both given to 3rd parties who consume this file and used 
in testing tools to ensure that the XML files are completely valid/as 
intended.

Now, I need to create a smaller XML file which is a subset of the 
original one but without a series of elements and attributes.
The question now is how to create (and maintain) a strict and readable 
schema for this smaller/subset. I want to enforce that all these 
elements/attributes are present or none at all.

In theory, I could annotate the full schema and try to generate a second 
schema from it but I can't imagine how to determine if some element 
needs a custom type because some sub-element's type has changed as well. 
Or I would have to manually tag the parent elements.

I wonder what the best solution is. Others must have struggled with the 
same problem and I don't want to reinvent the wheel ;-) If this isn't 
the right place to ask such a question, please direct me to resources, 
another forum, etc.

E.g. how to create a strict combined schema's for
<a u='0'>
    <b v='1'>
        <c w='2'/>
    </b>
</a>

and the same but without the a/b@v attribute
<a u='0'>
    <b>
        <c w='2'/>
    </b>
</a>

The c-element can be shared. It's obvious that b is a separate type. But 
the type for a also needs to change!

Kind regards,

Andy Den Tandt

============================================
Andy Den Tandt
Technical Product Manager
Enfocus - an Artwork Systems Brand
http://www.enfocus.com

Artwork Systems N.V.
Artwork Toren
Bellevue 5/1101, B-9050 Gent, Belgium
T: +32 9 265 84 11
F: +32 9 265 84 10
============================================
Received on Thursday, 2 August 2007 23:29:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:00 GMT