I don't think this can work. It doesn't feel instinctively right (not that
my XML instincts are particularly good!). The mian problem though is that I
don't know what all of the possible values are. I might have a Value1002 or
Value27649 etc. How do I represent this in a schema?
I'm surprised this is so difficult. I would have thought that a schema that
said "Many values allowed but at least one of them must be blahblah" isn't
such an unusual request??
Piers
"Martin SChukrazy" <pr****@hotmail.com> wrote in message
news:40**********************@news.rcn.com...
One suggestion is to change the
<Value>5</Value>
to a
<Value5>...</Value5>
That way you can have multiple values i.e. each value is equal to an
element and hence write a DTD/Schema that makes it conform to your rules defined
below...
"Piers Chivers" <Piers.Chivers@_no_spam_.btinternet.com> wrote in message
news:c1**********@hercules.btinternet.com... Hi,
I have XML like
<SomeElement>
<Value>5</Value>
<Value>3</Value>
<Value>7</Value>
</SomeElement>
I want to define the schema to say that the <Value>s must contain at
least one of a number of known values, and may contain some other <Value>s.
For example, if the known <Value>s were 3 and 5 then the above is valid.
Also,
<SomeElement>
<Value>5</Value>
<Value>1</Value>
</SomeElement>
AND
<SomeElement>
<Value>3<Value>
</SomeElement>
are valid because they contain one of (3 and 5). But
<SomeElement>
<Value>8</Value>
</SomeElement>
is not valid. I've tried defining this using xs:all and enumerations
but with no luck. All suggestions gratefully received.
Thanks,
Piers