[xsd-users] import, include, namespaces, restriction and schema versioning

Eric Niebler eric at boostpro.com
Tue Aug 18 17:25:14 EDT 2009


Hi all.

I'm looking for some advice about schema evolution and validation. I 
have a crazy idea but I don't know enough about XML schema in general 
and CodeSynth XSD in particular to determine whether it's feasible.

First, the problem: My tool allows users to create instance documents 
that match a particular schema, say schema1.xsd. Now, I release a new 
version of the tool and a new schema, say schema2.xsd, that adds 
elements to certain schema types. To keep the old instance documents 
readable, I make these new elements optional. This results in a schema 
that is looser than I would like; if I can read instance documents with 
the missing elements, I can also write them, and I don't want that. I 
want to express an asymmetry: it's ok for an element to be missing on 
read, but not on write.

Here's my crazy idea: Maybe I could play games with namespace maps 
and/or xsd:import/xsd:include and xsd:restriction to define a stricter 
write schema that is defined in terms of -- and refines -- the read 
schema. Is something like this even possible? Is this the right way to 
be thinking about this problem, or are there better ways?

Thanks in advance,

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com




More information about the xsd-users mailing list