W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2010

Trying to create generic schema

From: Jeff Faath <jfaath@gmail.com>
Date: Thu, 14 Jan 2010 13:34:19 -0600
Message-ID: <db1f4bc11001141134q65b4807br9f522d44faee7b36@mail.gmail.com>
To: xmlschema-dev@w3.org

I have a general question about creating a schema that is generic (from the
business point of view) vs non-generic.  I was wondering if I could get
advice from experts on the advantages or pitfalls of these two methods.  I'm
inexperienced with building XML documents so I don't have the foresight I
would like to have.  One method might look nicer now, but I'm worried it
might have issues with future processing and extendability needs.  The
question is probably best explained with an example.

We have multiple client applications that send data readings to a central
processor.  The context of the readings differ based on which application it
came from.  We anticipate having more applications in the future that send
more contextual data.  The schema is more complicated than this, but this
sums up the issue:


  <data type="appA">
  <data type="appB">



In the first example, the schema is much simpler with just three elements.
The type of data is determined by the 'type' attribute and that allows for
understanding the context of the reading values.  Having a new app installed
in the system would not require changing the schema.

In the second example, there are elements for each app and corresponding
readings.   The context is found in the explicit elements.  Adding a new app
would require adding a new element to the schema (and re-generating binding

The first example seems so much nicer, but I can't help but think there may
be some pitfalls to keeping it so clean.  The second example seems verbose,
but being explicit leaves no room for doubt when processing.  Might anyone
have some insight in how to go about this?  Is there some middle ground
between the two methods?


Received on Friday, 15 January 2010 08:58:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:55 UTC