[Home] [By Thread] [By Date] [Recent Entries]
On 1/20/2017 11:02 AM, Costello, Roger L. wrote: Hi Folks, As you know, a tree data structure can be represented in XML using parent-child relationships. ... Or you could give every node an ID attribute. Then you can add attributes presenting parent and child, which point to other IDs. By adding the right parent/child attributes, you can get the same nodes to represent any number of trees, even simultaneously. The only schema changes needed would be the new parent/child attributes.Lesson Learned: The binary relation representation is a flexible way to represent trees. Caveat: Of course, it is not wise to use binary relations exclusively. That would defeat the purpose of XML. Parent-child relationships are very useful. So, you might have a part of your XML document where great flexibility is needed. That would be a good use of binary relations – embedded within a larger XML document. The binary relation contains volatile stuff; the other part contains the non-volatile stuff. This way you minimize the need for schema changes. Comments? Roger seems to like to avoid attributes. But sometimes they make things simpler. TomP
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |

Cart



