fmi2006
asked on
XmlTextReader - xml element order problem
I'm using XmlTextReader and XmlTextWriter (Visual Studio 2005) to parse a big xml file.
What I need to do is:
read each element of the file,
for each element check some conditions in order to leave the element I'm reading unchanged or remove it;
to leave the element unchanged, I write it to another xml file (using XmlTextWriter),
to remove it, I do not write it to the new file.
Everything is ok, but I noticed that sometimes XmlTextReader change the original order of the elements: it appens quite often when there are empty elements nested into other elements.
How can I control XmlTextReader in order to get the right sequence? Do I need to create my own MyXmlTextReader? How can I do this?
Thank you,
fmi2006
What I need to do is:
read each element of the file,
for each element check some conditions in order to leave the element I'm reading unchanged or remove it;
to leave the element unchanged, I write it to another xml file (using XmlTextWriter),
to remove it, I do not write it to the new file.
Everything is ok, but I noticed that sometimes XmlTextReader change the original order of the elements: it appens quite often when there are empty elements nested into other elements.
How can I control XmlTextReader in order to get the right sequence? Do I need to create my own MyXmlTextReader? How can I do this?
Thank you,
fmi2006
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I solved the strange-element-sequence-p roblem!
It was a bug in my code!!!!
Anyway thanks for support,
Bye
It was a bug in my code!!!!
Anyway thanks for support,
Bye
ASKER
I will try to create my own XmlTextReader and I will let you know the result...