Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am reading an XML file.
If I get read a line having <book type="Comic">

It should move back to previously read line <issues>


How to do this using XMLreader.


XML
<Issues>
<Article id=1>
</Article>
<Book type="Comic">
</Book>
</Issues>


I read the line
XML
<book type="Comic">
it should move to
XML
<article id="1">


How to do this
Posted
Updated 31-Mar-14 20:54pm
v2
Comments
Pheonyx 1-Apr-14 3:52am    
Why do you want to move backwards through a file?
I'm not certain you can do it as most "readers" as sequential forward readers. You would have to start again and jump forward to the line in question.

1 solution

You can't, see the description at http://msdn.microsoft.com/en-us/library/vstudio/system.xml.xmlreader[^]. If you want random access to your XML data then you should use the XML Document Object Model[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900