troubleshooting Question

Removing indentation from XML or setting it so that it does not automatically indent

Avatar of ITApprendista
ITApprendista asked on
.NET Programming
2 Comments1 Solution354 ViewsLast Modified:
I'm writing a custom program that edits xml files which are settings files for a program we use.  I've figured out how to change all the nodes & use XPath to locate the ones I need to edit.

Basically there is a method I wrote which creates a new XML (Configuration) file based off a template.  The problem is...the program by default uses XML files that have no indentation, no returns, no tabs.  So, when I open the XML template then save it as a new job I get a fully indented & formatted XML file.  All the info is correct but when you open this indented and formatted XML file in the program the program doesn't like it. there any way I can open and edit an XML file but NOT automatically indent it?

I'm programming all this with and using the DOM document properties to edit the XML files.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros