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>




Thomas,

      If the definition of  paragraph  were
<xs:element name="paragraph">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="text-v01" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>
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
approach.

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,
            Bob

Scalable XML Infrastructure
IBM Thomas J Watson Research Center
Yorktown Heights, NY, USA
http://www.research.ibm.com/XML






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





Hi,

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


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

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

--
Thomas



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

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:10 UTC