XP is just a number | |
PerlMonks |
Re: Fastest way of XML -> perl structureby Corion (Patriarch) |
on Mar 20, 2017 at 07:47 UTC ( [id://1185227]=note: print w/replies, xml ) | Need Help?? |
If you have an XSD (or whatever structural description of the XML), you should be able to create C code from that XSD which will then in turn create the appropriate Perl structures. There is XML::Compile, which creates Perl code from an XSD by creating more or less a top-down parser for it. There also is XML::LibXML, but that doesn't give you a ready-to-use Perl structure. A specialized generated C program should be quite fast and certainly faster than XML::LibXML, at least if you approach it with the idea that the incoming XML will strictly conform to your XSD and that any nonconformance will need no memory cleanup as the program is supposed to exit anyway.
In Section
Seekers of Perl Wisdom
|
|