[xml] Rewinding an xmlTextReaderPtr


I am trying to use the libxml2 libraries for parsing an XML file. I am using the reader interface for parsing the file. Currently I am stuck at the following problem I have written a wrapper function that reads through an xml file and returns the 'value' of the 'field name' passed.
Assuming I have an xml file like this...
My function returns the following
        getFieldFromFile(reader, "title")  ==> money
        getFieldFromFile(reader, "creator") ==> Tojo
        getFieldFromFile(reader, "location") ==> somewhere.
But if I change the order of invocation of these function, say 'creator' first and 'title' next, I will not be able to get the value of 'title'. This is because the reader (of type xmlTextReaderPtr) would have passed through the 'title' field, before it reached 'creator' field. Now my question is, is there a way to rewind the xmlTextReaderPtr to the beginning of the file, without re-opening the actual xml file.
It would be very helpful if you can give me some pointers on this.
thanks and regards

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]