使用 Perl 修改 XML 文件
我有一个具有某种格式的 XML 文件。我希望以我想要的方式修改数据。我觉得 XML::Twig 就是这样做的方法。
我想知道是否还有其他更好的选择?
I have an XML file, with some format. I want the data to be modified in some way I want. I feel XML::Twig is the way to do it.
I want to know if there is any other better alternative?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能会发现
XML::Twig
是一个完成任务的理想工具,Stack Overflow 上有很多问题/答案似乎重申了这一点:您可能还会发现,了解 XML::Twig 的作者确实在此站点上回答问题会有所帮助:Mirod 。
但是,如果您确实正在寻找替代方案,请查看
XML::LibXML
。该模块基于 libxml2 库 (XML::Twig 写在XML 之上::Parser
使用 expat 库)。Mirod 本人在他的 XML::Twig 的替代品中列出了="http://xmltwig.com/xmltwig/XML-Twig-FAQ.html" rel="nofollow noreferrer">常见问题解答。
You will probably find the
XML::Twig
is an ideal tool for the task and there have been plenty of questions/answers on Stack Overflow that seem to reaffirm this:You may also find it helpful to know that the author of XML::Twig does answer questions on this site: Mirod.
However if you really are looking for an alternative then have a look at
XML::LibXML
. This module is based on libxml2 library (XML::Twig is written on top ofXML::Parser
which uses the expat library).Mirod himself lists alternatives to XML::Twig in his FAQ.