W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2006

A question on element default values

From: Sreeni Nair <sreeni.nair@gmail.com>
Date: Fri, 15 Sep 2006 11:10:51 -0400
Message-ID: <6faa38410609150810v6c6b6028if6f8e9383d6ae751@mail.gmail.com>
To: xmlschema-dev@w3.org
I am a schema-newbie. In my current project, I am facing in a problem with
schema upgrades. In detail, it is like the following:
>From my application, I can store the configuration data as an XML file into
the non-volatile memory. It follows the representation set forth by a
schema. In time, the schema could get modified and new elements etc could be
added. If the application is using a newer version of the schema than the
XML file on disk (ie the application needs more elements than that is
present in the old XML file), is there a way to provide some default values
for the new fields from the schema itself? I understand that missing
optional attributes can be initialized with default values as given in the
schema itself, whereas for elements, the schema definition requires that the
element itself to be present in order to use the default value from the
schema. In the case I described, the elements themselves will be absent.

Has anyone encountered such a scenario before? Is there a work-around to
this solution using the schema structures themselves? Any input will be much
appreciated. I searched the archive, but could not find any description of a
similar situation.

Thanks in advance,
Sreeni Nair

-- 
"We don't check for NULL."
Received on Friday, 15 September 2006 16:19:25 GMT

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