Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting messed up XML-document to more readable form

Status
Not open for further replies.

comma

Programmer
Feb 12, 2003
24
FI
Hi!

I was wondering if there is convenient way to format messed xml-document with Perl.

Ok, IE shows the file in nice format, but I would like to make it look nice, when opened to normal text editor?

Example:
<?xml version=&quot;1.0&quot;?>
<section>
<subchapter name=&quot;example&quot;>
<subdata name=&quot;exampledata&quot; id=&quot;0&quot; />
</subchapter>
</section>

should be formatted to form and written back to disk:

<?xml version=&quot;1.0&quot;?>
<section>
<subchapter name=&quot;example&quot;>
<subdata name=&quot;exampledata&quot; id=&quot;0&quot; />
</subchapter>
</section>

Do you have any example or hint on this?

Thank you!

BR,
comma
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top