W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2005

Re: XML Schema

From: George Cristian Bina <george@sync.ro>
Date: Wed, 09 Nov 2005 09:42:07 +0200
Message-ID: <4371A84F.7050108@sync.ro>
To: Udo Ende <u.ende@mid.de>
Cc: Xmlschema-Dev-Request <xmlschema-dev@w3.org>

Hi Udo,

You cannot do much more than this. The only thing I can think of is that 
you can use key constraints to enforce some elements that do not have 
complex content to appear and to appear only once.
You have to move this check at application level or you can use 
Schematron embedded rules, but that will not be XML Schema alone.

Best Regards,
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Udo Ende wrote:
> 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
Received on Wednesday, 9 November 2005 07:40:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:09 UTC