[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] Re: Designing Schemas for Backward and Forward Compatibility - XML Schema, Relax NG, Schematron
- From: "Costello, Roger L." <costello@mitre.org>
- To: <xml-dev@lists.xml.org>
- Date: Tue, 28 Aug 2007 09:36:07 -0400
Hello Niklas,
I realized yesterday while I was summarizing the discussions that my
initial email was incorrect. The document I posted yesterday contains
tested and correct examples.
The approach I was taking in my initial email would create this Relax
NG document (version #3):
<?xml version="1.0" encoding="UTF-8"?>
<element name="BookStore" xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<oneOrMore>
<element name="Book">
<element name="Title">
<text/>
</element>
<element name="Author">
<text/>
</element>
<element name="Date">
<text/>
</element>
<element name="ISBN">
<text/>
</element>
<element name="Publisher">
<text/>
</element>
<element name="NumPages">
<data type="nonNegativeInteger"/>
</element>
<element name="Hardcover">
<data type="boolean"/>
</element>
<zeroOrMore>
<element>
<anyName/>
<text/>
</element>
</zeroOrMore>
</element>
</oneOrMore>
</element>
Notice that in this schema <NumPages> and <Hardcover> are required
elements.
Now consider a version #1 XML instance document (I'll show only one
<Book> element for brevity):
<BookStore>
<Book>
<Title>My Life and Times</Title>
<Author>Paul McCartney</Author>
<Date>1998</Date>
<ISBN>1-56592-235-2</ISBN>
<Publisher>McMillin Publishing</Publisher>
</Book>
</BookStore>
Notice that the <Book> element does not contain <NumPages> or
<Hardcover>
Thus, the version #1 XML instance does not validate against the version
#3 schema, i.e. no backward and forward compatibility.
/Roger
-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Niklas Gustavsson
Sent: Tuesday, August 28, 2007 9:06 AM
To: xml-dev@lists.xml.org
Subject: [xml-dev] Re: Designing Schemas for Backward and Forward
Compatibility - XML Schema, Relax NG, Schematron
Excellent document. I noticed that the RNG example changed from your
initial email [1] compared to the document below. Specifically, the
original example used the follow construct for the version 2 schema:
<element name="Publisher">
<text/>
</element>
<optional>
<element name="Reviewer">
<text/>
</element>
</optional>
<zeroOrMore>
<element>
<anyName/>
<text/>
</element>
</zeroOrMore>
While the example in the document below uses:
<element name="Publisher">
<text/>
</element>
<optional>
<element name="NumPages">
<data type="nonNegativeInteger"/>
</element>
<optional>
<element>
<anyName/>
<text/>
</element>
<zeroOrMore>
<element>
<anyName/>
<text/>
</element>
</zeroOrMore>
</optional>
</optional>
I'm assuming there is a reason for this change, but I can't figure out
what it could be?
[1] http://permalink.gmane.org/gmane.text.xml.devel/36575
/niklas
Costello, Roger L. wrote:
> Hi Folks,
>
> I have written a summary of our discussions:
>
> http://www.xfront.com/backward-forward-compatibility/
>
> Comments welcome.
>
> /Roger
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]