You might want to give AnyData::Format::XML a look. From the introduction, it sounds like you should be able to use it to compare the contents of two XML files as if they were two databases, without having to slurp either file into memory. I imagine that you could then use database queries to find the differences between the two files and write those to another file, but then again, I've been doing a lot of database work recently, and you know what they say everything looks like to a man with a hammer. :) | [reply] |
There is another module that does something similar: XML::SemanticDiff but it also uses XML::Parser, so it is likely to give you the same memory problems.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] |
XML::Twig was created by mirod with huge XML files in mind. Whether it suits your needs or not... only you can judge :)
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
Don't fool yourself.
| [reply] |
I don't think we can help much if you do not give us more details regarding the format of the XMLs, what kind of differences do you expect and how do you want to compare them.Maybe you could parse the file in chunks and compare the chunks, but if that's possible and how to do that ... that's a question.
You'd probably need to use a pull parser, XML::LibXML::Reader or XML::TokeParser, to be able to parse the two files at once and decide from which you want the next piece.
| [reply] |