I am using serialization in c# 3.0 (trying to serialize). I want to use the schemaLocation xml attribute as that is what is in an example i need to stick to. I cannot work out what c# attribute i need to use to do this.
I have tried:
where "exampleClass" is the root node in the serialized document.
The output should be like:
what comes out is more like:
I have tried:
Code Snippet
public Class exampleClass
{
[System.Xml.Serialization.XmlAttributeAttribute("schemaLocation", Namespace = "http://www.rewerse.net/I1/2006/R2ML http://oxygen.informatik.tu-cottbus.de/R2ML/0.4/R2ML.xsd")]
public string schemaLocation;
}
where "exampleClass" is the root node in the serialized document.
The output should be like:
Code Snippet
<exampleClass schemaLocation="http://oxygen.informatik.tu-cottbus.de/R2ML/0.4/R2ML.xsd">
...
</exampleClass>
what comes out is more like:
Code Snippet
<exampleClass xmlns="http://oxygen.informatik.tu-cottbus.de/R2ML/0.4/R2ML.xsd">
...
</exampleClass>