使用什么XML库? [英] What XML lib to use?

查看:54
本文介绍了使用什么XML库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑,我想读/写XML文件,但我真的不明白

要使用哪个库。


我在其他语言中使用过基于DOM的库,PyXML库是否用于


I''m confused, I want to read/write XML files but I don''t really understand
what library to use.

I''ve used DOM-based libraries in other languages, is PyXML the library to
use?

推荐答案

您可以尝试xml.dom和xml.sax。两者都是带有Python

标准包的内置库。您可以轻松地使用这些非常简单的读取和写入xml文件。有许多用于Python的第三方模块

操纵XML。但以上是基本的。

You can try xml.dom and xml.sax. Both are inbuilt libraries with Python
standard package. You can read and write xml files with these very
easily. There are number of third party modules for Python that
manipulate XML. But the above are the basic ones.


您可以尝试xml.dom和xml.sax。两者都是带有Python

标准包的内置库。您可以轻松地使用这些非常简单的读取和写入xml文件。有许多用于Python的第三方模块

操纵XML。但以上是基本的。

You can try xml.dom and xml.sax. Both are inbuilt libraries with Python
standard package. You can read and write xml files with these very
easily. There are number of third party modules for Python that
manipulate XML. But the above are the basic ones.


2005年9月13日星期二19:23:50 +0200

Kalle Anke < SK ***** @ gmail.com>写道:
On Tue, 13 Sep 2005 19:23:50 +0200
Kalle Anke <sk*****@gmail.com> wrote:
我很困惑,我想读/写XML文件,但我真的不明白要使用哪个库。

我'在其他语言中使用过基于DOM的库,是使用PyXML库吗?
I''m confused, I want to read/write XML files but I don''t really
understand what library to use.

I''ve used DOM-based libraries in other languages, is PyXML the
library to use?




PyXML将完成这项工作。我目前正在我的一个项目中使用它。

4suite还有他们的cDomlette,它提供了一个高速的b $ b b轻量级DOM实现。虽然,如果你不需要

规范化,XPath或那些类型的扩展,你可以用minidom和标准中包含的其他代码来获得
Python

发布,并且无需安装额外的库。


我也听说过ElementTree的优秀内容;我自己没有用它

(很大程度上是因为我找不到任何有关XML的资源

规范化)。


-Michael



PyXML will do the job. I''m currently using it in one of my projects.
4suite has their cDomlette also, which provides a high-speed
lightweight DOM implementation. Although, if you don''t need
canonicalization, XPath, or those kinds of extensions, you can probably
get by with minidom and the other code included in the standard Python
distribution, and avoid the need to install additional libraries.

I have also heard excellent things about ElementTree; I haven''t used it
myself though (largely because I can''t find any resources on doing XML
canonicalization with it).

-Michael



这篇关于使用什么XML库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆