 |
 |
 |
I can't offhand think of a way to do this in XML Schema, but I should
point out that many in the XML community consider the example you describe
to be a suboptimal use of XML markup. Very often when you have rules
like:
Some of the inner elements are only optional, others are included more
than one time (therefore I can not use "all" for the complexType).
There is some implied structure that the markup is not capturing. It's
hard to be sure without seeing some details, but very often adding levels
of markup in the instance makes the XML more self-describing, and at the
same time makes it more suitable for Schema validation. Among the reaons
that schema does not support more elaborate pattern specifications for
content models is that they are so often (though admittedly not always) a
questionnable approach.
--------------------------------------
Noah Mendelsohn
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------
"Udo Ende" <u.ende@m...>
Sent by: xmlschema-dev-request@w...
11/08/2005 10:41 AM
To: "Xmlschema-Dev-Request" <xmlschema-dev@w...>
cc: (bcc: Noah Mendelsohn/Cambridge/IBM)
Subject: XML Schema
Hi,
I do not find a solution for my following problem:
The root elements of my XML data contain many different inner elements.
Therefore I chose a complexType definition for the root elements.
Some of the inner elements are only optional, others are included more
than
one time (therefore I can not use "all" for the complexType).
I can not tell in which order the inner elements will appear. Therefore I
can not use "sequence" for the complexType.
I decided to use "choice" - with the attribute "maxOccurs" "unbounded" not
only allowing one element under the root elements.
But with that it seems I lose a validation opportunity to tell if an inner
element must appear or is only optional (minOccurs 1 for the inner
elements
does not show a difference within validation).
Any idea how I could handle this situation?
Regards,
Udo
From K.Buchcik@4... Fri Nov 11 11:50:43 2005
Received: from lisa.w3.org ([128.30.52.41])
by frink.w3.org w
|
 | 



|  |
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.
|  |
| |
 |
 |
 |