Efficient Parser for large XMLs

后端 未结 4 1970
迷失自我
迷失自我 2021-01-15 06:48

I have very large XML files to process. I want to convert them to readable PDFs with colors, borders, images, tables and fonts. I don\'t have a lot of resources in my machin

相关标签:
4条回答
  • 2021-01-15 07:02

    Yes I think Sax will work for you. Dom is not good for large XML files as It keeps the whole XML file in memory. You can see a Comparison I wrote in my blog here

    0 讨论(0)
  • 2021-01-15 07:08

    SAX is very good parser but it is outdated.

    Recently Oracle have launched new Parser to parse the xml files efficiently called Stax

    *http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.6/tutorial/doc/SJSXP2.html*

    Attached link will also shows comparisons of all parsers along with memory utilization and its features.

    Thanks, Pavan

    0 讨论(0)
  • 2021-01-15 07:08

    If you want the best of DOM without its memory overhead, vtd-xml is the best bet, here is the proof...

    http://recipp.ipp.pt/bitstream/10400.22/1847/1/ART_BrunoOliveira_2013.pdf

    0 讨论(0)
  • 2021-01-15 07:13

    Not sure if you're interested in using Perl, but if you're open to it, the following are all good options: LibXML, LibXSLT and XML-Twig, which is good for files too large to fit in memory (so is LibXML::Reader). Of course as SAX is there, but it can be slow. Most people recommend the first two options. Finally, CPAN is an amazing source with a very active community.

    0 讨论(0)
提交回复
热议问题