Subject: | xml_split -g and -s don't return text nodes |
Date: | Wed, 8 Sep 2010 12:18:59 +0200 |
To: | <bug-XML-Twig [...] rt.cpan.org> |
From: | "MedioEurope - Azur.be | Jurgen Pletinckx" <Jurgen [...] medio.be> |
When running xml_split -g or -s, all text nodes are stripped from the
output.
Test case:
* Input test.xml
<?xml version="1.0" encoding="UTF-8"?><collection>
<record>
<control tag="1">14</control>
</record>
<record>
<control tag="1">15</control>
</record>
<record>
<control tag="1">22</control>
</record>
</collection>
* command: xml_split -g 2 test.xml
* output test-01.xml
<?xml version="1.0" encoding="UTF-8"?>
<xml_split:root xmlns:xml_split="http://xmltwig.com/xml_split">
<record><control tag="1"></control></record><record><control
tag="1"></control></record>
</xml_split:root>
At first glance, it appears XML::Parser::original_string does not return
anything for text nodes. Or, Default handler doesn't get called for text
nodes. Or I'm wrong. I may try to patch, but reading XML::Parser code
(or even client code) tends to make my eyes bleed.
Cheers,
--
Jurgen Pletinckx