Hello Monks,
I'm fairly new to Perl and started recently to learn Perl to parse and work with XML files. Pretty neat and easy.
I'm currently using ::LibXML and having formatting problem. I am adding new node to an existing node using
worked fine but the formatting of each file is different for example my output would look something like:
<root_tag> <element1>text</element1> #space <element2>text</element2> #space <element3>txt</element3> <new_node> <new_element1>text</new_element1> <new_element2>text</new_element2><new_element3> </new_element3> </new_node> </root_tag>
in the above example my existing XML file has spaces between elements, where my new source file doesn't i.e <new_node>.
also the tags gets missed up when copied i.e <new_element2>text</new_element2><new_element3>
indentation is also not precise. Im outputting my results to a file using
$new_object->toString(2;);
$new_object->toFile('file_name.xml');
so in summary the question is whats the best way when using LibXML to get a nice formatted XML output.
In reply to XML output formatting by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |