Skip Menu |

This queue is for tickets about the XML-LibXML-PrettyPrint CPAN distribution.

Report information
The Basics
Id: 71821
Status: rejected
Priority: 0/
Queue: XML-LibXML-PrettyPrint

People
Owner: perl [...] toby.ink
Requestors: rr [...] yopmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Not memory-efficient for large files
XML::LibXML may be the fastest parser, but in the default DOM mode, it is not memory efficient. XML::Twig includes a pretty printer called xml_pp which handles large files fine. XML::LibXML can also handle large files if you switch to using it's pull parser: XML::LibXML::Reader.
Firstly, it operates on a XML::LibXML DOM. Assuming you've already got that DOM in memory, XML::LibXML::PrettyPrint won't *add* much to your memory usage. Secondly, the DESCRIPTION section in the documentation makes it clear that this module is designed for pretty rare cases, and that most of the time you're better off not pretty-printing your XML at all. Thirdly, the style of indentation it offers wouldn't work well with a stream-based XML parser, as in some cases it needs to be able to do look aheads. e.g. when processing an element of category EL_COMPACT it needs to check if any of its descendants are EL_BLOCK. Yes, that's possible with a stream-based parser, but it's quite fiddly. So I'm afraid this is a "WONTFIX".