LXML retains references between child nodes and their parents.
lxml保持子节点及其父节点之间的引用。
Both coding styles can co-exist happily in an lxml-based application.
这两种编程风格可以在一个基于lxml的应用程序中和谐共存。
The LXML parse method reads the entire document and builds an in-memory tree.
lxmlparse方法读取整个文档并在内存中构建一个树。
Consult the FAQ section on threads in the LXML documentation for more information.
要了解更多内容,可参考lxml文档中有关线程的FAQ部分。
LXML offers several approaches, from a simplified search syntax to full XPath 1.0.
lxml提供了简化的搜索语法和完整的XPath 1.0等各种方法。
Which parts of LXML you use in your code depends on your needs: Are you comfortable with XPath?
您要在代码中使用lxml的哪一部分取决于您的需求:您是否熟悉XPath ?
Serializing XML to a string or file is where lxml excels because it relies on libxml2 C code directly.
将XML序列化为一个字符串或文件是lxml 的长项,因为它依赖于libxml2C代码库。
In addition to the use of specific methods within LXML, you can use approaches outside of the library to influence execution speed.
除了使用lxml内部的特定方法外,还可以通过库以外的方法提高执行速度。
For content in HTML that might not be well formed, LXML provides two useful packages: the lxml.html module and the BeautifulSoup parser.
对于不具备良好格式的html内容,lxml提供了两个有用的包:lxml . html模块和BeautifulSoup解析器。
If your task requires any serialization at all, LXML is a clear choice, but there are some tricks to get the best performance out of the library.
如果要执行要求序列化的任务,lxml无疑是最佳选择,但是需要使用一些技巧来获得最佳性能。
Typical gains for a pure Python program are between two and four times, but lxml does most of its work in C, so the difference is unusually small.
一个纯Python程序的典型性能收益是普通程序的2 至4倍,但是lxml 使用C 语言完成了大部分工作,因此它们之间的差别非常小。
This article does not cover all of lxml but instead demonstrates techniques to efficiently process very large XML files, optimizing for high speed and low memory usage.
本文并没有介绍 lxml的所有部分,但是演示了一些可以有效处理大型XML文件、进行优化以提高处理速度并减少内存使用的技术。
The output from Listing 3 will be identical to that of the target parser method in Listing 2 but ought to be much faster because LXML can optimize the event handling internally.
清单3的输出与清单2的目标解析器方法的输出相同,但是速度应该会提高很多,因为lxml可以在内部优化事件处理。
When building an in-memory tree is not desired or practical, use an iterative parsing technique that does not rely on reading the entire source file. LXML offers two approaches.
如果构建内存树并不是必须的或并不实际,则可以使用一种迭代解析技术,这种技术不需要读取整个源树。
When building an in-memory tree is not desired or practical, use an iterative parsing technique that does not rely on reading the entire source file. LXML offers two approaches.
如果构建内存树并不是必须的或并不实际,则可以使用一种迭代解析技术,这种技术不需要读取整个源树。
应用推荐