indentation in saved XML files

Feb 27, 2014 at 1:41 AM
Hello, I love your HL7 CCD library for .Net. Thank you!!!

Is there a way to control the indentation in the XML file created by the ClinicalDocument Save method? The default is a 2 space indentation. I'd like to use 4 spaces instead.

Thanks, Bill
Coordinator
Feb 27, 2014 at 7:37 PM
Hi,
The ClinicalDocument.Save(object) method accepts an instance of XmlWriter. So the solution is something like writer.Settings.Indent = true; writer.Settings.IndentChars = " ", and finally pDocument.Save(writer).
Feb 28, 2014 at 10:29 PM
Great! Thanks for the quick reply.