Click to See Complete Forum and Search --> : DataContractSerializer - Controlling Output


Eggman002
September 12th, 2008, 02:01 PM
I am working with the DataContractSerializer and I would like to know if it is possible to control the output a bit more.

Right now, I am getting a bunch of namespace references like d4p1 etc.

So when serializing a DirectX Vector, I might get:


<Vector xmlns:d4p1="http://schemas.datacontract.org/2004/07/Microsoft.DirectX" xmlns="...">
<d4p1:X>1</d4p1:X>
<d4p1:Y>1</d4p1:Y>
<d4p1:Z>1</d4p1:Z>
</Vector>


I don't get these for all objects, only for some. I would like it to be consistent. I would like to be able to get rid of the d4p1 so that I just get:


<Vector>
<X>1</X>
<Y>1</Y>
<Z>1</Z>
</Vector>


Is this possible? If so how can I do it?