Restriction for complexType

Discussion in 'XML' started by Sami Ather, Feb 23, 2005.

  1. Sami Ather

    Sami Ather Guest

    does anybody knows how to put a restrcition on a complexType with an
    attribute.
    eg we have a tag score and there is an attribute round for this tag.
    round attribute can have values from 1 to 9 and based upon round
    number we have different upper limit for scores like
    <score round="1">256</score> # maximum score for round 1 can be 256
    <score round="2">128</score> # maximum socre for round 2 can be 128
    <score round="3">56</score> # maximum score for round 3 can be 56
    !!!!
    Sami Ather, Feb 23, 2005
    #1
    1. Advertising

  2. Sami Ather wrote:

    > does anybody knows how to put a restrcition on a complexType with an
    > attribute.
    > eg we have a tag score and there is an attribute round for this tag.
    > round attribute can have values from 1 to 9 and based upon round
    > number we have different upper limit for scores like
    > <score round="1">256</score> # maximum score for round 1 can be 256
    > <score round="2">128</score> # maximum socre for round 2 can be 128
    > <score round="3">56</score> # maximum score for round 3 can be 56


    I don't think W3C XML schema allows you to constraint the content of an
    element in relation to the value of an attribute.
    Such constraints can be expressed and checked with schematron for instance:
    <http://xml.ascc.net/resource/schematron/schematron.html>


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Feb 23, 2005
    #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. Moth
    Replies:
    2
    Views:
    421
  2. Wolfgang
    Replies:
    2
    Views:
    730
    Wolfgang
    Oct 7, 2003
  3. D. Alvarado

    complexType is not allowed here!?

    D. Alvarado, Apr 20, 2004, in forum: XML
    Replies:
    2
    Views:
    845
    Henry S. Thompson
    Apr 21, 2004
  4. tsolbjor
    Replies:
    0
    Views:
    491
    tsolbjor
    Jul 19, 2004
  5. unishippers.suckfeed.newshosting.com

    XSD Schema: complexType or Group?

    unishippers.suckfeed.newshosting.com, Nov 4, 2004, in forum: XML
    Replies:
    2
    Views:
    396
    unishippers.suckfeed.newshosting.com
    Nov 5, 2004
Loading...

Share This Page