W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2004

Re: Element versioning

From: Bob Schloss <rschloss@us.ibm.com>
Date: Wed, 18 Aug 2004 10:58:34 -0400
To: Thomas Solbjør <thomas.solbjor@strath.ac.uk>
Cc: xmlschema-dev@w3.org
Message-ID: <OFA094FD64.4FE68B4B-ON85256EF4.00516E7B-85256EF4.00524427@us.ibm.com>


      If the definition of  paragraph  were
<xs:element name="paragraph">
      <xs:element ref="text-v01" minOccurs="1" maxOccurs="unbounded"/>
then you would be able to declare a global element text-v02 and make it in
the same substitution group as
global element text-v01.

The benefits of this way of doing this is that anywhere, not just as a
particle with a paragraph element information item,
where text-v01 was allowed, now text-v02 was allowed.

The drawback is that there is no way to cause a validator to make sure that
if multiple particles exist,
there can be at most one text-v01 and at most one text-v02, or there should
be either one text-v01 period,
or one of each.

Another way to do this is to explicitly use xsi:type on multiple occurances
of the same element with the identical tag.
I'm really not certain that all validators would handle this correctly.

In languages such as XSLT 1.0, to select between the contents of these
multi-version inner elements will be doable whether you use the different
element tag name approach I offered first, or the xsi:type attribute

A third way to do this is to have different namespace URIs, so that NCNAME
of both versions are 'text', but the fully qualified name of the two
versions are distinct.

            Good Luck,

Scalable XML Infrastructure
IBM Thomas J Watson Research Center
Yorktown Heights, NY, USA

             Thomas Solbjør                                                
             trath.ac.uk>                                               To 
             Sent by:                  <xmlschema-dev@w3.org>              
             xmlschema-dev-req                                          cc 
                                       Element versioning                  
             08/18/2004 05:25                                              


I have been trying to make some elements that support versioning. Im
thinking of compared to databases, a nested table. I want an element
old versions of the same element, ie. I don’t want to delete old content.

An example (not proper XML syntax):
             <text id="aParagraph" version="2">
                         This is a new text.
             <text id="aParagraph" version="1">
                         This is atext.

Multiple elements cannot share id's, but how should I do this? What is the
best way?


Received on Wednesday, 18 August 2004 14:59:27 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:06 UTC