How to represent a Many-To-Many relationship in XML or other simple file format?

Posted by CSharperWithJava on Stack Overflow See other posts from Stack Overflow or by CSharperWithJava
Published on 2010-06-17T22:08:22Z Indexed on 2010/06/17 22:13 UTC
Read the original article Hit count: 195

Filed under:
|
|
|
|

I have a list management appliaction that stores its data in a many-to-many relationship database.

I.E. A note can be in any number of lists, and a list can have any number of notes.

I also can export this data to and XML file and import it in another instance of my app for sharing lists between users. However, this is based on a legacy system where the list to note relationship was one-to-many (ideal for XML).

Now a note that is in multiple lists is esentially split into two identical rows in the DB and all relation between them is lost.

Question: How can I represent this many-to-many relationship in a simple, standard file format? (Preferably XML to maintain backwards compatibility)

© Stack Overflow or respective owner

Related posts about java

Related posts about Xml