Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Different ways to set out an xml file

Status
Not open for further replies.

cashdeskmac

Programmer
Aug 3, 2006
1
GB
Can anyone tell me the difference between these two xml files:

<?xml version="1.0" ?>
<Bookshop>
<book title="my first book" author="someone"/>
<book title="another book" author="someone else"/>

<DVD title="how to cook" director="TV Chef"/>
<DVD title="Gardening" director="TV gardener"/>
</Bookshop>

and:

<?xml version="1.0" ?>
<Bookshop>
<Books>
<book title="my first book" author="someone"/>
<book title="another book" author="someone else"/>
</Books>

<DVDs>
<DVD title="how to cook" director="TV Chef"/>
<DVD title="Gardening" director="TV gardener"/>
</DVDs>
</Bookshop>

Both allow me to generate a schema and fill a DataSet, but is there any significant difference between them, and is one prefered over the other?

 
>Both allow me to generate a schema and fill a DataSet
But that is not going to be a criterion to select one over the other. I guess one has to overcome the idea that one kind of rendering is "necessarily" better than the other, except some over-zealous practitioners. Common sense rules and the extension plan rules.

Common senses rules because you have not tried this kind of thing.
[tt]
<book title="my first book" author="someone"/>
<book>
<title>another book</title>
<author>someone else</author>
</book>
[/tt]
That is already a proof. I'm sure one can make out a schema for that but it is so awkward to logically managing it conceptually and performance-wise...

Extension plan matters. If you have something in mind to add to book which may be different from that to add to dvd, then using <books></books> vs <dvd></dvd> would be a good idea.

Then, there are performance consideration. The size of source files, the easiness of retrieving or reading it...

I would not worry too much at this stage. At some time, somebody is bound to be unhappy of this or that. Whether it is too late to change is a matter of management.

In sum, I have no opinion yet I find I had typed so many syllables for nothing...

ps. Don't take the above seriously, I'm no expert, and have no pretention to be one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top