XSD restriction of nesting an element within another element with aspecific attribute value?

Discussion in 'XML' started by PeteOlcott, Feb 4, 2009.

  1. PeteOlcott

    PeteOlcott Guest

    <ElementName AttributeName="Specific Value">
    <OtherElementName />
    </ElementName>

    The idea is to somehow force the restriction that the
    <OtherElementName> element can only be nested within the <ElementName>
    tag if this tag has the attribute value of "Specific Value" for its
    attribute named AttributeName.
     
    PeteOlcott, Feb 4, 2009
    #1
    1. Advertising

  2. PeteOlcott

    Mukul Gandhi Guest

    Re: XSD restriction of nesting an element within another element witha specific attribute value?

    On Feb 5, 1:41 am, PeteOlcott <> wrote:
    > <ElementName AttributeName="Specific Value">
    >   <OtherElementName />
    > </ElementName>
    >
    >  The idea is to somehow force the restriction that the
    > <OtherElementName> element can only be nested within the <ElementName>
    > tag if this tag has the attribute value of "Specific Value" for its
    > attribute named AttributeName.


    This could be difficult with XSD 1.0. But you could do some validation
    at an application level.

    XSD 1.1 has a facility called 'assertions' which will make this
    requirement solved easily (ref, http://www.w3.org/TR/xmlschema11-1/#cAssertions).

    But XSD 1.1 is currently in draft. I am hoping we would see XSD 1.1
    becoming a recommendation soon, and implemented in products.
     
    Mukul Gandhi, Feb 5, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthet
    Replies:
    2
    Views:
    687
    Matthet
    Sep 24, 2003
  2. Replies:
    1
    Views:
    878
    Martin Honnen
    Jan 14, 2004
  3. Replies:
    4
    Views:
    426
  4. Trans
    Replies:
    10
    Views:
    312
    Sean O'Halpin
    Sep 16, 2005
  5. Jesper Rønn-Jensen
    Replies:
    4
    Views:
    143
    Joel VanderWerf
    Feb 22, 2008
Loading...

Share This Page