XML : .NET Reading Invalid self-closing XML element

I am having issues trying to read a self-closing xml element that is invalid. The xml is as such:

  <a key='value'>    <b key2='value2'>      <c importantkey='importantvalue'>    </b>  </a>    

By using .NET's xmlDocument class and xPath, i am unable to retrieve element "c" as it is an invalid tag.

I do not have control over the xml as this is passed from api. To be more specific, tumblr's api for xml will present video post in the above xml format. As a result, I am unable to retrieve the XML element. I can only retrieve up to 'a' element.

Is there any workaround that allows me to retrieve 'c' element as a xml node?

Thanks!

No comments:

Post a Comment