The Xml response I get is as follows:
<response>
<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:com.someDomain.item">
<name>some name</disc-name>
<description>some description</disc-desc>
</item>
<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:com.someDomain.item">
<name>some name</disc-name>
<description>some description</disc-desc>
</item>
<otherValue>12.1</otherValue>
</response>
My class is framed as such:
[XmlElement("item")]
public Item[] Items{get;set;}
[XmlElement("otherValue")
public string OtherValue{get;set;}
When I try to deserialize the above Xml into the described class, I get the error message "The namespace prefix" java "is not defined". Adding the "namespace" attribute to the class eliminates the parsing error (however, the xml is then distorted from the original).
t
[XmlElement(ElementName="item",Namespace="java")]
How should I decorate a given property to fit the new namespace? Or, how to define the namespace correctly?
I am not 100% using the stock array for my enumerable section, but I think the namespace problem is currently taking place. Any insights or thoughts are welcome!
UPDATE:
, , :
XmlElementAttribute ( ), , , xsi?
, , , Xml- - , xsi . , ( XmlElement ):
foreach(XmlNode node in element)
node.Attributes.RemoveAll();
, .