V
vmontressor
XML:OM does not XML-escape text nodes' content on output. E.g., the
command
% perl -MXML:OM -e 'print new
XML:OM:arser()->parse("<foo>></foo>")->toString()'
prints
<foo>></foo>
and not, as I would like and expect,
<foo>></foo>
Is there an easy way to simply XML-escape the content of all text
nodes, or something like that? (I can write a sub to do this myself, I
just figured there must be code for it already.)
It seems to do the right thing with attributes, BTW.
command
% perl -MXML:OM -e 'print new
XML:OM:arser()->parse("<foo>></foo>")->toString()'
prints
<foo>></foo>
and not, as I would like and expect,
<foo>></foo>
Is there an easy way to simply XML-escape the content of all text
nodes, or something like that? (I can write a sub to do this myself, I
just figured there must be code for it already.)
It seems to do the right thing with attributes, BTW.