XML Schemas

Fernando Silva

Usenet Archive
Joined
Jan 19, 2004
Messages
3
Reaction score
0
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
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,798
Members
249,594
Latest member
henrywalsh

Latest Threads

Top