I need a purse an XML string (.Net, C #), which was unfortunately not created properly Is .. xml stream coming back
I have tried to use an XML reader, but its outbreak is being terminated because it thinks, and correctly, there are 2 node elements, whenever it parsed Tried to do
What is something that I can do with this? I can not change XML because I do not have any control over the XML sending code.
Any help, will be appreciated
Thanks and Regards
Gagan januja
I think you can specify that the node type is a XmlNodeType Element
is similar to this example from MSDN, you can use XmlParserContext
in one of the XmlTextReader
overloads to specify (): < / P>
XmlTextReader tr = New XmlTextReader ("& lt; element1> abc & lt; / element1 & gt; & lt; element2 & gt; qrt & lt; / element2 & gt; & lt; pi asldfjsd? & Gt ; & Lt;! - Comment -> "XmlNodeType.Element, null"); While (tr.Read ()) {Console.WriteLine ("node type: {0} node name: {1}", tr.NodeType, tr.Name); }
Comments
Post a Comment