[xsd-users] support for deviations from XML schema

Azadeh Omrani a.omrani at gmail.com
Wed Jan 28 10:42:37 EST 2009


Hi,

As far as I know for a program that uses XSD to work, it is necessary for
the xml instance file(which is going to be parsed)  to comply with the
corresponding xml schema.

assume that we can make static changes in the schema file (before
compilation). but the xml file is out of reach to make changes in it.

imagine a case an xml file is to be parsed with some small deviations from
the precompiled schema.  deviations like:
1-in the schema there is a complextype which has a sequence of ordered
elements each having an unbounded cardinality, but in xml file those
elements are not in order. (that problem will not be solved with a change in
the schema from 'sequence' to 'all')
2-in the xml file, there are some elements which have typos in the element
or attribute names
3- There are some required elements or attributes missing.

at first sight the program will not work because the xml file can not be
parsed.

Is there any solution for each case of mentioned deviations? In a way that
either the schema file can be changed to maintain some more flexibility ( in
case 1) or the XSD xml parser can handle the situation and parse the rest of
xml elements and ignore the typos or deviations without interrupting( in
case 2 and 3)...?


Thank you
Azadeh



More information about the xsd-users mailing list