Update XmlHelper v1.01
I’ve updated the code for XmlHelper by adding two methods that I had forgoten about untill I needed them this afternoon.
/// <summary> /// Attractively format the XML with consistant indentation. /// </summary> /// <param name="strXML">A well formed XML string</param> /// <returns>An XML string with carage returns and indentations</returns> public static string PrettyPrint(string strXML) /// <summary> /// Attractively format the XML with consistant indentation. /// </summary> /// <param name="doc">The Xml Document you want to convert</param> /// <returns>An XML string with carage returns and indentations</returns> public static string PrettyPrint(XmlDocument doc)
both will take this :-
<?xml version="1.0" encoding="utf-8"?><NewDataSet><Foo><Bar>abc</Bar></Foo></NewDataSet>
to this :-
<?xml version="1.0" encoding="utf-8"?> <NewDataSet> <Foo> <Bar>abc</Bar> </Foo> </NewDataSet>
You can find XmlHelper v1.01 under projects, as always if anyone wants to suggest other methods or if you are using it and find a bug let me know…
