Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML Document Design to represent a Heirarchy

Reply
Thread Tools

XML Document Design to represent a Heirarchy

 
 
Trevor Andrew
Guest
Posts: n/a
 
      07-21-2003
Hi There,

I was wanting some advice regarding the best-practice approach to
representing a hierarchy in XML. Let me explain by an example of the two
different approaches I have seen.

In the first example all of the data in the document is enclosed within what
might be an ambiguous <categories> node. However on some occasions there
might be some need for this node to have some attributes. And then for
individual <category> nodes within that, they again have a <categories> node
within which child <category> nodes exist.

In the second example, the <categories> nodes are eliminated and hierarchy
is represented simply by there being <category> nodes within <category>
nodes.

Example 1

<root>
<categories>
<category>
...
</category>
<category>
...
<categories>
<category> ... </category>
<category> ... </category>
</categories>
<category>
</categories>
</root>

Example 2

<root>
<category>
...
</category>
<category>
...
<category>
</category>
<category>
</category>
</category>
</root>

What I would like guidance on is which approach would be considered
"best-practice", or are both valid in different circumstances? Additionally,
does anyone have some good references on where I could research these XML
design issues further? Are there any ramifications with regard to writing an
XSD schema for such document?

Thanks in Advance,
Trevor Andrew


 
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
User Control in a Page Heirarchy thomson ASP .Net 0 01-05-2007 05:55 AM
how to setup this heirarchy shahbazc@gmail.com Java 0 03-04-2005 05:55 PM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM
Kodak EasyShare v3.x folder heirarchy Charlie Digital Photography 1 09-10-2003 06:05 PM
Package heirarchy Tim Tyler Java 0 08-05-2003 08:27 AM



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