Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Duplicate data in XML

Hello,

What do you do about duplicate data in XML? for example:

If I have 2 cars for sale, both having the same seller. I don't want to store the seller's information twice... Do I need to create 2 files: "cars" and "sellers" then link them with a foreing key?

<cars>
<car>
<make>BMW</make>
<model>M3</model>
<seller>
<name>Peter</name>
<email>peter@email.com</email>
</seller>
</car>
<car>
<make>PORSCHE</make>
<model>911</model>
<seller>
<name>Peter</name>
<email>peter@email.com</email>
</seller>
</car>
</cars>
[839 byte] By [peterh] at [2007-11-11 8:11:44]
# 1 Re: Duplicate data in XML
>>Do I need to create 2 files: "cars" and "sellers" then link them with a foreing key?

Yeah.. I think creating two files and linking them is better way.
Sync at 2007-11-11 23:28:43 >