Subject: | cdata also pretty-printed |
Contrary to what the manual page states, cdata sections are also idented
when pretty-printing is turned on. I find this disturbing when operating
with multi-line text.
Example:
#!/usr/bin/perl -w
use strict;
use XML::Generator ();
my $gen = XML::Generator->new(pretty => 2);
print $gen->foo($gen->bar("This is a text with newlines.\nHere is line
two.\nThis is the third line."));
print $gen->foo($gen->bar($gen->xmlcdata("This is a text with
newlines.\nHere is line two.\nThis is the third line.")));
__END__
prints:
<foo>
<bar>This is a text with newlines.
Here is line two.
This is the third line.</bar>
</foo><foo>
<bar><![CDATA[This is a text with newlines.
Here is line two.
This is the third line.]]></bar>
</foo>