Sunday, 1 February 2015

Is there a way to change the tab indent / formatting of the XML when exporting to a string?



I have an XML object that I'm exporting to a string like so:



var xml:XML = new XML(myString);
trace(xml.toXMLString());


This results in something like:



<root>
<item>
<item>
<item/>
</item>
</item>
</root>


However, the indentations are much to short in my opinion especially with a lot of content and it's hard to read. Irregardless of the reasons is there a way to increase the indentations like maybe to use tabs or more tabs instead of spaces? Not sure what it's using (will check). I would like it to look closer to this. It looks much cooler too.



<root>
<item>
<item>
<item/>
</item>
</item>
</root>

No comments:

Post a Comment