I am developing a WCF method that returns object data, including a Dictionary property. The XML contains a large amount of markup and I was wondering if there was means of reducing the markup.
Below is an example of the current XML output for the Dictionary:
<gases>
<a:KeyValueOfstringfloat>
<a:Key>CH4</a:Key>
<a:Value>40</a:Value>
</a:KeyValueOfstringfloat>
<a:KeyValueOfstringfloat>
<a:Key>CO2</a:Key>
<a:Value>60</a:Value>
</a:KeyValueOfstringfloat>
</gases>
For each additional gas element added to the collection, an extra <a:KeyValueOfstringfloat>
along with its content is added. Is it possible to customise the formatting to something along the lines of:
<gases>
<key>value</key>
</gases>
Thanks in advance.