I am creating an XmlDocument object and setting PreserveWhiteSpace to True,
I use loadXMl to load XML from a file but when I look at the XML of the document object some of the whitespace has been stripped.
I need to EXACTLY maintain the original formatting of the file.
I want to use an XMLDocument as I need to query it using XPath and amend and add nodes.
Here is the original XML ...
Expand|Select|Wrap|Line Numbers
- <El1>
- <El2>
- <MCG
- class="UnionCodeGroup"
- version="1"
- PermissionSet="Full">
- <MemberShip
- class="MembershipClass"
- version="1"
- Url="http://www.thescripts.com/"
- />
- </MCG>
- <El2>
- </El1>
Expand|Select|Wrap|Line Numbers
- <El1>
- <El2>
- <MCG class="UnionCodeGroup" version="1" PermissionSet="Full">
- <MemberShip class="MembershipClass" version="1" Url="http://www.thescripts.com/"/>
- </MCG>
- <El2>
- </El1>
I know that it shouldn't make any difference as they are functionally the same but the 3rd party application that uses this file does requirte the formatting to be maintained (the attributes must be on different lines)
Any help on how I can preserve the original whitespace completely would be very welcome.
Thanks