Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Serialize without xmlns

$
0
0

Hi,

I'm trying to serialize a object without namespaces. I tried this:

XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("", "");
XmlSerializer slz = new XmlSerializer(someType);
slz.Serialize(myXmlTextWriter, someObject, ns);

But it does not work? i get all my elements with namespaces:

<ID xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2190583</ID><IssueDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2019-11-15</IssueDate>

How to prevent that?


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>