I'm trying to parse an XML of the following structure:
Input, output and logging tags can contain either 0,1 or 2.Code:<?xml version="1.0"?> <settings> <tab> <input> 0 </input> <output> 2 <path>C:\somepath</path> </output> <logging> 2 <path>D:\somepath</path> </logging> </tab> </settings>
If they contain 2 there is a path tag inside.
My problem is, using this parser, when I encounter a <path> element, how can I know what its parent is? (either input, output or logging).
It reads line per line and doesn't seem to remember anything about the past.
Is it possible using the xmltextreader or should I use another one?




Reply With Quote