Altova Mailing List Archives
>comp.text.xml Archive Home
>Recent entries
>Thread Prev - Re: Schema question regarding some mandatory/some optional values
[Thread Next]
Re: Schema question regarding some mandatory/some optional values
To: NULL
Date: 3/2/2004 9:50:00 AM
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" <prak24@h...> wrote in message news:403f9be0$0$3097$61fed72c@n...... > 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@_...> wrote in message > news:c1ldri$9p5$1@h...... > > 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 > > > > > >
Disclaimer
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

