hi, can i someway disable rendering of root element of collection?
this class with serialization attibutes
[XmlRoot(ElementName="SHOPITEM", Namespace="")]
public class ShopItem
{
[XmlElement("PRODUCTNAME")]
public string ProductName { get; set; }
[XmlArrayItem("VARIANT")]
public List<ShopItem> Variants { get; set; }
}
generates this xml:
<SHOPITEM xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PRODUCTNAME>test</PRODUCTNAME>
<Variants>
<VARIANT>
<PRODUCTNAME>hi 1</PRODUCTNAME>
</VARIANT>
<VARIANT>
<PRODUCTNAME>hi 2</PRODUCTNAME>
</VARIANT>
</Variants>
</SHOPITEM>
I don't want <Variants>
element here. What must i do?
Also i don't need xsi and xsd namespaces in root element..
Thanks a lot for help.