How to deserialize an xml that doesn't have a namespace, etc.?

I have an xml file that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<config>
 <node id="1" />
</config>

Now I try to deserialize it, but always get an error:

<config xmlns=''> was not expected

Anyone how to fix this? I have no control over xml.

Thanx

+3
source share
1 answer

Why not just load it as a DOM (e.g. with XmlDocumentor XDocument) and extract the data yourself? Assuming it was not saved with help XmlSerializer, it makes no sense to try to deserialize it that way.

EDIT: , . XmlSerializer, ? , - ? , ?

, ( ), . .

+2

Source: https://habr.com/ru/post/1751605/


All Articles