A schema question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lin Shen

    #1

    A schema question

    Hi,

    I want to write a schema to describe the following xml:

    <A>
    <B/>
    <C/>
    <D/>
    </A>

    where,

    1) <B>, <C> and <D> can be listed in any order
    2) <B> is optional and can occur at most once.
    3) <C> is required and must occur exactly once.
    4) <D> is required and can occur more than once.

    thanks
    lin
  • Abhinav

    #2
    Re: A schema question

    Lin Shen wrote:
    [color=blue]
    > Hi,
    >
    > I want to write a schema to describe the following xml:
    >
    > <A>
    > <B/>
    > <C/>
    > <D/>
    > </A>
    >
    > where,
    >
    > 1) <B>, <C> and <D> can be listed in any order[/color]

    use the all construct
    [color=blue]
    > 2) <B> is optional and can occur at most once.[/color]

    minOccurs="0"
    [color=blue]
    > 3) <C> is required and must occur exactly once.
    > 4) <D> is required and can occur more than once.[/color]

    maxOccurs="unbo unded"

    Check out http://w3schools.org for a gentle but useful intro to schemas.

    HTH

    --
    Abhinav

    Comment

    Working...