On 16 Jul, 20:36, Robert Dailey <rcdai...@gmail.com> wrote:
> On Jul 16, 1:05 pm, Joseph Kesselman <keshlam-nos...@comcast.net>
> wrote:
>
> > Robert Dailey wrote:
> > > Is there a way in Schema to specify that the "Frame" element is
> > > different (and thus requires different child elements) depending on
> > > the value of an attribute (specifically the "type" attribute)?
>
> > Presence or absence, maybe. Value, I don't think so. Some of the other
> > schema(-like) languages do support that, or you can enforce that
> > constrating in the application code...
>
> > --
> > Joe Kesselman / Beware the fury of a patient man. -- John Dryden
>
> Thank you for your reply, it was the answer I was looking for.
>
> I would also like to ask if it's possible to make a schema accept
> either of the following attribute combinations for a single element:
>
> <Offset x="0" y="0"/>
> <Offset var="myvar"/>
>
> Is this possible?
In schema you can effectively only specify the union of the two
types. As a result things like <Offsett x="0" var="myvar"/> would
also validate. You could apply additional constraints at the
application level. XSD1.1 is due to improve onthis and Relax-NG
supports what you want.
HTH,
Pete.
--
=============================================
Pete Cordell
Codalogic Ltd
for XML Schema to C++ data binding visit
http://www.codalogic.com/lmx/
=============================================