XML Schemas

Discussion in 'XML' started by Fernando Silva, May 12, 2004.

  1. Hello!

    I have a doubt in how to define a schema for the following XML:

    <X_0>
    <A>1</A>
    <B>2</B>
    </X_0>
    <X_1>
    <A>1</A>
    <B>2</B>
    </X_1>
    <X_2>
    <A>1</A>
    <B>2</B>
    </X_2>
    <X>
    <N>3</N>
    </X>

    The problem is that I don't know who many elements X_y (y is the
    number) are going to appear. They are variable.
    Is this possible to define in a Schema? Or I just have to insert as
    many X_y as the possible maximum?

    Thanks in advance.

    Regards,
    Fernando Silva
     
    Fernando Silva, May 12, 2004
    #1
    1. Advertising

  2. Fernando Silva wrote:


    > I have a doubt in how to define a schema for the following XML:
    >
    > <X_0>
    > <A>1</A>
    > <B>2</B>
    > </X_0>
    > <X_1>
    > <A>1</A>
    > <B>2</B>
    > </X_1>
    > <X_2>
    > <A>1</A>
    > <B>2</B>
    > </X_2>
    > <X>
    > <N>3</N>
    > </X>
    >
    > The problem is that I don't know who many elements X_y (y is the
    > number) are going to appear. They are variable.
    > Is this possible to define in a Schema? Or I just have to insert as
    > many X_y as the possible maximum?


    I would consider changing the structure to
    <x-list>
    <x x="1">...</x>
    <x y="2">...</x>
    ...
    <x y="n">...</x>
    </x-list>
    as you can't have a schema where element names have a variable part
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, May 12, 2004
    #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. Soeren
    Replies:
    2
    Views:
    358
    Waxolunist
    Sep 22, 2004
  2. Replies:
    3
    Views:
    791
  3. Replies:
    1
    Views:
    580
    Roedy Green
    Aug 30, 2005
  4. Tony Prichard
    Replies:
    0
    Views:
    730
    Tony Prichard
    Dec 12, 2003
  5. Andy B
    Replies:
    0
    Views:
    379
    Andy B
    Aug 7, 2008
Loading...

Share This Page