Optional attributegroup?

N

Nik

Hello,

I'm writing a validation schema for some XML and I wonder if there is
a good way to validate the following scenario:

The element:

<foo bar.1="1" bar.2="2" bar.4="4" tar="3"/>

The entire element is optional but that can be handled with
min/maxoccurs. The problem is the bar.* attributes. How can I define
that e.g. bar.[1-4] are optional but if any one of them are present
then the others should be present too?

Thanks in advance
 
M

Martin Honnen

Nik wrote:

I'm writing a validation schema for some XML and I wonder if there is
a good way to validate the following scenario:

The element:

<foo bar.1="1" bar.2="2" bar.4="4" tar="3"/>

The entire element is optional but that can be handled with
min/maxoccurs. The problem is the bar.* attributes. How can I define
that e.g. bar.[1-4] are optional but if any one of them are present
then the others should be present too?

In my view neither a DTD nor a W3C XML schema allows you to model such a
constraints involving different attributes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,841
Latest member
WilmerBelg

Latest Threads

Top