|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: An elegant implementation of an XML graph traversal
Richard Salz wrote:
>> Recall that, while an XML document is sometimes a tree, in the
>> general case it is a graph. And that graph may have loops.
>
> Could you post an example of this? I've never seen an XML document with loops.
In the following document Section A points to Section B and Section C. Section B points to Section D. Section C points to Section D. Section D points to Section A.
Thus, the XML document is a graph and it consists of two loops (cycles): A -> B -> D -> A and A -> C -> D -> A
<Document>
<Section id="A">
<Include idref="B" />
<Include idref="C" />
</Section>
<Section id="B">
<Include idref="D" />
</Section>
<Section id="C">
<Include idref="D" />
</Section>
<Section id="D">
<Include idref="A" />
</Section>
<Section id="E" />
</Document>
/Roger
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








