- From: Ashok Malhotra <ashokma@microsoft.com>
- Date: Mon, 26 Nov 2001 12:44:30 -0800
- To: <caroline.schappler@bnpparibas.com>, <castor-dev@exolab.org>, <xmlschema-dev@w3.org>
I am not sure I understand your question but I will try and answer it.
I think you want to define a document or a root element within which
element x may occur at least once and at most an unbounded number of
times.
Clearly, this is straightforward.
Then you want to impose a constraint that at least one occurrence of
element
x must have a specified attribute value. This is an example of what are
sometimes called co-occurrence constraints. Such constraints cannot be
defined using XML Schema.
All the best, Ashok
===========================================================
Ashok Malhotra <mailto: ashokma@microsoft.com>
Microsoft Corporation
-----Original Message-----
From: caroline.schappler@bnpparibas.com
[mailto:caroline.schappler@bnpparibas.com]
Sent: Monday, November 26, 2001 9:56 AM
To: castor-dev@exolab.org; xmlschema-dev@w3.org
Subject: XML Schema
Hi,
I would like to know if it is possible with XML schema to define a
constraint as described below :
I defined an element (x) which has a maxOccurs attribute to a value =
unbounded, and I have a validation rule
which define the existence of at least one instance of the element (x)I
describe above, with a specific value of one
of its attribute (y= "specific value").
How is it possible to achieve this kind of constraint using Xml schema?
For example :
<?xml version ...>
<xsd:element ref="x" maxOccurs="unbounded"/>
....
<xsd:element name="x">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="y"/>
.....
</xsd:sequence>
</xsd:complexType>
</xsd:element>
.....
Thanks for your help
This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.
---------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.
Received on Monday, 26 November 2001 15:45:38 UTC