in reply to Filtering large XML files
if ('text' eq $r->name and XML_READER_ELEMENT == $r->nodeType) { print $r->copyCurrentNode(1); } [download]
Thanks, this might work. Do you have any idea how to go about the <doc> node? I cannot simply use copyCurrentNode on that one. When I do this:
if ('doc' eq $r->name and XML_READER_ELEMENT == $r->nodeType) { print $r->copyCurrentNode(0)->toString; } [download]
I get:
(an empty, self-closed <doc/>). Is there a clean way to correctly output it as just an opening XML_READER_ELEMENT?