I am looking for a way with C # that I can serialize a class in XML and add a namespace, but define a prefix that this namespace will use.
I end up trying to create the following XML:
<myNamespace:Node xmlns:myNamespace="..."> <childNode>something in here</childNode> </myNamespace:Node>
I know with both DataContractSerializer and XmlSerializer , I can add a namespace, but they seem to create a prefix inside, with something that I cannot control. Can I control it using any of these serializers (I can use any of them)?
If I cannot control the generation of namespaces, I will need to write my own XML serializer, and if so, which one is better to write?
c # xml-serialization datacontractserializer xmlserializer
Aaron Powell Feb 26 '10 at 6:01 2010-02-26 06:01
source share