[xml] xmlTextReaderPreservePattern & XPATH



Hello,

I have a need to collect fragments of an xml file and create a new
file with them. Example reader3.c using xmlTextReaderPreservePattern
seems like the right solution.
The file input file is attached.
Since I need to collect different record types, the xpath expression
I'm using is one yelding a nodeset union like '//rec1 | //rec2'.
Executing reader3.c always returns only the subset of nodes identified
by the first part of the union (eg. if the expression is '//rec1 |
//rec2' then I'm getting 3 nodes, whereas if the expression is '//rec2
| //rec1' then I'm getting 2 nodes).
If I run the sample program xpath1.c with the same expression, I'm
getting 5 nodes, which is correct.

Shouldn't both programs behave the same way since the xpath expression
is the same?
Or I am mistaken in my assumption?

Thanks a lot.

Massimo

Attachment: test3.xml
Description: Text Data



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