Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Both extending and restricting with

From: "Hirtle, David" <David.Hirtle@--------.--.-->
To: xmlschema-dev@--.---
Date: 4/1/2005 4:10:00 AM
(Apologies if this message is received more than once -- yesterday's
attempt seems to have not gone through.)

I originally thought that XML Schema didn't permit "replacing" an
element with another via <redefine>, i.e. both extending and
restricting a content model, but the spec doesn't seem to forbid doing
it in two steps... so I whipped up an example.  Unfortunately, I'm
getting mixed validation results.

a.xsd (http://www.ruleml.org/0.89/xsd/a.xsd) defines an element "body"
which allows only the element "x".

b.xsd (http://www.ruleml.org/0.89/xsd/b.xsd) redefines "body" from
a.xsd, first extending it to allow a new element "y" and then
restricting it to disallow "x", effectively replacing "x" with "y" in
the content model of "body".

Assuming this is permissible in XML Schema...

ab.ruleml (http://www.ruleml.org/0.89/exa/ab.ruleml) should not be
valid w.r.t. b.xsd because "body" contains an "x".

XSV (web form and installation) reports no validity problems but
crashes.  Saxon correctly (?) identifies the problem, as appended
below.

So I'm left with the question: is this the correct way to "replace" an
element with another in a content model via <redefine> (if possible at
all with XML Schema)?  And what about the validators?

Thanks,

David

***

java com.saxonica.Validate -t http://www.ruleml.org/0.89/exa/ab.ruleml
Saxon-SA 8.3 from Saxonica
Java version 1.5.0_01
Processing http://www.ruleml.org/0.89/exa/ab.ruleml
Loading schema document http://www.ruleml.org/0.89/xsd/b.xsd
Loading schema document http://www.ruleml.org/0.89/xsd/a.xsd
Finished loading schema document http://www.ruleml.org/0.89/xsd/a.xsd
Finished loading schema document http://www.ruleml.org/0.89/xsd/b.xsd
Validation error on line 5 column 4 of http://www.ruleml.org/0.89/exa/ab.ruleml:
In content of element <body>: The content model does not allow element <x>
to appear here.
Expected: {http://www.ruleml.org/0.89/xsd}y
Validation error on line 7 column 8 of http://www.ruleml.org/0.89/exa/ab.ruleml:
One or more validation errors were reported
Validation of source document failed

From mike@s... Fri Apr 01 14:34:37 2005
Received: from lisa.w3.org 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent