Anirudh Nair - 2011-09-20

Hi all,

I have a requirement of reading and writing XML that is highly cross-referenced(within the same XML). So, does tinyXML  support cross referencing. Basically, I want the below explained functionality.

<classes>
    <data:class id="ENGL6004">
      <title>From Here to Eternity: Studies in the Future
        and other Temporal Genres</title>
      <Teacher>Margaret Doornan</Teacher>
    </data:class>
    <data:class id="HIST6010">
      <title>The You Decade: A History of Finger Pointing
        in Post-War America</title>
      <Teacher>Kelly Griftman</Teacher>
     </data:class>
    <data:class id="ENGL6020">
      <title>Reading between the Lines: The Literature
        of Waiting</title>
      <Teacher>Norbert James</Teacher>
    </data:class>
</classes>

<students>
    <student Index="0">
      <name>Kelly Griftman</name>
      <year>Senior</year>
      <status>full-time</status>
      <ref:class ref="HIST6010"/>
      <ref:class ref="ENGL6020"/>
    <student>
    <student Index="1">
      <name>Norbert James</name>
      <year>Senior</year>
      <status>full-time</status>
      <ref:class ref="ENGL6004"/>
      <ref:class ref="ENGL6020"/>     
    <student>
</students>
 

So, now if I fetch the node student with Index==1, the node should look like

<student Index="1">
      <name>Norbert James</name>
      <year>Senior</year>
      <status>full-time</status>
      <class id="ENGL6004">
      <title>From Here to Eternity: Studies in the Future
        and other Temporal Genres</title>
      <Teacher>Margaret Doornan</Teacher>
      </class>
      <class id="ENGL6020">
      <title>Reading between the Lines: The Literature
        of Waiting</title>
      <Teacher>Norbert James</Teacher>
      </class>   
<student>

Does, <LIB Name> provide such a functionality.

Thanks
Anirudh