开发者

How can I add knowledge of namespaces before I deserialize XML

开发者 https://www.devze.com 2023-01-11 07:11 出处:网络
I\'ve found several examples of creating XmlSerializerNamespaces and adding 1 to开发者_开发问答 many namespaces, then serializing based on the object and the list of namespaces.

I've found several examples of creating XmlSerializerNamespaces and adding 1 to开发者_开发问答 many namespaces, then serializing based on the object and the list of namespaces.

I can't find any examples of where I have an XML string and I need to deserialize and I want to utilize the namespaces. I've tried reading the string into an XmlTextReader and then setting the Namespaces property to true, but it still didn't work.


The namespaces are part of the XML document already and when deserializing them should be populated automatically.

The Namespaces property is by default set to true, so no need to set it to true again - see MSDN.

Can you post your code and XML?

0

精彩评论

暂无评论...
验证码 换一张
取 消