Could you guys help me with a way to indent XML properly using MSXML4 and nodes (instead of using InStr to find < and />). I am looking for a clean and proper way to do it.
I currenly have something like this:
<PropertyBag><CProject name="TestProj1"><FileName>test.lfp</FileName></CProject></PropertyBag>
and I would like it to turn out like this:
Notice how the inner-most node contents doesn't go on a new line. I think it looks better this way.Code:<PropertyBag> <CProject name="TestProj1"> <FileName>test.lfp</FileName> </CProject> </PropertyBag>
I have searched the forums and google and not found anything. I'm not good with MSXML so I don't even know where to start.
Also, having the option to use 4 spaces or tabs would be great.
Thanks a ton.




Reply With Quote