Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Extending by removing minOccurs restriction

From: Rowan Bradley <rowan.bradley@------------.--->
To: "'xmlschema-dev@--.---'" <-------------@--.--->
Date: 12/22/2004 2:18:00 PM
This may be a beginner's question. I need to develop a schema based on a
schema published by a third party (NRF-ARTS). I need to add some elements to
the published schema - I can do this via the xsd:extension element of the
xsd document. Is it the case that I can only add elements after any existing
elements? I.e. if the existing schema contains a sequence of 10 elements,
there is no way to add one after the 5th of these?
 
I also need to be able to make one of the required elements in the published
schema optional. There doesn't seem to be a way using restriction and
extension to change a minOccurs="1" to a minOccurs="0", presumably because
this is not actually a restriction, i.e. an instance of the new derived
schema would not necessarily be a valid instance of the base schema.
 
I wondered if one could do this in two steps: first derive a schema by
restriction which removes the element which I want to make optional, then
derive a further schema from this by extension which adds the element back
with a minOccurs="0". But this won't work because I can't put the
replacement element in the same position in the sequence that the old one
was in due to the first problem mentioned - it will have to go at the end.
Obviously instances that don't have the newly optional element will not be
valid instances of the original schema, but this problem means that even
instances that do have the optional element will not be valid instances,
since the element will be in the wrong place.
 
Can anyone suggest a better way of doing this?
 
Thanks - Rowan


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