W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2003

Defining uniqueness on optional element

From: Cams Ismael <Ismael.Cams@siemens.com>
Date: Thu, 27 Mar 2003 09:53:22 +0100
Message-ID: <57FD2C3A246F76438CA6FDAD8FE9F1957ABC70@hrtades7.atea.be>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>

Hello all,

I have an question regarding uniqueness. Consider following xml file:

     <module name="test1">
     <module name="test1">

The community element is optional. What I need is to define uniqueness:
	a) for the module names if the community tag is not present
            b) for the combination module name/community if the community
tag is available

What I have now is:

<xsd:unique name="uniqueModule"> (xsd:unique because community tag is
	<xsd:selector xpath="module"/>
	<xsd:field xpath="community"/>

This covers the second case, but not the first one (when optional tag is not
available this module element is ignored). Because it's not possible to use
tests in these XPath expressions I don't see a solution for my problem. Can
somebody help me with this ?

Thanks in advance.

Kind regards,
Received on Thursday, 27 March 2003 03:53:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:09 UTC