XSD Deficiency: Incompatibility of xs:add and xs:any

K

KMyers1

Hello XML Gurus,

I am quite new to XML, and could be missing something very basic, so I
hope that you will be able to enlighten me. I am working on an
application where I had hoped to use XML as a data storage and
interchange format. In writing similar applications previously that
worked with simple tabular data, it was almost always very important
to write the application in a manner such that it would support two
fundamental rules regarding extensibility for data storage and
interchange formats.

To help illustrate these rules, consider an application that requires
an input table which must contain columns A and B. Then the
extensibility rules that I am having a problem with in XSD can be
stated as follows:

1. The application should function correctly regardless of the order
in which required columns are supplied in the input table. This means
that tables with column ordering A,B should work equally well to a
table with column ordering B,A.

2. The application should function correctly regardless of additional
columns that may be supplied in the input table, of which the
application has no prior knowledge. This means that an application
requiring an input table with columns A and B should work equally well
with an input table that contains only columns A,B or with an input
table that contains columns X,B,Y,A,Z, and that it must be possible
for the application to be written with no prior awareness of columns
X,Y,Z.

With RDBMS tables, spreadsheets, delimited files, etc. it is easy to
write an application that supports data format extensibility according
to the two preceding rules. But I can't figure out how equivalent
support for arbitrary element ordering and inclusion of non-specified
elements can be implemented with XSD.

Arbitrary element ordering is support through the use of xs:all, and
inclusion of non-specified elements is supported through the use of
xs:any. But these two XSD schema specifications appear to be mutually
exclusive, i.e. you can't apply both of them to the same group of
elements. Without the capability of using both of these
specifications together, I can't see any way to support both of the
above fundamental rules for data format extensibility in XSD, and this
requirement is extremely important for my application (and many
others).

Can someone please enlighten me as to how the above data format
extensibility rules can both be supported for the same group of
elements in XSD?

Thanks,
Kevin M.
 
U

usenet

Hello XML Gurus,

I am quite new to XML, and could be missing something very basic, so I
hope that you will be able to enlighten me. I am working on an
application where I had hoped to use XML as a data storage and
interchange format. In writing similar applications previously that
worked with simple tabular data, it was almost always very important
to write the application in a manner such that it would support two
fundamental rules regarding extensibility for data storage and
interchange formats.
...

You're not missing anything basic. It's schema that is missing
things. The versioning aspects of schema are absolutely awful.
People have gone to prison for less!

There's a paper on how to work around the versioning limitations of
schema here:

http://www.xml.com/pub/a/2004/10/27/extend.html

Note that they don't really satisfy what you are looking for,
particularly with regard to ordering.

They are working on a new version of XSD, which will hopefully fix
this.

HTH,

Pete.
--
=============================================
Pete Cordell
Codalogic
for XML Schema to C++ data binding visit
http://www.codalogic.com/lmx/
=============================================
 
K

KMyers1

You're not missing anything basic. It's schema that is missing
things. The versioning aspects of schema are absolutely awful.
People have gone to prison for less!

There's a paper on how to work around the versioning limitations of
schema here:

http://www.xml.com/pub/a/2004/10/27/extend.html

Note that they don't really satisfy what you are looking for,
particularly with regard to ordering.

They are working on a new version of XSD, which will hopefully fix
this.

HTH,

Pete.
--

Hi Pete,

Thanks a lot for your extremely helpful comments! That is exactly the
kind of feedback that I was looking for, although I wish that it had
turned out to be a problem with my understanding rather than an actual
definiciency in the schema spec.

Regards,
Kevin M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top