Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML Schemas

Reply
Thread Tools

XML Schemas

 
 
Fernando Silva
Guest
Posts: n/a
 
      05-12-2004
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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      05-12-2004


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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can xml schemas from a dataset be used to validate standard xml files? Andy B ASP .Net 0 08-06-2008 11:42 PM
"root element collision" while trying use commonality in two XML schemas lbrtchx@hotmail.com Java 1 08-30-2005 02:44 AM
How 2 get single JDOM doc of XML schema that also includes external schemas kyancy@gmail.com Java 3 03-09-2005 07:19 PM
Strange problem with JDOM, Xerces and XML Schemas Soeren Java 2 09-22-2004 10:17 AM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57