how to make xml formatted in a better way C# linq

5.00 avg. rating (96% score) - 2 votes

how to make xml formatted in a better way C#

input format  xml

<Parameter ID=”ABC”><Min>-273</Min> <Max>1734.96875</Max></Parameter>

output format xml

<Parameter ID=”ABC”>
<Min>-273</Min>
<Max>1734.96875</Max>
</Parameter>

Solution

string unformattedxmlstr = “<Parameter ID=”ABC”><Min>-273</Min> <Max>1734.96875</Max></Parameter>”;

string formatedxmlstr = System.Xml.Linq.XElement.Parse(unformattedxmlstr).ToString()

 

 

%d bloggers like this: