Let's say I have a fragmented XML as follows.
<A>
<B></B>
</A>
<A>
<B></B>
</A>
I can use XmlReader
with Fragment option to parse this not complete
XML string.
XmlReaderSettings settings = new XmlReaderSettings();
settings.ConformanceLevel = ConformanceLevel.Fragment;
XmlReader reader;
using (StringReader stringReader = new StringReader(inputXml))
{
reader = XmlReader.Create(stringReader, settings);
}
XPathDocument xPathDoc = new XPathDocument(reader);
XPathNavigator rootNode = xPathDoc.CreateNavigator();
XPathNodeIterator pipeUnits = rootNode.SelectChildren("A", string.Empty);
while (pipeUnits.MoveNext())
Can I do this fragmented XML string parsing with Linq?