What's the best XML parser for Perl?

2019-01-11 00:40发布

I have tried many of the Perl XML Parsers. I was quite interested in the Sablotron Parser, but it is such a pain to install on a Windows box. Currently I have started using XML::LibXML and XML::LibXSLT both of which seem to do everything I need.

They seem to be quite standard as well. Are there any better XML Parsers to use than this?

标签: xml perl libxml2
8条回答
地球回转人心会变
2楼-- · 2019-01-11 01:15

I think you should give XML::MyXML a try, too. It's very easy to use.

查看更多
Fickle 薄情
3楼-- · 2019-01-11 01:21

You could also look at XML::Liberal which uses LibXML underneath.

查看更多
不美不萌又怎样
4楼-- · 2019-01-11 01:23

If you need speed, power or features, XML::LibXML is the way to go. If you're after ease of use, though, XML::Simple is a viable alternative.

查看更多
淡お忘
5楼-- · 2019-01-11 01:24

In my experience XML::Simple is best for quick and dirty parsing of XML. We use it for parsing data from third parties that do not always conform to the XML standard. XML::Simple throws informative errors and gets you up an running extremely quickly.

查看更多
唯我独甜
6楼-- · 2019-01-11 01:28

(Actually it's not an answer, but a comment - however, I cannot comment...)

XML::Simple has been mentioned here.
(I know it's few from few years ago, but this appeared up in Google today...)

However, it's site (http://metacpan.org/pod/XML::Simple) now says:

STATUS OF THIS MODULE

The use of this module in new code is discouraged. Other modules are available which provide more straightforward and consistent interfaces. In particular, XML::LibXML is highly recommended.

The major problems with this module are the large number of options and the arbitrary ways in which these options interact - often with unexpected results.

Patches with bug fixes and documentation fixes are welcome, but new features are unlikely to be added.

查看更多
对你真心纯属浪费
7楼-- · 2019-01-11 01:29

I think you are using a pretty good one. XML::LibXML, Matt Sergeant and Christian Glahn's Perl interface to Daniel Velliard's libxml2 is one of the faster XML Parsers that I know of.

查看更多
登录 后发表回答