From: Hyunjee Kim Date: Thu, 31 Jan 2019 02:25:24 +0000 (+0900) Subject: Imported Upstream version 4.2.4 X-Git-Tag: upstream/4.3.0~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8eeb40644440ca274e1a8f296e616c7a1580342f;p=platform%2Fupstream%2Fpython-lxml.git Imported Upstream version 4.2.4 Change-Id: I94cee0a0257a2abc694fa49fea9cdaa094e414a5 Signed-off-by: Hyunjee Kim --- diff --git a/CHANGES.txt b/CHANGES.txt index 2acc1794..06ca52d7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,23 @@ lxml changelog ============== +4.2.4 (2018-08-03) +================== + +Features added +-------------- + +* GH#259: Allow using ``pkg-config`` for build configuration. + Patch by Patrick Griffis. + +Bugs fixed +---------- + +* LP#1773749, GH#268: Crash when moving an element to another document with + ``Element.insert()``. + Patch by Alexander Weggerle. + + 4.2.3 (2018-06-27) ================== diff --git a/PKG-INFO b/PKG-INFO index 04f5f69e..9f89cb73 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: lxml -Version: 4.2.3 +Version: 4.2.4 Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API. Home-page: http://lxml.de/ Author: lxml dev team @@ -36,13 +36,21 @@ Description: lxml is a Pythonic, mature binding for the libxml2 and libxslt libr as soon as a maintenance branch has been established. Note that this requires Cython to be installed at an appropriate version for the build. - 4.2.3 (2018-06-27) + 4.2.4 (2018-08-03) ================== + Features added + -------------- + + * GH#259: Allow using ``pkg-config`` for build configuration. + Patch by Patrick Griffis. + Bugs fixed ---------- - * Reverted GH#265: lxml links against zlib as a shared library again. + * LP#1773749, GH#268: Crash when moving an element to another document with + ``Element.insert()``. + Patch by Alexander Weggerle. diff --git a/buildlibxml.py b/buildlibxml.py index 6c9b33ae..e114eee7 100644 --- a/buildlibxml.py +++ b/buildlibxml.py @@ -204,7 +204,7 @@ def tryint(s): def download_libxml2(dest_dir, version=None): """Downloads libxml2, returning the filename where the library was downloaded""" - version_re = re.compile(r'LATEST_LIBXML2_IS_([0-9.]+[0-9])') + version_re = re.compile(r'LATEST_LIBXML2_IS_([0-9.]+[0-9](?:-[abrc0-9]+)?)') filename = 'libxml2-%s.tar.gz' return download_library(dest_dir, LIBXML2_LOCATION, 'libxml2', version_re, filename, version=version) @@ -212,7 +212,7 @@ def download_libxml2(dest_dir, version=None): def download_libxslt(dest_dir, version=None): """Downloads libxslt, returning the filename where the library was downloaded""" - version_re = re.compile(r'LATEST_LIBXSLT_IS_([0-9.]+[0-9])') + version_re = re.compile(r'LATEST_LIBXSLT_IS_([0-9.]+[0-9](?:-[abrc0-9]+)?)') filename = 'libxslt-%s.tar.gz' return download_library(dest_dir, LIBXML2_LOCATION, 'libxslt', version_re, filename, version=version) @@ -236,7 +236,7 @@ def download_zlib(dest_dir, version): def find_max_version(libname, filenames, version_re=None): if version_re is None: - version_re = re.compile(r'%s-([0-9.]+[0-9])' % libname) + version_re = re.compile(r'%s-([0-9.]+[0-9](?:-[abrc0-9]+)?)' % libname) versions = [] for fn in filenames: match = version_re.search(fn) diff --git a/doc/build.txt b/doc/build.txt index 61ba3754..b0499e4e 100644 --- a/doc/build.txt +++ b/doc/build.txt @@ -120,6 +120,14 @@ setup.py to make sure the right config is found:: python setup.py build --with-xslt-config=/path/to/xslt-config +There are also env vars to allow overriding the config tool:: + + env XML2_CONFIG=/path/to/xml2-config python build + +You may also use ``pkg-config`` as the tools:: + + env XSLT_CONFIG="pkg-config libxslt" python setup.py build + If this doesn't help, you may have to add the location of the header files to the include path like:: diff --git a/doc/html/FAQ.html b/doc/html/FAQ.html deleted file mode 100644 index 831f8469..00000000 --- a/doc/html/FAQ.html +++ /dev/null @@ -1,1000 +0,0 @@ - - - - - -lxml FAQ - Frequently Asked Questions - - - - - -
-

lxml FAQ - Frequently Asked Questions

- -

Frequently asked questions on lxml. See also the notes on compatibility to -ElementTree.

-
-

Contents

- -
-
-

General Questions

-
-

Is there a tutorial?

-

Read the lxml.etree Tutorial. While this is still work in progress -(just as any good documentation), it provides an overview of the most -important concepts in lxml.etree. If you want to help out, -improving the tutorial is a very good place to start.

-

There is also a tutorial for ElementTree which works for -lxml.etree. The documentation of the extended etree API also -contains many examples for lxml.etree. Fredrik Lundh's element -library contains a lot of nice recipes that show how to solve common -tasks in ElementTree and lxml.etree. To learn using -lxml.objectify, read the objectify documentation.

-

John Shipman has written another tutorial called Python XML -processing with lxml that contains lots of examples. Liza Daly -wrote a nice article about high-performance aspects when parsing -large files with lxml.

-
-
-

Where can I find more documentation about lxml?

-

There is a lot of documentation on the web and also in the Python -standard library documentation, as lxml implements the well-known -ElementTree API and tries to follow its documentation as closely as -possible. The recipes in Fredrik Lundh's element library are -generally worth taking a look at. There are a couple of issues where -lxml cannot keep up compatibility. They are described in the -compatibility documentation.

-

The lxml specific extensions to the API are described by individual -files in the doc directory of the source distribution and on the -web page.

-

The generated API documentation is a comprehensive API reference -for the lxml package.

-
-
-

What standards does lxml implement?

-

The compliance to XML Standards depends on the support in libxml2 and libxslt. -Here is a quote from http://xmlsoft.org/:

-
-In most cases libxml2 tries to implement the specifications in a relatively -strictly compliant way. As of release 2.4.16, libxml2 passed all 1800+ tests -from the OASIS XML Tests Suite.
-

lxml currently supports libxml2 2.6.20 or later, which has even better -support for various XML standards. The important ones are:

-
    -
  • XML 1.0
  • -
  • HTML 4
  • -
  • XML namespaces
  • -
  • XML Schema 1.0
  • -
  • XPath 1.0
  • -
  • XInclude 1.0
  • -
  • XSLT 1.0
  • -
  • EXSLT
  • -
  • XML catalogs
  • -
  • canonical XML
  • -
  • RelaxNG
  • -
  • xml:id
  • -
  • xml:base
  • -
-

Support for XML Schema is currently not 100% complete in libxml2, but -is definitely very close to compliance. Schematron is supported in -two ways, the best being the original ISO Schematron reference -implementation via XSLT. libxml2 also supports loading documents -through HTTP and FTP.

-

For RelaxNG Compact Syntax -support, there is a tool called rnc2rng, -written by David Mertz, which you might be able to use from Python. Failing -that, trang is the 'official' -command line tool (written in Java) to do the conversion.

-
-
-

Who uses lxml?

-

As an XML library, lxml is often used under the hood of in-house -server applications, such as web servers or applications that -facilitate some kind of content management. Many people who deploy -Zope, Plone or Django use it together with lxml in the background, -without speaking publicly about it. Therefore, it is hard to get an -idea of who uses it, and the following list of 'users and projects we -know of' is very far from a complete list of lxml's users.

-

Also note that the compatibility to the ElementTree library does not -require projects to set a hard dependency on lxml - as long as they do -not take advantage of lxml's enhanced feature set.

-
    -
  • cssutils, -a CSS parser and toolkit, can be used with lxml.cssselect
  • -
  • Deliverance, -a content theming tool
  • -
  • Enfold Proxy 4, -a web server accelerator with on-the-fly XSLT processing
  • -
  • Inteproxy, -a secure HTTP proxy
  • -
  • lwebstring, -an XML template engine
  • -
  • openpyxl, -a library to read/write MS Excel 2007 files
  • -
  • OpenXMLlib, -a library for handling OpenXML document meta data
  • -
  • PsychoPy, -psychology software in Python
  • -
  • Pycoon, -a WSGI web development framework based on XML pipelines
  • -
  • pycsw, -an OGC CSW server implementation written in Python
  • -
  • PyQuery, -a query framework for XML/HTML, similar to jQuery for JavaScript
  • -
  • python-docx, -a package for handling Microsoft's Word OpenXML format
  • -
  • Rambler, -a meta search engine that aggregates different data sources
  • -
  • rdfadict, -an RDFa parser with a simple dictionary-like interface.
  • -
  • xupdate-processor, -an XUpdate implementation for lxml.etree
  • -
  • Diazo, -an XSLT-under-the-hood web site theming engine
  • -
-

Zope3 and some of its extensions have good support for lxml:

-
    -
  • gocept.lxml, -Zope3 interface bindings for lxml
  • -
  • z3c.rml, -an implementation of ReportLab's RML format
  • -
  • zif.sedna, -an XQuery based interface to the Sedna OpenSource XML database
  • -
-

And don't miss the quotes by our generally happy users, and other -sites that link to lxml. As Liza Daly puts it: "Many software -products come with the pick-two caveat, meaning that you must choose -only two: speed, flexibility, or readability. When used carefully, -lxml can provide all three."

-
-
-

What is the difference between lxml.etree and lxml.objectify?

-

The two modules provide different ways of handling XML. However, objectify -builds on top of lxml.etree and therefore inherits most of its capabilities -and a large portion of its API.

-
    -
  • lxml.etree is a generic API for XML and HTML handling. It aims for -ElementTree compatibility and supports the entire XML infoset. It is well -suited for both mixed content and data centric XML. Its generality makes it -the best choice for most applications.

    -
  • -
  • lxml.objectify is a specialized API for XML data handling in a Python object -syntax. It provides a very natural way to deal with data fields stored in a -structurally well defined XML format. Data is automatically converted to -Python data types and can be manipulated with normal Python operators. Look -at the examples in the objectify documentation to see what it feels like -to use it.

    -

    Objectify is not well suited for mixed contents or HTML documents. As it is -built on top of lxml.etree, however, it inherits the normal support for -XPath, XSLT or validation.

    -
  • -
-
-
-

How can I make my application run faster?

-

lxml.etree is a very fast library for processing XML. There are, however, a -few caveats involved in the mapping of the powerful libxml2 library to the -simple and convenient ElementTree API. Not all operations are as fast as the -simplicity of the API might suggest, while some use cases can heavily benefit -from finding the right way of doing them. The benchmark page has a -comparison to other ElementTree implementations and a number of tips for -performance tweaking. As with any Python application, the rule of thumb is: -the more of your processing runs in C, the faster your application gets. See -also the section on threading.

-
-
-

What about that trailing text on serialised Elements?

-

The ElementTree tree model defines an Element as a container with a tag name, -contained text, child Elements and a tail text. This means that whenever you -serialise an Element, you will get all parts of that Element:

-
>>> root = etree.XML("<root><tag>text<child/></tag>tail</root>")
->>> print(etree.tostring(root[0]))
-<tag>text<child/></tag>tail
-
-

Here is an example that shows why not serialising the tail would be -even more surprising from an object point of view:

-
>>> root = etree.Element("test")
-
->>> root.text = "TEXT"
->>> print(etree.tostring(root))
-<test>TEXT</test>
-
->>> root.tail = "TAIL"
->>> print(etree.tostring(root))
-<test>TEXT</test>TAIL
-
->>> root.tail = None
->>> print(etree.tostring(root))
-<test>TEXT</test>
-
-

Just imagine a Python list where you append an item and it doesn't -show up when you look at the list.

-

The .tail property is a huge simplification for the tree model as -it avoids text nodes to appear in the list of children and makes -access to them quick and simple. So this is a benefit in most -applications and simplifies many, many XML tree algorithms.

-

However, in document-like XML (and especially HTML), the above result can be -unexpected to new users and can sometimes require a bit more overhead. A good -way to deal with this is to use helper functions that copy the Element without -its tail. The lxml.html package also deals with this in a couple of -places, as most HTML algorithms benefit from a tail-free behaviour.

-
-
-

How can I find out if an Element is a comment or PI?

-
>>> root = etree.XML("<?my PI?><root><!-- empty --></root>")
-
->>> root.tag
-'root'
->>> root.getprevious().tag is etree.PI
-True
->>> root[0].tag is etree.Comment
-True
-
-
-
-

How can I map an XML tree into a dict of dicts?

-

I'm glad you asked.

-
def recursive_dict(element):
-     return element.tag, \
-            dict(map(recursive_dict, element)) or element.text
-
-

Note that this beautiful quick-and-dirty converter expects children -to have unique tag names and will silently overwrite any data that -was contained in preceding siblings with the same name. For any -real-world application of xml-to-dict conversion, you would better -write your own, longer version of this.

-
-
-

Why does lxml sometimes return 'str' values for text in Python 2?

-

In Python 2, lxml's API returns byte strings for plain ASCII text -values, be it for tag names or text in Element content. This is the -same behaviour as known from ElementTree. The reasoning is that ASCII -encoded byte strings are compatible with Unicode strings in Python 2, -but consume less memory (usually by a factor of 2 or 4) and are faster -to create because they do not require decoding. Plain ASCII string -values are very common in XML, so this optimisation is generally worth -it.

-

In Python 3, lxml always returns Unicode strings for text and names, -as does ElementTree. Since Python 3.3, Unicode strings containing -only characters that can be encoded in ASCII or Latin-1 are generally -as efficient as byte strings. In older versions of Python 3, the -above mentioned drawbacks apply.

-
-
-

Why do I get XInclude or DTD lookup failures on some systems but not on others?

-

To avoid network access, external resources are first looked up in -XML catalogues. -Many systems have them installed by default, but some don't. -On Linux systems, the default place to look is the index file -/etc/xml/catalog, which most importantly provides a mapping from -doctype IDs to locally installed DTD files.

-

See the libxml2 catalogue documentation -for further information.

-
-
-

How do namespaces work in lxml?

-

The same as in ElementTree. See the tutorial.

-
-
-
-

Installation

-
-

Which version of libxml2 and libxslt should I use or require?

-

It really depends on your application, but the rule of thumb is: more recent -versions contain less bugs and provide more features.

-
    -
  • Do not use libxml2 2.6.27 if you want to use XPath (including XSLT). You -will get crashes when XPath errors occur during the evaluation (e.g. for -unknown functions). This happens inside the evaluation call to libxml2, so -there is nothing that lxml can do about it.
  • -
  • Try to use versions of both libraries that were released together. At least -the libxml2 version should not be older than the libxslt version.
  • -
  • If you use XML Schema or Schematron which are still under development, the -most recent version of libxml2 is usually a good bet.
  • -
  • The same applies to XPath, where a substantial number of bugs and memory -leaks were fixed over time. If you encounter crashes or memory leaks in -XPath applications, try a more recent version of libxml2.
  • -
  • For parsing and fixing broken HTML, lxml requires at least libxml2 2.6.21.
  • -
  • For the normal tree handling, however, any libxml2 version starting with -2.6.20 should do.
  • -
-

Read the release notes of libxml2 and the release notes of libxslt to -see when (or if) a specific bug has been fixed.

-
-
-

Where are the binary builds?

-

Thanks to the help by Joar Wandborg, we try to make "manylinux" binary -builds for Linux available shortly after each source release, as they -are very frequently used by continuous integration and/or build servers.

-

Thanks to the help by Maximilian Hils and the Appveyor build service, -we also try to serve the frequent requests for binary builds available -for Microsoft Windows in a timely fashion, since users of that platform -usually fail to build lxml themselves. Two of the major design issues -of this operating system make this non-trivial for its users: the lack -of a pre-installed standard compiler and the missing package management.

-

Besides that, Christoph Gohlke generously provides unofficial lxml binary -builds for Windows -that are usually very up to date. Consider using them if you prefer a -binary build over a signed official source release.

-
-
-

Why do I get errors about missing UCS4 symbols when installing lxml?

-

You are using a Python installation that was configured for a different -internal Unicode representation than the lxml package you are trying to -install. CPython versions before 3.3 allowed to switch between two types -at build time: the 32 bit encoding UCS4 and the 16 bit encoding UCS2. -Sadly, both are not compatible, so eggs and other binary distributions -can only support the one they were compiled with.

-

This means that you have to compile lxml from sources for your system. Note -that you do not need Cython for this, the lxml source distribution is directly -compilable on both platform types. See the build instructions on how to do -this.

-
-
-

My C compiler crashes on installation

-

lxml consists of a relatively large amount of (Cython) generated C code -in a single source module. Compiling this module requires a lot of free -memory, usually more than half a GB, which can pose problems especially on -shared/cloud build systems.

-

If your C compiler crashes while building lxml from sources, consider -using one of the binary wheels that we provide. The "manylinux" binaries -should generally work well on most build systems and install substantially -faster than a source build.

-
-
-
-

Contributing

-
-

Why is lxml not written in Python?

-

It almost is.

-

lxml is not written in plain Python, because it interfaces with two C -libraries: libxml2 and libxslt. Accessing them at the C-level is -required for performance reasons.

-

However, to avoid writing plain C-code and caring too much about the -details of built-in types and reference counting, lxml is written in -Cython, a superset of the Python language that translates to C-code. -Chances are that if you know Python, you can write code that Cython -accepts. Again, the C-ish style used in the lxml code is just for -performance optimisations. If you want to contribute, don't bother -with the details, a Python implementation of your contribution is -better than none. And keep in mind that lxml's flexible API often -favours an implementation of features in pure Python, without -bothering with C-code at all. For example, the lxml.html package -is written entirely in Python.

-

Please contact the mailing list if you need any help.

-
-
-

How can I contribute?

-

If you find something that you would like lxml to do (or do better), -then please tell us about it on the mailing list. Pull requests -on github are always appreciated, especially when accompanied by unit -tests and documentation (doctests would be great). See the tests -subdirectories in the lxml source tree (below the src directory) -and the ReST text files in the doc directory.

-

We also have a list of missing features that we would like to -implement but didn't due to lack if time. If you find the time, -patches are very welcome.

-

Besides enhancing the code, there are a lot of places where you can help the -project and its user base. You can

-
    -
  • spread the word and write about lxml. Many users (especially new Python -users) have not yet heard about lxml, although our user base is constantly -growing. If you write your own blog and feel like saying something about -lxml, go ahead and do so. If we think your contribution or criticism is -valuable to other users, we may even put a link or a quote on the project -page.
  • -
  • provide code examples for the general usage of lxml or specific problems -solved with lxml. Readable code is a very good way of showing how a library -can be used and what great things you can do with it. Again, if we hear -about it, we can set a link on the project page.
  • -
  • work on the documentation. The web page is generated from a set of ReST -text files. It is meant both as a representative project page for lxml -and as a site for documenting lxml's API and usage. If you have questions -or an idea how to make it more readable and accessible while you are reading -it, please send a comment to the mailing list.
  • -
  • enhance the web site. We put some work into making the web site -usable, understandable and also easy to find, but there's always -things that can be done better. You may notice that we are not -top-ranked when searching the web for "Python and XML", so maybe you -have an idea how to improve that.
  • -
  • help with the tutorial. A tutorial is the most important starting point for -new users, so it is important for us to provide an easy to understand guide -into lxml. As all documentation, the tutorial is work in progress, so we -appreciate every helping hand.
  • -
  • improve the docstrings. lxml uses docstrings to support Python's integrated -online help() function. However, sometimes these are not sufficient to -grasp the details of the function in question. If you find such a place, -you can try to write up a better description and send it to the mailing -list.
  • -
-
-
-
-

Bugs

-
-

My application crashes!

-

One of the goals of lxml is "no segfaults", so if there is no clear -warning in the documentation that you were doing something potentially -harmful, you have found a bug and we would like to hear about it. -Please report this bug to the mailing list. See the section on bug -reporting to learn how to do that.

-

If your application (or e.g. your web container) uses threads, please -see the FAQ section on threading to check if you touch on one of the -potential pitfalls.

-

In any case, try to reproduce the problem with the latest versions of -libxml2 and libxslt. From time to time, bugs and race conditions are found -in these libraries, so a more recent version might already contain a fix for -your problem.

-

Remember: even if you see lxml appear in a crash stack trace, it is -not necessarily lxml that caused the crash.

-
-
-

My application crashes on MacOS-X!

-

This was a common problem up to lxml 2.1.x. Since lxml 2.2, the only -officially supported way to use it on this platform is through a -static build against freshly downloaded versions of libxml2 and -libxslt. See the build instructions for MacOS-X.

-
-
-

I think I have found a bug in lxml. What should I do?

-

First, you should look at the current developer changelog to see if this -is a known problem that has already been fixed in the master branch since the -release you are using.

-

Also, the 'crash' section above has a few good advices what to try to see if -the problem is really in lxml - and not in your setup. Believe it or not, -that happens more often than you might think, especially when old libraries -or even multiple library versions are installed.

-

You should always try to reproduce the problem with the latest -versions of libxml2 and libxslt - and make sure they are used. -lxml.etree can tell you what it runs with:

-
import sys
-from lxml import etree
-
-print("%-20s: %s" % ('Python',           sys.version_info))
-print("%-20s: %s" % ('lxml.etree',       etree.LXML_VERSION))
-print("%-20s: %s" % ('libxml used',      etree.LIBXML_VERSION))
-print("%-20s: %s" % ('libxml compiled',  etree.LIBXML_COMPILED_VERSION))
-print("%-20s: %s" % ('libxslt used',     etree.LIBXSLT_VERSION))
-print("%-20s: %s" % ('libxslt compiled', etree.LIBXSLT_COMPILED_VERSION))
-
-

If you can figure that the problem is not in lxml but in the -underlying libxml2 or libxslt, you can ask right on the respective -mailing lists, which may considerably reduce the time to find a fix or -work-around. See the next question for some hints on how to do that.

-

Otherwise, we would really like to hear about it. Please report it to -the bug tracker or to the mailing list so that we can fix it. -It is very helpful in this case if you can come up with a short code -snippet that demonstrates your problem. If others can reproduce and -see the problem, it is much easier for them to fix it - and maybe even -easier for you to describe it and get people convinced that it really -is a problem to fix.

-

It is important that you always report the version of lxml, libxml2 -and libxslt that you get from the code snippet above. If we do not -know the library versions you are using, we will ask back, so it will -take longer for you to get a helpful answer.

-

Since as a user of lxml you are likely a programmer, you might find -this article on bug reports an interesting read.

-
-
-

How do I know a bug is really in lxml and not in libxml2?

-

A large part of lxml's functionality is implemented by libxml2 and -libxslt, so problems that you encounter may be in one or the other. -Knowing the right place to ask will reduce the time it takes to fix -the problem, or to find a work-around.

-

Both libxml2 and libxslt come with their own command line frontends, -namely xmllint and xsltproc. If you encounter problems with -XSLT processing for specific stylesheets or with validation for -specific schemas, try to run the XSLT with xsltproc or the -validation with xmllint respectively to find out if it fails there -as well. If it does, please report directly to the mailing lists of -the respective project, namely:

- -

On the other hand, everything that seems to be related to Python code, -including custom resolvers, custom XPath functions, etc. is likely -outside of the scope of libxml2/libxslt. If you encounter problems -here or you are not sure where there the problem may come from, please -ask on the lxml mailing list first.

-

In any case, a good explanation of the problem including some simple -test code and some input data will help us (or the libxml2 developers) -see and understand the problem, which largely increases your chance of -getting help. See the question above for a few hints on what is -helpful here.

-
-
-
-

Threading

-
-

Can I use threads to concurrently access the lxml API?

-

Short answer: yes, if you use lxml 2.2 and later.

-

Since version 1.1, lxml frees the GIL (Python's global interpreter -lock) internally when parsing from disk and memory, as long as you use -either the default parser (which is replicated for each thread) or -create a parser for each thread yourself. lxml also allows -concurrency during validation (RelaxNG and XMLSchema) and XSL -transformation. You can share RelaxNG, XMLSchema and XSLT objects -between threads.

-

While you can also share parsers between threads, this will serialize -the access to each of them, so it is better to .copy() parsers or -to just use the default parser if you do not need any special -configuration. The same applies to the XPath evaluators, which use an -internal lock to protect their prepared evaluation contexts. It is -therefore best to use separate evaluator instances in threads.

-

Warning: Before lxml 2.2, and especially before 2.1, there were -various issues when moving subtrees between different threads, or when -applying XSLT objects from one thread to trees parsed or modified in -another. If you need code to run with older versions, you should -generally avoid modifying trees in other threads than the one it was -generated in. Although this should work in many cases, there are -certain scenarios where the termination of a thread that parsed a tree -can crash the application if subtrees of this tree were moved to other -documents. You should be on the safe side when passing trees between -threads if you either

-
    -
  • do not modify these trees and do not move their elements to other -trees, or
  • -
  • do not terminate threads while the trees they parsed are still in -use (e.g. by using a fixed size thread-pool or long-running threads -in processing chains)
  • -
-

Since lxml 2.2, even multi-thread pipelines are supported. However, -note that it is more efficient to do all tree work inside one thread, -than to let multiple threads work on a tree one after the other. This -is because trees inherit state from the thread that created them, -which must be maintained when the tree is modified inside another -thread.

-
-
-

Does my program run faster if I use threads?

-

Depends. The best way to answer this is timing and profiling.

-

The global interpreter lock (GIL) in Python serializes access to the -interpreter, so if the majority of your processing is done in Python -code (walking trees, modifying elements, etc.), your gain will be -close to zero. The more of your XML processing moves into lxml, -however, the higher your gain. If your application is bound by XML -parsing and serialisation, or by very selective XPath expressions and -complex XSLTs, your speedup on multi-processor machines can be -substantial.

-

See the question above to learn which operations free the GIL to support -multi-threading.

-
-
-

Would my single-threaded program run faster if I turned off threading?

-

Possibly, yes. You can see for yourself by compiling lxml entirely -without threading support. Pass the --without-threading option to -setup.py when building lxml from source. You can also build libxml2 -without pthread support (--without-pthreads option), which may add -another bit of performance. Note that this will leave internal data -structures entirely without thread protection, so make sure you really -do not use lxml outside of the main application thread in this case.

-
-
-

Why can't I reuse XSLT stylesheets in other threads?

-

Since later lxml 2.0 versions, you can do this. There is some -overhead involved as the result document needs an additional cleanup -traversal when the input document and/or the stylesheet were created -in other threads. However, on a multi-processor machine, the gain of -freeing the GIL easily covers this drawback.

-

If you need even the last bit of performance, consider keeping (a copy -of) the stylesheet in thread-local storage, and try creating the input -document(s) in the same thread. And do not forget to benchmark your -code to see if the increased code complexity is really worth it.

-
-
-

My program crashes when run with mod_python/Pyro/Zope/Plone/...

-

These environments can use threads in a way that may not make it obvious when -threads are created and what happens in which thread. This makes it hard to -ensure lxml's threading support is used in a reliable way. Sadly, if problems -arise, they are as diverse as the applications, so it is difficult to provide -any generally applicable solution. Also, these environments are so complex -that problems become hard to debug and even harder to reproduce in a -predictable way. If you encounter crashes in one of these systems, but your -code runs perfectly when started by hand, the following gives you a few hints -for possible approaches to solve your specific problem:

-
    -
  • make sure you use recent versions of libxml2, libxslt and lxml. The -libxml2 developers keep fixing bugs in each release, and lxml also -tries to become more robust against possible pitfalls. So newer -versions might already fix your problem in a reliable way. Version -2.2 of lxml contains many improvements.

    -
  • -
  • make sure the library versions you installed are really used. Do -not rely on what your operating system tells you! Print the version -constants in lxml.etree from within your runtime environment to -make sure it is the case. This is especially a problem under -MacOS-X when newer library versions were installed in addition to -the outdated system libraries. Please read the bugs section -regarding MacOS-X in this FAQ.

    -
  • -
  • if you use mod_python, try setting this option:

    -
    -

    PythonInterpreter main_interpreter

    -
    -

    There was a discussion on the mailing list about this problem:

    -
    -

    http://comments.gmane.org/gmane.comp.python.lxml.devel/2942

    -
    -
  • -
  • in a threaded environment, try to initially import lxml.etree -from the main application thread instead of doing first-time imports -separately in each spawned worker thread. If you cannot control the -thread spawning of your web/application server, an import of -lxml.etree in sitecustomize.py or usercustomize.py may still do -the trick.

    -
  • -
  • compile lxml without threading support by running setup.py with the ---without-threading option. While this might be slower in certain -scenarios on multi-processor systems, it might also keep your application -from crashing, which should be worth more to you than peek performance. -Remember that lxml is fast anyway, so concurrency may not even be worth it.

    -
  • -
  • look out for fancy XSLT stuff like foreign document access or -passing in subtrees trough XSLT variables. This might or might not -work, depending on your specific usage. Again, later versions of -lxml and libxslt provide safer support here.

    -
  • -
  • try copying trees at suspicious places in your code and working with -those instead of a tree shared between threads. Note that the -copying must happen inside the target thread to be effective, not in -the thread that created the tree. Serialising in one thread and -parsing in another is also a simple (and fast) way of separating -thread contexts.

    -
  • -
  • try keeping thread-local copies of XSLT stylesheets, i.e. one per thread, -instead of sharing one. Also see the question above.

    -
  • -
  • you can try to serialise suspicious parts of your code with explicit thread -locks, thus disabling the concurrency of the runtime system.

    -
  • -
  • report back on the mailing list to see if there are other ways to work -around your specific problems. Do not forget to report the version numbers -of lxml, libxml2 and libxslt you are using (see the question on reporting -a bug).

    -
  • -
-

Note that most of these options will degrade performance and/or your -code quality. If you are unsure what to do, please ask on the mailing -list.

-
-
-
-

Parsing and Serialisation

-
-

Why doesn't the pretty_print option reformat my XML output?

-

Pretty printing (or formatting) an XML document means adding white space to -the content. These modifications are harmless if they only impact elements in -the document that do not carry (text) data. They corrupt your data if they -impact elements that contain data. If lxml cannot distinguish between -whitespace and data, it will not alter your data. Whitespace is therefore -only added between nodes that do not contain data. This is always the case -for trees constructed element-by-element, so no problems should be expected -here. For parsed trees, a good way to assure that no conflicting whitespace -is left in the tree is the remove_blank_text option:

-
>>> parser = etree.XMLParser(remove_blank_text=True)
->>> tree = etree.parse(filename, parser)
-
-

This will allow the parser to drop blank text nodes when constructing the -tree. If you now call a serialization function to pretty print this tree, -lxml can add fresh whitespace to the XML tree to indent it.

-

Note that the remove_blank_text option also uses a heuristic if it -has no definite knowledge about the document's ignorable whitespace. -It will keep blank text nodes that appear after non-blank text nodes -at the same level. This is to prevent document-style XML from losing -content.

-

The HTMLParser has this structural knowledge built-in, which means that -most whitespace that appears between tags in HTML documents will not -be removed by this option, except in places where it is truly ignorable, -e.g. in the page header, between table structure tags, etc. Therefore, -it is also safe to use this option with the HTMLParser, as it will keep -content like the following intact (i.e. it will not remove the space -that separates the two words):

-
<p><b>some</b> <em>text</em></p>
-
-

If you want to be sure all blank text is removed from an XML document -(or just more blank text than the parser does by itself), you have to -use either a DTD to tell the parser which whitespace it can safely -ignore, or remove the ignorable whitespace manually after parsing, -e.g. by setting all tail text to None:

-
for element in root.iter():
-    element.tail = None
-
-

Fredrik Lundh also has a Python-level function for indenting XML by -appending whitespace to tags. It can be found on his element -library recipe page.

-
-
-

Why can't lxml parse my XML from unicode strings?

-

First of all, XML is explicitly defined as a stream of bytes. It's not -Unicode text. Take a look at the XML specification, it's all about byte -sequences and how to map them to text and structure. That leads to rule -number one: do not decode your XML data yourself. That's a part of the -work of an XML parser, and it does it very well. Just pass it your data as -a plain byte stream, it will always do the right thing, by specification.

-

This also includes not opening XML files in text mode. Make sure you always -use binary mode, or, even better, pass the file path into lxml's parse() -function to let it do the file opening, reading and closing itself. This -is the most simple and most efficient way to do it.

-

That being said, lxml can read Python unicode strings and even tries to -support them if libxml2 does not. This is because there is one valid use -case for parsing XML from text strings: literal XML fragments in source -code.

-

However, if the unicode string declares an XML encoding internally -(<?xml encoding="..."?>), parsing is bound to fail, as this encoding is -almost certainly not the real encoding used in Python unicode. The same is -true for HTML unicode strings that contain charset meta tags, although the -problems may be more subtle here. The libxml2 HTML parser may not be able -to parse the meta tags in broken HTML and may end up ignoring them, so even -if parsing succeeds, later handling may still fail with character encoding -errors. Therefore, parsing HTML from unicode strings is a much saner thing -to do than parsing XML from unicode strings.

-

Note that Python uses different encodings for unicode on different platforms, -so even specifying the real internal unicode encoding is not portable between -Python interpreters. Don't do it.

-

Python unicode strings with XML data that carry encoding information are -broken. lxml will not parse them. You must provide parsable data in a -valid encoding.

-
-
-

Can lxml parse from file objects opened in unicode/text mode?

-

Technically, yes. However, you likely do not want to do that, because -it is extremely inefficient. The text encoding that libxml2 uses -internally is UTF-8, so parsing from a Unicode file means that Python -first reads a chunk of data from the file, then decodes it into a new -buffer, and then copies it into a new unicode string object, just to -let libxml2 make yet another copy while encoding it down into UTF-8 -in order to parse it. It's clear that this involves a lot more -recoding and copying than when parsing straight from the bytes that -the file contains.

-

If you really know the encoding better than the parser (e.g. when -parsing HTML that lacks a content declaration), then instead of passing -an encoding parameter into the file object when opening it, create a -new instance of an XMLParser or HTMLParser and pass the encoding into -its constructor. Afterwards, use that parser for parsing, e.g. by -passing it into the etree.parse(file, parser) function. Remember -to open the file in binary mode (mode="rb"), or, if possible, prefer -passing the file path directly into parse() instead of an opened -Python file object.

-
-
-

What is the difference between str(xslt(doc)) and xslt(doc).write() ?

-

The str() implementation of the XSLTResultTree class (a subclass of the -ElementTree class) knows about the output method chosen in the stylesheet -(xsl:output), write() doesn't. If you call write(), the result will be a -normal XML tree serialization in the requested encoding. Calling this method -may also fail for XSLT results that are not XML trees (e.g. string results).

-

If you call str(), it will return the serialized result as specified by the -XSL transform. This correctly serializes string results to encoded Python -strings and honours xsl:output options like indent. This almost -certainly does what you want, so you should only use write() if you are -sure that the XSLT result is an XML tree and you want to override the encoding -and indentation options requested by the stylesheet.

-
-
-

Why can't I just delete parents or clear the root node in iterparse()?

-

The iterparse() implementation is based on the libxml2 parser. It -requires the tree to be intact to finish parsing. If you delete or modify -parents of the current node, chances are you modify the structure in a way -that breaks the parser. Normally, this will result in a segfault. Please -refer to the iterparse section of the lxml API documentation to find out -what you can do and what you can't do.

-
-
-

How do I output null characters in XML text?

-

Don't. What you would produce is not well-formed XML. XML parsers -will refuse to parse a document that contains null characters. The -right way to embed binary data in XML is using a text encoding such as -uuencode or base64.

-
-
-

Is lxml vulnerable to XML bombs?

-

This has nothing to do with lxml itself, only with the parser of -libxml2. Since libxml2 version 2.7, the parser imposes hard security -limits on input documents to prevent DoS attacks with forged input -data. Since lxml 2.2.1, you can disable these limits with the -huge_tree parser option if you need to parse really large, -trusted documents. All lxml versions will leave these restrictions -enabled by default.

-

Note that libxml2 versions of the 2.6 series do not restrict their -parser and are therefore vulnerable to DoS attacks.

-

Note also that these "hard limits" may still be high enough to -allow for excessive resource usage in a given use case. They are -compile time modifiable, so building your own library versions will -allow you to change the limits to your own needs. Also see the next -question.

-
-
-

How do I use lxml safely as a web-service endpoint?

-

XML based web-service endpoints are generally subject to several -types of attacks if they allow some kind of untrusted input. -From the point of view of the underlying XML tool, the most -obvious attacks try to send a relatively small amount of data -that induces a comparatively large resource consumption on the -receiver side.

-

First of all, make sure network access is not enabled for the XML -parser that you use for parsing untrusted content and that it is -not configured to load external DTDs. Otherwise, attackers can -try to trick the parser into an attempt to load external resources -that are overly slow or impossible to retrieve, thus wasting time -and other valuable resources on your server such as socket -connections. Note that you can register your own document loader -in lxml, which allows for fine-grained control over any read access -to resources.

-

Some of the most famous excessive content expansion attacks -use XML entity references. Luckily, entity expansion is mostly -useless for the data commonly sent through web services and -can simply be disabled, which rules out several types of -denial of service attacks at once. This also involves an attack -that reads local files from the server, as XML entities can be -defined to expand into their content. Consequently, version -1.2 of the SOAP standard explicitly disallows entity references -in the XML stream.

-

To disable entity expansion, use an XML parser that is configured -with the option resolve_entities=False. Then, after (or -while) parsing the document, use root.iter(etree.Entity) to -recursively search for entity references. If it contains any, -reject the entire input document with a suitable error response. -In lxml 3.x, you can also use the new DTD introspection API to -apply your own restrictions on input documents.

-

Another attack to consider is compression bombs. If you allow -compressed input into your web service, attackers can try to send -well forged highly repetitive and thus very well compressing input -that unpacks into a very large XML document in your server's main -memory, potentially a thousand times larger than the compressed -input data.

-

As a counter measure, either disable compressed input for your -web server, at least for untrusted sources, or use incremental -parsing with iterparse() instead of parsing the whole input -document into memory in one shot. That allows you to enforce -suitable limits on the input by applying semantic checks that -detect and prevent an illegitimate use of your service. If -possible, you can also use this to reduce the amount of data -that you need to keep in memory while parsing the document, -thus further reducing the possibility of an attacker to trick -your system into excessive resource usage.

-

Finally, please be aware that XPath suffers from the same -vulnerability as SQL when it comes to content injection. The -obvious fix is to not build any XPath expressions via string -formatting or concatenation when the parameters may come from -untrusted sources, and instead use XPath variables, which -safely expose their values to the evaluation engine.

-

The defusedxml package comes with an example setup and a wrapper -API for lxml that applies certain counter measures internally.

-
-
-
-

XPath and Document Traversal

-
-

What are the findall() and xpath() methods on Element(Tree)?

-

findall() is part of the original ElementTree API. It supports a -simple subset of the XPath language, without predicates, conditions and -other advanced features. It is very handy for finding specific tags in a -tree. Another important difference is namespace handling, which uses the -{namespace}tagname notation. This is not supported by XPath. The -findall, find and findtext methods are compatible with other ElementTree -implementations and allow writing portable code that runs on ElementTree, -cElementTree and lxml.etree.

-

xpath(), on the other hand, supports the complete power of the XPath -language, including predicates, XPath functions and Python extension -functions. The syntax is defined by the XPath specification. If you need -the expressiveness and selectivity of XPath, the xpath() method, the -XPath class and the XPathEvaluator are the best choice.

-
-
-

Why doesn't findall() support full XPath expressions?

-

It was decided that it is more important to keep compatibility with -ElementTree to simplify code migration between the libraries. The main -difference compared to XPath is the {namespace}tagname notation used in -findall(), which is not valid XPath.

-

ElementTree and lxml.etree use the same implementation, which assures 100% -compatibility. Note that findall() is so fast in lxml that a native -implementation would not bring any performance benefits.

-
-
-

How can I find out which namespace prefixes are used in a document?

-

You can traverse the document (root.iter()) and collect the prefix -attributes from all Elements into a set. However, it is unlikely that you -really want to do that. You do not need these prefixes, honestly. You only -need the namespace URIs. All namespace comparisons use these, so feel free to -make up your own prefixes when you use XPath expressions or extension -functions.

-

The only place where you might consider specifying prefixes is the -serialization of Elements that were created through the API. Here, you can -specify a prefix mapping through the nsmap argument when creating the root -Element. Its children will then inherit this prefix for serialization.

-
-
-

How can I specify a default namespace for XPath expressions?

-

You can't. In XPath, there is no such thing as a default namespace. Just use -an arbitrary prefix and let the namespace dictionary of the XPath evaluators -map it to your namespace. See also the question above.

-
-
-
- - - \ No newline at end of file diff --git a/doc/html/api.html b/doc/html/api.html deleted file mode 100644 index 73434928..00000000 --- a/doc/html/api.html +++ /dev/null @@ -1,538 +0,0 @@ - - - - - -APIs specific to lxml.etree - - - -
-

APIs specific to lxml.etree

- -

lxml.etree tries to follow established APIs wherever possible. Sometimes, -however, the need to expose a feature in an easy way led to the invention of a -new API. This page describes the major differences and a few additions to the -main ElementTree API.

-

For a complete reference of the API, see the generated API -documentation.

-

Separate pages describe the support for parsing XML, executing XPath and -XSLT, validating XML and interfacing with other XML tools through the -SAX-API.

-

lxml is extremely extensible through XPath functions in Python, custom -Python element classes, custom URL resolvers and even at the C-level.

- -
-

lxml.etree

-

lxml.etree tries to follow the ElementTree API wherever it can. There are -however some incompatibilities (see compatibility). The extensions are -documented here.

-

If you need to know which version of lxml is installed, you can access the -lxml.etree.LXML_VERSION attribute to retrieve a version tuple. Note, -however, that it did not exist before version 1.0, so you will get an -AttributeError in older versions. The versions of libxml2 and libxslt are -available through the attributes LIBXML_VERSION and LIBXSLT_VERSION.

-

The following examples usually assume this to be executed first:

-
>>> from lxml import etree
-
-
-
-

Other Element APIs

-

While lxml.etree itself uses the ElementTree API, it is possible to replace -the Element implementation by custom element subclasses. This has been -used to implement well-known XML APIs on top of lxml. For example, lxml ships -with a data-binding implementation called objectify, which is similar to -the Amara bindery tool.

-

lxml.etree comes with a number of different lookup schemes to customize the -mapping between libxml2 nodes and the Element classes used by lxml.etree.

-
-
-

Trees and Documents

-

Compared to the original ElementTree API, lxml.etree has an extended tree -model. It knows about parents and siblings of elements:

-
>>> root = etree.Element("root")
->>> a = etree.SubElement(root, "a")
->>> b = etree.SubElement(root, "b")
->>> c = etree.SubElement(root, "c")
->>> d = etree.SubElement(root, "d")
->>> e = etree.SubElement(d,    "e")
->>> b.getparent() == root
-True
->>> print(b.getnext().tag)
-c
->>> print(c.getprevious().tag)
-b
-
-

Elements always live within a document context in lxml. This implies that -there is also a notion of an absolute document root. You can retrieve an -ElementTree for the root node of a document from any of its elements.

-
>>> tree = d.getroottree()
->>> print(tree.getroot().tag)
-root
-
-

Note that this is different from wrapping an Element in an ElementTree. You -can use ElementTrees to create XML trees with an explicit root node:

-
>>> tree = etree.ElementTree(d)
->>> print(tree.getroot().tag)
-d
->>> etree.tostring(tree)
-b'<d><e/></d>'
-
-

ElementTree objects are serialised as complete documents, including -preceding or trailing processing instructions and comments.

-

All operations that you run on such an ElementTree (like XPath, XSLT, etc.) -will understand the explicitly chosen root as root node of a document. They -will not see any elements outside the ElementTree. However, ElementTrees do -not modify their Elements:

-
>>> element = tree.getroot()
->>> print(element.tag)
-d
->>> print(element.getparent().tag)
-root
->>> print(element.getroottree().getroot().tag)
-root
-
-

The rule is that all operations that are applied to Elements use either the -Element itself as reference point, or the absolute root of the document that -contains this Element (e.g. for absolute XPath expressions). All operations -on an ElementTree use its explicit root node as reference.

-
-
-

Iteration

-

The ElementTree API makes Elements iterable to supports iteration over their -children. Using the tree defined above, we get:

-
>>> [ child.tag for child in root ]
-['a', 'b', 'c', 'd']
-
-

To iterate in the opposite direction, use the builtin reversed() function -that exists in Python 2.4 and later.

-

Tree traversal should use the element.iter() method:

-
>>> [ el.tag for el in root.iter() ]
-['root', 'a', 'b', 'c', 'd', 'e']
-
-

lxml.etree also supports this, but additionally features an extended API for -iteration over the children, following/preceding siblings, ancestors and -descendants of an element, as defined by the respective XPath axis:

-
>>> [ child.tag for child in root.iterchildren() ]
-['a', 'b', 'c', 'd']
->>> [ child.tag for child in root.iterchildren(reversed=True) ]
-['d', 'c', 'b', 'a']
->>> [ sibling.tag for sibling in b.itersiblings() ]
-['c', 'd']
->>> [ sibling.tag for sibling in c.itersiblings(preceding=True) ]
-['b', 'a']
->>> [ ancestor.tag for ancestor in e.iterancestors() ]
-['d', 'root']
->>> [ el.tag for el in root.iterdescendants() ]
-['a', 'b', 'c', 'd', 'e']
-
-

Note how element.iterdescendants() does not include the element -itself, as opposed to element.iter(). The latter effectively -implements the 'descendant-or-self' axis in XPath.

-

All of these iterators support one (or more, since lxml 3.0) additional -arguments that filter the generated elements by tag name:

-
>>> [ child.tag for child in root.iterchildren('a') ]
-['a']
->>> [ child.tag for child in d.iterchildren('a') ]
-[]
->>> [ el.tag for el in root.iterdescendants('d') ]
-['d']
->>> [ el.tag for el in root.iter('d') ]
-['d']
->>> [ el.tag for el in root.iter('d', 'a') ]
-['a', 'd']
-
-

Note that the order of the elements is determined by the iteration order, -which is the document order in most cases (except for preceding siblings -and ancestors, where it is the reversed document order). The order of -the tag selection arguments is irrelevant, as you can see in the last -example.

-

The most common way to traverse an XML tree is depth-first, which -traverses the tree in document order. This is implemented by the -.iter() method. While there is no dedicated method for -breadth-first traversal, it is almost as simple if you use the -collections.deque type that is available in Python 2.4 and later.

-
>>> root = etree.XML('<root><a><b/><c/></a><d><e/></d></root>')
->>> print(etree.tostring(root, pretty_print=True, encoding='unicode'))
-<root>
-  <a>
-    <b/>
-    <c/>
-  </a>
-  <d>
-    <e/>
-  </d>
-</root>
-
->>> queue = deque([root])
->>> while queue:
-...    el = queue.popleft()  # pop next element
-...    queue.extend(el)      # append its children
-...    print(el.tag)
-root
-a
-d
-b
-c
-e
-
-

See also the section on the utility functions iterparse() and -iterwalk() in the parser documentation.

-
-
-

Error handling on exceptions

-

Libxml2 provides error messages for failures, be it during parsing, XPath -evaluation or schema validation. The preferred way of accessing them is -through the local error_log property of the respective evaluator or -transformer object. See their documentation for details.

-

However, lxml also keeps a global error log of all errors that occurred at the -application level. Whenever an exception is raised, you can retrieve the -errors that occurred and "might have" lead to the problem from the error log -copy attached to the exception:

-
>>> etree.clear_error_log()
->>> broken_xml = '''
-... <root>
-...   <a>
-... </root>
-... '''
->>> try:
-...   etree.parse(StringIO(broken_xml))
-... except etree.XMLSyntaxError, e:
-...   pass # just put the exception into e
-
-

Once you have caught this exception, you can access its error_log property -to retrieve the log entries or filter them by a specific type, error domain or -error level:

-
>>> log = e.error_log.filter_from_level(etree.ErrorLevels.FATAL)
->>> print(log)
-<string>:4:8:FATAL:PARSER:ERR_TAG_NAME_MISMATCH: Opening and ending tag mismatch: a line 3 and root
-<string>:5:1:FATAL:PARSER:ERR_TAG_NOT_FINISHED: Premature end of data in tag root line 2
-
-

This might look a little cryptic at first, but it is the information that -libxml2 gives you. At least the message at the end should give you a hint -what went wrong and you can see that the fatal errors (FATAL) happened during -parsing (PARSER) lines 4, column 8 and line 5, column 1 of a string (<string>, -or the filename if available). Here, PARSER is the so-called error domain, -see lxml.etree.ErrorDomains for that. You can get it from a log entry -like this:

-
>>> entry = log[0]
->>> print(entry.domain_name)
-PARSER
->>> print(entry.type_name)
-ERR_TAG_NAME_MISMATCH
->>> print(entry.filename)
-<string>
-
-

There is also a convenience attribute last_error that returns the last -error or fatal error that occurred:

-
>>> entry = e.error_log.last_error
->>> print(entry.domain_name)
-PARSER
->>> print(entry.type_name)
-ERR_TAG_NOT_FINISHED
->>> print(entry.filename)
-<string>
-
-
-
-

Error logging

-

lxml.etree supports logging libxml2 messages to the Python stdlib logging -module. This is done through the etree.PyErrorLog class. It disables the -error reporting from exceptions and forwards log messages to a Python logger. -To use it, see the descriptions of the function etree.useGlobalPythonLog -and the class etree.PyErrorLog for help. Note that this does not affect -the local error logs of XSLT, XMLSchema, etc.

-
-
-

Serialisation

-

lxml.etree has direct support for pretty printing XML output. Functions like -ElementTree.write() and tostring() support it through a keyword -argument:

-
>>> root = etree.XML("<root><test/></root>")
->>> etree.tostring(root)
-b'<root><test/></root>'
-
->>> print(etree.tostring(root, pretty_print=True))
-<root>
-  <test/>
-</root>
-
-

Note the newline that is appended at the end when pretty printing the -output. It was added in lxml 2.0.

-

By default, lxml (just as ElementTree) outputs the XML declaration only if it -is required by the standard:

-
>>> unicode_root = etree.Element( u"t\u3120st" )
->>> unicode_root.text = u"t\u0A0Ast"
->>> etree.tostring(unicode_root, encoding="utf-8")
-b'<t\xe3\x84\xa0st>t\xe0\xa8\x8ast</t\xe3\x84\xa0st>'
-
->>> print(etree.tostring(unicode_root, encoding="iso-8859-1"))
-<?xml version='1.0' encoding='iso-8859-1'?>
-<t&#12576;st>t&#2570;st</t&#12576;st>
-
-

Also see the general remarks on Unicode support.

-

You can enable or disable the declaration explicitly by passing another -keyword argument for the serialisation:

-
>>> print(etree.tostring(root, xml_declaration=True))
-<?xml version='1.0' encoding='ASCII'?>
-<root><test/></root>
-
->>> unicode_root.clear()
->>> etree.tostring(unicode_root, encoding="UTF-16LE",
-...                              xml_declaration=False)
-b'<\x00t\x00 1s\x00t\x00/\x00>\x00'
-
-

Note that a standard compliant XML parser will not consider the last line -well-formed XML if the encoding is not explicitly provided somehow, e.g. in an -underlying transport protocol:

-
>>> notxml = etree.tostring(unicode_root, encoding="UTF-16LE",
-...                                       xml_declaration=False)
->>> root = etree.XML(notxml)        #doctest: +ELLIPSIS
-Traceback (most recent call last):
-  ...
-lxml.etree.XMLSyntaxError: ...
-
-

Since version 2.3, the serialisation can override the internal subset -of the document with a user provided DOCTYPE:

-
>>> xml = '<!DOCTYPE root>\n<root/>'
->>> tree = etree.parse(StringIO(xml))
-
->>> print(etree.tostring(tree))
-<!DOCTYPE root>
-<root/>
-
->>> print(etree.tostring(tree,
-...     doctype='<!DOCTYPE root SYSTEM "/tmp/test.dtd">'))
-<!DOCTYPE root SYSTEM "/tmp/test.dtd">
-<root/>
-
-

The content will be encoded, but otherwise copied verbatim into the -output stream. It is therefore left to the user to take care for a -correct doctype format, including the name of the root node.

-
-
-

Incremental XML generation

-

Since version 3.1, lxml provides an xmlfile API for incrementally -generating XML using the with statement. It's main purpose is to -freely and safely mix surrounding elements with pre-built in-memory -trees, e.g. to write out large documents that consist mostly of -repetitive subtrees (like database dumps). But it can be useful in -many cases where memory consumption matters or where XML is naturally -generated in sequential steps. Since lxml 3.4.1, there is an equivalent -context manager for HTML serialisation called htmlfile.

-

The API can serialise to real files (given as file path or file -object), as well as file-like objects, e.g. io.BytesIO(). -Here is a simple example:

-
->>> f = BytesIO()
->>> with etree.xmlfile(f) as xf:
-...     with xf.element('abc'):
-...         xf.write('text')
-
->>> print(f.getvalue().decode('utf-8'))
-<abc>text</abc>
-
-

xmlfile() accepts a file path as first argument, or a file(-like) -object, as in the example above. In the first case, it takes care to -open and close the file itself, whereas file(-like) objects are not -closed by default. This is left to the code that opened them. Since -lxml 3.4, however, you can pass the argument close=True to make -lxml call the object's .close() method when exiting the xmlfile -context manager.

-

To insert pre-constructed Elements and subtrees, just pass them -into write():

-
->>> f = BytesIO()
->>> with etree.xmlfile(f) as xf:
-...     with xf.element('abc'):
-...         with xf.element('in'):
-...
-...             for value in '123':
-...                 # construct a really complex XML tree
-...                 el = etree.Element('xyz', attr=value)
-...
-...                 xf.write(el)
-...
-...                 # no longer needed, discard it right away!
-...                 el = None
-
->>> print(f.getvalue().decode('utf-8'))
-<abc><in><xyz attr="1"/><xyz attr="2"/><xyz attr="3"/></in></abc>
-
-

It is a common pattern to have one or more nested element() -blocks, and then build in-memory XML subtrees in a loop (using the -ElementTree API, the builder API, XSLT, or whatever) and write them -out into the XML file one after the other. That way, they can be -removed from memory right after their construction, which can largely -reduce the memory footprint of an application, while keeping the -overall XML generation easy, safe and correct.

-

Together with Python coroutines, this can be used to generate XML -in an asynchronous, non-blocking fashion, e.g. for a stream protocol -like the instant messaging protocol -XMPP:

-
-def writer(out_stream):
-    with xmlfile(out_stream) as xf:
-        with xf.element('{http://etherx.jabber.org/streams}stream'):
-            while True:
-                el = (yield)
-                xf.write(el)
-                xf.flush()
-
-w = writer(stream)
-next(w)   # start writing (run up to 'yield')
-
-

Then, whenever XML elements are available for writing, call

-
-w.send(element)
-
-

And when done:

-
-w.close()
-
-

Note the additional xf.flush() call in the example above, which is -available since lxml 3.4. Normally, the output stream is buffered to -avoid excessive I/O calls. Whenever the internal buffer fills up, its -content is written out. In the case above, however, we want to make -sure that each message that we write (i.e. each element subtree) is -written out immediately, so we flush the content explicitly at the -right point.

-

Alternatively, if buffering is not desired at all, it can be disabled -by passing the flag buffered=False into xmlfile() (also since -lxml 3.4).

-

Here is a similar example using an async coroutine in Py3.5 or later, which is -supported since lxml 4.0. The output stream is expected to have methods -async def write(self, data) and async def close(self) in this case.

-
-async def writer(out_stream, xml_messages):
-    async with xmlfile(out_stream) as xf:
-        async with xf.element('{http://etherx.jabber.org/streams}stream'):
-             async for el in xml_messages:
-                  await xf.write(el)
-                  await xf.flush()
-
-
-class DummyAsyncOut(object):
-    async def write(self, data):
-        print(data.decode('utf8'))
-
-    async def close(self):
-         pass
-
-stream = DummyAsyncOut()
-async_writer = writer(stream, async_message_stream)
-
-
-
-

CDATA

-

By default, lxml's parser will strip CDATA sections from the tree and -replace them by their plain text content. As real applications for -CDATA are rare, this is the best way to deal with this issue.

-

However, in some cases, keeping CDATA sections or creating them in a -document is required to adhere to existing XML language definitions. -For these special cases, you can instruct the parser to leave CDATA -sections in the document:

-
>>> parser = etree.XMLParser(strip_cdata=False)
->>> root = etree.XML('<root><![CDATA[test]]></root>', parser)
->>> root.text
-'test'
-
->>> etree.tostring(root)
-b'<root><![CDATA[test]]></root>'
-
-

Note how the .text property does not give any indication that the -text content is wrapped by a CDATA section. If you want to make sure -your data is wrapped by a CDATA block, you can use the CDATA() -text wrapper:

-
>>> root.text = 'test'
-
->>> root.text
-'test'
->>> etree.tostring(root)
-b'<root>test</root>'
-
->>> root.text = etree.CDATA(root.text)
-
->>> root.text
-'test'
->>> etree.tostring(root)
-b'<root><![CDATA[test]]></root>'
-
-
-
-

XInclude and ElementInclude

-

You can let lxml process xinclude statements in a document by calling the -xinclude() method on a tree:

-
>>> data = StringIO('''\
-... <doc xmlns:xi="http://www.w3.org/2001/XInclude">
-... <foo/>
-... <xi:include href="doc/test.xml" />
-... </doc>''')
-
->>> tree = etree.parse(data)
->>> tree.xinclude()
->>> print(etree.tostring(tree.getroot()))
-<doc xmlns:xi="http://www.w3.org/2001/XInclude">
-<foo/>
-<a xml:base="doc/test.xml"/>
-</doc>
-
-

Note that the ElementTree compatible ElementInclude module is also supported -as lxml.ElementInclude. It has the additional advantage of supporting -custom URL resolvers at the Python level. The normal XInclude mechanism -cannot deploy these. If you need ElementTree compatibility or custom -resolvers, you have to stick to the external Python module.

-
-
-

write_c14n on ElementTree

-

The lxml.etree.ElementTree class has a method write_c14n, which takes a file -object as argument. This file object will receive an UTF-8 representation of -the canonicalized form of the XML, following the W3C C14N recommendation. For -example:

-
>>> f = StringIO('<a><b/></a>')
->>> tree = etree.parse(f)
->>> f2 = StringIO()
->>> tree.write_c14n(f2)
->>> print(f2.getvalue().decode("utf-8"))
-<a><b></b></a>
-
-
-
- - - \ No newline at end of file diff --git a/doc/html/api/abc.ABCMeta-class.html b/doc/html/api/abc.ABCMeta-class.html deleted file mode 100644 index e2c2b7f0..00000000 --- a/doc/html/api/abc.ABCMeta-class.html +++ /dev/null @@ -1,449 +0,0 @@ - - - - - abc.ABCMeta - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - abc :: - ABCMeta :: - Class ABCMeta - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Type ABCMeta

-
-object --+    
-         |    
-      type --+
-             |
-            ABCMeta
-
- -
-

Metaclass for defining Abstract Base Classes (ABCs).

-

Use this metaclass to create an ABC. An ABC can be subclassed -directly, and then acts as a mix-in class. You can also register -unrelated concrete classes (even built-in classes) and unrelated -ABCs as 'virtual subclasses' -- these and their descendants will -be considered subclasses of the registering ABC by the built-in -issubclass() function, but the registering ABC won't show up in -their MRO (Method Resolution Order) nor will method -implementations defined by the registering ABC be callable (not -even via super()).

- - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- bool - - - - - - -
__instancecheck__(cls, - instance)
- Override for isinstance(instance, cls).
- - -
- -
- bool - - - - - - -
__subclasscheck__(cls, - subclass)
- Override for issubclass(subclass, cls).
- - -
- -
-   - - - - - - -
_dump_registry(cls, - file=None)
- Debug helper to print the ABC registry.
- - -
- -
-   - - - - - - -
register(cls, - subclass)
- Register a virtual subclass of an ABC.
- - -
- -
-

Inherited from type: - __call__, - __delattr__, - __eq__, - __ge__, - __getattribute__, - __gt__, - __hash__, - __init__, - __le__, - __lt__, - __ne__, - __repr__, - __setattr__, - __subclasses__, - mro -

-

Inherited from object: - __format__, - __reduce__, - __reduce_ex__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Static Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(mcls, - name, - bases, - namespace) - - -
- -
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - _abc_invalidation_counter = 22 -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from type: - __abstractmethods__, - __base__, - __bases__, - __basicsize__, - __dictoffset__, - __flags__, - __itemsize__, - __mro__, - __name__, - __weakrefoffset__ -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__instancecheck__(cls, - instance) -

-
  -
- - Override for isinstance(instance, cls). -
-
Returns: bool
-
Overrides: - type.__instancecheck__ -
-
-
-
- -
- -
- - -
-

__new__(mcls, - name, - bases, - namespace) -
Static Method -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__subclasscheck__(cls, - subclass) -

-
  -
- - Override for issubclass(subclass, cls). -
-
Returns: bool
-
Overrides: - type.__subclasscheck__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/api-objects.txt b/doc/html/api/api-objects.txt deleted file mode 100644 index 6c88e089..00000000 --- a/doc/html/api/api-objects.txt +++ /dev/null @@ -1,7678 +0,0 @@ -lxml.ElementInclude lxml.ElementInclude-module.html -lxml.ElementInclude.XINCLUDE_INCLUDE lxml.ElementInclude-module.html#XINCLUDE_INCLUDE -lxml.ElementInclude.XINCLUDE_FALLBACK lxml.ElementInclude-module.html#XINCLUDE_FALLBACK -lxml.ElementInclude._include lxml.ElementInclude-module.html#_include -lxml.ElementInclude.__package__ lxml.ElementInclude-module.html#__package__ -lxml.ElementInclude._lxml_default_loader lxml.ElementInclude-module.html#_lxml_default_loader -lxml.ElementInclude.include lxml.ElementInclude-module.html#include -lxml.ElementInclude.XINCLUDE lxml.ElementInclude-module.html#XINCLUDE -lxml.ElementInclude.XINCLUDE_ITER_TAG lxml.ElementInclude-module.html#XINCLUDE_ITER_TAG -lxml.ElementInclude._wrap_et_loader lxml.ElementInclude-module.html#_wrap_et_loader -lxml.ElementInclude.default_loader lxml.ElementInclude-module.html#default_loader -lxml lxml-module.html -lxml.get_include lxml-module.html#get_include -lxml.__package__ lxml-module.html#__package__ -lxml.builder lxml.builder-module.html -lxml.builder.E lxml.builder-module.html#E -lxml.builder.__reduce_cython__ lxml.builder-module.html#__reduce_cython__ -lxml.builder.__pyx_unpickle_ElementMaker lxml.builder-module.html#__pyx_unpickle_ElementMaker -lxml.builder.__package__ lxml.builder-module.html#__package__ -lxml.builder.__pyx_capi__ lxml.builder-module.html#__pyx_capi__ -lxml.builder.__test__ lxml.builder-module.html#__test__ -lxml.builder.__setstate_cython__ lxml.builder-module.html#__setstate_cython__ -lxml.cssselect lxml.cssselect-module.html -lxml.cssselect.ns lxml.cssselect-module.html#ns -lxml.cssselect._make_lower_case lxml.cssselect-module.html#_make_lower_case -lxml.cssselect.__package__ lxml.cssselect-module.html#__package__ -lxml.doctestcompare lxml.doctestcompare-module.html -lxml.doctestcompare._norm_whitespace_re lxml.doctestcompare-module.html#_norm_whitespace_re -lxml.doctestcompare.norm_whitespace lxml.doctestcompare-module.html#norm_whitespace -lxml.doctestcompare.PARSE_XML lxml.doctestcompare-module.html#PARSE_XML -lxml.doctestcompare._IS_PYTHON_3 lxml.doctestcompare-module.html#_IS_PYTHON_3 -lxml.doctestcompare._find_doctest_frame lxml.doctestcompare-module.html#_find_doctest_frame -lxml.doctestcompare.strip lxml.doctestcompare-module.html#strip -lxml.doctestcompare._repr_re lxml.doctestcompare-module.html#_repr_re -lxml.doctestcompare._html_parser lxml.doctestcompare-module.html#_html_parser -lxml.doctestcompare.NOPARSE_MARKUP lxml.doctestcompare-module.html#NOPARSE_MARKUP -lxml.doctestcompare.__package__ lxml.doctestcompare-module.html#__package__ -lxml.doctestcompare.html_fromstring lxml.doctestcompare-module.html#html_fromstring -lxml.doctestcompare.temp_install lxml.doctestcompare-module.html#temp_install -lxml.doctestcompare.__test__ lxml.doctestcompare-module.html#__test__ -lxml.doctestcompare.install lxml.doctestcompare-module.html#install -lxml.doctestcompare.PARSE_HTML lxml.doctestcompare-module.html#PARSE_HTML -lxml.etree lxml.etree-module.html -lxml.etree.XPathEvaluator lxml.etree-module.html#XPathEvaluator -lxml.etree.XMLID lxml.etree-module.html#XMLID -lxml.etree.LIBXSLT_VERSION lxml.etree-module.html#LIBXSLT_VERSION -lxml.etree.XMLDTDID lxml.etree-module.html#XMLDTDID -lxml.etree.ElementTree lxml.etree-module.html#ElementTree -lxml.etree.cleanup_namespaces lxml.etree-module.html#cleanup_namespaces -lxml.etree.set_default_parser lxml.etree-module.html#set_default_parser -lxml.etree.parseid lxml.etree-module.html#parseid -lxml.etree.tostring lxml.etree-module.html#tostring -lxml.etree.iselement lxml.etree-module.html#iselement -lxml.etree.adopt_external_document lxml.etree-module.html#adopt_external_document -lxml.etree.FunctionNamespace lxml.etree-module.html#FunctionNamespace -lxml.etree.strip_attributes lxml.etree-module.html#strip_attributes -lxml.etree.Entity lxml.etree-module.html#Entity -lxml.etree.__package__ lxml.etree-module.html#__package__ -lxml.etree.dump lxml.etree-module.html#dump -lxml.etree.strip_elements lxml.etree-module.html#strip_elements -lxml.etree.HTML lxml.etree-module.html#HTML -lxml.etree.memory_debugger lxml.etree-module.html#memory_debugger -lxml.etree.PI lxml.etree-module.html#PI -lxml.etree.Extension lxml.etree-module.html#Extension -lxml.etree.DEBUG lxml.etree-module.html#DEBUG -lxml.etree.Comment lxml.etree-module.html#Comment -lxml.etree.ProcessingInstruction lxml.etree-module.html#ProcessingInstruction -lxml.etree.LXML_VERSION lxml.etree-module.html#LXML_VERSION -lxml.etree.LIBXML_COMPILED_VERSION lxml.etree-module.html#LIBXML_COMPILED_VERSION -lxml.etree.strip_tags lxml.etree-module.html#strip_tags -lxml.etree.tounicode lxml.etree-module.html#tounicode -lxml.etree.LIBXSLT_COMPILED_VERSION lxml.etree-module.html#LIBXSLT_COMPILED_VERSION -lxml.etree.__pyx_capi__ lxml.etree-module.html#__pyx_capi__ -lxml.etree.XML lxml.etree-module.html#XML -lxml.etree.__test__ lxml.etree-module.html#__test__ -lxml.etree.use_global_python_log lxml.etree-module.html#use_global_python_log -lxml.etree.LIBXML_VERSION lxml.etree-module.html#LIBXML_VERSION -lxml.etree.tostringlist lxml.etree-module.html#tostringlist -lxml.etree.SubElement lxml.etree-module.html#SubElement -lxml.etree.get_default_parser lxml.etree-module.html#get_default_parser -lxml.etree.register_namespace lxml.etree-module.html#register_namespace -lxml.etree.parse lxml.etree-module.html#parse -lxml.etree.set_element_class_lookup lxml.etree-module.html#set_element_class_lookup -lxml.etree.clear_error_log lxml.etree-module.html#clear_error_log -lxml.etree.fromstringlist lxml.etree-module.html#fromstringlist -lxml.etree.Element lxml.etree-module.html#Element -lxml.etree.fromstring lxml.etree-module.html#fromstring -lxml.html.ElementSoup lxml.html.ElementSoup-module.html -lxml.html.ElementSoup.parse lxml.html.ElementSoup-module.html#parse -lxml.html.ElementSoup._parse lxml.html.soupparser-module.html#parse -lxml.html.ElementSoup.convert_tree lxml.html.ElementSoup-module.html#convert_tree -lxml.html.ElementSoup.__doc__ lxml.html.ElementSoup-module.html#__doc__ -lxml.html.ElementSoup.__package__ lxml.html.ElementSoup-module.html#__package__ -lxml.html lxml.html-module.html -lxml.html._rel_links_xpath lxml.html-module.html#_rel_links_xpath -lxml.html._looks_like_full_html_unicode lxml.html-module.html#_looks_like_full_html_unicode -lxml.html._unquote_match lxml.html-module.html#_unquote_match -lxml.html.parse lxml.html-module.html#parse -lxml.html._nons lxml.html-module.html#_nons -lxml.html._iter_css_imports lxml.html-module.html#_iter_css_imports -lxml.html._forms_xpath lxml.html-module.html#_forms_xpath -lxml.html._contains_block_level_tag lxml.html-module.html#_contains_block_level_tag -lxml.html._element_name lxml.html-module.html#_element_name -lxml.html._archive_re lxml.html-module.html#_archive_re -lxml.html.iterlinks lxml.html-module.html#iterlinks -lxml.html.__package__ lxml.html-module.html#__package__ -lxml.html._collect_string_content lxml.html-module.html#_collect_string_content -lxml.html.submit_form lxml.html-module.html#submit_form -lxml.html.xhtml_parser lxml.html-module.html#xhtml_parser -lxml.html.XHTML_NAMESPACE lxml.html-module.html#XHTML_NAMESPACE -lxml.html._id_xpath lxml.html-module.html#_id_xpath -lxml.html.make_links_absolute lxml.html-module.html#make_links_absolute -lxml.html.resolve_base_href lxml.html-module.html#resolve_base_href -lxml.html.__bytes_replace_meta_content_type lxml.html-module.html#__bytes_replace_meta_content_type -lxml.html.rewrite_links lxml.html-module.html#rewrite_links -lxml.html.fragment_fromstring lxml.html-module.html#fragment_fromstring -lxml.html.html_to_xhtml lxml.html-module.html#html_to_xhtml -lxml.html.fragments_fromstring lxml.html-module.html#fragments_fromstring -lxml.html._looks_like_full_html_bytes lxml.html-module.html#_looks_like_full_html_bytes -lxml.html.__str_replace_meta_content_type lxml.html-module.html#__str_replace_meta_content_type -lxml.html._options_xpath lxml.html-module.html#_options_xpath -lxml.html.document_fromstring lxml.html-module.html#document_fromstring -lxml.html.Element lxml.html-module.html#Element -lxml.html.__fix_docstring lxml.html-module.html#__fix_docstring -lxml.html._class_xpath lxml.html-module.html#_class_xpath -lxml.html.tostring lxml.html-module.html#tostring -lxml.html.find_class lxml.html-module.html#find_class -lxml.html.html_parser lxml.html-module.html#html_parser -lxml.html.open_in_browser lxml.html-module.html#open_in_browser -lxml.html._parse_meta_refresh_url lxml.html-module.html#_parse_meta_refresh_url -lxml.html.fromstring lxml.html-module.html#fromstring -lxml.html._label_xpath lxml.html-module.html#_label_xpath -lxml.html._iter_css_urls lxml.html-module.html#_iter_css_urls -lxml.html._transform_result lxml.html-module.html#_transform_result -lxml.html.find_rel_links lxml.html-module.html#find_rel_links -lxml.html.open_http_urllib lxml.html-module.html#open_http_urllib -lxml.html.xhtml_to_html lxml.html-module.html#xhtml_to_html -lxml.html.builder lxml.html.builder-module.html -lxml.html.builder.BLOCKQUOTE lxml.html.builder-module.html#BLOCKQUOTE -lxml.html.builder.OBJECT lxml.html.builder-module.html#OBJECT -lxml.html.builder.LINK lxml.html.builder-module.html#LINK -lxml.html.builder.BR lxml.html.builder-module.html#BR -lxml.html.builder.OPTGROUP lxml.html.builder-module.html#OPTGROUP -lxml.html.builder.__package__ lxml.html.builder-module.html#__package__ -lxml.html.builder.SUB lxml.html.builder-module.html#SUB -lxml.html.builder.PRE lxml.html.builder-module.html#PRE -lxml.html.builder.FRAME lxml.html.builder-module.html#FRAME -lxml.html.builder.BODY lxml.html.builder-module.html#BODY -lxml.html.builder.TH lxml.html.builder-module.html#TH -lxml.html.builder.P lxml.html.builder-module.html#P -lxml.html.builder.BASE lxml.html.builder-module.html#BASE -lxml.html.builder.TFOOT lxml.html.builder-module.html#TFOOT -lxml.html.builder.VAR lxml.html.builder-module.html#VAR -lxml.html.builder.MAP lxml.html.builder-module.html#MAP -lxml.html.builder.OL lxml.html.builder-module.html#OL -lxml.html.builder.TEXTAREA lxml.html.builder-module.html#TEXTAREA -lxml.html.builder.ACRONYM lxml.html.builder-module.html#ACRONYM -lxml.html.builder.MENU lxml.html.builder-module.html#MENU -lxml.html.builder.DT lxml.html.builder-module.html#DT -lxml.html.builder.ADDRESS lxml.html.builder-module.html#ADDRESS -lxml.html.builder.CODE lxml.html.builder-module.html#CODE -lxml.html.builder.HR lxml.html.builder-module.html#HR -lxml.html.builder.ISINDEX lxml.html.builder-module.html#ISINDEX -lxml.html.builder.HEAD lxml.html.builder-module.html#HEAD -lxml.html.builder.LABEL lxml.html.builder-module.html#LABEL -lxml.html.builder.META lxml.html.builder-module.html#META -lxml.html.builder.DEL lxml.html.builder-module.html#DEL -lxml.html.builder.FONT lxml.html.builder-module.html#FONT -lxml.html.builder.SELECT lxml.html.builder-module.html#SELECT -lxml.html.builder.NOFRAMES lxml.html.builder-module.html#NOFRAMES -lxml.html.builder.CENTER lxml.html.builder-module.html#CENTER -lxml.html.builder.KBD lxml.html.builder-module.html#KBD -lxml.html.builder.HTML lxml.html.builder-module.html#HTML -lxml.html.builder.EM lxml.html.builder-module.html#EM -lxml.html.builder.FRAMESET lxml.html.builder-module.html#FRAMESET -lxml.html.builder.FIELDSET lxml.html.builder-module.html#FIELDSET -lxml.html.builder.FOR lxml.html.builder-module.html#FOR -lxml.html.builder.BASEFONT lxml.html.builder-module.html#BASEFONT -lxml.html.builder.BDO lxml.html.builder-module.html#BDO -lxml.html.builder.PARAM lxml.html.builder-module.html#PARAM -lxml.html.builder.S lxml.html.builder-module.html#S -lxml.html.builder.INPUT lxml.html.builder-module.html#INPUT -lxml.html.builder.H2 lxml.html.builder-module.html#H2 -lxml.html.builder.H3 lxml.html.builder-module.html#H3 -lxml.html.builder.BUTTON lxml.html.builder-module.html#BUTTON -lxml.html.builder.SCRIPT lxml.html.builder-module.html#SCRIPT -lxml.html.builder.H6 lxml.html.builder-module.html#H6 -lxml.html.builder.H4 lxml.html.builder-module.html#H4 -lxml.html.builder.INS lxml.html.builder-module.html#INS -lxml.html.builder.UL lxml.html.builder-module.html#UL -lxml.html.builder.STRIKE lxml.html.builder-module.html#STRIKE -lxml.html.builder.OPTION lxml.html.builder-module.html#OPTION -lxml.html.builder.TITLE lxml.html.builder-module.html#TITLE -lxml.html.builder.SUP lxml.html.builder-module.html#SUP -lxml.html.builder.SMALL lxml.html.builder-module.html#SMALL -lxml.html.builder.STRONG lxml.html.builder-module.html#STRONG -lxml.html.builder.COL lxml.html.builder-module.html#COL -lxml.html.builder.AREA lxml.html.builder-module.html#AREA -lxml.html.builder.APPLET lxml.html.builder-module.html#APPLET -lxml.html.builder.TABLE lxml.html.builder-module.html#TABLE -lxml.html.builder.B lxml.html.builder-module.html#B -lxml.html.builder.IMG lxml.html.builder-module.html#IMG -lxml.html.builder.DFN lxml.html.builder-module.html#DFN -lxml.html.builder.SPAN lxml.html.builder-module.html#SPAN -lxml.html.builder.DL lxml.html.builder-module.html#DL -lxml.html.builder.H1 lxml.html.builder-module.html#H1 -lxml.html.builder.DD lxml.html.builder-module.html#DD -lxml.html.builder.TBODY lxml.html.builder-module.html#TBODY -lxml.html.builder.DIV lxml.html.builder-module.html#DIV -lxml.html.builder.H5 lxml.html.builder-module.html#H5 -lxml.html.builder.LEGEND lxml.html.builder-module.html#LEGEND -lxml.html.builder.DIR lxml.html.builder-module.html#DIR -lxml.html.builder.NOSCRIPT lxml.html.builder-module.html#NOSCRIPT -lxml.html.builder.COLGROUP lxml.html.builder-module.html#COLGROUP -lxml.html.builder.BIG lxml.html.builder-module.html#BIG -lxml.html.builder.TT lxml.html.builder-module.html#TT -lxml.html.builder.TR lxml.html.builder-module.html#TR -lxml.html.builder.LI lxml.html.builder-module.html#LI -lxml.html.builder.IFRAME lxml.html.builder-module.html#IFRAME -lxml.html.builder.TD lxml.html.builder-module.html#TD -lxml.html.builder.CLASS lxml.html.builder-module.html#CLASS -lxml.html.builder.A lxml.html.builder-module.html#A -lxml.html.builder.STYLE lxml.html.builder-module.html#STYLE -lxml.html.builder.E lxml.html.builder-module.html#E -lxml.html.builder.FORM lxml.html.builder-module.html#FORM -lxml.html.builder.I lxml.html.builder-module.html#I -lxml.html.builder.Q lxml.html.builder-module.html#Q -lxml.html.builder.CAPTION lxml.html.builder-module.html#CAPTION -lxml.html.builder.U lxml.html.builder-module.html#U -lxml.html.builder.ABBR lxml.html.builder-module.html#ABBR -lxml.html.builder.THEAD lxml.html.builder-module.html#THEAD -lxml.html.builder.SAMP lxml.html.builder-module.html#SAMP -lxml.html.builder.CITE lxml.html.builder-module.html#CITE -lxml.html.clean lxml.html.clean-module.html -lxml.html.clean._css_import_re lxml.html.clean-module.html#_css_import_re -lxml.html.clean.word_break_html lxml.html.clean-module.html#word_break_html -lxml.html.clean._link_regexes lxml.html.clean-module.html#_link_regexes -lxml.html.clean._substitute_whitespace lxml.html.clean-module.html#_substitute_whitespace -lxml.html.clean._find_styled_elements lxml.html.clean-module.html#_find_styled_elements -lxml.html.clean.unichr lxml.html.clean-module.html#unichr -lxml.html.clean._break_text lxml.html.clean-module.html#_break_text -lxml.html.clean.basestring lxml.html.clean-module.html#basestring -lxml.html.clean._avoid_classes lxml.html.clean-module.html#_avoid_classes -lxml.html.clean.__package__ lxml.html.clean-module.html#__package__ -lxml.html.clean._avoid_elements lxml.html.clean-module.html#_avoid_elements -lxml.html.clean._find_external_links lxml.html.clean-module.html#_find_external_links -lxml.html.clean._is_javascript_scheme lxml.html.clean-module.html#_is_javascript_scheme -lxml.html.clean.autolink lxml.html.clean-module.html#autolink -lxml.html.clean._conditional_comment_re lxml.html.clean-module.html#_conditional_comment_re -lxml.html.clean._is_possibly_malicious_scheme lxml.html.clean-module.html#_is_possibly_malicious_scheme -lxml.html.clean._link_text lxml.html.clean-module.html#_link_text -lxml.html.clean._avoid_hosts lxml.html.clean-module.html#_avoid_hosts -lxml.html.clean.autolink_html lxml.html.clean-module.html#autolink_html -lxml.html.clean.__test__ lxml.html.clean-module.html#__test__ -lxml.html.clean.clean_html lxml.html.clean-module.html#clean_html -lxml.html.clean._is_image_dataurl lxml.html.clean-module.html#_is_image_dataurl -lxml.html.clean._avoid_word_break_classes lxml.html.clean-module.html#_avoid_word_break_classes -lxml.html.clean._css_javascript_re lxml.html.clean-module.html#_css_javascript_re -lxml.html.clean.word_break lxml.html.clean-module.html#word_break -lxml.html.clean._insert_break lxml.html.clean-module.html#_insert_break -lxml.html.clean._break_prefer_re lxml.html.clean-module.html#_break_prefer_re -lxml.html.clean.clean lxml.html.clean-module.html#clean -lxml.html.clean._avoid_word_break_elements lxml.html.clean-module.html#_avoid_word_break_elements -lxml.html.defs lxml.html.defs-module.html -lxml.html.defs.block_tags lxml.html.defs-module.html#block_tags -lxml.html.defs.link_attrs lxml.html.defs-module.html#link_attrs -lxml.html.defs.tags lxml.html.defs-module.html#tags -lxml.html.defs.font_style_tags lxml.html.defs-module.html#font_style_tags -lxml.html.defs.event_attrs lxml.html.defs-module.html#event_attrs -lxml.html.defs.safe_attrs lxml.html.defs-module.html#safe_attrs -lxml.html.defs.table_tags lxml.html.defs-module.html#table_tags -lxml.html.defs.__package__ lxml.html.defs-module.html#__package__ -lxml.html.defs.top_level_tags lxml.html.defs-module.html#top_level_tags -lxml.html.defs.html5_tags lxml.html.defs-module.html#html5_tags -lxml.html.defs.form_tags lxml.html.defs-module.html#form_tags -lxml.html.defs.phrase_tags lxml.html.defs-module.html#phrase_tags -lxml.html.defs.deprecated_tags lxml.html.defs-module.html#deprecated_tags -lxml.html.defs.head_tags lxml.html.defs-module.html#head_tags -lxml.html.defs.list_tags lxml.html.defs-module.html#list_tags -lxml.html.defs.special_inline_tags lxml.html.defs-module.html#special_inline_tags -lxml.html.defs.empty_tags lxml.html.defs-module.html#empty_tags -lxml.html.defs.general_block_tags lxml.html.defs-module.html#general_block_tags -lxml.html.defs.frame_tags lxml.html.defs-module.html#frame_tags -lxml.html.defs.nonstandard_tags lxml.html.defs-module.html#nonstandard_tags -lxml.html.diff lxml.html.diff-module.html -lxml.html.diff._move_el_inside_block lxml.html.diff-module.html#_move_el_inside_block -lxml.html.diff.compress_merge_back lxml.html.diff-module.html#compress_merge_back -lxml.html.diff.serialize_html_fragment lxml.html.diff-module.html#serialize_html_fragment -lxml.html.diff.split_delete lxml.html.diff-module.html#split_delete -lxml.html.diff.split_unbalanced lxml.html.diff-module.html#split_unbalanced -lxml.html.diff.tokenize_annotated lxml.html.diff-module.html#tokenize_annotated -lxml.html.diff.is_word lxml.html.diff-module.html#is_word -lxml.html.diff._contains_block_level_tag lxml.html.diff-module.html#_contains_block_level_tag -lxml.html.diff.empty_tags lxml.html.diff-module.html#empty_tags -lxml.html.diff.is_start_tag lxml.html.diff-module.html#is_start_tag -lxml.html.diff.end_tag lxml.html.diff-module.html#end_tag -lxml.html.diff.fixup_chunks lxml.html.diff-module.html#fixup_chunks -lxml.html.diff.html_annotate lxml.html.diff-module.html#html_annotate -lxml.html.diff.cleanup_delete lxml.html.diff-module.html#cleanup_delete -lxml.html.diff.htmldiff lxml.html.diff-module.html#htmldiff -lxml.html.diff._fixup_ins_del_tags lxml.html.diff-module.html#_fixup_ins_del_tags -lxml.html.diff.htmldiff_tokens lxml.html.diff-module.html#htmldiff_tokens -lxml.html.diff.expand_tokens lxml.html.diff-module.html#expand_tokens -lxml.html.diff.__package__ lxml.html.diff-module.html#__package__ -lxml.html.diff.block_level_tags lxml.html.diff-module.html#block_level_tags -lxml.html.diff.compress_tokens lxml.html.diff-module.html#compress_tokens -lxml.html.diff.html_annotate_merge_annotations lxml.html.diff-module.html#html_annotate_merge_annotations -lxml.html.diff._merge_element_contents lxml.html.diff-module.html#_merge_element_contents -lxml.html.diff.split_words lxml.html.diff-module.html#split_words -lxml.html.diff.block_level_container_tags lxml.html.diff-module.html#block_level_container_tags -lxml.html.diff.flatten_el lxml.html.diff-module.html#flatten_el -lxml.html.diff.markup_serialize_tokens lxml.html.diff-module.html#markup_serialize_tokens -lxml.html.diff._body_re lxml.html.diff-module.html#_body_re -lxml.html.diff.locate_unbalanced_start lxml.html.diff-module.html#locate_unbalanced_start -lxml.html.diff.fixup_ins_del_tags lxml.html.diff-module.html#fixup_ins_del_tags -lxml.html.diff.default_markup lxml.html.diff-module.html#default_markup -lxml.html.diff.tokenize lxml.html.diff-module.html#tokenize -lxml.html.diff.__test__ lxml.html.diff-module.html#__test__ -lxml.html.diff.cleanup_html lxml.html.diff-module.html#cleanup_html -lxml.html.diff.split_words_re lxml.html.diff-module.html#split_words_re -lxml.html.diff.parse_html lxml.html.diff-module.html#parse_html -lxml.html.diff.merge_delete lxml.html.diff-module.html#merge_delete -lxml.html.diff.split_trailing_whitespace lxml.html.diff-module.html#split_trailing_whitespace -lxml.html.diff._ins_del_re lxml.html.diff-module.html#_ins_del_re -lxml.html.diff.locate_unbalanced_end lxml.html.diff-module.html#locate_unbalanced_end -lxml.html.diff.start_tag lxml.html.diff-module.html#start_tag -lxml.html.diff._end_body_re lxml.html.diff-module.html#_end_body_re -lxml.html.diff.is_end_tag lxml.html.diff-module.html#is_end_tag -lxml.html.diff.copy_annotations lxml.html.diff-module.html#copy_annotations -lxml.html.diff.merge_insert lxml.html.diff-module.html#merge_insert -lxml.html.diff.end_whitespace_re lxml.html.diff-module.html#end_whitespace_re -lxml.html.diff.start_whitespace_re lxml.html.diff-module.html#start_whitespace_re -lxml.html.formfill lxml.html.formfill-module.html -lxml.html.formfill._fill_single lxml.html.formfill-module.html#_fill_single -lxml.html.formfill._input_xpath lxml.html.formfill-module.html#_input_xpath -lxml.html.formfill._insert_error lxml.html.formfill-module.html#_insert_error -lxml.html.formfill._fill_form lxml.html.formfill-module.html#_fill_form -lxml.html.formfill._check lxml.html.formfill-module.html#_check -lxml.html.formfill._takes_multiple lxml.html.formfill-module.html#_takes_multiple -lxml.html.formfill.__package__ lxml.html.formfill-module.html#__package__ -lxml.html.formfill.insert_errors_html lxml.html.formfill-module.html#insert_errors_html -lxml.html.formfill._form_name_xpath lxml.html.formfill-module.html#_form_name_xpath -lxml.html.formfill._name_xpath lxml.html.formfill-module.html#_name_xpath -lxml.html.formfill.fill_form_html lxml.html.formfill-module.html#fill_form_html -lxml.html.formfill._add_class lxml.html.formfill-module.html#_add_class -lxml.html.formfill.default_error_creator lxml.html.formfill-module.html#default_error_creator -lxml.html.formfill._find_elements_for_name lxml.html.formfill-module.html#_find_elements_for_name -lxml.html.formfill._label_for_xpath lxml.html.formfill-module.html#_label_for_xpath -lxml.html.formfill._fill_multiple lxml.html.formfill-module.html#_fill_multiple -lxml.html.formfill._select lxml.html.formfill-module.html#_select -lxml.html.formfill.fill_form lxml.html.formfill-module.html#fill_form -lxml.html.formfill.insert_errors lxml.html.formfill-module.html#insert_errors -lxml.html.formfill._find_form_ids lxml.html.formfill-module.html#_find_form_ids -lxml.html.formfill._tag lxml.html.formfill-module.html#_tag -lxml.html.formfill._find_form lxml.html.formfill-module.html#_find_form -lxml.html.html5parser lxml.html.html5parser-module.html -lxml.html.html5parser.parse lxml.html.html5parser-module.html#parse -lxml.html.html5parser.html_parser lxml.html.html5parser-module.html#html_parser -lxml.html.html5parser.__package__ lxml.html.html5parser-module.html#__package__ -lxml.html.html5parser.xhtml_parser lxml.html.html5parser-module.html#xhtml_parser -lxml.html.html5parser.fragment_fromstring lxml.html.html5parser-module.html#fragment_fromstring -lxml.html.html5parser.fragments_fromstring lxml.html.html5parser-module.html#fragments_fromstring -lxml.html.html5parser.document_fromstring lxml.html.html5parser-module.html#document_fromstring -lxml.html.html5parser.fromstring lxml.html.html5parser-module.html#fromstring -lxml.html.html5parser._find_tag lxml.html.html5parser-module.html#_find_tag -lxml.html.html5parser._looks_like_url lxml.html.html5parser-module.html#_looks_like_url -lxml.html.soupparser lxml.html.soupparser-module.html -lxml.html.soupparser.parse lxml.html.soupparser-module.html#parse -lxml.html.soupparser.unichr lxml.html.soupparser-module.html#unichr -lxml.html.soupparser.handle_entities lxml.html.soupparser-module.html#handle_entities -lxml.html.soupparser.__package__ lxml.html.soupparser-module.html#__package__ -lxml.html.soupparser._parse_doctype_declaration lxml.html.soupparser-module.html#_parse_doctype_declaration -lxml.html.soupparser.convert_tree lxml.html.soupparser-module.html#convert_tree -lxml.html.soupparser._convert_tree lxml.html.soupparser-module.html#_convert_tree -lxml.html.soupparser._DECLARATION_OR_DOCTYPE lxml.html.soupparser-module.html#_DECLARATION_OR_DOCTYPE -lxml.html.soupparser.unescape lxml.html.soupparser-module.html#unescape -lxml.html.soupparser.fromstring lxml.html.soupparser-module.html#fromstring -lxml.html.soupparser._init_node_converters lxml.html.soupparser-module.html#_init_node_converters -lxml.html.soupparser._parse lxml.html.soupparser-module.html#_parse -lxml.html.usedoctest lxml.html.usedoctest-module.html -lxml.includes lxml.includes-module.html -lxml.includes.__package__ lxml.includes-module.html#__package__ -lxml.isoschematron lxml.isoschematron-module.html -lxml.isoschematron.SVRL_NS lxml.isoschematron-module.html#SVRL_NS -lxml.isoschematron.iso_svrl_for_xslt1 lxml.isoschematron-module.html#iso_svrl_for_xslt1 -lxml.isoschematron._xml_schema_root lxml.isoschematron-module.html#_xml_schema_root -lxml.isoschematron._stylesheet_param_dict lxml.isoschematron-module.html#_stylesheet_param_dict -lxml.isoschematron.svrl_validation_errors lxml.isoschematron-module.html#svrl_validation_errors -lxml.isoschematron.iso_dsdl_include lxml.isoschematron-module.html#iso_dsdl_include -lxml.isoschematron.extract_rng lxml.isoschematron-module.html#extract_rng -lxml.isoschematron._resources_dir lxml.isoschematron-module.html#_resources_dir -lxml.isoschematron.__package__ lxml.isoschematron-module.html#__package__ -lxml.isoschematron.SCHEMATRON_NS lxml.isoschematron-module.html#SCHEMATRON_NS -lxml.isoschematron._schematron_root lxml.isoschematron-module.html#_schematron_root -lxml.isoschematron.extract_xsd lxml.isoschematron-module.html#extract_xsd -lxml.isoschematron.RELAXNG_NS lxml.isoschematron-module.html#RELAXNG_NS -lxml.isoschematron.XML_SCHEMA_NS lxml.isoschematron-module.html#XML_SCHEMA_NS -lxml.isoschematron.schematron_schema_valid lxml.isoschematron-module.html#schematron_schema_valid -lxml.isoschematron.stylesheet_params lxml.isoschematron-module.html#stylesheet_params -lxml.isoschematron.iso_abstract_expand lxml.isoschematron-module.html#iso_abstract_expand -lxml.objectify lxml.objectify-module.html -lxml.objectify.enable_recursive_str lxml.objectify-module.html#enable_recursive_str -lxml.objectify.dump lxml.objectify-module.html#dump -lxml.objectify.__parseBool lxml.objectify-module.html#__parseBool -lxml.objectify.annotate lxml.objectify-module.html#annotate -lxml.objectify.set_default_parser lxml.objectify-module.html#set_default_parser -lxml.objectify.pyannotate lxml.objectify-module.html#pyannotate -lxml.objectify.getRegisteredTypes lxml.objectify-module.html#getRegisteredTypes -lxml.objectify.xsiannotate lxml.objectify-module.html#xsiannotate -lxml.objectify.PYTYPE_ATTRIBUTE lxml.objectify-module.html#PYTYPE_ATTRIBUTE -lxml.objectify.__package__ lxml.objectify-module.html#__package__ -lxml.objectify.pytypename lxml.objectify-module.html#pytypename -lxml.objectify.makeparser lxml.objectify-module.html#makeparser -lxml.objectify.XML lxml.objectify-module.html#XML -lxml.objectify.deannotate lxml.objectify-module.html#deannotate -lxml.objectify.E lxml.objectify-module.html#E -lxml.objectify.Element lxml.objectify-module.html#Element -lxml.objectify.__test__ lxml.objectify-module.html#__test__ -lxml.objectify.__unpickleElementTree lxml.objectify-module.html#__unpickleElementTree -lxml.objectify.__lower_bool lxml.objectify-module.html#__lower_bool -lxml.objectify.parse lxml.objectify-module.html#parse -lxml.objectify.set_pytype_attribute_tag lxml.objectify-module.html#set_pytype_attribute_tag -lxml.objectify.__checkBool lxml.objectify-module.html#__checkBool -lxml.objectify.fromstring lxml.objectify-module.html#fromstring -lxml.objectify.DataElement lxml.objectify-module.html#DataElement -lxml.objectify.SubElement lxml.objectify-module.html#SubElement -lxml.pyclasslookup lxml.pyclasslookup-module.html -lxml.pyclasslookup.__package__ lxml.pyclasslookup-module.html#__package__ -lxml.sax lxml.sax-module.html -lxml.sax.Comment lxml.etree-module.html#Comment -lxml.sax.ProcessingInstruction lxml.etree-module.html#PI -lxml.sax.SubElement lxml.etree-module.html#SubElement -lxml.sax.__package__ lxml.sax-module.html#__package__ -lxml.sax.saxify lxml.sax-module.html#saxify -lxml.sax._getNsTag lxml.sax-module.html#_getNsTag -lxml.sax.ElementTree lxml.etree-module.html#ElementTree -lxml.tests lxml.tests-module.html -lxml.tests.__package__ lxml.tests-module.html#__package__ -lxml.tests.common_imports lxml.tests.common_imports-module.html -lxml.tests.common_imports.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.common_imports._str lxml.tests.common_imports-module.html#_str -lxml.tests.common_imports.IS_PYTHON3 lxml.tests.common_imports-module.html#IS_PYTHON3 -lxml.tests.common_imports.IS_PYTHON2 lxml.tests.common_imports-module.html#IS_PYTHON2 -lxml.tests.common_imports._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.common_imports.canonicalize lxml.tests.common_imports-module.html#canonicalize -lxml.tests.common_imports._fix_unicode lxml.tests.common_imports-module.html#_fix_unicode -lxml.tests.common_imports.write_to_file lxml.tests.common_imports-module.html#write_to_file -lxml.tests.common_imports.unichr_escape lxml.tests.common_imports-module.html#unichr_escape -lxml.tests.common_imports.__package__ lxml.tests.common_imports-module.html#__package__ -lxml.tests.common_imports.filter_by_version lxml.tests.common_imports-module.html#filter_by_version -lxml.tests.common_imports._get_caller_relative_path lxml.tests.common_imports-module.html#_get_caller_relative_path -lxml.tests.common_imports.unentitify lxml.tests.common_imports-module.html#unentitify -lxml.tests.common_imports.doctest_parser lxml.tests.common_imports-module.html#doctest_parser -lxml.tests.common_imports.fileUrlInTestDir lxml.tests.common_imports-module.html#fileUrlInTestDir -lxml.tests.common_imports._fix_bytes lxml.tests.common_imports-module.html#_fix_bytes -lxml.tests.common_imports.path2url lxml.tests.common_imports-module.html#path2url -lxml.tests.common_imports._fix_exceptions lxml.tests.common_imports-module.html#_fix_exceptions -lxml.tests.common_imports.make_version_tuple lxml.tests.common_imports-module.html#make_version_tuple -lxml.tests.common_imports.ET_VERSION lxml.tests.common_imports-module.html#ET_VERSION -lxml.tests.common_imports.read_file lxml.tests.common_imports-module.html#read_file -lxml.tests.common_imports.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.common_imports.IS_PYPY lxml.tests.common_imports-module.html#IS_PYPY -lxml.tests.common_imports.CET_VERSION lxml.tests.common_imports-module.html#CET_VERSION -lxml.tests.common_imports._fix_traceback lxml.tests.common_imports-module.html#_fix_traceback -lxml.tests.common_imports.readFileInTestDir lxml.tests.common_imports-module.html#readFileInTestDir -lxml.tests.dummy_http_server lxml.tests.dummy_http_server-module.html -lxml.tests.dummy_http_server.build_web_server lxml.tests.dummy_http_server-module.html#build_web_server -lxml.tests.dummy_http_server.webserver lxml.tests.dummy_http_server-module.html#webserver -lxml.tests.dummy_http_server.__package__ lxml.tests.dummy_http_server-module.html#__package__ -lxml.tests.selftest lxml.tests.selftest-module.html -lxml.tests.selftest.bad_find lxml.tests.selftest-module.html#bad_find -lxml.tests.selftest.encoding lxml.tests.selftest-module.html#encoding -lxml.tests.selftest.serialize lxml.tests.selftest-module.html#serialize -lxml.tests.selftest.parseliteral lxml.tests.selftest-module.html#parseliteral -lxml.tests.selftest.check_element lxml.tests.selftest-module.html#check_element -lxml.tests.selftest.ENTITY_XML lxml.tests.selftest-module.html#ENTITY_XML -lxml.tests.selftest.XINCLUDE lxml.tests.selftest-module.html#XINCLUDE -lxml.tests.selftest.find lxml.tests.selftest-module.html#find -lxml.tests.selftest.bug_xmltoolkit28 lxml.tests.selftest-module.html#bug_xmltoolkit28 -lxml.tests.selftest.check_element_tree lxml.tests.selftest-module.html#check_element_tree -lxml.tests.selftest.fix_compatibility lxml.tests.selftest-module.html#fix_compatibility -lxml.tests.selftest.SAMPLE_XML lxml.tests.selftest-module.html#SAMPLE_XML -lxml.tests.selftest.check_string_or_none lxml.tests.selftest-module.html#check_string_or_none -lxml.tests.selftest.stdout lxml.tests.selftest-module.html#stdout -lxml.tests.selftest.namespace lxml.tests.selftest-module.html#namespace -lxml.tests.selftest.bug_xmltoolkit25 lxml.tests.selftest-module.html#bug_xmltoolkit25 -lxml.tests.selftest.__package__ lxml.tests.selftest-module.html#__package__ -lxml.tests.selftest.parsefile lxml.tests.selftest-module.html#parsefile -lxml.tests.selftest.normalize_crlf lxml.tests.selftest-module.html#normalize_crlf -lxml.tests.selftest.summarize_list lxml.tests.selftest-module.html#summarize_list -lxml.tests.selftest.simpleops lxml.tests.selftest-module.html#simpleops -lxml.tests.selftest.xinclude_loader lxml.tests.selftest-module.html#xinclude_loader -lxml.tests.selftest.iterators lxml.tests.selftest-module.html#iterators -lxml.tests.selftest.summarize lxml.tests.selftest-module.html#summarize -lxml.tests.selftest.writefile lxml.tests.selftest-module.html#writefile -lxml.tests.selftest.xinclude_default lxml.tests.selftest-module.html#xinclude_default -lxml.tests.selftest.interface lxml.tests.selftest-module.html#interface -lxml.tests.selftest.check_mapping lxml.tests.selftest-module.html#check_mapping -lxml.tests.selftest.xinclude lxml.tests.selftest-module.html#xinclude -lxml.tests.selftest.writestring lxml.tests.selftest-module.html#writestring -lxml.tests.selftest.check_string lxml.tests.selftest-module.html#check_string -lxml.tests.selftest.qname lxml.tests.selftest-module.html#qname -lxml.tests.selftest.iterparse lxml.tests.selftest-module.html#iterparse -lxml.tests.selftest.xpath_tokenizer lxml.tests.selftest-module.html#xpath_tokenizer -lxml.tests.selftest2 lxml.tests.selftest2-module.html -lxml.tests.selftest2.stdout lxml.tests.selftest2-module.html#stdout -lxml.tests.selftest2.serialize lxml.tests.selftest2-module.html#serialize -lxml.tests.selftest2.check_element lxml.tests.selftest2-module.html#check_element -lxml.tests.selftest2.ENTITY_XML lxml.tests.selftest2-module.html#ENTITY_XML -lxml.tests.selftest2.find lxml.tests.selftest2-module.html#find -lxml.tests.selftest2.summarize lxml.tests.selftest2-module.html#summarize -lxml.tests.selftest2.check_element_tree lxml.tests.selftest2-module.html#check_element_tree -lxml.tests.selftest2.SAMPLE_XML lxml.tests.selftest2-module.html#SAMPLE_XML -lxml.tests.selftest2.encoding lxml.tests.selftest2-module.html#encoding -lxml.tests.selftest2.unserialize lxml.tests.selftest2-module.html#unserialize -lxml.tests.selftest2.__package__ lxml.tests.selftest2-module.html#__package__ -lxml.tests.selftest2.parsefile lxml.tests.selftest2-module.html#parsefile -lxml.tests.selftest2.SAMPLE_XML_NS lxml.tests.selftest2-module.html#SAMPLE_XML_NS -lxml.tests.selftest2.summarize_list lxml.tests.selftest2-module.html#summarize_list -lxml.tests.selftest2.makeelement lxml.tests.selftest2-module.html#makeelement -lxml.tests.selftest2.writefile lxml.tests.selftest2-module.html#writefile -lxml.tests.selftest2.cdata lxml.tests.selftest2-module.html#cdata -lxml.tests.selftest2.check_mapping lxml.tests.selftest2-module.html#check_mapping -lxml.tests.selftest2.copy lxml.tests.selftest2-module.html#copy -lxml.tests.selftest2.check_string lxml.tests.selftest2-module.html#check_string -lxml.tests.selftest2.qname lxml.tests.selftest2-module.html#qname -lxml.tests.selftest2.element lxml.tests.selftest2-module.html#element -lxml.tests.selftest2.attrib lxml.tests.selftest2-module.html#attrib -lxml.tests.test_builder lxml.tests.test_builder-module.html -lxml.tests.test_builder.__package__ lxml.tests.test_builder-module.html#__package__ -lxml.tests.test_builder._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_builder.test_suite lxml.tests.test_builder-module.html#test_suite -lxml.tests.test_builder.this_dir lxml.tests.test_builder-module.html#this_dir -lxml.tests.test_classlookup lxml.tests.test_classlookup-module.html -lxml.tests.test_classlookup.xml_str lxml.tests.test_classlookup-module.html#xml_str -lxml.tests.test_classlookup.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_classlookup._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_classlookup.__package__ lxml.tests.test_classlookup-module.html#__package__ -lxml.tests.test_classlookup.this_dir lxml.tests.test_classlookup-module.html#this_dir -lxml.tests.test_classlookup._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_classlookup.test_suite lxml.tests.test_classlookup-module.html#test_suite -lxml.tests.test_classlookup.canonicalize lxml.tests.common_imports-module.html#canonicalize -lxml.tests.test_css lxml.tests.test_css-module.html -lxml.tests.test_css.__package__ lxml.tests.test_css-module.html#__package__ -lxml.tests.test_css.HTML lxml.tests.test_css-module.html#HTML -lxml.tests.test_css.test_suite lxml.tests.test_css-module.html#test_suite -lxml.tests.test_doctestcompare lxml.tests.test_doctestcompare-module.html -lxml.tests.test_doctestcompare.__package__ lxml.tests.test_doctestcompare-module.html#__package__ -lxml.tests.test_doctestcompare.test_suite lxml.tests.test_doctestcompare-module.html#test_suite -lxml.tests.test_doctestcompare.indent lxml.tests.test_doctestcompare-module.html#indent -lxml.tests.test_dtd lxml.tests.test_dtd-module.html -lxml.tests.test_dtd.fileUrlInTestDir lxml.tests.common_imports-module.html#fileUrlInTestDir -lxml.tests.test_dtd.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_dtd._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_dtd.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_dtd.__package__ lxml.tests.test_dtd-module.html#__package__ -lxml.tests.test_dtd._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_dtd.test_suite lxml.tests.test_dtd-module.html#test_suite -lxml.tests.test_dtd.this_dir lxml.tests.test_dtd-module.html#this_dir -lxml.tests.test_elementpath lxml.tests.test_elementpath-module.html -lxml.tests.test_elementpath.__package__ lxml.tests.test_elementpath-module.html#__package__ -lxml.tests.test_elementpath.test_suite lxml.tests.test_elementpath-module.html#test_suite -lxml.tests.test_elementpath.summarize lxml.tests.test_elementpath-module.html#summarize -lxml.tests.test_elementpath.normalize_crlf lxml.tests.test_elementpath-module.html#normalize_crlf -lxml.tests.test_elementpath.summarize_list lxml.tests.test_elementpath-module.html#summarize_list -lxml.tests.test_elementtree lxml.tests.test_elementtree-module.html -lxml.tests.test_elementtree.ElementTreePullTestCase lxml.tests.test_elementtree-module.html#ElementTreePullTestCase -lxml.tests.test_elementtree._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_elementtree.canonicalize lxml.tests.common_imports-module.html#canonicalize -lxml.tests.test_elementtree._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_elementtree.next lxml.tests.common_imports-module.html#next -lxml.tests.test_elementtree.__package__ lxml.tests.test_elementtree-module.html#__package__ -lxml.tests.test_elementtree.filter_by_version lxml.tests.common_imports-module.html#filter_by_version -lxml.tests.test_elementtree.this_dir lxml.tests.test_elementtree-module.html#this_dir -lxml.tests.test_elementtree.cElementTree lxml.tests.test_elementtree-module.html#cElementTree -lxml.tests.test_elementtree.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_elementtree.test_suite lxml.tests.test_elementtree-module.html#test_suite -lxml.tests.test_errors lxml.tests.test_errors-module.html -lxml.tests.test_errors.__package__ lxml.tests.test_errors-module.html#__package__ -lxml.tests.test_errors.test_suite lxml.tests.test_errors-module.html#test_suite -lxml.tests.test_errors.this_dir lxml.tests.test_errors-module.html#this_dir -lxml.tests.test_etree lxml.tests.test_etree-module.html -lxml.tests.test_etree.tmpfile lxml.tests.test_etree-module.html#tmpfile -lxml.tests.test_etree.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_etree._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_etree.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_etree._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_etree.canonicalize lxml.tests.common_imports-module.html#canonicalize -lxml.tests.test_etree.__package__ lxml.tests.test_etree-module.html#__package__ -lxml.tests.test_etree.fileUrlInTestDir lxml.tests.common_imports-module.html#fileUrlInTestDir -lxml.tests.test_etree.path2url lxml.tests.common_imports-module.html#path2url -lxml.tests.test_etree.read_file lxml.tests.common_imports-module.html#read_file -lxml.tests.test_etree.test_suite lxml.tests.test_etree-module.html#test_suite -lxml.tests.test_external_document lxml.tests.test_external_document-module.html -lxml.tests.test_external_document.__package__ lxml.tests.test_external_document-module.html#__package__ -lxml.tests.test_external_document.DOC_NAME lxml.tests.test_external_document-module.html#DOC_NAME -lxml.tests.test_external_document.test_suite lxml.tests.test_external_document-module.html#test_suite -lxml.tests.test_external_document.DESTRUCTOR_NAME lxml.tests.test_external_document-module.html#DESTRUCTOR_NAME -lxml.tests.test_htmlparser lxml.tests.test_htmlparser-module.html -lxml.tests.test_htmlparser.write_to_file lxml.tests.common_imports-module.html#write_to_file -lxml.tests.test_htmlparser._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_htmlparser.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_htmlparser.__package__ lxml.tests.test_htmlparser-module.html#__package__ -lxml.tests.test_htmlparser.this_dir lxml.tests.test_htmlparser-module.html#this_dir -lxml.tests.test_htmlparser._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_htmlparser.test_suite lxml.tests.test_htmlparser-module.html#test_suite -lxml.tests.test_htmlparser.next lxml.tests.common_imports-module.html#next -lxml.tests.test_http_io lxml.tests.test_http_io-module.html -lxml.tests.test_http_io.webserver lxml.tests.dummy_http_server-module.html#webserver -lxml.tests.test_http_io._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_http_io.__package__ lxml.tests.test_http_io-module.html#__package__ -lxml.tests.test_http_io.this_dir lxml.tests.test_http_io-module.html#this_dir -lxml.tests.test_http_io.test_suite lxml.tests.test_http_io-module.html#test_suite -lxml.tests.test_incremental_xmlfile lxml.tests.test_incremental_xmlfile-module.html -lxml.tests.test_incremental_xmlfile._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_incremental_xmlfile.this_dir lxml.tests.test_incremental_xmlfile-module.html#this_dir -lxml.tests.test_incremental_xmlfile.__package__ lxml.tests.test_incremental_xmlfile-module.html#__package__ -lxml.tests.test_incremental_xmlfile.test_suite lxml.tests.test_incremental_xmlfile-module.html#test_suite -lxml.tests.test_io lxml.tests.test_io-module.html -lxml.tests.test_io._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_io._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_io.read_file lxml.tests.common_imports-module.html#read_file -lxml.tests.test_io.this_dir lxml.tests.test_io-module.html#this_dir -lxml.tests.test_io.__package__ lxml.tests.test_io-module.html#__package__ -lxml.tests.test_io.write_to_file lxml.tests.common_imports-module.html#write_to_file -lxml.tests.test_io.test_suite lxml.tests.test_io-module.html#test_suite -lxml.tests.test_isoschematron lxml.tests.test_isoschematron-module.html -lxml.tests.test_isoschematron.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_isoschematron.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_isoschematron.__package__ lxml.tests.test_isoschematron-module.html#__package__ -lxml.tests.test_isoschematron.test_suite lxml.tests.test_isoschematron-module.html#test_suite -lxml.tests.test_isoschematron.this_dir lxml.tests.test_isoschematron-module.html#this_dir -lxml.tests.test_nsclasses lxml.tests.test_nsclasses-module.html -lxml.tests.test_nsclasses.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_nsclasses.__package__ lxml.tests.test_nsclasses-module.html#__package__ -lxml.tests.test_nsclasses._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_nsclasses.test_suite lxml.tests.test_nsclasses-module.html#test_suite -lxml.tests.test_nsclasses.this_dir lxml.tests.test_nsclasses-module.html#this_dir -lxml.tests.test_objectify lxml.tests.test_objectify-module.html -lxml.tests.test_objectify.xsitype2objclass lxml.tests.test_objectify-module.html#xsitype2objclass -lxml.tests.test_objectify.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_objectify._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_objectify._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_objectify.PYTYPE_NAMESPACE lxml.tests.test_objectify-module.html#PYTYPE_NAMESPACE -lxml.tests.test_objectify.canonicalize lxml.tests.common_imports-module.html#canonicalize -lxml.tests.test_objectify.pytype2objclass lxml.tests.test_objectify-module.html#pytype2objclass -lxml.tests.test_objectify.xml_str lxml.tests.test_objectify-module.html#xml_str -lxml.tests.test_objectify.DEFAULT_NSMAP lxml.tests.test_objectify-module.html#DEFAULT_NSMAP -lxml.tests.test_objectify.XML_SCHEMA_NS lxml.tests.test_objectify-module.html#XML_SCHEMA_NS -lxml.tests.test_objectify.TREE_PYTYPE lxml.tests.test_objectify-module.html#TREE_PYTYPE -lxml.tests.test_objectify.__package__ lxml.tests.test_objectify-module.html#__package__ -lxml.tests.test_objectify.XML_SCHEMA_INSTANCE_TYPE_ATTR lxml.tests.test_objectify-module.html#XML_SCHEMA_INSTANCE_TYPE_ATTR -lxml.tests.test_objectify.XML_SCHEMA_NIL_ATTR lxml.tests.test_objectify-module.html#XML_SCHEMA_NIL_ATTR -lxml.tests.test_objectify.this_dir lxml.tests.test_objectify-module.html#this_dir -lxml.tests.test_objectify.XML_SCHEMA_INSTANCE_NS lxml.tests.test_objectify-module.html#XML_SCHEMA_INSTANCE_NS -lxml.tests.test_objectify.objectclass2xsitype lxml.tests.test_objectify-module.html#objectclass2xsitype -lxml.tests.test_objectify.v lxml.tests.test_objectify-module.html#v -lxml.tests.test_objectify.objectclass2pytype lxml.tests.test_objectify-module.html#objectclass2pytype -lxml.tests.test_objectify.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_objectify.test_suite lxml.tests.test_objectify-module.html#test_suite -lxml.tests.test_pyclasslookup lxml.tests.test_pyclasslookup-module.html -lxml.tests.test_pyclasslookup.xml_str lxml.tests.test_pyclasslookup-module.html#xml_str -lxml.tests.test_pyclasslookup.this_dir lxml.tests.test_pyclasslookup-module.html#this_dir -lxml.tests.test_pyclasslookup.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_pyclasslookup.__package__ lxml.tests.test_pyclasslookup-module.html#__package__ -lxml.tests.test_pyclasslookup._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_pyclasslookup.test_suite lxml.tests.test_pyclasslookup-module.html#test_suite -lxml.tests.test_pyclasslookup.canonicalize lxml.tests.common_imports-module.html#canonicalize -lxml.tests.test_relaxng lxml.tests.test_relaxng-module.html -lxml.tests.test_relaxng.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_relaxng.rnc2rng lxml.tests.test_relaxng-module.html#rnc2rng -lxml.tests.test_relaxng.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_relaxng.__package__ lxml.tests.test_relaxng-module.html#__package__ -lxml.tests.test_relaxng.this_dir lxml.tests.test_relaxng-module.html#this_dir -lxml.tests.test_relaxng._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_relaxng.test_suite lxml.tests.test_relaxng-module.html#test_suite -lxml.tests.test_sax lxml.tests.test_sax-module.html -lxml.tests.test_sax.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_sax.__package__ lxml.tests.test_sax-module.html#__package__ -lxml.tests.test_sax._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_sax.test_suite lxml.tests.test_sax-module.html#test_suite -lxml.tests.test_sax.this_dir lxml.tests.test_sax-module.html#this_dir -lxml.tests.test_schematron lxml.tests.test_schematron-module.html -lxml.tests.test_schematron.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_schematron.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_schematron.__package__ lxml.tests.test_schematron-module.html#__package__ -lxml.tests.test_schematron.test_suite lxml.tests.test_schematron-module.html#test_suite -lxml.tests.test_schematron.this_dir lxml.tests.test_schematron-module.html#this_dir -lxml.tests.test_threading lxml.tests.test_threading-module.html -lxml.tests.test_threading.__package__ lxml.tests.test_threading-module.html#__package__ -lxml.tests.test_threading._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_threading.test_suite lxml.tests.test_threading-module.html#test_suite -lxml.tests.test_threading.this_dir lxml.tests.test_threading-module.html#this_dir -lxml.tests.test_unicode lxml.tests.test_unicode-module.html -lxml.tests.test_unicode._chr lxml.tests.test_unicode-module.html#_chr -lxml.tests.test_unicode.uxml lxml.tests.test_unicode-module.html#uxml -lxml.tests.test_unicode.invalid_tag lxml.tests.test_unicode-module.html#invalid_tag -lxml.tests.test_unicode._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_unicode.__package__ lxml.tests.test_unicode-module.html#__package__ -lxml.tests.test_unicode.this_dir lxml.tests.test_unicode-module.html#this_dir -lxml.tests.test_unicode._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_unicode.klingon lxml.tests.test_unicode-module.html#klingon -lxml.tests.test_unicode.test_suite lxml.tests.test_unicode-module.html#test_suite -lxml.tests.test_unicode.uni lxml.tests.test_unicode-module.html#uni -lxml.tests.test_unicode.ascii_uni lxml.tests.test_unicode-module.html#ascii_uni -lxml.tests.test_xmlschema lxml.tests.test_xmlschema-module.html -lxml.tests.test_xmlschema.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_xmlschema.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_xmlschema.__package__ lxml.tests.test_xmlschema-module.html#__package__ -lxml.tests.test_xmlschema.test_suite lxml.tests.test_xmlschema-module.html#test_suite -lxml.tests.test_xmlschema.this_dir lxml.tests.test_xmlschema-module.html#this_dir -lxml.tests.test_xpathevaluator lxml.tests.test_xpathevaluator-module.html -lxml.tests.test_xpathevaluator.argsTest1 lxml.tests.test_xpathevaluator-module.html#argsTest1 -lxml.tests.test_xpathevaluator.argsTest2 lxml.tests.test_xpathevaluator-module.html#argsTest2 -lxml.tests.test_xpathevaluator.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_xpathevaluator.tag lxml.tests.test_xpathevaluator-module.html#tag -lxml.tests.test_xpathevaluator.stringTest lxml.tests.test_xpathevaluator-module.html#stringTest -lxml.tests.test_xpathevaluator._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_xpathevaluator.booleanTest lxml.tests.test_xpathevaluator-module.html#booleanTest -lxml.tests.test_xpathevaluator.this_dir lxml.tests.test_xpathevaluator-module.html#this_dir -lxml.tests.test_xpathevaluator.setTest lxml.tests.test_xpathevaluator-module.html#setTest -lxml.tests.test_xpathevaluator.resultTypesTest2 lxml.tests.test_xpathevaluator-module.html#resultTypesTest2 -lxml.tests.test_xpathevaluator.SAMPLE_XML lxml.tests.test_xpathevaluator-module.html#SAMPLE_XML -lxml.tests.test_xpathevaluator.__package__ lxml.tests.test_xpathevaluator-module.html#__package__ -lxml.tests.test_xpathevaluator.test_suite lxml.tests.test_xpathevaluator-module.html#test_suite -lxml.tests.test_xpathevaluator.floatTest lxml.tests.test_xpathevaluator-module.html#floatTest -lxml.tests.test_xpathevaluator.stringListTest lxml.tests.test_xpathevaluator-module.html#stringListTest -lxml.tests.test_xpathevaluator.xpath lxml.tests.test_xpathevaluator-module.html#xpath -lxml.tests.test_xpathevaluator.tag_or_value lxml.tests.test_xpathevaluator-module.html#tag_or_value -lxml.tests.test_xpathevaluator.resultTypesTest lxml.tests.test_xpathevaluator-module.html#resultTypesTest -lxml.tests.test_xpathevaluator.extension lxml.tests.test_xpathevaluator-module.html#extension -lxml.tests.test_xpathevaluator.uri lxml.tests.test_xpathevaluator-module.html#uri -lxml.tests.test_xpathevaluator.setTest2 lxml.tests.test_xpathevaluator-module.html#setTest2 -lxml.tests.test_xslt lxml.tests.test_xslt-module.html -lxml.tests.test_xslt.make_doctest lxml.tests.common_imports-module.html#make_doctest -lxml.tests.test_xslt._str lxml.tests.common_imports-module.html#_str -lxml.tests.test_xslt._bytes lxml.tests.common_imports-module.html#_bytes -lxml.tests.test_xslt.this_dir lxml.tests.test_xslt-module.html#this_dir -lxml.tests.test_xslt.__package__ lxml.tests.test_xslt-module.html#__package__ -lxml.tests.test_xslt.is_python3 lxml.tests.test_xslt-module.html#is_python3 -lxml.tests.test_xslt.fileInTestDir lxml.tests.common_imports-module.html#fileInTestDir -lxml.tests.test_xslt.test_suite lxml.tests.test_xslt-module.html#test_suite -lxml.usedoctest lxml.usedoctest-module.html -xml.etree.ElementTree xml.etree.ElementTree-module.html -xml.etree.ElementTree.XMLID xml.etree.ElementTree-module.html#XMLID -xml.etree.ElementTree.register_namespace xml.etree.ElementTree-module.html#register_namespace -xml.etree.ElementTree.dump xml.etree.ElementTree-module.html#dump -xml.etree.ElementTree._raise_serialization_error xml.etree.ElementTree-module.html#_raise_serialization_error -xml.etree.ElementTree.HTML_EMPTY xml.etree.ElementTree-module.html#HTML_EMPTY -xml.etree.ElementTree._serialize_text xml.etree.ElementTree-module.html#_serialize_text -xml.etree.ElementTree.parse xml.etree.ElementTree-module.html#parse -xml.etree.ElementTree._encode xml.etree.ElementTree-module.html#_encode -xml.etree.ElementTree._namespace_map xml.etree.ElementTree-module.html#_namespace_map -xml.etree.ElementTree.__package__ xml.etree.ElementTree-module.html#__package__ -xml.etree.ElementTree._serialize xml.etree.ElementTree-module.html#_serialize -xml.etree.ElementTree._serialize_xml xml.etree.ElementTree-module.html#_serialize_xml -xml.etree.ElementTree.PI xml.etree.ElementTree-module.html#PI -xml.etree.ElementTree._escape_attrib xml.etree.ElementTree-module.html#_escape_attrib -xml.etree.ElementTree.XML xml.etree.ElementTree-module.html#XML -xml.etree.ElementTree._namespaces xml.etree.ElementTree-module.html#_namespaces -xml.etree.ElementTree._escape_cdata xml.etree.ElementTree-module.html#_escape_cdata -xml.etree.ElementTree._serialize_html xml.etree.ElementTree-module.html#_serialize_html -xml.etree.ElementTree._escape_attrib_html xml.etree.ElementTree-module.html#_escape_attrib_html -xml.etree.ElementTree.VERSION xml.etree.ElementTree-module.html#VERSION -xml.etree.ElementTree.tostring xml.etree.ElementTree-module.html#tostring -xml.etree.ElementTree.fromstringlist xml.etree.ElementTree-module.html#fromstringlist -xml.etree.ElementTree.iselement xml.etree.ElementTree-module.html#iselement -xml.etree.ElementTree.Comment xml.etree.ElementTree-module.html#Comment -xml.etree.ElementTree.ProcessingInstruction xml.etree.ElementTree-module.html#ProcessingInstruction -xml.etree.ElementTree.tostringlist xml.etree.ElementTree-module.html#tostringlist -xml.etree.ElementTree.fromstring xml.etree.ElementTree-module.html#fromstring -xml.etree.ElementTree.iterparse xml.etree.ElementTree-module.html#iterparse -xml.etree.ElementTree.SubElement xml.etree.ElementTree-module.html#SubElement -abc.ABCMeta abc.ABCMeta-class.html -abc.ABCMeta.__new__ abc.ABCMeta-class.html#__new__ -abc.ABCMeta._abc_invalidation_counter abc.ABCMeta-class.html#_abc_invalidation_counter -abc.ABCMeta.__instancecheck__ abc.ABCMeta-class.html#__instancecheck__ -abc.ABCMeta.__subclasscheck__ abc.ABCMeta-class.html#__subclasscheck__ -abc.ABCMeta.register abc.ABCMeta-class.html#register -abc.ABCMeta._dump_registry abc.ABCMeta-class.html#_dump_registry -cssselect.parser.SelectorError cssselect.parser.SelectorError-class.html -cssselect.parser.SelectorSyntaxError cssselect.parser.SelectorSyntaxError-class.html -cssselect.xpath.ExpressionError cssselect.xpath.ExpressionError-class.html -cssselect.xpath.XPathExpr cssselect.xpath.XPathExpr-class.html -cssselect.xpath.XPathExpr.add_star_prefix cssselect.xpath.XPathExpr-class.html#add_star_prefix -cssselect.xpath.XPathExpr.join cssselect.xpath.XPathExpr-class.html#join -cssselect.xpath.XPathExpr.__str__ cssselect.xpath.XPathExpr-class.html#__str__ -cssselect.xpath.XPathExpr.add_name_test cssselect.xpath.XPathExpr-class.html#add_name_test -cssselect.xpath.XPathExpr.__repr__ cssselect.xpath.XPathExpr-class.html#__repr__ -cssselect.xpath.XPathExpr.add_condition cssselect.xpath.XPathExpr-class.html#add_condition -cssselect.xpath.XPathExpr.__init__ cssselect.xpath.XPathExpr-class.html#__init__ -exceptions.AssertionError exceptions.AssertionError-class.html -exceptions.AssertionError.__init__ exceptions.AssertionError-class.html#__init__ -exceptions.AssertionError.__new__ exceptions.AssertionError-class.html#__new__ -lxml.ElementInclude.FatalIncludeError lxml.ElementInclude.FatalIncludeError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.LxmlError.__new__ lxml.etree.LxmlError-class.html#__new__ -lxml.etree.LxmlSyntaxError.__qualname__ lxml.etree.LxmlSyntaxError-class.html#__qualname__ -lxml.builder.ElementMaker lxml.builder.ElementMaker-class.html -lxml.builder.ElementMaker._namespace lxml.builder.ElementMaker-class.html#_namespace -lxml.builder.ElementMaker._typemap lxml.builder.ElementMaker-class.html#_typemap -lxml.builder.ElementMaker.__new__ lxml.builder.ElementMaker-class.html#__new__ -lxml.builder.ElementMaker.__setstate__ lxml.builder.ElementMaker-class.html#__setstate__ -lxml.builder.ElementMaker.__reduce__ lxml.builder.ElementMaker-class.html#__reduce__ -lxml.builder.ElementMaker.__getattribute__ lxml.builder.ElementMaker-class.html#__getattribute__ -lxml.builder.ElementMaker.__getattr__ lxml.builder.ElementMaker-class.html#__getattr__ -lxml.builder.ElementMaker._makeelement lxml.builder.ElementMaker-class.html#_makeelement -lxml.builder.ElementMaker.__init__ lxml.builder.ElementMaker-class.html#__init__ -lxml.builder.ElementMaker.__call__ lxml.builder.ElementMaker-class.html#__call__ -lxml.builder.ElementMaker._nsmap lxml.builder.ElementMaker-class.html#_nsmap -lxml.cssselect.CSSSelector lxml.cssselect.CSSSelector-class.html -lxml.etree.XPath.__new__ lxml.etree.XPath-class.html#__new__ -lxml.etree._XPathEvaluatorBase.evaluate lxml.etree._XPathEvaluatorBase-class.html#evaluate -lxml.etree._XPathEvaluatorBase.error_log lxml.etree._XPathEvaluatorBase-class.html#error_log -lxml.cssselect.CSSSelector.__repr__ lxml.cssselect.CSSSelector-class.html#__repr__ -lxml.etree.XPath.__call__ lxml.etree.XPath-class.html#__call__ -lxml.etree.XPath.path lxml.etree.XPath-class.html#path -lxml.cssselect.CSSSelector.__init__ lxml.cssselect.CSSSelector-class.html#__init__ -lxml.cssselect.LxmlHTMLTranslator lxml.cssselect.LxmlHTMLTranslator-class.html -lxml.cssselect.LxmlTranslator.xpath_contains_function lxml.cssselect.LxmlTranslator-class.html#xpath_contains_function -cssselect.xpath.GenericTranslator.xpathexpr_cls cssselect.xpath.XPathExpr-class.html -lxml.cssselect.LxmlTranslator lxml.cssselect.LxmlTranslator-class.html -lxml.cssselect.LxmlTranslator.xpath_contains_function lxml.cssselect.LxmlTranslator-class.html#xpath_contains_function -cssselect.xpath.GenericTranslator.xpathexpr_cls cssselect.xpath.XPathExpr-class.html -lxml.doctestcompare.LHTMLOutputChecker lxml.doctestcompare.LHTMLOutputChecker-class.html -lxml.doctestcompare.LXMLOutputChecker.collect_diff_end_tag lxml.doctestcompare.LXMLOutputChecker-class.html#collect_diff_end_tag -lxml.doctestcompare.LXMLOutputChecker.text_compare lxml.doctestcompare.LXMLOutputChecker-class.html#text_compare -lxml.doctestcompare.LHTMLOutputChecker.get_default_parser lxml.doctestcompare.LHTMLOutputChecker-class.html#get_default_parser -lxml.doctestcompare.LXMLOutputChecker.collect_diff_tag lxml.doctestcompare.LXMLOutputChecker-class.html#collect_diff_tag -lxml.doctestcompare.LXMLOutputChecker.collect_diff_text lxml.doctestcompare.LXMLOutputChecker-class.html#collect_diff_text -lxml.doctestcompare.LXMLOutputChecker.get_parser lxml.doctestcompare.LXMLOutputChecker-class.html#get_parser -lxml.doctestcompare.LXMLOutputChecker.collect_diff lxml.doctestcompare.LXMLOutputChecker-class.html#collect_diff -lxml.doctestcompare.LXMLOutputChecker.html_empty_tag lxml.doctestcompare.LXMLOutputChecker-class.html#html_empty_tag -lxml.doctestcompare.LXMLOutputChecker._looks_like_markup lxml.doctestcompare.LXMLOutputChecker-class.html#_looks_like_markup -lxml.doctestcompare.LXMLOutputChecker.format_tag lxml.doctestcompare.LXMLOutputChecker-class.html#format_tag -lxml.doctestcompare.LXMLOutputChecker.check_output lxml.doctestcompare.LXMLOutputChecker-class.html#check_output -lxml.doctestcompare.LXMLOutputChecker.compare_docs lxml.doctestcompare.LXMLOutputChecker-class.html#compare_docs -lxml.doctestcompare.LXMLOutputChecker.format_doc lxml.doctestcompare.LXMLOutputChecker-class.html#format_doc -lxml.doctestcompare.LXMLOutputChecker.output_difference lxml.doctestcompare.LXMLOutputChecker-class.html#output_difference -lxml.doctestcompare.LXMLOutputChecker.format_end_tag lxml.doctestcompare.LXMLOutputChecker-class.html#format_end_tag -lxml.doctestcompare.LXMLOutputChecker.format_text lxml.doctestcompare.LXMLOutputChecker-class.html#format_text -lxml.doctestcompare.LXMLOutputChecker.empty_tags lxml.doctestcompare.LXMLOutputChecker-class.html#empty_tags -lxml.doctestcompare.LXMLOutputChecker.tag_compare lxml.doctestcompare.LXMLOutputChecker-class.html#tag_compare -lxml.doctestcompare.LXMLOutputChecker lxml.doctestcompare.LXMLOutputChecker-class.html -lxml.doctestcompare.LXMLOutputChecker.text_compare lxml.doctestcompare.LXMLOutputChecker-class.html#text_compare -lxml.doctestcompare.LXMLOutputChecker._looks_like_markup lxml.doctestcompare.LXMLOutputChecker-class.html#_looks_like_markup -lxml.doctestcompare.LXMLOutputChecker.empty_tags lxml.doctestcompare.LXMLOutputChecker-class.html#empty_tags -lxml.doctestcompare.LXMLOutputChecker.collect_diff_tag lxml.doctestcompare.LXMLOutputChecker-class.html#collect_diff_tag -lxml.doctestcompare.LXMLOutputChecker.compare_docs lxml.doctestcompare.LXMLOutputChecker-class.html#compare_docs -lxml.doctestcompare.LXMLOutputChecker.get_parser lxml.doctestcompare.LXMLOutputChecker-class.html#get_parser -lxml.doctestcompare.LXMLOutputChecker.html_empty_tag lxml.doctestcompare.LXMLOutputChecker-class.html#html_empty_tag -lxml.doctestcompare.LXMLOutputChecker.get_default_parser lxml.doctestcompare.LXMLOutputChecker-class.html#get_default_parser -lxml.doctestcompare.LXMLOutputChecker.format_tag lxml.doctestcompare.LXMLOutputChecker-class.html#format_tag -lxml.doctestcompare.LXMLOutputChecker.check_output lxml.doctestcompare.LXMLOutputChecker-class.html#check_output -lxml.doctestcompare.LXMLOutputChecker.collect_diff lxml.doctestcompare.LXMLOutputChecker-class.html#collect_diff -lxml.doctestcompare.LXMLOutputChecker.tag_compare lxml.doctestcompare.LXMLOutputChecker-class.html#tag_compare -lxml.doctestcompare.LXMLOutputChecker.format_doc lxml.doctestcompare.LXMLOutputChecker-class.html#format_doc -lxml.doctestcompare.LXMLOutputChecker.output_difference lxml.doctestcompare.LXMLOutputChecker-class.html#output_difference -lxml.doctestcompare.LXMLOutputChecker.format_end_tag lxml.doctestcompare.LXMLOutputChecker-class.html#format_end_tag -lxml.doctestcompare.LXMLOutputChecker.format_text lxml.doctestcompare.LXMLOutputChecker-class.html#format_text -lxml.doctestcompare.LXMLOutputChecker.collect_diff_end_tag lxml.doctestcompare.LXMLOutputChecker-class.html#collect_diff_end_tag -lxml.doctestcompare.LXMLOutputChecker.collect_diff_text lxml.doctestcompare.LXMLOutputChecker-class.html#collect_diff_text -lxml.doctestcompare._RestoreChecker lxml.doctestcompare._RestoreChecker-class.html -lxml.doctestcompare._RestoreChecker.uninstall_dt_self lxml.doctestcompare._RestoreChecker-class.html#uninstall_dt_self -lxml.doctestcompare._RestoreChecker.install_clone lxml.doctestcompare._RestoreChecker-class.html#install_clone -lxml.doctestcompare._RestoreChecker.uninstall_module lxml.doctestcompare._RestoreChecker-class.html#uninstall_module -lxml.doctestcompare._RestoreChecker.uninstall_clone lxml.doctestcompare._RestoreChecker-class.html#uninstall_clone -lxml.doctestcompare._RestoreChecker.install_dt_self lxml.doctestcompare._RestoreChecker-class.html#install_dt_self -lxml.doctestcompare._RestoreChecker.__call__ lxml.doctestcompare._RestoreChecker-class.html#__call__ -lxml.doctestcompare._RestoreChecker.call_super lxml.doctestcompare._RestoreChecker-class.html#call_super -lxml.doctestcompare._RestoreChecker.__init__ lxml.doctestcompare._RestoreChecker-class.html#__init__ -lxml.etree.AncestorsIterator lxml.etree.AncestorsIterator-class.html -lxml.etree.AncestorsIterator.__new__ lxml.etree.AncestorsIterator-class.html#__new__ -lxml.etree._ElementMatchIterator.__next__ lxml.etree._ElementMatchIterator-class.html#__next__ -lxml.etree._ElementMatchIterator.next lxml.etree._ElementMatchIterator-class.html#next -lxml.etree._ElementMatchIterator.__iter__ lxml.etree._ElementMatchIterator-class.html#__iter__ -lxml.etree.AttributeBasedElementClassLookup lxml.etree.AttributeBasedElementClassLookup-class.html -lxml.etree.AttributeBasedElementClassLookup.__new__ lxml.etree.AttributeBasedElementClassLookup-class.html#__new__ -lxml.etree.FallbackElementClassLookup.fallback lxml.etree.FallbackElementClassLookup-class.html#fallback -lxml.etree.FallbackElementClassLookup.set_fallback lxml.etree.FallbackElementClassLookup-class.html#set_fallback -lxml.etree.AttributeBasedElementClassLookup.__init__ lxml.etree.AttributeBasedElementClassLookup-class.html#__init__ -lxml.etree.C14NError lxml.etree.C14NError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.C14NError.__new__ lxml.etree.C14NError-class.html#__new__ -lxml.etree.CDATA lxml.etree.CDATA-class.html -lxml.etree.CDATA.__new__ lxml.etree.CDATA-class.html#__new__ -lxml.etree.CommentBase lxml.etree.CommentBase-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Comment.tag lxml.etree._Comment-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree.CommentBase.__new__ lxml.etree.CommentBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.CommentBase.__init__ lxml.etree.CommentBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Comment.__repr__ lxml.etree._Comment-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree.CustomElementClassLookup lxml.etree.CustomElementClassLookup-class.html -lxml.etree.CustomElementClassLookup.__new__ lxml.etree.CustomElementClassLookup-class.html#__new__ -lxml.etree.CustomElementClassLookup.lookup lxml.etree.CustomElementClassLookup-class.html#lookup -lxml.etree.FallbackElementClassLookup.fallback lxml.etree.FallbackElementClassLookup-class.html#fallback -lxml.etree.FallbackElementClassLookup.set_fallback lxml.etree.FallbackElementClassLookup-class.html#set_fallback -lxml.etree.FallbackElementClassLookup.__init__ lxml.etree.FallbackElementClassLookup-class.html#__init__ -lxml.etree.DTD lxml.etree.DTD-class.html -lxml.etree._Validator._append_log_message lxml.etree._Validator-class.html#_append_log_message -lxml.etree.DTD.iterelements lxml.etree.DTD-class.html#iterelements -lxml.etree.DTD.system_url lxml.etree.DTD-class.html#system_url -lxml.etree._Validator.validate lxml.etree._Validator-class.html#validate -lxml.etree.DTD.__init__ lxml.etree.DTD-class.html#__init__ -lxml.etree.DTD.__new__ lxml.etree.DTD-class.html#__new__ -lxml.etree._Validator._clear_error_log lxml.etree._Validator-class.html#_clear_error_log -lxml.etree.DTD.iterentities lxml.etree.DTD-class.html#iterentities -lxml.etree.DTD.entities lxml.etree.DTD-class.html#entities -lxml.etree.DTD.__call__ lxml.etree.DTD-class.html#__call__ -lxml.etree.DTD.elements lxml.etree.DTD-class.html#elements -lxml.etree._Validator.assert_ lxml.etree._Validator-class.html#assert_ -lxml.etree.DTD.name lxml.etree.DTD-class.html#name -lxml.etree._Validator.assertValid lxml.etree._Validator-class.html#assertValid -lxml.etree._Validator.error_log lxml.etree._Validator-class.html#error_log -lxml.etree.DTD.external_id lxml.etree.DTD-class.html#external_id -lxml.etree.DTDError lxml.etree.DTDError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.DTDError.__new__ lxml.etree.DTDError-class.html#__new__ -lxml.etree.DTDParseError lxml.etree.DTDParseError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.DTDParseError.__new__ lxml.etree.DTDParseError-class.html#__new__ -lxml.etree.DTDValidateError lxml.etree.DTDValidateError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.DTDValidateError.__new__ lxml.etree.DTDValidateError-class.html#__new__ -lxml.etree.DocInfo lxml.etree.DocInfo-class.html -lxml.etree.DocInfo.xml_version lxml.etree.DocInfo-class.html#xml_version -lxml.etree.DocInfo.public_id lxml.etree.DocInfo-class.html#public_id -lxml.etree.DocInfo.encoding lxml.etree.DocInfo-class.html#encoding -lxml.etree.DocInfo.externalDTD lxml.etree.DocInfo-class.html#externalDTD -lxml.etree.DocInfo.system_url lxml.etree.DocInfo-class.html#system_url -lxml.etree.DocInfo.__new__ lxml.etree.DocInfo-class.html#__new__ -lxml.etree.DocInfo.internalDTD lxml.etree.DocInfo-class.html#internalDTD -lxml.etree.DocInfo.URL lxml.etree.DocInfo-class.html#URL -lxml.etree.DocInfo.standalone lxml.etree.DocInfo-class.html#standalone -lxml.etree.DocInfo.clear lxml.etree.DocInfo-class.html#clear -lxml.etree.DocInfo.root_name lxml.etree.DocInfo-class.html#root_name -lxml.etree.DocInfo.doctype lxml.etree.DocInfo-class.html#doctype -lxml.etree.DocumentInvalid lxml.etree.DocumentInvalid-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.DocumentInvalid.__new__ lxml.etree.DocumentInvalid-class.html#__new__ -lxml.etree.ETCompatXMLParser lxml.etree.ETCompatXMLParser-class.html -lxml.etree._FeedParser.feed lxml.etree._FeedParser-class.html#feed -lxml.etree._FeedParser.close lxml.etree._FeedParser-class.html#close -lxml.etree.ETCompatXMLParser.__init__ lxml.etree.ETCompatXMLParser-class.html#__init__ -lxml.etree.ETCompatXMLParser.__new__ lxml.etree.ETCompatXMLParser-class.html#__new__ -lxml.etree._FeedParser.feed_error_log lxml.etree._FeedParser-class.html#feed_error_log -lxml.etree.ETXPath lxml.etree.ETXPath-class.html -lxml.etree.ETXPath.__new__ lxml.etree.ETXPath-class.html#__new__ -lxml.etree._XPathEvaluatorBase.evaluate lxml.etree._XPathEvaluatorBase-class.html#evaluate -lxml.etree._XPathEvaluatorBase.error_log lxml.etree._XPathEvaluatorBase-class.html#error_log -lxml.etree.XPath.__repr__ lxml.etree.XPath-class.html#__repr__ -lxml.etree.XPath.__call__ lxml.etree.XPath-class.html#__call__ -lxml.etree.XPath.path lxml.etree.XPath-class.html#path -lxml.etree.ETXPath.__init__ lxml.etree.ETXPath-class.html#__init__ -lxml.etree.ElementBase lxml.etree.ElementBase-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.etree._Element.__repr__ lxml.etree._Element-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree.ElementChildIterator lxml.etree.ElementChildIterator-class.html -lxml.etree.ElementChildIterator.__new__ lxml.etree.ElementChildIterator-class.html#__new__ -lxml.etree._ElementMatchIterator.__next__ lxml.etree._ElementMatchIterator-class.html#__next__ -lxml.etree._ElementMatchIterator.next lxml.etree._ElementMatchIterator-class.html#next -lxml.etree._ElementMatchIterator.__iter__ lxml.etree._ElementMatchIterator-class.html#__iter__ -lxml.etree.ElementClassLookup lxml.etree.ElementClassLookup-class.html -lxml.etree.ElementClassLookup.__new__ lxml.etree.ElementClassLookup-class.html#__new__ -lxml.etree.ElementDefaultClassLookup lxml.etree.ElementDefaultClassLookup-class.html -lxml.etree.ElementDefaultClassLookup.entity_class lxml.etree.ElementDefaultClassLookup-class.html#entity_class -lxml.etree.ElementDefaultClassLookup.__new__ lxml.etree.ElementDefaultClassLookup-class.html#__new__ -lxml.etree.ElementDefaultClassLookup.element_class lxml.etree.ElementDefaultClassLookup-class.html#element_class -lxml.etree.ElementDefaultClassLookup.pi_class lxml.etree.ElementDefaultClassLookup-class.html#pi_class -lxml.etree.ElementDefaultClassLookup.comment_class lxml.etree.ElementDefaultClassLookup-class.html#comment_class -lxml.etree.ElementDefaultClassLookup.__init__ lxml.etree.ElementDefaultClassLookup-class.html#__init__ -lxml.etree.ElementDepthFirstIterator lxml.etree.ElementDepthFirstIterator-class.html -lxml.etree.ElementDepthFirstIterator.__new__ lxml.etree.ElementDepthFirstIterator-class.html#__new__ -lxml.etree.ElementDepthFirstIterator.__next__ lxml.etree.ElementDepthFirstIterator-class.html#__next__ -lxml.etree.ElementDepthFirstIterator.next lxml.etree.ElementDepthFirstIterator-class.html#next -lxml.etree.ElementDepthFirstIterator.__iter__ lxml.etree.ElementDepthFirstIterator-class.html#__iter__ -lxml.etree.ElementNamespaceClassLookup lxml.etree.ElementNamespaceClassLookup-class.html -lxml.etree.ElementNamespaceClassLookup.__new__ lxml.etree.ElementNamespaceClassLookup-class.html#__new__ -lxml.etree.ElementNamespaceClassLookup.get_namespace lxml.etree.ElementNamespaceClassLookup-class.html#get_namespace -lxml.etree.FallbackElementClassLookup.fallback lxml.etree.FallbackElementClassLookup-class.html#fallback -lxml.etree.FallbackElementClassLookup.set_fallback lxml.etree.FallbackElementClassLookup-class.html#set_fallback -lxml.etree.ElementNamespaceClassLookup.__init__ lxml.etree.ElementNamespaceClassLookup-class.html#__init__ -lxml.etree.ElementTextIterator lxml.etree.ElementTextIterator-class.html -lxml.etree.ElementTextIterator.__new__ lxml.etree.ElementTextIterator-class.html#__new__ -lxml.etree.ElementTextIterator.__next__ lxml.etree.ElementTextIterator-class.html#__next__ -lxml.etree.ElementTextIterator.next lxml.etree.ElementTextIterator-class.html#next -lxml.etree.ElementTextIterator.__iter__ lxml.etree.ElementTextIterator-class.html#__iter__ -lxml.etree.EntityBase lxml.etree.EntityBase-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Entity.text lxml.etree._Entity-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Entity.tag lxml.etree._Entity-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree.EntityBase.__new__ lxml.etree.EntityBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.EntityBase.__init__ lxml.etree.EntityBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Entity.name lxml.etree._Entity-class.html#name -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Entity.__repr__ lxml.etree._Entity-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree.Error lxml.etree.Error-class.html -lxml.etree.Error.__new__ lxml.etree.Error-class.html#__new__ -lxml.etree.ErrorDomains lxml.etree.ErrorDomains-class.html -lxml.etree.ErrorDomains.HTTP lxml.etree.ErrorDomains-class.html#HTTP -lxml.etree.ErrorDomains.SCHEMATRONV lxml.etree.ErrorDomains-class.html#SCHEMATRONV -lxml.etree.ErrorDomains.DTD lxml.etree.ErrorDomains-class.html#DTD -lxml.etree.ErrorDomains.VALID lxml.etree.ErrorDomains-class.html#VALID -lxml.etree.ErrorDomains.I18N lxml.etree.ErrorDomains-class.html#I18N -lxml.etree.ErrorDomains.XINCLUDE lxml.etree.ErrorDomains-class.html#XINCLUDE -lxml.etree.ErrorDomains.C14N lxml.etree.ErrorDomains-class.html#C14N -lxml.etree.ErrorDomains.__qualname__ lxml.etree.ErrorDomains-class.html#__qualname__ -lxml.etree.ErrorDomains.NONE lxml.etree.ErrorDomains-class.html#NONE -lxml.etree.ErrorDomains.DATATYPE lxml.etree.ErrorDomains-class.html#DATATYPE -lxml.etree.ErrorDomains._getName lxml.etree.ErrorDomains-class.html#_getName -lxml.etree.ErrorDomains.HTML lxml.etree.ErrorDomains-class.html#HTML -lxml.etree.ErrorDomains.CHECK lxml.etree.ErrorDomains-class.html#CHECK -lxml.etree.ErrorDomains.FTP lxml.etree.ErrorDomains-class.html#FTP -lxml.etree.ErrorDomains._names lxml.etree.ErrorDomains-class.html#_names -lxml.etree.ErrorDomains.XSLT lxml.etree.ErrorDomains-class.html#XSLT -lxml.etree.ErrorDomains.BUFFER lxml.etree.ErrorDomains-class.html#BUFFER -lxml.etree.ErrorDomains.PARSER lxml.etree.ErrorDomains-class.html#PARSER -lxml.etree.ErrorDomains.NAMESPACE lxml.etree.ErrorDomains-class.html#NAMESPACE -lxml.etree.ErrorDomains.URI lxml.etree.ErrorDomains-class.html#URI -lxml.etree.ErrorDomains.MODULE lxml.etree.ErrorDomains-class.html#MODULE -lxml.etree.ErrorDomains.IO lxml.etree.ErrorDomains-class.html#IO -lxml.etree.ErrorDomains.REGEXP lxml.etree.ErrorDomains-class.html#REGEXP -lxml.etree.ErrorDomains.XPATH lxml.etree.ErrorDomains-class.html#XPATH -lxml.etree.ErrorDomains.RELAXNGV lxml.etree.ErrorDomains-class.html#RELAXNGV -lxml.etree.ErrorDomains.RELAXNGP lxml.etree.ErrorDomains-class.html#RELAXNGP -lxml.etree.ErrorDomains.WRITER lxml.etree.ErrorDomains-class.html#WRITER -lxml.etree.ErrorDomains.TREE lxml.etree.ErrorDomains-class.html#TREE -lxml.etree.ErrorDomains.SCHEMASP lxml.etree.ErrorDomains-class.html#SCHEMASP -lxml.etree.ErrorDomains.CATALOG lxml.etree.ErrorDomains-class.html#CATALOG -lxml.etree.ErrorDomains.SCHEMASV lxml.etree.ErrorDomains-class.html#SCHEMASV -lxml.etree.ErrorDomains.MEMORY lxml.etree.ErrorDomains-class.html#MEMORY -lxml.etree.ErrorDomains.OUTPUT lxml.etree.ErrorDomains-class.html#OUTPUT -lxml.etree.ErrorDomains.XPOINTER lxml.etree.ErrorDomains-class.html#XPOINTER -lxml.etree.ErrorLevels lxml.etree.ErrorLevels-class.html -lxml.etree.ErrorLevels.NONE lxml.etree.ErrorLevels-class.html#NONE -lxml.etree.ErrorLevels._names lxml.etree.ErrorLevels-class.html#_names -lxml.etree.ErrorLevels.__qualname__ lxml.etree.ErrorLevels-class.html#__qualname__ -lxml.etree.ErrorLevels.WARNING lxml.etree.ErrorLevels-class.html#WARNING -lxml.etree.ErrorLevels.ERROR lxml.etree.ErrorLevels-class.html#ERROR -lxml.etree.ErrorLevels.FATAL lxml.etree.ErrorLevels-class.html#FATAL -lxml.etree.ErrorLevels._getName lxml.etree.ErrorLevels-class.html#_getName -lxml.etree.ErrorTypes lxml.etree.ErrorTypes-class.html -lxml.etree.ErrorTypes.I18N_CONV_FAILED lxml.etree.ErrorTypes-class.html#I18N_CONV_FAILED -lxml.etree.ErrorTypes.SCHEMAP_ATTRFORMDEFAULT_VALUE lxml.etree.ErrorTypes-class.html#SCHEMAP_ATTRFORMDEFAULT_VALUE -lxml.etree.ErrorTypes.SCHEMAP_REDEFINED_NOTATION lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_NOTATION -lxml.etree.ErrorTypes.RNGP_EXCEPT_MULTIPLE lxml.etree.ErrorTypes-class.html#RNGP_EXCEPT_MULTIPLE -lxml.etree.ErrorTypes.SCHEMAP_AU_PROPS_CORRECT_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_AU_PROPS_CORRECT_2 -lxml.etree.ErrorTypes.IO_EINVAL lxml.etree.ErrorTypes-class.html#IO_EINVAL -lxml.etree.ErrorTypes.ERR_VERSION_MISMATCH lxml.etree.ErrorTypes-class.html#ERR_VERSION_MISMATCH -lxml.etree.ErrorTypes.ERR_ELEMCONTENT_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_ELEMCONTENT_NOT_STARTED -lxml.etree.ErrorTypes.SCHEMAP_TYPE_AND_SUBTYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_TYPE_AND_SUBTYPE -lxml.etree.ErrorTypes.FTP_URL_SYNTAX lxml.etree.ErrorTypes-class.html#FTP_URL_SYNTAX -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP -lxml.etree.ErrorTypes.SCHEMAP_INVALID_ATTR_USE lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_USE -lxml.etree.ErrorTypes.CHECK_WRONG_PREV lxml.etree.ErrorTypes-class.html#CHECK_WRONG_PREV -lxml.etree.ErrorTypes.CHECK_NS_SCOPE lxml.etree.ErrorTypes-class.html#CHECK_NS_SCOPE -lxml.etree.ErrorTypes.CHECK_NOT_NS_DECL lxml.etree.ErrorTypes-class.html#CHECK_NOT_NS_DECL -lxml.etree.ErrorTypes.XINCLUDE_XPTR_RESULT lxml.etree.ErrorTypes-class.html#XINCLUDE_XPTR_RESULT -lxml.etree.ErrorTypes.ERR_PEREF_IN_EPILOG lxml.etree.ErrorTypes-class.html#ERR_PEREF_IN_EPILOG -lxml.etree.ErrorTypes.IO_EMLINK lxml.etree.ErrorTypes-class.html#IO_EMLINK -lxml.etree.ErrorTypes.RNGP_PARAM_NAME_MISSING lxml.etree.ErrorTypes-class.html#RNGP_PARAM_NAME_MISSING -lxml.etree.ErrorTypes.WAR_NS_URI_RELATIVE lxml.etree.ErrorTypes-class.html#WAR_NS_URI_RELATIVE -lxml.etree.ErrorTypes.SCHEMAP_SRC_ELEMENT_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_2_2 -lxml.etree.ErrorTypes.IO_ENFILE lxml.etree.ErrorTypes-class.html#IO_ENFILE -lxml.etree.ErrorTypes.SCHEMATRONV_ASSERT lxml.etree.ErrorTypes-class.html#SCHEMATRONV_ASSERT -lxml.etree.ErrorTypes.FTP_ACCNT lxml.etree.ErrorTypes-class.html#FTP_ACCNT -lxml.etree.ErrorTypes.RNGP_PAT_START_GROUP lxml.etree.ErrorTypes-class.html#RNGP_PAT_START_GROUP -lxml.etree.ErrorTypes.SCHEMAV_MISSING lxml.etree.ErrorTypes-class.html#SCHEMAV_MISSING -lxml.etree.ErrorTypes.MODULE_OPEN lxml.etree.ErrorTypes-class.html#MODULE_OPEN -lxml.etree.ErrorTypes.XPATH_INVALID_OPERAND lxml.etree.ErrorTypes-class.html#XPATH_INVALID_OPERAND -lxml.etree.ErrorTypes.CHECK_FOUND_NOTATION lxml.etree.ErrorTypes-class.html#CHECK_FOUND_NOTATION -lxml.etree.ErrorTypes.SCHEMAP_SRC_IMPORT_1_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_1_1 -lxml.etree.ErrorTypes.ERR_UNPARSED_ENTITY lxml.etree.ErrorTypes-class.html#ERR_UNPARSED_ENTITY -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_NOTATION_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_NOTATION_CHILD -lxml.etree.ErrorTypes.CHECK_OUTSIDE_DICT lxml.etree.ErrorTypes-class.html#CHECK_OUTSIDE_DICT -lxml.etree.ErrorTypes.SCHEMAV_NOTEMPTY lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTEMPTY -lxml.etree.ErrorTypes.RNGP_PAT_DATA_EXCEPT_GROUP lxml.etree.ErrorTypes-class.html#RNGP_PAT_DATA_EXCEPT_GROUP -lxml.etree.ErrorTypes.ERR_PEREF_SEMICOL_MISSING lxml.etree.ErrorTypes-class.html#ERR_PEREF_SEMICOL_MISSING -lxml.etree.ErrorTypes.DTD_LOAD_ERROR lxml.etree.ErrorTypes-class.html#DTD_LOAD_ERROR -lxml.etree.ErrorTypes.__qualname__ lxml.etree.ErrorTypes-class.html#__qualname__ -lxml.etree.ErrorTypes.SCHEMAP_INVALID_BOOLEAN lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_BOOLEAN -lxml.etree.ErrorTypes.DTD_NOT_STANDALONE lxml.etree.ErrorTypes-class.html#DTD_NOT_STANDALONE -lxml.etree.ErrorTypes.SCHEMAP_ST_PROPS_CORRECT_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_ST_PROPS_CORRECT_3 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ATTRIBUTE_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_1 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ATTRIBUTE_3 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_3 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ATTRIBUTE_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_2 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ATTRIBUTE_4 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_4 -lxml.etree.ErrorTypes.C14N_INVALID_NODE lxml.etree.ErrorTypes-class.html#C14N_INVALID_NODE -lxml.etree.ErrorTypes.XPATH_START_LITERAL_ERROR lxml.etree.ErrorTypes-class.html#XPATH_START_LITERAL_ERROR -lxml.etree.ErrorTypes.RNGP_TEXT_HAS_CHILD lxml.etree.ErrorTypes-class.html#RNGP_TEXT_HAS_CHILD -lxml.etree.ErrorTypes.SCHEMAV_CVC_WILDCARD lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_WILDCARD -lxml.etree.ErrorTypes.XPATH_UNDEF_VARIABLE_ERROR lxml.etree.ErrorTypes-class.html#XPATH_UNDEF_VARIABLE_ERROR -lxml.etree.ErrorTypes.SCHEMAP_S4S_ATTR_MISSING lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ATTR_MISSING -lxml.etree.ErrorTypes.SCHEMAP_INTERNAL lxml.etree.ErrorTypes-class.html#SCHEMAP_INTERNAL -lxml.etree.ErrorTypes.RNGP_EXCEPT_MISSING lxml.etree.ErrorTypes-class.html#RNGP_EXCEPT_MISSING -lxml.etree.ErrorTypes.TREE_INVALID_HEX lxml.etree.ErrorTypes-class.html#TREE_INVALID_HEX -lxml.etree.ErrorTypes.RNGP_DEFINE_CREATE_FAILED lxml.etree.ErrorTypes-class.html#RNGP_DEFINE_CREATE_FAILED -lxml.etree.ErrorTypes.XPATH_ENCODING_ERROR lxml.etree.ErrorTypes-class.html#XPATH_ENCODING_ERROR -lxml.etree.ErrorTypes.SCHEMAV_CVC_IDC lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_IDC -lxml.etree.ErrorTypes.CHECK_NO_ELEM lxml.etree.ErrorTypes-class.html#CHECK_NO_ELEM -lxml.etree.ErrorTypes.IO_EXDEV lxml.etree.ErrorTypes-class.html#IO_EXDEV -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_TYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_TYPE -lxml.etree.ErrorTypes.ERR_LT_IN_ATTRIBUTE lxml.etree.ErrorTypes-class.html#ERR_LT_IN_ATTRIBUTE -lxml.etree.ErrorTypes.SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE -lxml.etree.ErrorTypes.IO_EMFILE lxml.etree.ErrorTypes-class.html#IO_EMFILE -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_3_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_3_2_2 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_3_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_3_2_1 -lxml.etree.ErrorTypes.XINCLUDE_XPTR_FAILED lxml.etree.ErrorTypes-class.html#XINCLUDE_XPTR_FAILED -lxml.etree.ErrorTypes.ERR_MISPLACED_CDATA_END lxml.etree.ErrorTypes-class.html#ERR_MISPLACED_CDATA_END -lxml.etree.ErrorTypes.RNGP_ELEMENT_NO_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_ELEMENT_NO_CONTENT -lxml.etree.ErrorTypes.IO_ENOENT lxml.etree.ErrorTypes-class.html#IO_ENOENT -lxml.etree.ErrorTypes.RNGP_ATTRIBUTE_NOOP lxml.etree.ErrorTypes-class.html#RNGP_ATTRIBUTE_NOOP -lxml.etree.ErrorTypes.SCHEMAP_SRC_REDEFINE lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_REDEFINE -lxml.etree.ErrorTypes.ERR_CHARREF_IN_PROLOG lxml.etree.ErrorTypes-class.html#ERR_CHARREF_IN_PROLOG -lxml.etree.ErrorTypes.RNGP_REF_NAME_INVALID lxml.etree.ErrorTypes-class.html#RNGP_REF_NAME_INVALID -lxml.etree.ErrorTypes.ERR_NOTATION_PROCESSING lxml.etree.ErrorTypes-class.html#ERR_NOTATION_PROCESSING -lxml.etree.ErrorTypes.RNGP_INCLUDE_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_INCLUDE_EMPTY -lxml.etree.ErrorTypes.RNGP_INCLUDE_RECURSE lxml.etree.ErrorTypes-class.html#RNGP_INCLUDE_RECURSE -lxml.etree.ErrorTypes.SCHEMAP_ELEM_NONAME_NOREF lxml.etree.ErrorTypes-class.html#SCHEMAP_ELEM_NONAME_NOREF -lxml.etree.ErrorTypes.RNGP_EMPTY_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_EMPTY_CONTENT -lxml.etree.ErrorTypes.XPTR_EVAL_FAILED lxml.etree.ErrorTypes-class.html#XPTR_EVAL_FAILED -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_1 -lxml.etree.ErrorTypes.XPATH_INVALID_CTXT_POSITION lxml.etree.ErrorTypes-class.html#XPATH_INVALID_CTXT_POSITION -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_2_3 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_3 -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_2_4 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_4 -lxml.etree.ErrorTypes.ERR_INTERNAL_ERROR lxml.etree.ErrorTypes-class.html#ERR_INTERNAL_ERROR -lxml.etree.ErrorTypes.ERR_DOCTYPE_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_DOCTYPE_NOT_FINISHED -lxml.etree.ErrorTypes.RNGP_PAT_NSNAME_EXCEPT_ANYNAME lxml.etree.ErrorTypes-class.html#RNGP_PAT_NSNAME_EXCEPT_ANYNAME -lxml.etree.ErrorTypes.RNGP_EMPTY_NOT_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_EMPTY_NOT_EMPTY -lxml.etree.ErrorTypes.SCHEMAP_NO_XMLNS lxml.etree.ErrorTypes-class.html#SCHEMAP_NO_XMLNS -lxml.etree.ErrorTypes.RNGP_PAT_LIST_ATTR lxml.etree.ErrorTypes-class.html#RNGP_PAT_LIST_ATTR -lxml.etree.ErrorTypes.ERR_NO_DTD lxml.etree.ErrorTypes-class.html#ERR_NO_DTD -lxml.etree.ErrorTypes.ERR_ENTITY_LOOP lxml.etree.ErrorTypes-class.html#ERR_ENTITY_LOOP -lxml.etree.ErrorTypes.IO_EINTR lxml.etree.ErrorTypes-class.html#IO_EINTR -lxml.etree.ErrorTypes.ERR_MISSING_ENCODING lxml.etree.ErrorTypes-class.html#ERR_MISSING_ENCODING -lxml.etree.ErrorTypes.DTD_STANDALONE_WHITE_SPACE lxml.etree.ErrorTypes-class.html#DTD_STANDALONE_WHITE_SPACE -lxml.etree.ErrorTypes.DTD_ENTITY_TYPE lxml.etree.ErrorTypes-class.html#DTD_ENTITY_TYPE -lxml.etree.ErrorTypes.IO_ENOTEMPTY lxml.etree.ErrorTypes-class.html#IO_ENOTEMPTY -lxml.etree.ErrorTypes.RNGP_REF_NO_NAME lxml.etree.ErrorTypes-class.html#RNGP_REF_NO_NAME -lxml.etree.ErrorTypes.XINCLUDE_MULTIPLE_ROOT lxml.etree.ErrorTypes-class.html#XINCLUDE_MULTIPLE_ROOT -lxml.etree.ErrorTypes.SCHEMAV_NOTYPE lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTYPE -lxml.etree.ErrorTypes.RNGP_ELEMENT_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_ELEMENT_EMPTY -lxml.etree.ErrorTypes.IO_ECANCELED lxml.etree.ErrorTypes-class.html#IO_ECANCELED -lxml.etree.ErrorTypes.RNGP_EXCEPT_NO_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_EXCEPT_NO_CONTENT -lxml.etree.ErrorTypes.WAR_NS_COLUMN lxml.etree.ErrorTypes-class.html#WAR_NS_COLUMN -lxml.etree.ErrorTypes.IO_ENOTSOCK lxml.etree.ErrorTypes-class.html#IO_ENOTSOCK -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_DERIVED_OK_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_DERIVED_OK_2_1 -lxml.etree.ErrorTypes.ERR_URI_FRAGMENT lxml.etree.ErrorTypes-class.html#ERR_URI_FRAGMENT -lxml.etree.ErrorTypes.SCHEMAV_NOTNILLABLE lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTNILLABLE -lxml.etree.ErrorTypes.RNGP_PAT_LIST_TEXT lxml.etree.ErrorTypes-class.html#RNGP_PAT_LIST_TEXT -lxml.etree.ErrorTypes.SCHEMAV_UNDECLAREDELEM lxml.etree.ErrorTypes-class.html#SCHEMAV_UNDECLAREDELEM -lxml.etree.ErrorTypes.SCHEMAP_AG_PROPS_CORRECT lxml.etree.ErrorTypes-class.html#SCHEMAP_AG_PROPS_CORRECT -lxml.etree.ErrorTypes.IO_ENOMEM lxml.etree.ErrorTypes-class.html#IO_ENOMEM -lxml.etree.ErrorTypes.ERR_NOTATION_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_NOTATION_NOT_STARTED -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_ELEM_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ELEM_CHILD -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_4_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_4_1 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_4_3 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_4_3 -lxml.etree.ErrorTypes.DTD_NO_DOC lxml.etree.ErrorTypes-class.html#DTD_NO_DOC -lxml.etree.ErrorTypes.RNGP_TYPE_NOT_FOUND lxml.etree.ErrorTypes-class.html#RNGP_TYPE_NOT_FOUND -lxml.etree.ErrorTypes.RNGP_EXTERNALREF_RECURSE lxml.etree.ErrorTypes-class.html#RNGP_EXTERNALREF_RECURSE -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_ATTRGRP_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ATTRGRP_CHILD -lxml.etree.ErrorTypes.IO_EACCES lxml.etree.ErrorTypes-class.html#IO_EACCES -lxml.etree.ErrorTypes._names lxml.etree.ErrorTypes-class.html#_names -lxml.etree.ErrorTypes.SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES -lxml.etree.ErrorTypes.ERR_RESERVED_XML_NAME lxml.etree.ErrorTypes-class.html#ERR_RESERVED_XML_NAME -lxml.etree.ErrorTypes.RNGP_TEXT_EXPECTED lxml.etree.ErrorTypes-class.html#RNGP_TEXT_EXPECTED -lxml.etree.ErrorTypes.RNGP_CHOICE_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_CHOICE_EMPTY -lxml.etree.ErrorTypes.ERR_TAG_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_TAG_NOT_FINISHED -lxml.etree.ErrorTypes.CHECK_FOUND_TEXT lxml.etree.ErrorTypes-class.html#CHECK_FOUND_TEXT -lxml.etree.ErrorTypes.RNGP_PARENTREF_NO_NAME lxml.etree.ErrorTypes-class.html#RNGP_PARENTREF_NO_NAME -lxml.etree.ErrorTypes.RNGP_PAT_ONEMORE_GROUP_ATTR lxml.etree.ErrorTypes-class.html#RNGP_PAT_ONEMORE_GROUP_ATTR -lxml.etree.ErrorTypes.SCHEMAV_CVC_ENUMERATION_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ENUMERATION_VALID -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_RESTRICTION_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_RESTRICTION_CHILD -lxml.etree.ErrorTypes.DTD_ELEM_REDEFINED lxml.etree.ErrorTypes-class.html#DTD_ELEM_REDEFINED -lxml.etree.ErrorTypes.RNGP_MISSING_HREF lxml.etree.ErrorTypes-class.html#RNGP_MISSING_HREF -lxml.etree.ErrorTypes.IO_ERANGE lxml.etree.ErrorTypes-class.html#IO_ERANGE -lxml.etree.ErrorTypes.HTTP_UNKNOWN_HOST lxml.etree.ErrorTypes-class.html#HTTP_UNKNOWN_HOST -lxml.etree.ErrorTypes.RNGP_PAT_START_ATTR lxml.etree.ErrorTypes-class.html#RNGP_PAT_START_ATTR -lxml.etree.ErrorTypes.SCHEMAP_NOTATION_NO_NAME lxml.etree.ErrorTypes-class.html#SCHEMAP_NOTATION_NO_NAME -lxml.etree.ErrorTypes.NS_ERR_COLON lxml.etree.ErrorTypes-class.html#NS_ERR_COLON -lxml.etree.ErrorTypes.ERR_PEREF_IN_INT_SUBSET lxml.etree.ErrorTypes-class.html#ERR_PEREF_IN_INT_SUBSET -lxml.etree.ErrorTypes.RNGP_VALUE_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_VALUE_EMPTY -lxml.etree.ErrorTypes.WAR_UNKNOWN_VERSION lxml.etree.ErrorTypes-class.html#WAR_UNKNOWN_VERSION -lxml.etree.ErrorTypes.SCHEMAV_ISABSTRACT lxml.etree.ErrorTypes-class.html#SCHEMAV_ISABSTRACT -lxml.etree.ErrorTypes.IO_EMSGSIZE lxml.etree.ErrorTypes-class.html#IO_EMSGSIZE -lxml.etree.ErrorTypes.CATALOG_ENTRY_BROKEN lxml.etree.ErrorTypes-class.html#CATALOG_ENTRY_BROKEN -lxml.etree.ErrorTypes.SCHEMAP_SRC_IMPORT_1_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_1_2 -lxml.etree.ErrorTypes.RNGP_CREATE_FAILURE lxml.etree.ErrorTypes-class.html#RNGP_CREATE_FAILURE -lxml.etree.ErrorTypes.ERR_NAME_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_NAME_REQUIRED -lxml.etree.ErrorTypes.SCHEMAP_S4S_ATTR_NOT_ALLOWED lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ATTR_NOT_ALLOWED -lxml.etree.ErrorTypes.ERR_ATTLIST_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_ATTLIST_NOT_FINISHED -lxml.etree.ErrorTypes._getName lxml.etree.ErrorTypes-class.html#_getName -lxml.etree.ErrorTypes.XPTR_EXTRA_OBJECTS lxml.etree.ErrorTypes-class.html#XPTR_EXTRA_OBJECTS -lxml.etree.ErrorTypes.IO_EISCONN lxml.etree.ErrorTypes-class.html#IO_EISCONN -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_CHOICE_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_CHOICE_CHILD -lxml.etree.ErrorTypes.ERR_PUBID_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_PUBID_REQUIRED -lxml.etree.ErrorTypes.SCHEMAP_NOTHING_TO_PARSE lxml.etree.ErrorTypes-class.html#SCHEMAP_NOTHING_TO_PARSE -lxml.etree.ErrorTypes.RNGP_NOTALLOWED_NOT_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_NOTALLOWED_NOT_EMPTY -lxml.etree.ErrorTypes.RNGP_REF_NOT_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_REF_NOT_EMPTY -lxml.etree.ErrorTypes.SCHEMAP_DEF_AND_PREFIX lxml.etree.ErrorTypes-class.html#SCHEMAP_DEF_AND_PREFIX -lxml.etree.ErrorTypes.ERR_NOTATION_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_NOTATION_NOT_FINISHED -lxml.etree.ErrorTypes.RNGP_ATTRIBUTE_CHILDREN lxml.etree.ErrorTypes-class.html#RNGP_ATTRIBUTE_CHILDREN -lxml.etree.ErrorTypes.RNGP_PAT_START_DATA lxml.etree.ErrorTypes-class.html#RNGP_PAT_START_DATA -lxml.etree.ErrorTypes.RNGP_ELEMENT_NAME lxml.etree.ErrorTypes-class.html#RNGP_ELEMENT_NAME -lxml.etree.ErrorTypes.RNGP_INTERLEAVE_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_INTERLEAVE_EMPTY -lxml.etree.ErrorTypes.RNGP_PAT_DATA_EXCEPT_INTERLEAVE lxml.etree.ErrorTypes-class.html#RNGP_PAT_DATA_EXCEPT_INTERLEAVE -lxml.etree.ErrorTypes.ERR_VERSION_MISSING lxml.etree.ErrorTypes-class.html#ERR_VERSION_MISSING -lxml.etree.ErrorTypes.RNGP_DEFINE_MISSING lxml.etree.ErrorTypes-class.html#RNGP_DEFINE_MISSING -lxml.etree.ErrorTypes.CATALOG_NOT_CATALOG lxml.etree.ErrorTypes-class.html#CATALOG_NOT_CATALOG -lxml.etree.ErrorTypes.XINCLUDE_TEXT_DOCUMENT lxml.etree.ErrorTypes-class.html#XINCLUDE_TEXT_DOCUMENT -lxml.etree.ErrorTypes.DTD_NO_ELEM_NAME lxml.etree.ErrorTypes-class.html#DTD_NO_ELEM_NAME -lxml.etree.ErrorTypes.ERR_UNSUPPORTED_ENCODING lxml.etree.ErrorTypes-class.html#ERR_UNSUPPORTED_ENCODING -lxml.etree.ErrorTypes.ERR_ENTITY_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_ENTITY_NOT_STARTED -lxml.etree.ErrorTypes.DTD_ELEM_DEFAULT_NAMESPACE lxml.etree.ErrorTypes-class.html#DTD_ELEM_DEFAULT_NAMESPACE -lxml.etree.ErrorTypes.IO_EDOM lxml.etree.ErrorTypes-class.html#IO_EDOM -lxml.etree.ErrorTypes.ERR_NO_MEMORY lxml.etree.ErrorTypes-class.html#ERR_NO_MEMORY -lxml.etree.ErrorTypes.RNGP_GROUP_ATTR_CONFLICT lxml.etree.ErrorTypes-class.html#RNGP_GROUP_ATTR_CONFLICT -lxml.etree.ErrorTypes.FTP_EPSV_ANSWER lxml.etree.ErrorTypes-class.html#FTP_EPSV_ANSWER -lxml.etree.ErrorTypes.IO_ENOTTY lxml.etree.ErrorTypes-class.html#IO_ENOTTY -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_2_3_1_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_1_1 -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_2_3_1_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_1_2 -lxml.etree.ErrorTypes.IO_EFAULT lxml.etree.ErrorTypes-class.html#IO_EFAULT -lxml.etree.ErrorTypes.SCHEMAP_COS_CT_EXTENDS_1_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_CT_EXTENDS_1_1 -lxml.etree.ErrorTypes.SCHEMAV_ELEMCONT lxml.etree.ErrorTypes-class.html#SCHEMAV_ELEMCONT -lxml.etree.ErrorTypes.IO_ECHILD lxml.etree.ErrorTypes-class.html#IO_ECHILD -lxml.etree.ErrorTypes.ERR_VALUE_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_VALUE_REQUIRED -lxml.etree.ErrorTypes.SCHEMAP_COS_VALID_DEFAULT_2_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_2_2_1 -lxml.etree.ErrorTypes.ERR_PCDATA_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_PCDATA_REQUIRED -lxml.etree.ErrorTypes.RNGP_PAT_START_TEXT lxml.etree.ErrorTypes-class.html#RNGP_PAT_START_TEXT -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_1_3_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_3_1 -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_1_3_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_3_2 -lxml.etree.ErrorTypes.RNGP_INTERLEAVE_CREATE_FAILED lxml.etree.ErrorTypes-class.html#RNGP_INTERLEAVE_CREATE_FAILED -lxml.etree.ErrorTypes.CHECK_WRONG_NAME lxml.etree.ErrorTypes-class.html#CHECK_WRONG_NAME -lxml.etree.ErrorTypes.XPATH_INVALID_CHAR_ERROR lxml.etree.ErrorTypes-class.html#XPATH_INVALID_CHAR_ERROR -lxml.etree.ErrorTypes.DTD_UNKNOWN_ID lxml.etree.ErrorTypes-class.html#DTD_UNKNOWN_ID -lxml.etree.ErrorTypes.ERR_INVALID_HEX_CHARREF lxml.etree.ErrorTypes-class.html#ERR_INVALID_HEX_CHARREF -lxml.etree.ErrorTypes.SCHEMAV_CVC_MAXLENGTH_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MAXLENGTH_VALID -lxml.etree.ErrorTypes.ERR_ENTITY_CHAR_ERROR lxml.etree.ErrorTypes-class.html#ERR_ENTITY_CHAR_ERROR -lxml.etree.ErrorTypes.DTD_ID_SUBSET lxml.etree.ErrorTypes-class.html#DTD_ID_SUBSET -lxml.etree.ErrorTypes.IO_LOAD_ERROR lxml.etree.ErrorTypes-class.html#IO_LOAD_ERROR -lxml.etree.ErrorTypes.ERR_INVALID_ENCODING lxml.etree.ErrorTypes-class.html#ERR_INVALID_ENCODING -lxml.etree.ErrorTypes.SCHEMAP_COS_ALL_LIMITED lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ALL_LIMITED -lxml.etree.ErrorTypes.IO_EIO lxml.etree.ErrorTypes-class.html#IO_EIO -lxml.etree.ErrorTypes.RNGP_DEFINE_NAME_MISSING lxml.etree.ErrorTypes-class.html#RNGP_DEFINE_NAME_MISSING -lxml.etree.ErrorTypes.IO_ENOTDIR lxml.etree.ErrorTypes-class.html#IO_ENOTDIR -lxml.etree.ErrorTypes.XINCLUDE_TEXT_FRAGMENT lxml.etree.ErrorTypes-class.html#XINCLUDE_TEXT_FRAGMENT -lxml.etree.ErrorTypes.SCHEMAP_MISSING_SIMPLETYPE_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_MISSING_SIMPLETYPE_CHILD -lxml.etree.ErrorTypes.DTD_NOT_PCDATA lxml.etree.ErrorTypes-class.html#DTD_NOT_PCDATA -lxml.etree.ErrorTypes.ERR_INVALID_URI lxml.etree.ErrorTypes-class.html#ERR_INVALID_URI -lxml.etree.ErrorTypes.SCHEMAV_VALUE lxml.etree.ErrorTypes-class.html#SCHEMAV_VALUE -lxml.etree.ErrorTypes.XPATH_INVALID_PREDICATE_ERROR lxml.etree.ErrorTypes-class.html#XPATH_INVALID_PREDICATE_ERROR -lxml.etree.ErrorTypes.IO_ENOEXEC lxml.etree.ErrorTypes-class.html#IO_ENOEXEC -lxml.etree.ErrorTypes.RNGP_GRAMMAR_NO_START lxml.etree.ErrorTypes-class.html#RNGP_GRAMMAR_NO_START -lxml.etree.ErrorTypes.ERR_XMLDECL_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_XMLDECL_NOT_FINISHED -lxml.etree.ErrorTypes.RNGP_REF_NO_DEF lxml.etree.ErrorTypes-class.html#RNGP_REF_NO_DEF -lxml.etree.ErrorTypes.RNGP_NEED_COMBINE lxml.etree.ErrorTypes-class.html#RNGP_NEED_COMBINE -lxml.etree.ErrorTypes.ERR_STANDALONE_VALUE lxml.etree.ErrorTypes-class.html#ERR_STANDALONE_VALUE -lxml.etree.ErrorTypes.SCHEMAP_INVALID_ATTR_NAME lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_NAME -lxml.etree.ErrorTypes.SCHEMAP_CT_PROPS_CORRECT_4 lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_4 -lxml.etree.ErrorTypes.IO_ENOSYS lxml.etree.ErrorTypes-class.html#IO_ENOSYS -lxml.etree.ErrorTypes.SCHEMAP_ELEMFORMDEFAULT_VALUE lxml.etree.ErrorTypes-class.html#SCHEMAP_ELEMFORMDEFAULT_VALUE -lxml.etree.ErrorTypes.ERR_STRING_NOT_CLOSED lxml.etree.ErrorTypes-class.html#ERR_STRING_NOT_CLOSED -lxml.etree.ErrorTypes.SCHEMAP_CT_PROPS_CORRECT_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_2 -lxml.etree.ErrorTypes.SCHEMAP_CT_PROPS_CORRECT_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_3 -lxml.etree.ErrorTypes.SCHEMAV_CVC_AU lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_AU -lxml.etree.ErrorTypes.RNGP_FORBIDDEN_ATTRIBUTE lxml.etree.ErrorTypes-class.html#RNGP_FORBIDDEN_ATTRIBUTE -lxml.etree.ErrorTypes.ERR_PI_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_PI_NOT_FINISHED -lxml.etree.ErrorTypes.XPATH_EXPR_ERROR lxml.etree.ErrorTypes-class.html#XPATH_EXPR_ERROR -lxml.etree.ErrorTypes.RNGP_NSNAME_NO_NS lxml.etree.ErrorTypes-class.html#RNGP_NSNAME_NO_NS -lxml.etree.ErrorTypes.NS_ERR_EMPTY lxml.etree.ErrorTypes-class.html#NS_ERR_EMPTY -lxml.etree.ErrorTypes.ERR_HYPHEN_IN_COMMENT lxml.etree.ErrorTypes-class.html#ERR_HYPHEN_IN_COMMENT -lxml.etree.ErrorTypes.XPATH_NUMBER_ERROR lxml.etree.ErrorTypes-class.html#XPATH_NUMBER_ERROR -lxml.etree.ErrorTypes.RNGP_PARENTREF_NOT_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_PARENTREF_NOT_EMPTY -lxml.etree.ErrorTypes.ERR_PI_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_PI_NOT_STARTED -lxml.etree.ErrorTypes.RNGP_TYPE_MISSING lxml.etree.ErrorTypes-class.html#RNGP_TYPE_MISSING -lxml.etree.ErrorTypes.IO_EPERM lxml.etree.ErrorTypes-class.html#IO_EPERM -lxml.etree.ErrorTypes.ERR_COMMENT_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_COMMENT_NOT_FINISHED -lxml.etree.ErrorTypes.DTD_CONTENT_ERROR lxml.etree.ErrorTypes-class.html#DTD_CONTENT_ERROR -lxml.etree.ErrorTypes.DTD_NOTATION_VALUE lxml.etree.ErrorTypes-class.html#DTD_NOTATION_VALUE -lxml.etree.ErrorTypes.RNGP_URI_NOT_ABSOLUTE lxml.etree.ErrorTypes-class.html#RNGP_URI_NOT_ABSOLUTE -lxml.etree.ErrorTypes.SCHEMAP_SRC_IMPORT_3_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_3_1 -lxml.etree.ErrorTypes.XPATH_VARIABLE_REF_ERROR lxml.etree.ErrorTypes-class.html#XPATH_VARIABLE_REF_ERROR -lxml.etree.ErrorTypes.SCHEMAP_SRC_IMPORT_3_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_3_2 -lxml.etree.ErrorTypes.XPATH_UNKNOWN_FUNC_ERROR lxml.etree.ErrorTypes-class.html#XPATH_UNKNOWN_FUNC_ERROR -lxml.etree.ErrorTypes.C14N_UNKNOW_NODE lxml.etree.ErrorTypes-class.html#C14N_UNKNOW_NODE -lxml.etree.ErrorTypes.SCHEMAP_INVALID_MAXOCCURS lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_MAXOCCURS -lxml.etree.ErrorTypes.SCHEMAV_NOTTOPLEVEL lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTTOPLEVEL -lxml.etree.ErrorTypes.SCHEMAP_WILDCARD_INVALID_NS_MEMBER lxml.etree.ErrorTypes-class.html#SCHEMAP_WILDCARD_INVALID_NS_MEMBER -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_LIST_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_LIST_CHILD -lxml.etree.ErrorTypes.WAR_LANG_VALUE lxml.etree.ErrorTypes-class.html#WAR_LANG_VALUE -lxml.etree.ErrorTypes.SCHEMAP_DERIVATION_OK_RESTRICTION_4_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_4_1 -lxml.etree.ErrorTypes.SCHEMAP_DERIVATION_OK_RESTRICTION_4_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_4_2 -lxml.etree.ErrorTypes.SCHEMAP_DERIVATION_OK_RESTRICTION_4_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_4_3 -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_PREFIX lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_PREFIX -lxml.etree.ErrorTypes.ERR_STRING_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_STRING_NOT_STARTED -lxml.etree.ErrorTypes.SCHEMAP_RECURSIVE lxml.etree.ErrorTypes-class.html#SCHEMAP_RECURSIVE -lxml.etree.ErrorTypes.CHECK_ENTITY_TYPE lxml.etree.ErrorTypes-class.html#CHECK_ENTITY_TYPE -lxml.etree.ErrorTypes.RNGP_EMPTY_CONSTRUCT lxml.etree.ErrorTypes-class.html#RNGP_EMPTY_CONSTRUCT -lxml.etree.ErrorTypes.RNGP_CHOICE_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_CHOICE_CONTENT -lxml.etree.ErrorTypes.XINCLUDE_RECURSION lxml.etree.ErrorTypes-class.html#XINCLUDE_RECURSION -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_INCLUDE_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_INCLUDE_CHILD -lxml.etree.ErrorTypes.ERR_ENTITY_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_ENTITY_NOT_FINISHED -lxml.etree.ErrorTypes.IO_ENAMETOOLONG lxml.etree.ErrorTypes-class.html#IO_ENAMETOOLONG -lxml.etree.ErrorTypes.DTD_EMPTY_NOTATION lxml.etree.ErrorTypes-class.html#DTD_EMPTY_NOTATION -lxml.etree.ErrorTypes.ERR_EXT_SUBSET_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_EXT_SUBSET_NOT_FINISHED -lxml.etree.ErrorTypes.SCHEMAP_REGEXP_INVALID lxml.etree.ErrorTypes-class.html#SCHEMAP_REGEXP_INVALID -lxml.etree.ErrorTypes.SCHEMAV_CVC_MINEXCLUSIVE_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MINEXCLUSIVE_VALID -lxml.etree.ErrorTypes.RNGP_PREFIX_UNDEFINED lxml.etree.ErrorTypes-class.html#RNGP_PREFIX_UNDEFINED -lxml.etree.ErrorTypes.DTD_CONTENT_MODEL lxml.etree.ErrorTypes-class.html#DTD_CONTENT_MODEL -lxml.etree.ErrorTypes.ERR_ENTITY_PROCESSING lxml.etree.ErrorTypes-class.html#ERR_ENTITY_PROCESSING -lxml.etree.ErrorTypes.RNGP_PAT_DATA_EXCEPT_TEXT lxml.etree.ErrorTypes-class.html#RNGP_PAT_DATA_EXCEPT_TEXT -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD -lxml.etree.ErrorTypes.SCHEMAP_SRC_ATTRIBUTE_4 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_4 -lxml.etree.ErrorTypes.SCHEMAP_SRC_ATTRIBUTE_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_2 -lxml.etree.ErrorTypes.SCHEMAP_SRC_ATTRIBUTE_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_1 -lxml.etree.ErrorTypes.SCHEMAP_INCLUDE_SCHEMA_NO_URI lxml.etree.ErrorTypes-class.html#SCHEMAP_INCLUDE_SCHEMA_NO_URI -lxml.etree.ErrorTypes.SCHEMAV_ATTRUNKNOWN lxml.etree.ErrorTypes-class.html#SCHEMAV_ATTRUNKNOWN -lxml.etree.ErrorTypes.SCHEMAP_COS_CT_EXTENDS_1_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_CT_EXTENDS_1_2 -lxml.etree.ErrorTypes.SCHEMAP_COS_CT_EXTENDS_1_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_CT_EXTENDS_1_3 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_3_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_3_1 -lxml.etree.ErrorTypes.DTD_CONTENT_NOT_DETERMINIST lxml.etree.ErrorTypes-class.html#DTD_CONTENT_NOT_DETERMINIST -lxml.etree.ErrorTypes.SCHEMAV_NOROLLBACK lxml.etree.ErrorTypes-class.html#SCHEMAV_NOROLLBACK -lxml.etree.ErrorTypes.ERR_DOCUMENT_END lxml.etree.ErrorTypes-class.html#ERR_DOCUMENT_END -lxml.etree.ErrorTypes.ERR_ENTITYREF_IN_EPILOG lxml.etree.ErrorTypes-class.html#ERR_ENTITYREF_IN_EPILOG -lxml.etree.ErrorTypes.XINCLUDE_INVALID_CHAR lxml.etree.ErrorTypes-class.html#XINCLUDE_INVALID_CHAR -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_FACET_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_FACET_CHILD -lxml.etree.ErrorTypes.RNGP_DEFINE_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_DEFINE_EMPTY -lxml.etree.ErrorTypes.RNGP_PAT_ATTR_ELEM lxml.etree.ErrorTypes-class.html#RNGP_PAT_ATTR_ELEM -lxml.etree.ErrorTypes.SCHEMAP_INVALID_ATTR_INLINE_COMBINATION lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_INLINE_COMBINATION -lxml.etree.ErrorTypes.RNGP_PAT_START_INTERLEAVE lxml.etree.ErrorTypes-class.html#RNGP_PAT_START_INTERLEAVE -lxml.etree.ErrorTypes.I18N_EXCESS_HANDLER lxml.etree.ErrorTypes-class.html#I18N_EXCESS_HANDLER -lxml.etree.ErrorTypes.IO_ENETUNREACH lxml.etree.ErrorTypes-class.html#IO_ENETUNREACH -lxml.etree.ErrorTypes.RNGP_INVALID_VALUE lxml.etree.ErrorTypes-class.html#RNGP_INVALID_VALUE -lxml.etree.ErrorTypes.IO_NO_INPUT lxml.etree.ErrorTypes-class.html#IO_NO_INPUT -lxml.etree.ErrorTypes.RNGP_PAT_START_LIST lxml.etree.ErrorTypes-class.html#RNGP_PAT_START_LIST -lxml.etree.ErrorTypes.SCHEMAP_P_PROPS_CORRECT_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_P_PROPS_CORRECT_1 -lxml.etree.ErrorTypes.ERR_ATTRIBUTE_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_ATTRIBUTE_NOT_STARTED -lxml.etree.ErrorTypes.CHECK_NOT_ATTR lxml.etree.ErrorTypes-class.html#CHECK_NOT_ATTR -lxml.etree.ErrorTypes.CHECK_NOT_ENTITY_DECL lxml.etree.ErrorTypes-class.html#CHECK_NOT_ENTITY_DECL -lxml.etree.ErrorTypes.ERR_ENTITYREF_IN_PROLOG lxml.etree.ErrorTypes-class.html#ERR_ENTITYREF_IN_PROLOG -lxml.etree.ErrorTypes.ERR_PEREF_NO_NAME lxml.etree.ErrorTypes-class.html#ERR_PEREF_NO_NAME -lxml.etree.ErrorTypes.RNGP_FOREIGN_ELEMENT lxml.etree.ErrorTypes-class.html#RNGP_FOREIGN_ELEMENT -lxml.etree.ErrorTypes.SCHEMAP_DERIVATION_OK_RESTRICTION_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_2 -lxml.etree.ErrorTypes.CHECK_NOT_ATTR_DECL lxml.etree.ErrorTypes-class.html#CHECK_NOT_ATTR_DECL -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_FACET_TYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_FACET_TYPE -lxml.etree.ErrorTypes.SCHEMAP_SRC_IMPORT_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_2 -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_2_3_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_2 -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_2_3_2_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_3 -lxml.etree.ErrorTypes.XINCLUDE_HREF_URI lxml.etree.ErrorTypes-class.html#XINCLUDE_HREF_URI -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_2_3_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_1 -lxml.etree.ErrorTypes.ERR_SEPARATOR_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_SEPARATOR_REQUIRED -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_2_3_2_4 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_4 -lxml.etree.ErrorTypes.FTP_PASV_ANSWER lxml.etree.ErrorTypes-class.html#FTP_PASV_ANSWER -lxml.etree.ErrorTypes.SAVE_NO_DOCTYPE lxml.etree.ErrorTypes-class.html#SAVE_NO_DOCTYPE -lxml.etree.ErrorTypes.DTD_NO_PREFIX lxml.etree.ErrorTypes-class.html#DTD_NO_PREFIX -lxml.etree.ErrorTypes.ERR_MIXED_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_MIXED_NOT_STARTED -lxml.etree.ErrorTypes.ERR_ENTITYREF_SEMICOL_MISSING lxml.etree.ErrorTypes-class.html#ERR_ENTITYREF_SEMICOL_MISSING -lxml.etree.ErrorTypes.ERR_CONDSEC_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_CONDSEC_NOT_FINISHED -lxml.etree.ErrorTypes.RNGP_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_EMPTY -lxml.etree.ErrorTypes.RNGP_PARENTREF_NO_PARENT lxml.etree.ErrorTypes-class.html#RNGP_PARENTREF_NO_PARENT -lxml.etree.ErrorTypes.RNGP_PAT_DATA_EXCEPT_ELEM lxml.etree.ErrorTypes-class.html#RNGP_PAT_DATA_EXCEPT_ELEM -lxml.etree.ErrorTypes.WAR_SPACE_VALUE lxml.etree.ErrorTypes-class.html#WAR_SPACE_VALUE -lxml.etree.ErrorTypes.ERR_MIXED_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_MIXED_NOT_FINISHED -lxml.etree.ErrorTypes.SCHEMAP_WARN_ATTR_POINTLESS_PROH lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_ATTR_POINTLESS_PROH -lxml.etree.ErrorTypes.RNGP_START_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_START_CONTENT -lxml.etree.ErrorTypes.RNGP_DEF_CHOICE_AND_INTERLEAVE lxml.etree.ErrorTypes-class.html#RNGP_DEF_CHOICE_AND_INTERLEAVE -lxml.etree.ErrorTypes.SCHEMAV_CVC_MAXINCLUSIVE_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MAXINCLUSIVE_VALID -lxml.etree.ErrorTypes.CATALOG_MISSING_ATTR lxml.etree.ErrorTypes-class.html#CATALOG_MISSING_ATTR -lxml.etree.ErrorTypes.SCHEMAV_CONSTRUCT lxml.etree.ErrorTypes-class.html#SCHEMAV_CONSTRUCT -lxml.etree.ErrorTypes.ERR_ATTRIBUTE_REDEFINED lxml.etree.ErrorTypes-class.html#ERR_ATTRIBUTE_REDEFINED -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_REF lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_REF -lxml.etree.ErrorTypes.SCHEMAV_CVC_MAXEXCLUSIVE_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MAXEXCLUSIVE_VALID -lxml.etree.ErrorTypes.RNGP_ANYNAME_ATTR_ANCESTOR lxml.etree.ErrorTypes-class.html#RNGP_ANYNAME_ATTR_ANCESTOR -lxml.etree.ErrorTypes.DTD_DIFFERENT_PREFIX lxml.etree.ErrorTypes-class.html#DTD_DIFFERENT_PREFIX -lxml.etree.ErrorTypes.RNGP_EXTERNAL_REF_FAILURE lxml.etree.ErrorTypes-class.html#RNGP_EXTERNAL_REF_FAILURE -lxml.etree.ErrorTypes.CATALOG_PREFER_VALUE lxml.etree.ErrorTypes-class.html#CATALOG_PREFER_VALUE -lxml.etree.ErrorTypes.XPTR_RESOURCE_ERROR lxml.etree.ErrorTypes-class.html#XPTR_RESOURCE_ERROR -lxml.etree.ErrorTypes.DTD_ATTRIBUTE_REDEFINED lxml.etree.ErrorTypes-class.html#DTD_ATTRIBUTE_REDEFINED -lxml.etree.ErrorTypes.XPATH_MEMORY_ERROR lxml.etree.ErrorTypes-class.html#XPATH_MEMORY_ERROR -lxml.etree.ErrorTypes.IO_EBADMSG lxml.etree.ErrorTypes-class.html#IO_EBADMSG -lxml.etree.ErrorTypes.IO_ENCODER lxml.etree.ErrorTypes-class.html#IO_ENCODER -lxml.etree.ErrorTypes.RNGP_ELEM_TEXT_CONFLICT lxml.etree.ErrorTypes-class.html#RNGP_ELEM_TEXT_CONFLICT -lxml.etree.ErrorTypes.ERR_INVALID_CHARREF lxml.etree.ErrorTypes-class.html#ERR_INVALID_CHARREF -lxml.etree.ErrorTypes.SCHEMAP_ST_PROPS_CORRECT_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_ST_PROPS_CORRECT_1 -lxml.etree.ErrorTypes.SCHEMAP_ST_PROPS_CORRECT_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_ST_PROPS_CORRECT_2 -lxml.etree.ErrorTypes.ERR_ENTITYREF_IN_DTD lxml.etree.ErrorTypes-class.html#ERR_ENTITYREF_IN_DTD -lxml.etree.ErrorTypes.SCHEMAP_S4S_ATTR_INVALID_VALUE lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ATTR_INVALID_VALUE -lxml.etree.ErrorTypes.RNGP_INVALID_URI lxml.etree.ErrorTypes-class.html#RNGP_INVALID_URI -lxml.etree.ErrorTypes.RNGP_XMLNS_NAME lxml.etree.ErrorTypes-class.html#RNGP_XMLNS_NAME -lxml.etree.ErrorTypes.IO_ESPIPE lxml.etree.ErrorTypes-class.html#IO_ESPIPE -lxml.etree.ErrorTypes.CHECK_FOUND_ENTITY lxml.etree.ErrorTypes-class.html#CHECK_FOUND_ENTITY -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD -lxml.etree.ErrorTypes.RNGP_GRAMMAR_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_GRAMMAR_EMPTY -lxml.etree.ErrorTypes.RNGP_REF_CREATE_FAILED lxml.etree.ErrorTypes-class.html#RNGP_REF_CREATE_FAILED -lxml.etree.ErrorTypes.SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1 -lxml.etree.ErrorTypes.SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2 -lxml.etree.ErrorTypes.SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3 -lxml.etree.ErrorTypes.ERR_CDATA_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_CDATA_NOT_FINISHED -lxml.etree.ErrorTypes.ERR_LTSLASH_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_LTSLASH_REQUIRED -lxml.etree.ErrorTypes.SCHEMAV_NOTDETERMINIST lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTDETERMINIST -lxml.etree.ErrorTypes.IO_FLUSH lxml.etree.ErrorTypes-class.html#IO_FLUSH -lxml.etree.ErrorTypes.ERR_CHARREF_AT_EOF lxml.etree.ErrorTypes-class.html#ERR_CHARREF_AT_EOF -lxml.etree.ErrorTypes.HTML_STRUCURE_ERROR lxml.etree.ErrorTypes-class.html#HTML_STRUCURE_ERROR -lxml.etree.ErrorTypes.IO_EBADF lxml.etree.ErrorTypes-class.html#IO_EBADF -lxml.etree.ErrorTypes.SCHEMAP_ATTR_NONAME_NOREF lxml.etree.ErrorTypes-class.html#SCHEMAP_ATTR_NONAME_NOREF -lxml.etree.ErrorTypes.SCHEMAP_FAILED_BUILD_IMPORT lxml.etree.ErrorTypes-class.html#SCHEMAP_FAILED_BUILD_IMPORT -lxml.etree.ErrorTypes.CHECK_WRONG_PARENT lxml.etree.ErrorTypes-class.html#CHECK_WRONG_PARENT -lxml.etree.ErrorTypes.DTD_NOTATION_REDEFINED lxml.etree.ErrorTypes-class.html#DTD_NOTATION_REDEFINED -lxml.etree.ErrorTypes.ERR_ATTLIST_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_ATTLIST_NOT_STARTED -lxml.etree.ErrorTypes.XPATH_UNCLOSED_ERROR lxml.etree.ErrorTypes-class.html#XPATH_UNCLOSED_ERROR -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_2 -lxml.etree.ErrorTypes.RNGP_PAT_NSNAME_EXCEPT_NSNAME lxml.etree.ErrorTypes-class.html#RNGP_PAT_NSNAME_EXCEPT_NSNAME -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_1 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_6 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_6 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_7 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_7 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_5_2_2_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_2_2_2_1 -lxml.etree.ErrorTypes.SCHEMAP_SRC_IMPORT_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_2_1 -lxml.etree.ErrorTypes.SCHEMAP_SRC_IMPORT_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_2_2 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_5_2_2_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_2_2_2_2 -lxml.etree.ErrorTypes.RNGP_ELEMENT_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_ELEMENT_CONTENT -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_ATTR_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ATTR_CHILD -lxml.etree.ErrorTypes.ERR_CONDSEC_INVALID_KEYWORD lxml.etree.ErrorTypes-class.html#ERR_CONDSEC_INVALID_KEYWORD -lxml.etree.ErrorTypes.RNGP_START_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_START_EMPTY -lxml.etree.ErrorTypes.IO_EAGAIN lxml.etree.ErrorTypes-class.html#IO_EAGAIN -lxml.etree.ErrorTypes.SCHEMAV_CVC_MININCLUSIVE_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MININCLUSIVE_VALID -lxml.etree.ErrorTypes.SCHEMAV_ELEMENT_CONTENT lxml.etree.ErrorTypes-class.html#SCHEMAV_ELEMENT_CONTENT -lxml.etree.ErrorTypes.XINCLUDE_FRAGMENT_ID lxml.etree.ErrorTypes-class.html#XINCLUDE_FRAGMENT_ID -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_2_3_2_5 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_5 -lxml.etree.ErrorTypes.I18N_NO_NAME lxml.etree.ErrorTypes-class.html#I18N_NO_NAME -lxml.etree.ErrorTypes.SCHEMAP_IMPORT_SCHEMA_NOT_URI lxml.etree.ErrorTypes-class.html#SCHEMAP_IMPORT_SCHEMA_NOT_URI -lxml.etree.ErrorTypes.NS_ERR_QNAME lxml.etree.ErrorTypes-class.html#NS_ERR_QNAME -lxml.etree.ErrorTypes.SCHEMAP_UNION_NOT_EXPRESSIBLE lxml.etree.ErrorTypes-class.html#SCHEMAP_UNION_NOT_EXPRESSIBLE -lxml.etree.ErrorTypes.SCHEMAP_SRC_CT_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_CT_1 -lxml.etree.ErrorTypes.RNGP_PAT_LIST_REF lxml.etree.ErrorTypes-class.html#RNGP_PAT_LIST_REF -lxml.etree.ErrorTypes.SCHEMAP_IMPORT_REDEFINE_NSNAME lxml.etree.ErrorTypes-class.html#SCHEMAP_IMPORT_REDEFINE_NSNAME -lxml.etree.ErrorTypes.SCHEMAV_ATTRINVALID lxml.etree.ErrorTypes-class.html#SCHEMAV_ATTRINVALID -lxml.etree.ErrorTypes.RNGP_PAT_DATA_EXCEPT_ATTR lxml.etree.ErrorTypes-class.html#RNGP_PAT_DATA_EXCEPT_ATTR -lxml.etree.ErrorTypes.IO_ESRCH lxml.etree.ErrorTypes-class.html#IO_ESRCH -lxml.etree.ErrorTypes.DTD_UNKNOWN_ELEM lxml.etree.ErrorTypes-class.html#DTD_UNKNOWN_ELEM -lxml.etree.ErrorTypes.XINCLUDE_DEPRECATED_NS lxml.etree.ErrorTypes-class.html#XINCLUDE_DEPRECATED_NS -lxml.etree.ErrorTypes.ERR_CHARREF_IN_EPILOG lxml.etree.ErrorTypes-class.html#ERR_CHARREF_IN_EPILOG -lxml.etree.ErrorTypes.RNGP_UNKNOWN_TYPE_LIB lxml.etree.ErrorTypes-class.html#RNGP_UNKNOWN_TYPE_LIB -lxml.etree.ErrorTypes.ERR_NMTOKEN_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_NMTOKEN_REQUIRED -lxml.etree.ErrorTypes.DTD_NOT_EMPTY lxml.etree.ErrorTypes-class.html#DTD_NOT_EMPTY -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_1 -lxml.etree.ErrorTypes.ERR_PEREF_IN_PROLOG lxml.etree.ErrorTypes-class.html#ERR_PEREF_IN_PROLOG -lxml.etree.ErrorTypes.SCHEMAP_NOT_DETERMINISTIC lxml.etree.ErrorTypes-class.html#SCHEMAP_NOT_DETERMINISTIC -lxml.etree.ErrorTypes.SCHEMAP_E_PROPS_CORRECT_6 lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_6 -lxml.etree.ErrorTypes.SCHEMAP_E_PROPS_CORRECT_5 lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_5 -lxml.etree.ErrorTypes.SCHEMAP_E_PROPS_CORRECT_4 lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_4 -lxml.etree.ErrorTypes.SCHEMAP_E_PROPS_CORRECT_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_3 -lxml.etree.ErrorTypes.SCHEMAP_E_PROPS_CORRECT_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_2 -lxml.etree.ErrorTypes.IO_EROFS lxml.etree.ErrorTypes-class.html#IO_EROFS -lxml.etree.ErrorTypes.RNGP_PAT_DATA_EXCEPT_ONEMORE lxml.etree.ErrorTypes-class.html#RNGP_PAT_DATA_EXCEPT_ONEMORE -lxml.etree.ErrorTypes.SCHEMAP_IMPORT_NAMESPACE_NOT_URI lxml.etree.ErrorTypes-class.html#SCHEMAP_IMPORT_NAMESPACE_NOT_URI -lxml.etree.ErrorTypes.SCHEMAP_FAILED_PARSE lxml.etree.ErrorTypes-class.html#SCHEMAP_FAILED_PARSE -lxml.etree.ErrorTypes.XPTR_SYNTAX_ERROR lxml.etree.ErrorTypes-class.html#XPTR_SYNTAX_ERROR -lxml.etree.ErrorTypes.MODULE_CLOSE lxml.etree.ErrorTypes-class.html#MODULE_CLOSE -lxml.etree.ErrorTypes.CHECK_NO_PARENT lxml.etree.ErrorTypes-class.html#CHECK_NO_PARENT -lxml.etree.ErrorTypes.SCHEMAP_REDEFINED_GROUP lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_GROUP -lxml.etree.ErrorTypes.IO_EEXIST lxml.etree.ErrorTypes-class.html#IO_EEXIST -lxml.etree.ErrorTypes.REGEXP_COMPILE_ERROR lxml.etree.ErrorTypes-class.html#REGEXP_COMPILE_ERROR -lxml.etree.ErrorTypes.CATALOG_RECURSION lxml.etree.ErrorTypes-class.html#CATALOG_RECURSION -lxml.etree.ErrorTypes.WAR_CATALOG_PI lxml.etree.ErrorTypes-class.html#WAR_CATALOG_PI -lxml.etree.ErrorTypes.ERR_ELEMCONTENT_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_ELEMCONTENT_NOT_FINISHED -lxml.etree.ErrorTypes.ERR_LT_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_LT_REQUIRED -lxml.etree.ErrorTypes.RNGP_PARSE_ERROR lxml.etree.ErrorTypes-class.html#RNGP_PARSE_ERROR -lxml.etree.ErrorTypes.RNGP_HREF_ERROR lxml.etree.ErrorTypes-class.html#RNGP_HREF_ERROR -lxml.etree.ErrorTypes.RNGP_START_MISSING lxml.etree.ErrorTypes-class.html#RNGP_START_MISSING -lxml.etree.ErrorTypes.ERR_EXT_ENTITY_STANDALONE lxml.etree.ErrorTypes-class.html#ERR_EXT_ENTITY_STANDALONE -lxml.etree.ErrorTypes.ERR_ENTITY_IS_PARAMETER lxml.etree.ErrorTypes-class.html#ERR_ENTITY_IS_PARAMETER -lxml.etree.ErrorTypes.RNGP_URI_FRAGMENT lxml.etree.ErrorTypes-class.html#RNGP_URI_FRAGMENT -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_5_1_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_1_2 -lxml.etree.ErrorTypes.ERR_XMLDECL_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_XMLDECL_NOT_STARTED -lxml.etree.ErrorTypes.XINCLUDE_NO_HREF lxml.etree.ErrorTypes-class.html#XINCLUDE_NO_HREF -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_5_1_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_1_1 -lxml.etree.ErrorTypes.CHECK_FOUND_ATTRIBUTE lxml.etree.ErrorTypes-class.html#CHECK_FOUND_ATTRIBUTE -lxml.etree.ErrorTypes.ERR_USER_STOP lxml.etree.ErrorTypes-class.html#ERR_USER_STOP -lxml.etree.ErrorTypes.SCHEMAP_SIMPLETYPE_NONAME lxml.etree.ErrorTypes-class.html#SCHEMAP_SIMPLETYPE_NONAME -lxml.etree.ErrorTypes.SCHEMAP_SRC_INCLUDE lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_INCLUDE -lxml.etree.ErrorTypes.RNGP_INTERLEAVE_ADD lxml.etree.ErrorTypes-class.html#RNGP_INTERLEAVE_ADD -lxml.etree.ErrorTypes.CHECK_NO_HREF lxml.etree.ErrorTypes-class.html#CHECK_NO_HREF -lxml.etree.ErrorTypes.RNGP_TYPE_VALUE lxml.etree.ErrorTypes-class.html#RNGP_TYPE_VALUE -lxml.etree.ErrorTypes.SCHEMAP_EXTENSION_NO_BASE lxml.etree.ErrorTypes-class.html#SCHEMAP_EXTENSION_NO_BASE -lxml.etree.ErrorTypes.RNGP_PAT_ANYNAME_EXCEPT_ANYNAME lxml.etree.ErrorTypes-class.html#RNGP_PAT_ANYNAME_EXCEPT_ANYNAME -lxml.etree.ErrorTypes.SCHEMAP_REDEFINED_TYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_TYPE -lxml.etree.ErrorTypes.ERR_ENTITYREF_AT_EOF lxml.etree.ErrorTypes-class.html#ERR_ENTITYREF_AT_EOF -lxml.etree.ErrorTypes.C14N_CREATE_CTXT lxml.etree.ErrorTypes-class.html#C14N_CREATE_CTXT -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_3_3_2_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_3 -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_3_3_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_2 -lxml.etree.ErrorTypes.RNGP_PAT_START_ONEMORE lxml.etree.ErrorTypes-class.html#RNGP_PAT_START_ONEMORE -lxml.etree.ErrorTypes.ERR_ENTITY_BOUNDARY lxml.etree.ErrorTypes-class.html#ERR_ENTITY_BOUNDARY -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_3_3_2_5 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_5 -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_3_3_2_4 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_4 -lxml.etree.ErrorTypes.ERR_UNKNOWN_ENCODING lxml.etree.ErrorTypes-class.html#ERR_UNKNOWN_ENCODING -lxml.etree.ErrorTypes.HTML_UNKNOWN_TAG lxml.etree.ErrorTypes-class.html#HTML_UNKNOWN_TAG -lxml.etree.ErrorTypes.SCHEMAP_INVALID_REF_AND_SUBTYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_REF_AND_SUBTYPE -lxml.etree.ErrorTypes.DTD_INVALID_DEFAULT lxml.etree.ErrorTypes-class.html#DTD_INVALID_DEFAULT -lxml.etree.ErrorTypes.C14N_RELATIVE_NAMESPACE lxml.etree.ErrorTypes-class.html#C14N_RELATIVE_NAMESPACE -lxml.etree.ErrorTypes.SCHEMAP_FACET_NO_VALUE lxml.etree.ErrorTypes-class.html#SCHEMAP_FACET_NO_VALUE -lxml.etree.ErrorTypes.CHECK_NO_DOC lxml.etree.ErrorTypes-class.html#CHECK_NO_DOC -lxml.etree.ErrorTypes.IO_EFBIG lxml.etree.ErrorTypes-class.html#IO_EFBIG -lxml.etree.ErrorTypes.SCHEMAP_INVALID_WHITE_SPACE lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_WHITE_SPACE -lxml.etree.ErrorTypes.RNGP_NSNAME_ATTR_ANCESTOR lxml.etree.ErrorTypes-class.html#RNGP_NSNAME_ATTR_ANCESTOR -lxml.etree.ErrorTypes.DTD_NO_ROOT lxml.etree.ErrorTypes-class.html#DTD_NO_ROOT -lxml.etree.ErrorTypes.SCHEMAP_S4S_ELEM_NOT_ALLOWED lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ELEM_NOT_ALLOWED -lxml.etree.ErrorTypes.RNGP_START_CHOICE_AND_INTERLEAVE lxml.etree.ErrorTypes-class.html#RNGP_START_CHOICE_AND_INTERLEAVE -lxml.etree.ErrorTypes.DTD_UNKNOWN_NOTATION lxml.etree.ErrorTypes-class.html#DTD_UNKNOWN_NOTATION -lxml.etree.ErrorTypes.ERR_NS_DECL_ERROR lxml.etree.ErrorTypes-class.html#ERR_NS_DECL_ERROR -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_GROUP_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_GROUP_CHILD -lxml.etree.ErrorTypes.RNGP_PAT_LIST_LIST lxml.etree.ErrorTypes-class.html#RNGP_PAT_LIST_LIST -lxml.etree.ErrorTypes.CHECK_WRONG_DOC lxml.etree.ErrorTypes-class.html#CHECK_WRONG_DOC -lxml.etree.ErrorTypes.ERR_LITERAL_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_LITERAL_NOT_FINISHED -lxml.etree.ErrorTypes.CHECK_FOUND_CDATA lxml.etree.ErrorTypes-class.html#CHECK_FOUND_CDATA -lxml.etree.ErrorTypes.SAVE_UNKNOWN_ENCODING lxml.etree.ErrorTypes-class.html#SAVE_UNKNOWN_ENCODING -lxml.etree.ErrorTypes.RNGP_GRAMMAR_MISSING lxml.etree.ErrorTypes-class.html#RNGP_GRAMMAR_MISSING -lxml.etree.ErrorTypes.SCHEMAV_NOTSIMPLE lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTSIMPLE -lxml.etree.ErrorTypes.DTD_ID_REDEFINED lxml.etree.ErrorTypes-class.html#DTD_ID_REDEFINED -lxml.etree.ErrorTypes.SCHEMAP_REDEFINED_ATTR lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_ATTR -lxml.etree.ErrorTypes.RNGP_ERROR_TYPE_LIB lxml.etree.ErrorTypes-class.html#RNGP_ERROR_TYPE_LIB -lxml.etree.ErrorTypes.CHECK_NAME_NOT_NULL lxml.etree.ErrorTypes-class.html#CHECK_NAME_NOT_NULL -lxml.etree.ErrorTypes.IO_UNKNOWN lxml.etree.ErrorTypes-class.html#IO_UNKNOWN -lxml.etree.ErrorTypes.HTTP_URL_SYNTAX lxml.etree.ErrorTypes-class.html#HTTP_URL_SYNTAX -lxml.etree.ErrorTypes.RNGP_NAME_MISSING lxml.etree.ErrorTypes-class.html#RNGP_NAME_MISSING -lxml.etree.ErrorTypes.CHECK_WRONG_NEXT lxml.etree.ErrorTypes-class.html#CHECK_WRONG_NEXT -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD -lxml.etree.ErrorTypes.SCHEMAP_NOATTR_NOREF lxml.etree.ErrorTypes-class.html#SCHEMAP_NOATTR_NOREF -lxml.etree.ErrorTypes.SAVE_NOT_UTF8 lxml.etree.ErrorTypes-class.html#SAVE_NOT_UTF8 -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_3_3_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_1 -lxml.etree.ErrorTypes.CHECK_NOT_UTF8 lxml.etree.ErrorTypes-class.html#CHECK_NOT_UTF8 -lxml.etree.ErrorTypes.DTD_NO_DTD lxml.etree.ErrorTypes-class.html#DTD_NO_DTD -lxml.etree.ErrorTypes.RNGP_PAT_LIST_INTERLEAVE lxml.etree.ErrorTypes-class.html#RNGP_PAT_LIST_INTERLEAVE -lxml.etree.ErrorTypes.ERR_ENTITY_PE_INTERNAL lxml.etree.ErrorTypes-class.html#ERR_ENTITY_PE_INTERNAL -lxml.etree.ErrorTypes.RNGP_INTERLEAVE_NO_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_INTERLEAVE_NO_CONTENT -lxml.etree.ErrorTypes.ERR_CONDSEC_INVALID lxml.etree.ErrorTypes-class.html#ERR_CONDSEC_INVALID -lxml.etree.ErrorTypes.RNGP_ELEM_CONTENT_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_ELEM_CONTENT_EMPTY -lxml.etree.ErrorTypes.SCHEMAP_NOROOT lxml.etree.ErrorTypes-class.html#SCHEMAP_NOROOT -lxml.etree.ErrorTypes.CHECK_UNKNOWN_NODE lxml.etree.ErrorTypes-class.html#CHECK_UNKNOWN_NODE -lxml.etree.ErrorTypes.XINCLUDE_UNKNOWN_ENCODING lxml.etree.ErrorTypes-class.html#XINCLUDE_UNKNOWN_ENCODING -lxml.etree.ErrorTypes.XPATH_INVALID_TYPE lxml.etree.ErrorTypes-class.html#XPATH_INVALID_TYPE -lxml.etree.ErrorTypes.RNGP_PARENTREF_CREATE_FAILED lxml.etree.ErrorTypes-class.html#RNGP_PARENTREF_CREATE_FAILED -lxml.etree.ErrorTypes.CHECK_NO_PREV lxml.etree.ErrorTypes-class.html#CHECK_NO_PREV -lxml.etree.ErrorTypes.XPATH_INVALID_CTXT_SIZE lxml.etree.ErrorTypes-class.html#XPATH_INVALID_CTXT_SIZE -lxml.etree.ErrorTypes.RNGP_DATA_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_DATA_CONTENT -lxml.etree.ErrorTypes.SCHEMAP_S4S_ELEM_MISSING lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ELEM_MISSING -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_BASE_TYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_BASE_TYPE -lxml.etree.ErrorTypes.XINCLUDE_NO_FALLBACK lxml.etree.ErrorTypes-class.html#XINCLUDE_NO_FALLBACK -lxml.etree.ErrorTypes.IO_WRITE lxml.etree.ErrorTypes-class.html#IO_WRITE -lxml.etree.ErrorTypes.SCHEMAP_SRC_RESOLVE lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_RESOLVE -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_3_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_1 -lxml.etree.ErrorTypes.SCHEMAV_DOCUMENT_ELEMENT_MISSING lxml.etree.ErrorTypes-class.html#SCHEMAV_DOCUMENT_ELEMENT_MISSING -lxml.etree.ErrorTypes.RNGP_PAT_DATA_EXCEPT_REF lxml.etree.ErrorTypes-class.html#RNGP_PAT_DATA_EXCEPT_REF -lxml.etree.ErrorTypes.CHECK_NO_NAME lxml.etree.ErrorTypes-class.html#CHECK_NO_NAME -lxml.etree.ErrorTypes.IO_ENOSPC lxml.etree.ErrorTypes-class.html#IO_ENOSPC -lxml.etree.ErrorTypes.SCHEMAP_AU_PROPS_CORRECT lxml.etree.ErrorTypes-class.html#SCHEMAP_AU_PROPS_CORRECT -lxml.etree.ErrorTypes.TREE_NOT_UTF8 lxml.etree.ErrorTypes-class.html#TREE_NOT_UTF8 -lxml.etree.ErrorTypes.RNGP_PAT_LIST_ELEM lxml.etree.ErrorTypes-class.html#RNGP_PAT_LIST_ELEM -lxml.etree.ErrorTypes.XPATH_EXPRESSION_OK lxml.etree.ErrorTypes-class.html#XPATH_EXPRESSION_OK -lxml.etree.ErrorTypes.XPTR_SUB_RESOURCE_ERROR lxml.etree.ErrorTypes-class.html#XPTR_SUB_RESOURCE_ERROR -lxml.etree.ErrorTypes.SCHEMAP_ELEM_DEFAULT_FIXED lxml.etree.ErrorTypes-class.html#SCHEMAP_ELEM_DEFAULT_FIXED -lxml.etree.ErrorTypes.WAR_ENTITY_REDEFINED lxml.etree.ErrorTypes-class.html#WAR_ENTITY_REDEFINED -lxml.etree.ErrorTypes.DTD_XMLID_VALUE lxml.etree.ErrorTypes-class.html#DTD_XMLID_VALUE -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_2 -lxml.etree.ErrorTypes.RNGP_GRAMMAR_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_GRAMMAR_CONTENT -lxml.etree.ErrorTypes.ERR_CHARREF_IN_DTD lxml.etree.ErrorTypes-class.html#ERR_CHARREF_IN_DTD -lxml.etree.ErrorTypes.I18N_NO_HANDLER lxml.etree.ErrorTypes-class.html#I18N_NO_HANDLER -lxml.etree.ErrorTypes.SCHEMAV_CVC_FACET_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_FACET_VALID -lxml.etree.ErrorTypes.DTD_MIXED_CORRUPT lxml.etree.ErrorTypes-class.html#DTD_MIXED_CORRUPT -lxml.etree.ErrorTypes.ERR_INVALID_DEC_CHARREF lxml.etree.ErrorTypes-class.html#ERR_INVALID_DEC_CHARREF -lxml.etree.ErrorTypes.SCHEMAV_CVC_TOTALDIGITS_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TOTALDIGITS_VALID -lxml.etree.ErrorTypes.CHECK_NOT_NCNAME lxml.etree.ErrorTypes-class.html#CHECK_NOT_NCNAME -lxml.etree.ErrorTypes.SCHEMAP_INVALID_ENUM lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ENUM -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_MEMBER_TYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_MEMBER_TYPE -lxml.etree.ErrorTypes.ERR_SPACE_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_SPACE_REQUIRED -lxml.etree.ErrorTypes.SCHEMAP_COMPLEXTYPE_NONAME_NOREF lxml.etree.ErrorTypes-class.html#SCHEMAP_COMPLEXTYPE_NONAME_NOREF -lxml.etree.ErrorTypes.RNGP_PAT_START_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_PAT_START_EMPTY -lxml.etree.ErrorTypes.ERR_DOCUMENT_EMPTY lxml.etree.ErrorTypes-class.html#ERR_DOCUMENT_EMPTY -lxml.etree.ErrorTypes.SCHEMAV_EXTRACONTENT lxml.etree.ErrorTypes-class.html#SCHEMAV_EXTRACONTENT -lxml.etree.ErrorTypes.SAVE_CHAR_INVALID lxml.etree.ErrorTypes-class.html#SAVE_CHAR_INVALID -lxml.etree.ErrorTypes.RNGP_XML_NS lxml.etree.ErrorTypes-class.html#RNGP_XML_NS -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD -lxml.etree.ErrorTypes.DTD_ATTRIBUTE_DEFAULT lxml.etree.ErrorTypes-class.html#DTD_ATTRIBUTE_DEFAULT -lxml.etree.ErrorTypes.IO_ENOTSUP lxml.etree.ErrorTypes-class.html#IO_ENOTSUP -lxml.etree.ErrorTypes.DTD_UNKNOWN_ATTRIBUTE lxml.etree.ErrorTypes-class.html#DTD_UNKNOWN_ATTRIBUTE -lxml.etree.ErrorTypes.XINCLUDE_INCLUDE_IN_INCLUDE lxml.etree.ErrorTypes-class.html#XINCLUDE_INCLUDE_IN_INCLUDE -lxml.etree.ErrorTypes.XPATH_UNFINISHED_LITERAL_ERROR lxml.etree.ErrorTypes-class.html#XPATH_UNFINISHED_LITERAL_ERROR -lxml.etree.ErrorTypes.SCHEMAP_ATTRGRP_NONAME_NOREF lxml.etree.ErrorTypes-class.html#SCHEMAP_ATTRGRP_NONAME_NOREF -lxml.etree.ErrorTypes.SCHEMAV_WRONGELEM lxml.etree.ErrorTypes-class.html#SCHEMAV_WRONGELEM -lxml.etree.ErrorTypes.SCHEMAP_INVALID_MINOCCURS lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_MINOCCURS -lxml.etree.ErrorTypes.RNGP_PARENTREF_NAME_INVALID lxml.etree.ErrorTypes-class.html#RNGP_PARENTREF_NAME_INVALID -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_1_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_1 -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_1_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_2 -lxml.etree.ErrorTypes.IO_ENODEV lxml.etree.ErrorTypes-class.html#IO_ENODEV -lxml.etree.ErrorTypes.SCHEMAP_COS_VALID_DEFAULT_2_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_2_2_2 -lxml.etree.ErrorTypes.IO_EBUSY lxml.etree.ErrorTypes-class.html#IO_EBUSY -lxml.etree.ErrorTypes.C14N_REQUIRES_UTF8 lxml.etree.ErrorTypes-class.html#C14N_REQUIRES_UTF8 -lxml.etree.ErrorTypes.SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE -lxml.etree.ErrorTypes.ERR_URI_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_URI_REQUIRED -lxml.etree.ErrorTypes.IO_EADDRINUSE lxml.etree.ErrorTypes-class.html#IO_EADDRINUSE -lxml.etree.ErrorTypes.SCHEMAV_INTERNAL lxml.etree.ErrorTypes-class.html#SCHEMAV_INTERNAL -lxml.etree.ErrorTypes.RNGP_VALUE_NO_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_VALUE_NO_CONTENT -lxml.etree.ErrorTypes.NS_ERR_UNDEFINED_NAMESPACE lxml.etree.ErrorTypes-class.html#NS_ERR_UNDEFINED_NAMESPACE -lxml.etree.ErrorTypes.SCHEMAP_A_PROPS_CORRECT_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_A_PROPS_CORRECT_2 -lxml.etree.ErrorTypes.CHECK_FOUND_ELEMENT lxml.etree.ErrorTypes-class.html#CHECK_FOUND_ELEMENT -lxml.etree.ErrorTypes.RNGP_ELEM_CONTENT_ERROR lxml.etree.ErrorTypes-class.html#RNGP_ELEM_CONTENT_ERROR -lxml.etree.ErrorTypes.SCHEMAP_RESTRICTION_NONAME_NOREF lxml.etree.ErrorTypes-class.html#SCHEMAP_RESTRICTION_NONAME_NOREF -lxml.etree.ErrorTypes.HTTP_USE_IP lxml.etree.ErrorTypes-class.html#HTTP_USE_IP -lxml.etree.ErrorTypes.SCHEMAP_SRC_ELEMENT_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_1 -lxml.etree.ErrorTypes.SCHEMAP_SRC_ELEMENT_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_3 -lxml.etree.ErrorTypes.ERR_ATTRIBUTE_NOT_FINISHED lxml.etree.ErrorTypes-class.html#ERR_ATTRIBUTE_NOT_FINISHED -lxml.etree.ErrorTypes.SCHEMAV_CVC_TYPE_3_1_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_3_1_1 -lxml.etree.ErrorTypes.SCHEMAV_CVC_TYPE_3_1_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_3_1_2 -lxml.etree.ErrorTypes.SCHEMATRONV_REPORT lxml.etree.ErrorTypes-class.html#SCHEMATRONV_REPORT -lxml.etree.ErrorTypes.SCHEMAV_MISC lxml.etree.ErrorTypes-class.html#SCHEMAV_MISC -lxml.etree.ErrorTypes.IO_EPIPE lxml.etree.ErrorTypes-class.html#IO_EPIPE -lxml.etree.ErrorTypes.SCHEMAP_SRC_ATTRIBUTE_GROUP_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_GROUP_1 -lxml.etree.ErrorTypes.SCHEMAP_SRC_ATTRIBUTE_GROUP_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_GROUP_3 -lxml.etree.ErrorTypes.SCHEMAP_SRC_ATTRIBUTE_GROUP_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_GROUP_2 -lxml.etree.ErrorTypes.IO_EAFNOSUPPORT lxml.etree.ErrorTypes-class.html#IO_EAFNOSUPPORT -lxml.etree.ErrorTypes.SCHEMAP_WARN_SKIP_SCHEMA lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_SKIP_SCHEMA -lxml.etree.ErrorTypes.SCHEMAP_A_PROPS_CORRECT_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_A_PROPS_CORRECT_3 -lxml.etree.ErrorTypes.CHECK_FOUND_DOCTYPE lxml.etree.ErrorTypes-class.html#CHECK_FOUND_DOCTYPE -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD -lxml.etree.ErrorTypes.TREE_UNTERMINATED_ENTITY lxml.etree.ErrorTypes-class.html#TREE_UNTERMINATED_ENTITY -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_1 -lxml.etree.ErrorTypes.WAR_UNDECLARED_ENTITY lxml.etree.ErrorTypes-class.html#WAR_UNDECLARED_ENTITY -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_4 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_4 -lxml.etree.ErrorTypes.RNGP_UNKNOWN_CONSTRUCT lxml.etree.ErrorTypes-class.html#RNGP_UNKNOWN_CONSTRUCT -lxml.etree.ErrorTypes.SCHEMAP_WARN_ATTR_REDECL_PROH lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_ATTR_REDECL_PROH -lxml.etree.ErrorTypes.ERR_ENTITY_IS_EXTERNAL lxml.etree.ErrorTypes-class.html#ERR_ENTITY_IS_EXTERNAL -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_3_3_1_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_1_2 -lxml.etree.ErrorTypes.RNGP_INVALID_DEFINE_NAME lxml.etree.ErrorTypes-class.html#RNGP_INVALID_DEFINE_NAME -lxml.etree.ErrorTypes.SCHEMAP_PREFIX_UNDEFINED lxml.etree.ErrorTypes-class.html#SCHEMAP_PREFIX_UNDEFINED -lxml.etree.ErrorTypes.RNGP_PAT_DATA_EXCEPT_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_PAT_DATA_EXCEPT_EMPTY -lxml.etree.ErrorTypes.SCHEMAV_INVALIDELEM lxml.etree.ErrorTypes-class.html#SCHEMAV_INVALIDELEM -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_IMPORT_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_IMPORT_CHILD -lxml.etree.ErrorTypes.RNGP_EXTERNALREF_EMTPY lxml.etree.ErrorTypes-class.html#RNGP_EXTERNALREF_EMTPY -lxml.etree.ErrorTypes.SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE lxml.etree.ErrorTypes-class.html#SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE -lxml.etree.ErrorTypes.IO_EALREADY lxml.etree.ErrorTypes-class.html#IO_EALREADY -lxml.etree.ErrorTypes.WAR_NS_URI lxml.etree.ErrorTypes-class.html#WAR_NS_URI -lxml.etree.ErrorTypes.SCHEMAP_REF_AND_CONTENT lxml.etree.ErrorTypes-class.html#SCHEMAP_REF_AND_CONTENT -lxml.etree.ErrorTypes.ERR_UNDECLARED_ENTITY lxml.etree.ErrorTypes-class.html#ERR_UNDECLARED_ENTITY -lxml.etree.ErrorTypes.IO_NETWORK_ATTEMPT lxml.etree.ErrorTypes-class.html#IO_NETWORK_ATTEMPT -lxml.etree.ErrorTypes.ERR_INVALID_CHAR lxml.etree.ErrorTypes-class.html#ERR_INVALID_CHAR -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_5_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_2_1 -lxml.etree.ErrorTypes.SCHEMAP_GROUP_NONAME_NOREF lxml.etree.ErrorTypes-class.html#SCHEMAP_GROUP_NONAME_NOREF -lxml.etree.ErrorTypes.ERR_LITERAL_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_LITERAL_NOT_STARTED -lxml.etree.ErrorTypes.SCHEMAP_CT_PROPS_CORRECT_5 lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_5 -lxml.etree.ErrorTypes.SCHEMAP_REDEFINED_ELEMENT lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_ELEMENT -lxml.etree.ErrorTypes.SCHEMAP_CVC_SIMPLE_TYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_CVC_SIMPLE_TYPE -lxml.etree.ErrorTypes.ERR_UNKNOWN_VERSION lxml.etree.ErrorTypes-class.html#ERR_UNKNOWN_VERSION -lxml.etree.ErrorTypes.SCHEMAP_NOT_SCHEMA lxml.etree.ErrorTypes-class.html#SCHEMAP_NOT_SCHEMA -lxml.etree.ErrorTypes.RNGP_UNKNOWN_COMBINE lxml.etree.ErrorTypes-class.html#RNGP_UNKNOWN_COMBINE -lxml.etree.ErrorTypes.SCHEMAP_SRC_ELEMENT_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_2_1 -lxml.etree.ErrorTypes.CHECK_NOT_DTD lxml.etree.ErrorTypes-class.html#CHECK_NOT_DTD -lxml.etree.ErrorTypes.CHECK_NO_NEXT lxml.etree.ErrorTypes-class.html#CHECK_NO_NEXT -lxml.etree.ErrorTypes.ERR_NOT_WELL_BALANCED lxml.etree.ErrorTypes-class.html#ERR_NOT_WELL_BALANCED -lxml.etree.ErrorTypes.RNGP_REF_CYCLE lxml.etree.ErrorTypes-class.html#RNGP_REF_CYCLE -lxml.etree.ErrorTypes.SCHEMAP_CT_PROPS_CORRECT_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_1 -lxml.etree.ErrorTypes.SCHEMAV_FACET lxml.etree.ErrorTypes-class.html#SCHEMAV_FACET -lxml.etree.ErrorTypes.ERR_ENCODING_NAME lxml.etree.ErrorTypes-class.html#ERR_ENCODING_NAME -lxml.etree.ErrorTypes.SCHEMAV_NOROOT lxml.etree.ErrorTypes-class.html#SCHEMAV_NOROOT -lxml.etree.ErrorTypes.DTD_XMLID_TYPE lxml.etree.ErrorTypes-class.html#DTD_XMLID_TYPE -lxml.etree.ErrorTypes.C14N_CREATE_STACK lxml.etree.ErrorTypes-class.html#C14N_CREATE_STACK -lxml.etree.ErrorTypes.SCHEMAV_CVC_TYPE_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_2 -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_SEQUENCE_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SEQUENCE_CHILD -lxml.etree.ErrorTypes.SCHEMAV_CVC_TYPE_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_1 -lxml.etree.ErrorTypes.IO_ENXIO lxml.etree.ErrorTypes-class.html#IO_ENXIO -lxml.etree.ErrorTypes.SCHEMAV_CVC_PATTERN_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_PATTERN_VALID -lxml.etree.ErrorTypes.ERR_ATTRIBUTE_WITHOUT_VALUE lxml.etree.ErrorTypes-class.html#ERR_ATTRIBUTE_WITHOUT_VALUE -lxml.etree.ErrorTypes.BUF_OVERFLOW lxml.etree.ErrorTypes-class.html#BUF_OVERFLOW -lxml.etree.ErrorTypes.SCHEMAP_INCLUDE_SCHEMA_NOT_URI lxml.etree.ErrorTypes-class.html#SCHEMAP_INCLUDE_SCHEMA_NOT_URI -lxml.etree.ErrorTypes.SCHEMAP_REDEFINED_ATTRGROUP lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_ATTRGROUP -lxml.etree.ErrorTypes.SCHEMAV_INVALIDATTR lxml.etree.ErrorTypes-class.html#SCHEMAV_INVALIDATTR -lxml.etree.ErrorTypes.ERR_OK lxml.etree.ErrorTypes-class.html#ERR_OK -lxml.etree.ErrorTypes.ERR_EQUAL_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_EQUAL_REQUIRED -lxml.etree.ErrorTypes.NS_ERR_XML_NAMESPACE lxml.etree.ErrorTypes-class.html#NS_ERR_XML_NAMESPACE -lxml.etree.ErrorTypes.ERR_EXTRA_CONTENT lxml.etree.ErrorTypes-class.html#ERR_EXTRA_CONTENT -lxml.etree.ErrorTypes.DTD_MULTIPLE_ID lxml.etree.ErrorTypes-class.html#DTD_MULTIPLE_ID -lxml.etree.ErrorTypes.IO_ECONNREFUSED lxml.etree.ErrorTypes-class.html#IO_ECONNREFUSED -lxml.etree.ErrorTypes.XPTR_UNKNOWN_SCHEME lxml.etree.ErrorTypes-class.html#XPTR_UNKNOWN_SCHEME -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_5_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_5_2 -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_5_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_5_1 -lxml.etree.ErrorTypes.RNGP_PAT_ONEMORE_INTERLEAVE_ATTR lxml.etree.ErrorTypes-class.html#RNGP_PAT_ONEMORE_INTERLEAVE_ATTR -lxml.etree.ErrorTypes.XINCLUDE_ENTITY_DEF_MISMATCH lxml.etree.ErrorTypes-class.html#XINCLUDE_ENTITY_DEF_MISMATCH -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_RESTRICTS_3_3_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_1 -lxml.etree.ErrorTypes.SCHEMAP_MG_PROPS_CORRECT_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_MG_PROPS_CORRECT_1 -lxml.etree.ErrorTypes.SCHEMAP_SRC_ATTRIBUTE_3_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_3_2 -lxml.etree.ErrorTypes.SCHEMAP_SRC_ATTRIBUTE_3_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_3_1 -lxml.etree.ErrorTypes.SCHEMAP_MG_PROPS_CORRECT_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_MG_PROPS_CORRECT_2 -lxml.etree.ErrorTypes.RNGP_PAT_START_VALUE lxml.etree.ErrorTypes-class.html#RNGP_PAT_START_VALUE -lxml.etree.ErrorTypes.DTD_ROOT_NAME lxml.etree.ErrorTypes-class.html#DTD_ROOT_NAME -lxml.etree.ErrorTypes.IO_EISDIR lxml.etree.ErrorTypes-class.html#IO_EISDIR -lxml.etree.ErrorTypes.IO_EINPROGRESS lxml.etree.ErrorTypes-class.html#IO_EINPROGRESS -lxml.etree.ErrorTypes.IO_EDEADLK lxml.etree.ErrorTypes-class.html#IO_EDEADLK -lxml.etree.ErrorTypes.SCHEMAP_COS_ST_DERIVED_OK_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_DERIVED_OK_2_2 -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_5_2_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_2_2_1 -lxml.etree.ErrorTypes.SCHEMAP_P_PROPS_CORRECT_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_P_PROPS_CORRECT_2_2 -lxml.etree.ErrorTypes.SCHEMAP_INVALID_FACET lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_FACET -lxml.etree.ErrorTypes.SCHEMAP_P_PROPS_CORRECT_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_P_PROPS_CORRECT_2_1 -lxml.etree.ErrorTypes.XINCLUDE_BUILD_FAILED lxml.etree.ErrorTypes-class.html#XINCLUDE_BUILD_FAILED -lxml.etree.ErrorTypes.ERR_PEREF_AT_EOF lxml.etree.ErrorTypes-class.html#ERR_PEREF_AT_EOF -lxml.etree.ErrorTypes.IO_ENOLCK lxml.etree.ErrorTypes-class.html#IO_ENOLCK -lxml.etree.ErrorTypes.DTD_MISSING_ATTRIBUTE lxml.etree.ErrorTypes-class.html#DTD_MISSING_ATTRIBUTE -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_3_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_3_1 -lxml.etree.ErrorTypes.CHECK_FOUND_ENTITYREF lxml.etree.ErrorTypes-class.html#CHECK_FOUND_ENTITYREF -lxml.etree.ErrorTypes.RNGP_PARAM_FORBIDDEN lxml.etree.ErrorTypes-class.html#RNGP_PARAM_FORBIDDEN -lxml.etree.ErrorTypes.DTD_ELEM_NAMESPACE lxml.etree.ErrorTypes-class.html#DTD_ELEM_NAMESPACE -lxml.etree.ErrorTypes.SCHEMAP_FAILED_LOAD lxml.etree.ErrorTypes-class.html#SCHEMAP_FAILED_LOAD -lxml.etree.ErrorTypes.SCHEMAP_SRC_SIMPLE_TYPE_4 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_4 -lxml.etree.ErrorTypes.DTD_ID_FIXED lxml.etree.ErrorTypes-class.html#DTD_ID_FIXED -lxml.etree.ErrorTypes.SCHEMAP_SRC_SIMPLE_TYPE_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_1 -lxml.etree.ErrorTypes.SCHEMAP_SRC_SIMPLE_TYPE_2 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_2 -lxml.etree.ErrorTypes.SCHEMAP_SRC_SIMPLE_TYPE_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_3 -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_3_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_3_2_1 -lxml.etree.ErrorTypes.XINCLUDE_PARSE_VALUE lxml.etree.ErrorTypes-class.html#XINCLUDE_PARSE_VALUE -lxml.etree.ErrorTypes.RNGP_INCLUDE_FAILURE lxml.etree.ErrorTypes-class.html#RNGP_INCLUDE_FAILURE -lxml.etree.ErrorTypes.CHECK_NO_DICT lxml.etree.ErrorTypes-class.html#CHECK_NO_DICT -lxml.etree.ErrorTypes.CHECK_NOT_ELEM_DECL lxml.etree.ErrorTypes-class.html#CHECK_NOT_ELEM_DECL -lxml.etree.ErrorTypes.XPTR_CHILDSEQ_START lxml.etree.ErrorTypes-class.html#XPTR_CHILDSEQ_START -lxml.etree.ErrorTypes.RNGP_ATTRIBUTE_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_ATTRIBUTE_EMPTY -lxml.etree.ErrorTypes.ERR_ENTITYREF_NO_NAME lxml.etree.ErrorTypes-class.html#ERR_ENTITYREF_NO_NAME -lxml.etree.ErrorTypes.RNGP_UNKNOWN_ATTRIBUTE lxml.etree.ErrorTypes-class.html#RNGP_UNKNOWN_ATTRIBUTE -lxml.etree.ErrorTypes.SCHEMAP_COS_VALID_DEFAULT_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_1 -lxml.etree.ErrorTypes.DTD_INVALID_CHILD lxml.etree.ErrorTypes-class.html#DTD_INVALID_CHILD -lxml.etree.ErrorTypes.SCHEMAV_CVC_ELT_4_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_4_2 -lxml.etree.ErrorTypes.RNGP_EXCEPT_EMPTY lxml.etree.ErrorTypes-class.html#RNGP_EXCEPT_EMPTY -lxml.etree.ErrorTypes.RNGP_PAT_ATTR_ATTR lxml.etree.ErrorTypes-class.html#RNGP_PAT_ATTR_ATTR -lxml.etree.ErrorTypes.ERR_GT_REQUIRED lxml.etree.ErrorTypes-class.html#ERR_GT_REQUIRED -lxml.etree.ErrorTypes.RNGP_ATTR_CONFLICT lxml.etree.ErrorTypes-class.html#RNGP_ATTR_CONFLICT -lxml.etree.ErrorTypes.SCHEMAV_CVC_FRACTIONDIGITS_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_FRACTIONDIGITS_VALID -lxml.etree.ErrorTypes.IO_ETIMEDOUT lxml.etree.ErrorTypes-class.html#IO_ETIMEDOUT -lxml.etree.ErrorTypes.SCHEMAP_C_PROPS_CORRECT lxml.etree.ErrorTypes-class.html#SCHEMAP_C_PROPS_CORRECT -lxml.etree.ErrorTypes.I18N_NO_OUTPUT lxml.etree.ErrorTypes-class.html#I18N_NO_OUTPUT -lxml.etree.ErrorTypes.CHECK_NS_ANCESTOR lxml.etree.ErrorTypes-class.html#CHECK_NS_ANCESTOR -lxml.etree.ErrorTypes.SCHEMAP_INVALID_FACET_VALUE lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_FACET_VALUE -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_ALL_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ALL_CHILD -lxml.etree.ErrorTypes.CHECK_FOUND_FRAGMENT lxml.etree.ErrorTypes-class.html#CHECK_FOUND_FRAGMENT -lxml.etree.ErrorTypes.ERR_DOCUMENT_START lxml.etree.ErrorTypes-class.html#ERR_DOCUMENT_START -lxml.etree.ErrorTypes.SCHEMAV_CVC_LENGTH_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_LENGTH_VALID -lxml.etree.ErrorTypes.SCHEMAV_CVC_MINLENGTH_VALID lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MINLENGTH_VALID -lxml.etree.ErrorTypes.SCHEMAP_COS_VALID_DEFAULT_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_2_1 -lxml.etree.ErrorTypes.XINCLUDE_FALLBACK_NOT_IN_INCLUDE lxml.etree.ErrorTypes-class.html#XINCLUDE_FALLBACK_NOT_IN_INCLUDE -lxml.etree.ErrorTypes.ERR_NAME_TOO_LONG lxml.etree.ErrorTypes-class.html#ERR_NAME_TOO_LONG -lxml.etree.ErrorTypes.ERR_TAG_NAME_MISMATCH lxml.etree.ErrorTypes-class.html#ERR_TAG_NAME_MISMATCH -lxml.etree.ErrorTypes.SCHEMAV_CVC_DATATYPE_VALID_1_2_1 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_DATATYPE_VALID_1_2_1 -lxml.etree.ErrorTypes.SCHEMAV_CVC_DATATYPE_VALID_1_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_DATATYPE_VALID_1_2_2 -lxml.etree.ErrorTypes.SCHEMAV_CVC_DATATYPE_VALID_1_2_3 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_DATATYPE_VALID_1_2_3 -lxml.etree.ErrorTypes.SCHEMAV_CVC_COMPLEX_TYPE_3_2_2 lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_3_2_2 -lxml.etree.ErrorTypes.CHECK_FOUND_COMMENT lxml.etree.ErrorTypes-class.html#CHECK_FOUND_COMMENT -lxml.etree.ErrorTypes.SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE -lxml.etree.ErrorTypes.SCHEMAP_NOTYPE_NOREF lxml.etree.ErrorTypes-class.html#SCHEMAP_NOTYPE_NOREF -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_SCHEMAS_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SCHEMAS_CHILD -lxml.etree.ErrorTypes.RNGP_ATTRIBUTE_CONTENT lxml.etree.ErrorTypes-class.html#RNGP_ATTRIBUTE_CONTENT -lxml.etree.ErrorTypes.DTD_UNKNOWN_ENTITY lxml.etree.ErrorTypes-class.html#DTD_UNKNOWN_ENTITY -lxml.etree.ErrorTypes.XPATH_UNDEF_PREFIX_ERROR lxml.etree.ErrorTypes-class.html#XPATH_UNDEF_PREFIX_ERROR -lxml.etree.ErrorTypes.NS_ERR_ATTRIBUTE_REDEFINED lxml.etree.ErrorTypes-class.html#NS_ERR_ATTRIBUTE_REDEFINED -lxml.etree.ErrorTypes.ERR_CONDSEC_NOT_STARTED lxml.etree.ErrorTypes-class.html#ERR_CONDSEC_NOT_STARTED -lxml.etree.ErrorTypes.CHECK_FOUND_PI lxml.etree.ErrorTypes-class.html#CHECK_FOUND_PI -lxml.etree.ErrorTypes.DTD_DUP_TOKEN lxml.etree.ErrorTypes-class.html#DTD_DUP_TOKEN -lxml.etree.ErrorTypes.DTD_ATTRIBUTE_VALUE lxml.etree.ErrorTypes-class.html#DTD_ATTRIBUTE_VALUE -lxml.etree.ErrorTypes.XPATH_INVALID_ARITY lxml.etree.ErrorTypes-class.html#XPATH_INVALID_ARITY -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_EXTENSION_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_EXTENSION_CHILD -lxml.etree.ErrorTypes.SCHEMAP_REF_AND_SUBTYPE lxml.etree.ErrorTypes-class.html#SCHEMAP_REF_AND_SUBTYPE -lxml.etree.ErrorTypes.SCHEMAP_SRC_IMPORT lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT -lxml.etree.ErrorTypes.SCHEMAP_NO_XSI lxml.etree.ErrorTypes-class.html#SCHEMAP_NO_XSI -lxml.etree.ErrorTypes.SCHEMAV_HAVEDEFAULT lxml.etree.ErrorTypes-class.html#SCHEMAV_HAVEDEFAULT -lxml.etree.ErrorTypes.RNGP_PAT_DATA_EXCEPT_LIST lxml.etree.ErrorTypes-class.html#RNGP_PAT_DATA_EXCEPT_LIST -lxml.etree.ErrorTypes.SCHEMAP_WARN_UNLOCATED_SCHEMA lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_UNLOCATED_SCHEMA -lxml.etree.ErrorTypes.ERR_NOT_STANDALONE lxml.etree.ErrorTypes-class.html#ERR_NOT_STANDALONE -lxml.etree.ErrorTypes.SCHEMAP_INVALID_ATTR_COMBINATION lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_COMBINATION -lxml.etree.ErrorTypes.SCHEMAP_DERIVATION_OK_RESTRICTION_3 lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_3 -lxml.etree.ErrorTypes.SCHEMAP_DERIVATION_OK_RESTRICTION_1 lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_1 -lxml.etree.ErrorTypes.SCHEMAP_UNKNOWN_UNION_CHILD lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_UNION_CHILD -lxml.etree.ErrorTypes.XINCLUDE_FALLBACKS_IN_INCLUDE lxml.etree.ErrorTypes-class.html#XINCLUDE_FALLBACKS_IN_INCLUDE -lxml.etree.ErrorTypes.IO_BUFFER_FULL lxml.etree.ErrorTypes-class.html#IO_BUFFER_FULL -lxml.etree.ErrorTypes.TREE_INVALID_DEC lxml.etree.ErrorTypes-class.html#TREE_INVALID_DEC -lxml.etree.ErrorTypes.DTD_STANDALONE_DEFAULTED lxml.etree.ErrorTypes-class.html#DTD_STANDALONE_DEFAULTED -lxml.etree.FallbackElementClassLookup lxml.etree.FallbackElementClassLookup-class.html -lxml.etree.FallbackElementClassLookup.__new__ lxml.etree.FallbackElementClassLookup-class.html#__new__ -lxml.etree.FallbackElementClassLookup.fallback lxml.etree.FallbackElementClassLookup-class.html#fallback -lxml.etree.FallbackElementClassLookup.set_fallback lxml.etree.FallbackElementClassLookup-class.html#set_fallback -lxml.etree.FallbackElementClassLookup.__init__ lxml.etree.FallbackElementClassLookup-class.html#__init__ -lxml.etree.HTMLParser lxml.etree.HTMLParser-class.html -lxml.etree._FeedParser.feed lxml.etree._FeedParser-class.html#feed -lxml.etree._FeedParser.close lxml.etree._FeedParser-class.html#close -lxml.etree.HTMLParser.__init__ lxml.etree.HTMLParser-class.html#__init__ -lxml.etree.HTMLParser.__new__ lxml.etree.HTMLParser-class.html#__new__ -lxml.etree._FeedParser.feed_error_log lxml.etree._FeedParser-class.html#feed_error_log -lxml.etree.HTMLPullParser lxml.etree.HTMLPullParser-class.html -lxml.etree._FeedParser.feed lxml.etree._FeedParser-class.html#feed -lxml.etree.HTMLPullParser.read_events lxml.etree.HTMLPullParser-class.html#read_events -lxml.etree._FeedParser.close lxml.etree._FeedParser-class.html#close -lxml.etree.HTMLPullParser.__init__ lxml.etree.HTMLPullParser-class.html#__init__ -lxml.etree.HTMLPullParser.__new__ lxml.etree.HTMLPullParser-class.html#__new__ -lxml.etree._FeedParser.feed_error_log lxml.etree._FeedParser-class.html#feed_error_log -lxml.etree.LxmlError lxml.etree.LxmlError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.LxmlError.__new__ lxml.etree.LxmlError-class.html#__new__ -lxml.etree.LxmlRegistryError lxml.etree.LxmlRegistryError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.LxmlRegistryError.__new__ lxml.etree.LxmlRegistryError-class.html#__new__ -lxml.etree.LxmlSyntaxError lxml.etree.LxmlSyntaxError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.LxmlError.__new__ lxml.etree.LxmlError-class.html#__new__ -lxml.etree.LxmlSyntaxError.__qualname__ lxml.etree.LxmlSyntaxError-class.html#__qualname__ -lxml.etree.NamespaceRegistryError lxml.etree.NamespaceRegistryError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.NamespaceRegistryError.__new__ lxml.etree.NamespaceRegistryError-class.html#__new__ -lxml.etree.PIBase lxml.etree.PIBase-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._ProcessingInstruction.tag lxml.etree._ProcessingInstruction-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree.PIBase.__new__ lxml.etree.PIBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.PIBase.__init__ lxml.etree.PIBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._ProcessingInstruction.get lxml.etree._ProcessingInstruction-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._ProcessingInstruction.target lxml.etree._ProcessingInstruction-class.html#target -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._ProcessingInstruction.__repr__ lxml.etree._ProcessingInstruction-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._ProcessingInstruction.attrib lxml.etree._ProcessingInstruction-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree.ParseError lxml.etree.ParseError-class.html -lxml.etree.ParseError.__init__ lxml.etree.ParseError-class.html#__init__ -lxml.etree.LxmlError.__new__ lxml.etree.LxmlError-class.html#__new__ -lxml.etree.ParseError.__qualname__ lxml.etree.ParseError-class.html#__qualname__ -lxml.etree.ParseError.position lxml.etree.ParseError-class.html#position -lxml.etree.ParserBasedElementClassLookup lxml.etree.ParserBasedElementClassLookup-class.html -lxml.etree.ParserBasedElementClassLookup.__new__ lxml.etree.ParserBasedElementClassLookup-class.html#__new__ -lxml.etree.FallbackElementClassLookup.fallback lxml.etree.FallbackElementClassLookup-class.html#fallback -lxml.etree.FallbackElementClassLookup.set_fallback lxml.etree.FallbackElementClassLookup-class.html#set_fallback -lxml.etree.FallbackElementClassLookup.__init__ lxml.etree.FallbackElementClassLookup-class.html#__init__ -lxml.etree.ParserError lxml.etree.ParserError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.ParserError.__new__ lxml.etree.ParserError-class.html#__new__ -lxml.etree.PyErrorLog lxml.etree.PyErrorLog-class.html -lxml.etree.PyErrorLog.level_map lxml.etree.PyErrorLog-class.html#level_map -lxml.etree.PyErrorLog.__new__ lxml.etree.PyErrorLog-class.html#__new__ -lxml.etree.PyErrorLog.receive lxml.etree.PyErrorLog-class.html#receive -lxml.etree._BaseErrorLog.last_error lxml.etree._BaseErrorLog-class.html#last_error -lxml.etree._BaseErrorLog.__repr__ lxml.etree._BaseErrorLog-class.html#__repr__ -lxml.etree.PyErrorLog.copy lxml.etree.PyErrorLog-class.html#copy -lxml.etree.PyErrorLog.__init__ lxml.etree.PyErrorLog-class.html#__init__ -lxml.etree.PyErrorLog.log lxml.etree.PyErrorLog-class.html#log -lxml.etree.PythonElementClassLookup lxml.etree.PythonElementClassLookup-class.html -lxml.etree.PythonElementClassLookup.__new__ lxml.etree.PythonElementClassLookup-class.html#__new__ -lxml.etree.PythonElementClassLookup.lookup lxml.etree.PythonElementClassLookup-class.html#lookup -lxml.etree.FallbackElementClassLookup.fallback lxml.etree.FallbackElementClassLookup-class.html#fallback -lxml.etree.FallbackElementClassLookup.set_fallback lxml.etree.FallbackElementClassLookup-class.html#set_fallback -lxml.etree.FallbackElementClassLookup.__init__ lxml.etree.FallbackElementClassLookup-class.html#__init__ -lxml.etree.QName lxml.etree.QName-class.html -lxml.etree.QName.text lxml.etree.QName-class.html#text -lxml.etree.QName.__str__ lxml.etree.QName-class.html#__str__ -lxml.etree.QName.localname lxml.etree.QName-class.html#localname -lxml.etree.QName.__lt__ lxml.etree.QName-class.html#__lt__ -lxml.etree.QName.__init__ lxml.etree.QName-class.html#__init__ -lxml.etree.QName.__new__ lxml.etree.QName-class.html#__new__ -lxml.etree.QName.namespace lxml.etree.QName-class.html#namespace -lxml.etree.QName.__ne__ lxml.etree.QName-class.html#__ne__ -lxml.etree.QName.__gt__ lxml.etree.QName-class.html#__gt__ -lxml.etree.QName.__eq__ lxml.etree.QName-class.html#__eq__ -lxml.etree.QName.__le__ lxml.etree.QName-class.html#__le__ -lxml.etree.QName.__hash__ lxml.etree.QName-class.html#__hash__ -lxml.etree.QName.__ge__ lxml.etree.QName-class.html#__ge__ -lxml.etree.RelaxNG lxml.etree.RelaxNG-class.html -lxml.etree._Validator._append_log_message lxml.etree._Validator-class.html#_append_log_message -lxml.etree._Validator.validate lxml.etree._Validator-class.html#validate -lxml.etree.RelaxNG.__init__ lxml.etree.RelaxNG-class.html#__init__ -lxml.etree.RelaxNG.__new__ lxml.etree.RelaxNG-class.html#__new__ -lxml.etree._Validator._clear_error_log lxml.etree._Validator-class.html#_clear_error_log -lxml.etree.RelaxNG.__call__ lxml.etree.RelaxNG-class.html#__call__ -lxml.etree._Validator.assert_ lxml.etree._Validator-class.html#assert_ -lxml.etree._Validator.assertValid lxml.etree._Validator-class.html#assertValid -lxml.etree.RelaxNG.from_rnc_string lxml.etree.RelaxNG-class.html#from_rnc_string -lxml.etree._Validator.error_log lxml.etree._Validator-class.html#error_log -lxml.etree.RelaxNGError lxml.etree.RelaxNGError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.RelaxNGError.__new__ lxml.etree.RelaxNGError-class.html#__new__ -lxml.etree.RelaxNGErrorTypes lxml.etree.RelaxNGErrorTypes-class.html -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_TEXTWRONG lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_TEXTWRONG -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_EXTRACONTENT lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_EXTRACONTENT -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_TYPEVAL lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_TYPEVAL -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_NODEFINE lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_NODEFINE -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_NOTELEM lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_NOTELEM -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_VALUE lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_VALUE -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_TYPECMP lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_TYPECMP -lxml.etree.RelaxNGErrorTypes._getName lxml.etree.RelaxNGErrorTypes-class.html#_getName -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_LISTELEM lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_LISTELEM -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_INTERNAL lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_INTERNAL -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_DATATYPE lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_DATATYPE -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_DATAELEM lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_DATAELEM -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_INVALIDATTR lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_INVALIDATTR -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ELEMNAME lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ELEMNAME -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_DUPID lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_DUPID -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ELEMNOTEMPTY lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ELEMNOTEMPTY -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_NOELEM lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_NOELEM -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_TYPE lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_TYPE -lxml.etree.RelaxNGErrorTypes.RELAXNG_OK lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_OK -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ELEMNONS lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ELEMNONS -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_CONTENTVALID lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_CONTENTVALID -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_LIST lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_LIST -lxml.etree.RelaxNGErrorTypes._names lxml.etree.RelaxNGErrorTypes-class.html#_names -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_EXTRADATA lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_EXTRADATA -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_MEMORY lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_MEMORY -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_NOSTATE lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_NOSTATE -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ELEMWRONG lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ELEMWRONG -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_LISTEXTRA lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_LISTEXTRA -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ATTRNONS lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ATTRNONS -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ELEMWRONGNS lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ELEMWRONGNS -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ATTRNAME lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ATTRNAME -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_VALELEM lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_VALELEM -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_INTERNODATA lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_INTERNODATA -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_NOGRAMMAR lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_NOGRAMMAR -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ELEMEXTRANS lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ELEMEXTRANS -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ATTRWRONGNS lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ATTRWRONGNS -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_INTEREXTRA lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_INTEREXTRA -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ATTREXTRANS lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ATTREXTRANS -lxml.etree.RelaxNGErrorTypes.__qualname__ lxml.etree.RelaxNGErrorTypes-class.html#__qualname__ -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_LACKDATA lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_LACKDATA -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_LISTEMPTY lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_LISTEMPTY -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_INTERSEQ lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_INTERSEQ -lxml.etree.RelaxNGErrorTypes.RELAXNG_ERR_ATTRVALID lxml.etree.RelaxNGErrorTypes-class.html#RELAXNG_ERR_ATTRVALID -lxml.etree.RelaxNGParseError lxml.etree.RelaxNGParseError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.RelaxNGParseError.__new__ lxml.etree.RelaxNGParseError-class.html#__new__ -lxml.etree.RelaxNGValidateError lxml.etree.RelaxNGValidateError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.RelaxNGValidateError.__new__ lxml.etree.RelaxNGValidateError-class.html#__new__ -lxml.etree.Resolver lxml.etree.Resolver-class.html -lxml.etree.Resolver.resolve lxml.etree.Resolver-class.html#resolve -lxml.etree.Resolver.resolve_filename lxml.etree.Resolver-class.html#resolve_filename -lxml.etree.Resolver.__new__ lxml.etree.Resolver-class.html#__new__ -lxml.etree.Resolver.resolve_string lxml.etree.Resolver-class.html#resolve_string -lxml.etree.Resolver.resolve_file lxml.etree.Resolver-class.html#resolve_file -lxml.etree.Resolver.resolve_empty lxml.etree.Resolver-class.html#resolve_empty -lxml.etree.Schematron lxml.etree.Schematron-class.html -lxml.etree.Schematron.__new__ lxml.etree.Schematron-class.html#__new__ -lxml.etree._Validator._clear_error_log lxml.etree._Validator-class.html#_clear_error_log -lxml.etree._Validator.assertValid lxml.etree._Validator-class.html#assertValid -lxml.etree._Validator._append_log_message lxml.etree._Validator-class.html#_append_log_message -lxml.etree._Validator.error_log lxml.etree._Validator-class.html#error_log -lxml.etree.Schematron.__call__ lxml.etree.Schematron-class.html#__call__ -lxml.etree._Validator.assert_ lxml.etree._Validator-class.html#assert_ -lxml.etree._Validator.validate lxml.etree._Validator-class.html#validate -lxml.etree.Schematron.__init__ lxml.etree.Schematron-class.html#__init__ -lxml.etree.SchematronError lxml.etree.SchematronError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.SchematronError.__new__ lxml.etree.SchematronError-class.html#__new__ -lxml.etree.SchematronParseError lxml.etree.SchematronParseError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.SchematronParseError.__new__ lxml.etree.SchematronParseError-class.html#__new__ -lxml.etree.SchematronValidateError lxml.etree.SchematronValidateError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.SchematronValidateError.__new__ lxml.etree.SchematronValidateError-class.html#__new__ -lxml.etree.SerialisationError lxml.etree.SerialisationError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.SerialisationError.__new__ lxml.etree.SerialisationError-class.html#__new__ -lxml.etree.SiblingsIterator lxml.etree.SiblingsIterator-class.html -lxml.etree.SiblingsIterator.__new__ lxml.etree.SiblingsIterator-class.html#__new__ -lxml.etree._ElementMatchIterator.__next__ lxml.etree._ElementMatchIterator-class.html#__next__ -lxml.etree._ElementMatchIterator.next lxml.etree._ElementMatchIterator-class.html#next -lxml.etree._ElementMatchIterator.__iter__ lxml.etree._ElementMatchIterator-class.html#__iter__ -lxml.etree.TreeBuilder lxml.etree.TreeBuilder-class.html -lxml.etree.TreeBuilder.comment lxml.etree.TreeBuilder-class.html#comment -lxml.etree.TreeBuilder.end lxml.etree.TreeBuilder-class.html#end -lxml.etree.TreeBuilder.__new__ lxml.etree.TreeBuilder-class.html#__new__ -lxml.etree.TreeBuilder.start lxml.etree.TreeBuilder-class.html#start -lxml.etree.TreeBuilder.close lxml.etree.TreeBuilder-class.html#close -lxml.etree.TreeBuilder.pi lxml.etree.TreeBuilder-class.html#pi -lxml.etree.TreeBuilder.data lxml.etree.TreeBuilder-class.html#data -lxml.etree.TreeBuilder.__init__ lxml.etree.TreeBuilder-class.html#__init__ -lxml.etree.XInclude lxml.etree.XInclude-class.html -lxml.etree.XInclude.__new__ lxml.etree.XInclude-class.html#__new__ -lxml.etree.XInclude.error_log lxml.etree.XInclude-class.html#error_log -lxml.etree.XInclude.__call__ lxml.etree.XInclude-class.html#__call__ -lxml.etree.XInclude.__init__ lxml.etree.XInclude-class.html#__init__ -lxml.etree.XIncludeError lxml.etree.XIncludeError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XIncludeError.__new__ lxml.etree.XIncludeError-class.html#__new__ -lxml.etree.XMLParser lxml.etree.XMLParser-class.html -lxml.etree._FeedParser.feed lxml.etree._FeedParser-class.html#feed -lxml.etree._FeedParser.close lxml.etree._FeedParser-class.html#close -lxml.etree.XMLParser.__init__ lxml.etree.XMLParser-class.html#__init__ -lxml.etree.XMLParser.__new__ lxml.etree.XMLParser-class.html#__new__ -lxml.etree._FeedParser.feed_error_log lxml.etree._FeedParser-class.html#feed_error_log -lxml.etree.XMLPullParser lxml.etree.XMLPullParser-class.html -lxml.etree._FeedParser.feed lxml.etree._FeedParser-class.html#feed -lxml.etree.XMLPullParser.read_events lxml.etree.XMLPullParser-class.html#read_events -lxml.etree._FeedParser.close lxml.etree._FeedParser-class.html#close -lxml.etree.XMLPullParser.__init__ lxml.etree.XMLPullParser-class.html#__init__ -lxml.etree.XMLPullParser.__new__ lxml.etree.XMLPullParser-class.html#__new__ -lxml.etree._FeedParser.feed_error_log lxml.etree._FeedParser-class.html#feed_error_log -lxml.etree.XMLSchema lxml.etree.XMLSchema-class.html -lxml.etree.XMLSchema.__new__ lxml.etree.XMLSchema-class.html#__new__ -lxml.etree._Validator._clear_error_log lxml.etree._Validator-class.html#_clear_error_log -lxml.etree._Validator.assertValid lxml.etree._Validator-class.html#assertValid -lxml.etree._Validator._append_log_message lxml.etree._Validator-class.html#_append_log_message -lxml.etree._Validator.error_log lxml.etree._Validator-class.html#error_log -lxml.etree.XMLSchema.__call__ lxml.etree.XMLSchema-class.html#__call__ -lxml.etree._Validator.assert_ lxml.etree._Validator-class.html#assert_ -lxml.etree._Validator.validate lxml.etree._Validator-class.html#validate -lxml.etree.XMLSchema.__init__ lxml.etree.XMLSchema-class.html#__init__ -lxml.etree.XMLSchemaError lxml.etree.XMLSchemaError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XMLSchemaError.__new__ lxml.etree.XMLSchemaError-class.html#__new__ -lxml.etree.XMLSchemaParseError lxml.etree.XMLSchemaParseError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XMLSchemaParseError.__new__ lxml.etree.XMLSchemaParseError-class.html#__new__ -lxml.etree.XMLSchemaValidateError lxml.etree.XMLSchemaValidateError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XMLSchemaValidateError.__new__ lxml.etree.XMLSchemaValidateError-class.html#__new__ -lxml.etree.XMLSyntaxError lxml.etree.XMLSyntaxError-class.html -lxml.etree.ParseError.__init__ lxml.etree.ParseError-class.html#__init__ -lxml.etree.LxmlError.__new__ lxml.etree.LxmlError-class.html#__new__ -lxml.etree.XMLSyntaxError.__qualname__ lxml.etree.XMLSyntaxError-class.html#__qualname__ -lxml.etree.ParseError.position lxml.etree.ParseError-class.html#position -lxml.etree.XPath lxml.etree.XPath-class.html -lxml.etree.XPath.__new__ lxml.etree.XPath-class.html#__new__ -lxml.etree._XPathEvaluatorBase.evaluate lxml.etree._XPathEvaluatorBase-class.html#evaluate -lxml.etree._XPathEvaluatorBase.error_log lxml.etree._XPathEvaluatorBase-class.html#error_log -lxml.etree.XPath.__repr__ lxml.etree.XPath-class.html#__repr__ -lxml.etree.XPath.__call__ lxml.etree.XPath-class.html#__call__ -lxml.etree.XPath.path lxml.etree.XPath-class.html#path -lxml.etree.XPath.__init__ lxml.etree.XPath-class.html#__init__ -lxml.etree.XPathDocumentEvaluator lxml.etree.XPathDocumentEvaluator-class.html -lxml.etree.XPathElementEvaluator.register_namespace lxml.etree.XPathElementEvaluator-class.html#register_namespace -lxml.etree.XPathDocumentEvaluator.__new__ lxml.etree.XPathDocumentEvaluator-class.html#__new__ -lxml.etree._XPathEvaluatorBase.evaluate lxml.etree._XPathEvaluatorBase-class.html#evaluate -lxml.etree._XPathEvaluatorBase.error_log lxml.etree._XPathEvaluatorBase-class.html#error_log -lxml.etree.XPathDocumentEvaluator.__call__ lxml.etree.XPathDocumentEvaluator-class.html#__call__ -lxml.etree.XPathElementEvaluator.register_namespaces lxml.etree.XPathElementEvaluator-class.html#register_namespaces -lxml.etree.XPathDocumentEvaluator.__init__ lxml.etree.XPathDocumentEvaluator-class.html#__init__ -lxml.etree.XPathElementEvaluator lxml.etree.XPathElementEvaluator-class.html -lxml.etree.XPathElementEvaluator.register_namespace lxml.etree.XPathElementEvaluator-class.html#register_namespace -lxml.etree.XPathElementEvaluator.__new__ lxml.etree.XPathElementEvaluator-class.html#__new__ -lxml.etree._XPathEvaluatorBase.evaluate lxml.etree._XPathEvaluatorBase-class.html#evaluate -lxml.etree._XPathEvaluatorBase.error_log lxml.etree._XPathEvaluatorBase-class.html#error_log -lxml.etree.XPathElementEvaluator.__call__ lxml.etree.XPathElementEvaluator-class.html#__call__ -lxml.etree.XPathElementEvaluator.register_namespaces lxml.etree.XPathElementEvaluator-class.html#register_namespaces -lxml.etree.XPathElementEvaluator.__init__ lxml.etree.XPathElementEvaluator-class.html#__init__ -lxml.etree.XPathError lxml.etree.XPathError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XPathError.__new__ lxml.etree.XPathError-class.html#__new__ -lxml.etree.XPathEvalError lxml.etree.XPathEvalError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XPathEvalError.__new__ lxml.etree.XPathEvalError-class.html#__new__ -lxml.etree.XPathFunctionError lxml.etree.XPathFunctionError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XPathFunctionError.__new__ lxml.etree.XPathFunctionError-class.html#__new__ -lxml.etree.XPathResultError lxml.etree.XPathResultError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XPathResultError.__new__ lxml.etree.XPathResultError-class.html#__new__ -lxml.etree.XPathSyntaxError lxml.etree.XPathSyntaxError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XPathError.__new__ lxml.etree.XPathError-class.html#__new__ -lxml.etree.XPathSyntaxError.__qualname__ lxml.etree.XPathSyntaxError-class.html#__qualname__ -lxml.etree.XSLT lxml.etree.XSLT-class.html -lxml.etree.XSLT.apply lxml.etree.XSLT-class.html#apply -lxml.etree.XSLT.__init__ lxml.etree.XSLT-class.html#__init__ -lxml.etree.XSLT.__new__ lxml.etree.XSLT-class.html#__new__ -lxml.etree.XSLT.set_global_max_depth lxml.etree.XSLT-class.html#set_global_max_depth -lxml.etree.XSLT.__call__ lxml.etree.XSLT-class.html#__call__ -lxml.etree.XSLT.__deepcopy__ lxml.etree.XSLT-class.html#__deepcopy__ -lxml.etree.XSLT.tostring lxml.etree.XSLT-class.html#tostring -lxml.etree.XSLT.strparam lxml.etree.XSLT-class.html#strparam -lxml.etree.XSLT.error_log lxml.etree.XSLT-class.html#error_log -lxml.etree.XSLT.__copy__ lxml.etree.XSLT-class.html#__copy__ -lxml.etree.XSLTAccessControl lxml.etree.XSLTAccessControl-class.html -lxml.etree.XSLTAccessControl.DENY_WRITE lxml.etree.XSLTAccessControl-class.html#DENY_WRITE -lxml.etree.XSLTAccessControl.__new__ lxml.etree.XSLTAccessControl-class.html#__new__ -lxml.etree.XSLTAccessControl.__repr__ lxml.etree.XSLTAccessControl-class.html#__repr__ -lxml.etree.XSLTAccessControl.DENY_ALL lxml.etree.XSLTAccessControl-class.html#DENY_ALL -lxml.etree.XSLTAccessControl.options lxml.etree.XSLTAccessControl-class.html#options -lxml.etree.XSLTAccessControl.__init__ lxml.etree.XSLTAccessControl-class.html#__init__ -lxml.etree.XSLTApplyError lxml.etree.XSLTApplyError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XSLTApplyError.__new__ lxml.etree.XSLTApplyError-class.html#__new__ -lxml.etree.XSLTError lxml.etree.XSLTError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XSLTError.__new__ lxml.etree.XSLTError-class.html#__new__ -lxml.etree.XSLTExtension lxml.etree.XSLTExtension-class.html -lxml.etree.XSLTExtension.execute lxml.etree.XSLTExtension-class.html#execute -lxml.etree.XSLTExtension.__new__ lxml.etree.XSLTExtension-class.html#__new__ -lxml.etree.XSLTExtension.apply_templates lxml.etree.XSLTExtension-class.html#apply_templates -lxml.etree.XSLTExtension.process_children lxml.etree.XSLTExtension-class.html#process_children -lxml.etree.XSLTExtensionError lxml.etree.XSLTExtensionError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XSLTExtensionError.__new__ lxml.etree.XSLTExtensionError-class.html#__new__ -lxml.etree.XSLTParseError lxml.etree.XSLTParseError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XSLTParseError.__new__ lxml.etree.XSLTParseError-class.html#__new__ -lxml.etree.XSLTSaveError lxml.etree.XSLTSaveError-class.html -lxml.etree.XSLTSaveError.__qualname__ lxml.etree.XSLTSaveError-class.html#__qualname__ -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.XSLTError.__new__ lxml.etree.XSLTError-class.html#__new__ -lxml.etree._Attrib lxml.etree._Attrib-class.html -lxml.etree._Attrib.iteritems lxml.etree._Attrib-class.html#iteritems -lxml.etree._Attrib.pop lxml.etree._Attrib-class.html#pop -lxml.etree._Attrib.has_key lxml.etree._Attrib-class.html#has_key -lxml.etree._Attrib.__lt__ lxml.etree._Attrib-class.html#__lt__ -lxml.etree._Attrib.__new__ lxml.etree._Attrib-class.html#__new__ -lxml.etree._Attrib.__contains__ lxml.etree._Attrib-class.html#__contains__ -lxml.etree._Attrib.itervalues lxml.etree._Attrib-class.html#itervalues -lxml.etree._Attrib.__len__ lxml.etree._Attrib-class.html#__len__ -lxml.etree._Attrib.__ne__ lxml.etree._Attrib-class.html#__ne__ -lxml.etree._Attrib.__getitem__ lxml.etree._Attrib-class.html#__getitem__ -lxml.etree._Attrib.get lxml.etree._Attrib-class.html#get -lxml.etree._Attrib.keys lxml.etree._Attrib-class.html#keys -lxml.etree._Attrib.__deepcopy__ lxml.etree._Attrib-class.html#__deepcopy__ -lxml.etree._Attrib.update lxml.etree._Attrib-class.html#update -lxml.etree._Attrib.__setitem__ lxml.etree._Attrib-class.html#__setitem__ -lxml.etree._Attrib.__gt__ lxml.etree._Attrib-class.html#__gt__ -lxml.etree._Attrib.__eq__ lxml.etree._Attrib-class.html#__eq__ -lxml.etree._Attrib.iterkeys lxml.etree._Attrib-class.html#iterkeys -lxml.etree._Attrib.__delitem__ lxml.etree._Attrib-class.html#__delitem__ -lxml.etree._Attrib.__nonzero__ lxml.etree._Attrib-class.html#__nonzero__ -lxml.etree._Attrib.items lxml.etree._Attrib-class.html#items -lxml.etree._Attrib.clear lxml.etree._Attrib-class.html#clear -lxml.etree._Attrib.__iter__ lxml.etree._Attrib-class.html#__iter__ -lxml.etree._Attrib.__le__ lxml.etree._Attrib-class.html#__le__ -lxml.etree._Attrib.values lxml.etree._Attrib-class.html#values -lxml.etree._Attrib.__repr__ lxml.etree._Attrib-class.html#__repr__ -lxml.etree._Attrib.__copy__ lxml.etree._Attrib-class.html#__copy__ -lxml.etree._Attrib.__ge__ lxml.etree._Attrib-class.html#__ge__ -lxml.etree._BaseErrorLog lxml.etree._BaseErrorLog-class.html -lxml.etree._BaseErrorLog.__new__ lxml.etree._BaseErrorLog-class.html#__new__ -lxml.etree._BaseErrorLog.receive lxml.etree._BaseErrorLog-class.html#receive -lxml.etree._BaseErrorLog.last_error lxml.etree._BaseErrorLog-class.html#last_error -lxml.etree._BaseErrorLog.__repr__ lxml.etree._BaseErrorLog-class.html#__repr__ -lxml.etree._BaseErrorLog.copy lxml.etree._BaseErrorLog-class.html#copy -lxml.etree._BaseErrorLog.__init__ lxml.etree._BaseErrorLog-class.html#__init__ -lxml.etree._Comment lxml.etree._Comment-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Comment.tag lxml.etree._Comment-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Comment.__new__ lxml.etree._Comment-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Comment.__repr__ lxml.etree._Comment-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._Document lxml.etree._Document-class.html -lxml.etree._Document.__new__ lxml.etree._Document-class.html#__new__ -lxml.etree._DomainErrorLog lxml.etree._DomainErrorLog-class.html -lxml.etree._ListErrorLog.filter_domains lxml.etree._ListErrorLog-class.html#filter_domains -lxml.etree._BaseErrorLog.last_error lxml.etree._BaseErrorLog-class.html#last_error -lxml.etree._ListErrorLog.filter_from_warnings lxml.etree._ListErrorLog-class.html#filter_from_warnings -lxml.etree._DomainErrorLog.__init__ lxml.etree._DomainErrorLog-class.html#__init__ -lxml.etree._DomainErrorLog.__new__ lxml.etree._DomainErrorLog-class.html#__new__ -lxml.etree._ListErrorLog.__contains__ lxml.etree._ListErrorLog-class.html#__contains__ -lxml.etree._ListErrorLog.filter_from_level lxml.etree._ListErrorLog-class.html#filter_from_level -lxml.etree._ListErrorLog.__len__ lxml.etree._ListErrorLog-class.html#__len__ -lxml.etree._ErrorLog.__exit__ lxml.etree._ErrorLog-class.html#__exit__ -lxml.etree._ListErrorLog.__getitem__ lxml.etree._ListErrorLog-class.html#__getitem__ -lxml.etree._ListErrorLog.filter_levels lxml.etree._ListErrorLog-class.html#filter_levels -lxml.etree._ErrorLog.__iter__ lxml.etree._ErrorLog-class.html#__iter__ -lxml.etree._ErrorLog.copy lxml.etree._ErrorLog-class.html#copy -lxml.etree._ListErrorLog.__nonzero__ lxml.etree._ListErrorLog-class.html#__nonzero__ -lxml.etree._ListErrorLog.filter_from_fatals lxml.etree._ListErrorLog-class.html#filter_from_fatals -lxml.etree._DomainErrorLog.receive lxml.etree._DomainErrorLog-class.html#receive -lxml.etree._ErrorLog.clear lxml.etree._ErrorLog-class.html#clear -lxml.etree._ListErrorLog.filter_from_errors lxml.etree._ListErrorLog-class.html#filter_from_errors -lxml.etree._ListErrorLog.filter_types lxml.etree._ListErrorLog-class.html#filter_types -lxml.etree._ListErrorLog.__repr__ lxml.etree._ListErrorLog-class.html#__repr__ -lxml.etree._Element lxml.etree._Element-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Element.__new__ lxml.etree._Element-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.__repr__ lxml.etree._Element-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._ElementIterator lxml.etree._ElementIterator-class.html -lxml.etree._ElementIterator.__new__ lxml.etree._ElementIterator-class.html#__new__ -lxml.etree._ElementIterator.__next__ lxml.etree._ElementIterator-class.html#__next__ -lxml.etree._ElementIterator.next lxml.etree._ElementIterator-class.html#next -lxml.etree._ElementIterator.__iter__ lxml.etree._ElementIterator-class.html#__iter__ -lxml.etree._ElementMatchIterator lxml.etree._ElementMatchIterator-class.html -lxml.etree._ElementMatchIterator.__new__ lxml.etree._ElementMatchIterator-class.html#__new__ -lxml.etree._ElementMatchIterator.__next__ lxml.etree._ElementMatchIterator-class.html#__next__ -lxml.etree._ElementMatchIterator.next lxml.etree._ElementMatchIterator-class.html#next -lxml.etree._ElementMatchIterator.__iter__ lxml.etree._ElementMatchIterator-class.html#__iter__ -lxml.etree._ElementStringResult lxml.etree._ElementStringResult-class.html -str.upper str-class.html#upper -lxml.etree._ElementStringResult.getparent lxml.etree._ElementStringResult-class.html#getparent -str.__getslice__ str-class.html#__getslice__ -str.startswith str-class.html#startswith -str.lstrip str-class.html#lstrip -str.capitalize str-class.html#capitalize -str.__str__ str-class.html#__str__ -str.__getattribute__ str-class.html#__getattribute__ -str.rpartition str-class.html#rpartition -str.replace str-class.html#replace -str.isdigit str-class.html#isdigit -str.endswith str-class.html#endswith -str.splitlines str-class.html#splitlines -str.expandtabs str-class.html#expandtabs -str.strip str-class.html#strip -str.__rmul__ str-class.html#__rmul__ -str.__lt__ str-class.html#__lt__ -str.ljust str-class.html#ljust -str.__rmod__ str-class.html#__rmod__ -str.index str-class.html#index -str.__getnewargs__ str-class.html#__getnewargs__ -str.__new__ str-class.html#__new__ -str.isalnum str-class.html#isalnum -str.__contains__ str-class.html#__contains__ -str.rindex str-class.html#rindex -str.__eq__ str-class.html#__eq__ -str.__format__ str-class.html#__format__ -str.find str-class.html#find -str.decode str-class.html#decode -str.isalpha str-class.html#isalpha -str.split str-class.html#split -str.rstrip str-class.html#rstrip -str.encode str-class.html#encode -str._formatter_parser str-class.html#_formatter_parser -str.translate str-class.html#translate -str.isspace str-class.html#isspace -str.__len__ str-class.html#__len__ -str.__mul__ str-class.html#__mul__ -str.__ne__ str-class.html#__ne__ -str.__getitem__ str-class.html#__getitem__ -str.format str-class.html#format -str.rjust str-class.html#rjust -str.swapcase str-class.html#swapcase -str.islower str-class.html#islower -str.zfill str-class.html#zfill -str.__add__ str-class.html#__add__ -str.__gt__ str-class.html#__gt__ -str.rsplit str-class.html#rsplit -str.__sizeof__ str-class.html#__sizeof__ -str.count str-class.html#count -str.lower str-class.html#lower -str.join str-class.html#join -str.center str-class.html#center -str.__mod__ str-class.html#__mod__ -str.partition str-class.html#partition -str.rfind str-class.html#rfind -str.istitle str-class.html#istitle -lxml.etree._ElementStringResult.__qualname__ lxml.etree._ElementStringResult-class.html#__qualname__ -str.__le__ str-class.html#__le__ -str.__repr__ str-class.html#__repr__ -str._formatter_field_name_split str-class.html#_formatter_field_name_split -str.__hash__ str-class.html#__hash__ -str.title str-class.html#title -str.isupper str-class.html#isupper -str.__ge__ str-class.html#__ge__ -lxml.etree._ElementTagMatcher lxml.etree._ElementTagMatcher-class.html -lxml.etree._ElementTagMatcher.__new__ lxml.etree._ElementTagMatcher-class.html#__new__ -lxml.etree._ElementTree lxml.etree._ElementTree-class.html -lxml.etree._ElementTree.getroot lxml.etree._ElementTree-class.html#getroot -lxml.etree._ElementTree.parser lxml.etree._ElementTree-class.html#parser -lxml.etree._ElementTree.parse lxml.etree._ElementTree-class.html#parse -lxml.etree._ElementTree.relaxng lxml.etree._ElementTree-class.html#relaxng -lxml.etree._ElementTree.find lxml.etree._ElementTree-class.html#find -lxml.etree._ElementTree.__new__ lxml.etree._ElementTree-class.html#__new__ -lxml.etree._ElementTree.findtext lxml.etree._ElementTree-class.html#findtext -lxml.etree._ElementTree.findall lxml.etree._ElementTree-class.html#findall -lxml.etree._ElementTree.write lxml.etree._ElementTree-class.html#write -lxml.etree._ElementTree._setroot lxml.etree._ElementTree-class.html#_setroot -lxml.etree._ElementTree.xpath lxml.etree._ElementTree-class.html#xpath -lxml.etree._ElementTree.iterfind lxml.etree._ElementTree-class.html#iterfind -lxml.etree._ElementTree.xslt lxml.etree._ElementTree-class.html#xslt -lxml.etree._ElementTree.__deepcopy__ lxml.etree._ElementTree-class.html#__deepcopy__ -lxml.etree._ElementTree.getpath lxml.etree._ElementTree-class.html#getpath -lxml.etree._ElementTree.getelementpath lxml.etree._ElementTree-class.html#getelementpath -lxml.etree._ElementTree.write_c14n lxml.etree._ElementTree-class.html#write_c14n -lxml.etree._ElementTree.xmlschema lxml.etree._ElementTree-class.html#xmlschema -lxml.etree._ElementTree.xinclude lxml.etree._ElementTree-class.html#xinclude -lxml.etree._ElementTree.docinfo lxml.etree._ElementTree-class.html#docinfo -lxml.etree._ElementTree.getiterator lxml.etree._ElementTree-class.html#getiterator -lxml.etree._ElementTree.iter lxml.etree._ElementTree-class.html#iter -lxml.etree._ElementTree.__copy__ lxml.etree._ElementTree-class.html#__copy__ -lxml.etree._ElementUnicodeResult lxml.etree._ElementUnicodeResult-class.html -lxml.etree._ElementUnicodeResult.getparent lxml.etree._ElementUnicodeResult-class.html#getparent -lxml.etree._ElementUnicodeResult.is_attribute lxml.etree._ElementUnicodeResult-class.html#is_attribute -lxml.etree._ElementUnicodeResult.__new__ lxml.etree._ElementUnicodeResult-class.html#__new__ -lxml.etree._ElementUnicodeResult.is_text lxml.etree._ElementUnicodeResult-class.html#is_text -lxml.etree._ElementUnicodeResult.attrname lxml.etree._ElementUnicodeResult-class.html#attrname -lxml.etree._ElementUnicodeResult.is_tail lxml.etree._ElementUnicodeResult-class.html#is_tail -lxml.etree._Entity lxml.etree._Entity-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Entity.text lxml.etree._Entity-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Entity.tag lxml.etree._Entity-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Entity.__new__ lxml.etree._Entity-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Entity.name lxml.etree._Entity-class.html#name -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Entity.__repr__ lxml.etree._Entity-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._ErrorLog lxml.etree._ErrorLog-class.html -lxml.etree._ListErrorLog.filter_domains lxml.etree._ListErrorLog-class.html#filter_domains -lxml.etree._BaseErrorLog.last_error lxml.etree._BaseErrorLog-class.html#last_error -lxml.etree._ListErrorLog.filter_from_warnings lxml.etree._ListErrorLog-class.html#filter_from_warnings -lxml.etree._ErrorLog.__init__ lxml.etree._ErrorLog-class.html#__init__ -lxml.etree._ErrorLog.__new__ lxml.etree._ErrorLog-class.html#__new__ -lxml.etree._ListErrorLog.__contains__ lxml.etree._ListErrorLog-class.html#__contains__ -lxml.etree._ListErrorLog.filter_from_level lxml.etree._ListErrorLog-class.html#filter_from_level -lxml.etree._ListErrorLog.__len__ lxml.etree._ListErrorLog-class.html#__len__ -lxml.etree._ErrorLog.__exit__ lxml.etree._ErrorLog-class.html#__exit__ -lxml.etree._ListErrorLog.__getitem__ lxml.etree._ListErrorLog-class.html#__getitem__ -lxml.etree._ListErrorLog.filter_levels lxml.etree._ListErrorLog-class.html#filter_levels -lxml.etree._ErrorLog.__iter__ lxml.etree._ErrorLog-class.html#__iter__ -lxml.etree._ErrorLog.copy lxml.etree._ErrorLog-class.html#copy -lxml.etree._ListErrorLog.__nonzero__ lxml.etree._ListErrorLog-class.html#__nonzero__ -lxml.etree._ListErrorLog.filter_from_fatals lxml.etree._ListErrorLog-class.html#filter_from_fatals -lxml.etree._ErrorLog.receive lxml.etree._ErrorLog-class.html#receive -lxml.etree._ErrorLog.clear lxml.etree._ErrorLog-class.html#clear -lxml.etree._ListErrorLog.filter_from_errors lxml.etree._ListErrorLog-class.html#filter_from_errors -lxml.etree._ListErrorLog.filter_types lxml.etree._ListErrorLog-class.html#filter_types -lxml.etree._ListErrorLog.__repr__ lxml.etree._ListErrorLog-class.html#__repr__ -lxml.etree._FeedParser lxml.etree._FeedParser-class.html -lxml.etree._FeedParser.feed lxml.etree._FeedParser-class.html#feed -lxml.etree._FeedParser.close lxml.etree._FeedParser-class.html#close -lxml.etree._FeedParser.__new__ lxml.etree._FeedParser-class.html#__new__ -lxml.etree._FeedParser.feed_error_log lxml.etree._FeedParser-class.html#feed_error_log -lxml.etree._IDDict lxml.etree._IDDict-class.html -lxml.etree._IDDict.has_key lxml.etree._IDDict-class.html#has_key -lxml.etree._IDDict.__new__ lxml.etree._IDDict-class.html#__new__ -lxml.etree._IDDict.__contains__ lxml.etree._IDDict-class.html#__contains__ -lxml.etree._IDDict.itervalues lxml.etree._IDDict-class.html#itervalues -lxml.etree._IDDict.__len__ lxml.etree._IDDict-class.html#__len__ -lxml.etree._IDDict.__getitem__ lxml.etree._IDDict-class.html#__getitem__ -lxml.etree._IDDict.get lxml.etree._IDDict-class.html#get -lxml.etree._IDDict.keys lxml.etree._IDDict-class.html#keys -lxml.etree._IDDict.__iter__ lxml.etree._IDDict-class.html#__iter__ -lxml.etree._IDDict.iteritems lxml.etree._IDDict-class.html#iteritems -lxml.etree._IDDict.copy lxml.etree._IDDict-class.html#copy -lxml.etree._IDDict.iterkeys lxml.etree._IDDict-class.html#iterkeys -lxml.etree._IDDict.items lxml.etree._IDDict-class.html#items -lxml.etree._IDDict.values lxml.etree._IDDict-class.html#values -lxml.etree._IDDict.__repr__ lxml.etree._IDDict-class.html#__repr__ -lxml.etree._ListErrorLog lxml.etree._ListErrorLog-class.html -lxml.etree._ListErrorLog.filter_domains lxml.etree._ListErrorLog-class.html#filter_domains -lxml.etree._BaseErrorLog.last_error lxml.etree._BaseErrorLog-class.html#last_error -lxml.etree._ListErrorLog.filter_from_warnings lxml.etree._ListErrorLog-class.html#filter_from_warnings -lxml.etree._ListErrorLog.__init__ lxml.etree._ListErrorLog-class.html#__init__ -lxml.etree._ListErrorLog.__new__ lxml.etree._ListErrorLog-class.html#__new__ -lxml.etree._ListErrorLog.__contains__ lxml.etree._ListErrorLog-class.html#__contains__ -lxml.etree._ListErrorLog.filter_from_level lxml.etree._ListErrorLog-class.html#filter_from_level -lxml.etree._ListErrorLog.__len__ lxml.etree._ListErrorLog-class.html#__len__ -lxml.etree._ListErrorLog.__getitem__ lxml.etree._ListErrorLog-class.html#__getitem__ -lxml.etree._ListErrorLog.filter_levels lxml.etree._ListErrorLog-class.html#filter_levels -lxml.etree._ListErrorLog.__iter__ lxml.etree._ListErrorLog-class.html#__iter__ -lxml.etree._ListErrorLog.copy lxml.etree._ListErrorLog-class.html#copy -lxml.etree._ListErrorLog.__nonzero__ lxml.etree._ListErrorLog-class.html#__nonzero__ -lxml.etree._ListErrorLog.filter_from_fatals lxml.etree._ListErrorLog-class.html#filter_from_fatals -lxml.etree._BaseErrorLog.receive lxml.etree._BaseErrorLog-class.html#receive -lxml.etree._ListErrorLog.filter_from_errors lxml.etree._ListErrorLog-class.html#filter_from_errors -lxml.etree._ListErrorLog.filter_types lxml.etree._ListErrorLog-class.html#filter_types -lxml.etree._ListErrorLog.__repr__ lxml.etree._ListErrorLog-class.html#__repr__ -lxml.etree._LogEntry lxml.etree._LogEntry-class.html -lxml.etree._LogEntry.domain lxml.etree._LogEntry-class.html#domain -lxml.etree._LogEntry.message lxml.etree._LogEntry-class.html#message -lxml.etree._LogEntry.level_name lxml.etree._LogEntry-class.html#level_name -lxml.etree._LogEntry.__new__ lxml.etree._LogEntry-class.html#__new__ -lxml.etree._LogEntry.type_name lxml.etree._LogEntry-class.html#type_name -lxml.etree._LogEntry.domain_name lxml.etree._LogEntry-class.html#domain_name -lxml.etree._LogEntry.filename lxml.etree._LogEntry-class.html#filename -lxml.etree._LogEntry.type lxml.etree._LogEntry-class.html#type -lxml.etree._LogEntry.path lxml.etree._LogEntry-class.html#path -lxml.etree._LogEntry.line lxml.etree._LogEntry-class.html#line -lxml.etree._LogEntry.level lxml.etree._LogEntry-class.html#level -lxml.etree._LogEntry.column lxml.etree._LogEntry-class.html#column -lxml.etree._LogEntry.__repr__ lxml.etree._LogEntry-class.html#__repr__ -lxml.etree._ProcessingInstruction lxml.etree._ProcessingInstruction-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._ProcessingInstruction.tag lxml.etree._ProcessingInstruction-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._ProcessingInstruction.__new__ lxml.etree._ProcessingInstruction-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._ProcessingInstruction.get lxml.etree._ProcessingInstruction-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._ProcessingInstruction.target lxml.etree._ProcessingInstruction-class.html#target -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._ProcessingInstruction.__repr__ lxml.etree._ProcessingInstruction-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._ProcessingInstruction.attrib lxml.etree._ProcessingInstruction-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._RotatingErrorLog lxml.etree._RotatingErrorLog-class.html -lxml.etree._ListErrorLog.filter_domains lxml.etree._ListErrorLog-class.html#filter_domains -lxml.etree._BaseErrorLog.last_error lxml.etree._BaseErrorLog-class.html#last_error -lxml.etree._ListErrorLog.filter_from_warnings lxml.etree._ListErrorLog-class.html#filter_from_warnings -lxml.etree._RotatingErrorLog.__init__ lxml.etree._RotatingErrorLog-class.html#__init__ -lxml.etree._RotatingErrorLog.__new__ lxml.etree._RotatingErrorLog-class.html#__new__ -lxml.etree._ListErrorLog.__contains__ lxml.etree._ListErrorLog-class.html#__contains__ -lxml.etree._ListErrorLog.filter_from_level lxml.etree._ListErrorLog-class.html#filter_from_level -lxml.etree._ListErrorLog.__len__ lxml.etree._ListErrorLog-class.html#__len__ -lxml.etree._ErrorLog.__exit__ lxml.etree._ErrorLog-class.html#__exit__ -lxml.etree._ListErrorLog.__getitem__ lxml.etree._ListErrorLog-class.html#__getitem__ -lxml.etree._ListErrorLog.filter_levels lxml.etree._ListErrorLog-class.html#filter_levels -lxml.etree._ErrorLog.__iter__ lxml.etree._ErrorLog-class.html#__iter__ -lxml.etree._ErrorLog.copy lxml.etree._ErrorLog-class.html#copy -lxml.etree._ListErrorLog.__nonzero__ lxml.etree._ListErrorLog-class.html#__nonzero__ -lxml.etree._ListErrorLog.filter_from_fatals lxml.etree._ListErrorLog-class.html#filter_from_fatals -lxml.etree._RotatingErrorLog.receive lxml.etree._RotatingErrorLog-class.html#receive -lxml.etree._ErrorLog.clear lxml.etree._ErrorLog-class.html#clear -lxml.etree._ListErrorLog.filter_from_errors lxml.etree._ListErrorLog-class.html#filter_from_errors -lxml.etree._ListErrorLog.filter_types lxml.etree._ListErrorLog-class.html#filter_types -lxml.etree._ListErrorLog.__repr__ lxml.etree._ListErrorLog-class.html#__repr__ -lxml.etree._SaxParserTarget lxml.etree._SaxParserTarget-class.html -lxml.etree._SaxParserTarget.__new__ lxml.etree._SaxParserTarget-class.html#__new__ -lxml.etree._TargetParserResult lxml.etree._TargetParserResult-class.html -lxml.etree._TargetParserResult.__qualname__ lxml.etree._TargetParserResult-class.html#__qualname__ -lxml.etree._TargetParserResult.__init__ lxml.etree._TargetParserResult-class.html#__init__ -lxml.etree._Validator lxml.etree._Validator-class.html -lxml.etree._Validator.__new__ lxml.etree._Validator-class.html#__new__ -lxml.etree._Validator._clear_error_log lxml.etree._Validator-class.html#_clear_error_log -lxml.etree._Validator.assertValid lxml.etree._Validator-class.html#assertValid -lxml.etree._Validator._append_log_message lxml.etree._Validator-class.html#_append_log_message -lxml.etree._Validator.error_log lxml.etree._Validator-class.html#error_log -lxml.etree._Validator.assert_ lxml.etree._Validator-class.html#assert_ -lxml.etree._Validator.validate lxml.etree._Validator-class.html#validate -lxml.etree._XPathEvaluatorBase lxml.etree._XPathEvaluatorBase-class.html -lxml.etree._XPathEvaluatorBase.__new__ lxml.etree._XPathEvaluatorBase-class.html#__new__ -lxml.etree._XPathEvaluatorBase.evaluate lxml.etree._XPathEvaluatorBase-class.html#evaluate -lxml.etree._XPathEvaluatorBase.error_log lxml.etree._XPathEvaluatorBase-class.html#error_log -lxml.etree._XPathEvaluatorBase.__init__ lxml.etree._XPathEvaluatorBase-class.html#__init__ -lxml.etree._XSLTProcessingInstruction lxml.etree._XSLTProcessingInstruction-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._XSLTProcessingInstruction.set lxml.etree._XSLTProcessingInstruction-class.html#set -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._ProcessingInstruction.tag lxml.etree._ProcessingInstruction-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._XSLTProcessingInstruction.__new__ lxml.etree._XSLTProcessingInstruction-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.PIBase.__init__ lxml.etree.PIBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._ProcessingInstruction.get lxml.etree._ProcessingInstruction-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._ProcessingInstruction.target lxml.etree._ProcessingInstruction-class.html#target -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._ProcessingInstruction.__repr__ lxml.etree._ProcessingInstruction-class.html#__repr__ -lxml.etree._XSLTProcessingInstruction.parseXSL lxml.etree._XSLTProcessingInstruction-class.html#parseXSL -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._ProcessingInstruction.attrib lxml.etree._ProcessingInstruction-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._XSLTResultTree lxml.etree._XSLTResultTree-class.html -lxml.etree._ElementTree.getroot lxml.etree._ElementTree-class.html#getroot -lxml.etree._XSLTResultTree.__str__ lxml.etree._XSLTResultTree-class.html#__str__ -lxml.etree._ElementTree.iterfind lxml.etree._ElementTree-class.html#iterfind -lxml.etree._ElementTree.parse lxml.etree._ElementTree-class.html#parse -lxml.etree._ElementTree.relaxng lxml.etree._ElementTree-class.html#relaxng -lxml.etree._ElementTree.findall lxml.etree._ElementTree-class.html#findall -lxml.etree._XSLTResultTree.__new__ lxml.etree._XSLTResultTree-class.html#__new__ -lxml.etree._ElementTree.findtext lxml.etree._ElementTree-class.html#findtext -lxml.etree._ElementTree.find lxml.etree._ElementTree-class.html#find -lxml.etree._ElementTree.write lxml.etree._ElementTree-class.html#write -lxml.etree._ElementTree._setroot lxml.etree._ElementTree-class.html#_setroot -lxml.etree._ElementTree.xpath lxml.etree._ElementTree-class.html#xpath -lxml.etree._ElementTree.parser lxml.etree._ElementTree-class.html#parser -lxml.etree._ElementTree.xslt lxml.etree._ElementTree-class.html#xslt -lxml.etree._ElementTree.__deepcopy__ lxml.etree._ElementTree-class.html#__deepcopy__ -lxml.etree._ElementTree.getpath lxml.etree._ElementTree-class.html#getpath -lxml.etree._ElementTree.getelementpath lxml.etree._ElementTree-class.html#getelementpath -lxml.etree._ElementTree.write_c14n lxml.etree._ElementTree-class.html#write_c14n -lxml.etree._ElementTree.xmlschema lxml.etree._ElementTree-class.html#xmlschema -lxml.etree._ElementTree.xinclude lxml.etree._ElementTree-class.html#xinclude -lxml.etree._ElementTree.docinfo lxml.etree._ElementTree-class.html#docinfo -lxml.etree._XSLTResultTree.__unicode__ lxml.etree._XSLTResultTree-class.html#__unicode__ -lxml.etree._XSLTResultTree.xslt_profile lxml.etree._XSLTResultTree-class.html#xslt_profile -lxml.etree._ElementTree.iter lxml.etree._ElementTree-class.html#iter -lxml.etree._XSLTResultTree.write_output lxml.etree._XSLTResultTree-class.html#write_output -lxml.etree._ElementTree.getiterator lxml.etree._ElementTree-class.html#getiterator -lxml.etree._ElementTree.__copy__ lxml.etree._ElementTree-class.html#__copy__ -lxml.etree.htmlfile lxml.etree.htmlfile-class.html -lxml.etree.xmlfile.__exit__ lxml.etree.xmlfile-class.html#__exit__ -lxml.etree.htmlfile.__new__ lxml.etree.htmlfile-class.html#__new__ -lxml.etree.xmlfile.__aexit__ lxml.etree.xmlfile-class.html#__aexit__ -lxml.etree.xmlfile.__enter__ lxml.etree.xmlfile-class.html#__enter__ -lxml.etree.xmlfile.__aenter__ lxml.etree.xmlfile-class.html#__aenter__ -lxml.etree.htmlfile.__init__ lxml.etree.htmlfile-class.html#__init__ -lxml.etree.iterparse lxml.etree.iterparse-class.html -lxml.etree.iterparse.set_element_class_lookup lxml.etree.iterparse-class.html#set_element_class_lookup -lxml.etree.iterparse.__init__ lxml.etree.iterparse-class.html#__init__ -lxml.etree.iterparse.__new__ lxml.etree.iterparse-class.html#__new__ -lxml.etree.iterparse.next lxml.etree.iterparse-class.html#next -lxml.etree.iterparse.version lxml.etree.iterparse-class.html#version -lxml.etree.iterparse.__next__ lxml.etree.iterparse-class.html#__next__ -lxml.etree.iterparse.makeelement lxml.etree.iterparse-class.html#makeelement -lxml.etree.iterparse.__iter__ lxml.etree.iterparse-class.html#__iter__ -lxml.etree.iterparse.resolvers lxml.etree.iterparse-class.html#resolvers -lxml.etree.iterparse.error_log lxml.etree.iterparse-class.html#error_log -lxml.etree.iterparse.root lxml.etree.iterparse-class.html#root -lxml.etree.iterwalk lxml.etree.iterwalk-class.html -lxml.etree.iterwalk.__new__ lxml.etree.iterwalk-class.html#__new__ -lxml.etree.iterwalk.__next__ lxml.etree.iterwalk-class.html#__next__ -lxml.etree.iterwalk.next lxml.etree.iterwalk-class.html#next -lxml.etree.iterwalk.__iter__ lxml.etree.iterwalk-class.html#__iter__ -lxml.etree.iterwalk.__init__ lxml.etree.iterwalk-class.html#__init__ -lxml.etree.iterwalk.skip_subtree lxml.etree.iterwalk-class.html#skip_subtree -lxml.etree.xmlfile lxml.etree.xmlfile-class.html -lxml.etree.xmlfile.__exit__ lxml.etree.xmlfile-class.html#__exit__ -lxml.etree.xmlfile.__new__ lxml.etree.xmlfile-class.html#__new__ -lxml.etree.xmlfile.__aexit__ lxml.etree.xmlfile-class.html#__aexit__ -lxml.etree.xmlfile.__enter__ lxml.etree.xmlfile-class.html#__enter__ -lxml.etree.xmlfile.__aenter__ lxml.etree.xmlfile-class.html#__aenter__ -lxml.etree.xmlfile.__init__ lxml.etree.xmlfile-class.html#__init__ -lxml.html.CheckboxGroup lxml.html.CheckboxGroup-class.html -lxml.html.CheckboxGroup.value_options lxml.html.CheckboxGroup-class.html#value_options -lxml.html.CheckboxGroup.value lxml.html.CheckboxGroup-class.html#value -lxml.html.CheckboxGroup.__repr__ lxml.html.CheckboxGroup-class.html#__repr__ -lxml.html.CheckboxValues lxml.html.CheckboxValues-class.html -_abcoll.Sized.__metaclass__ abc.ABCMeta-class.html -lxml.html.CheckboxValues.__init__ lxml.html.CheckboxValues-class.html#__init__ -lxml.html.CheckboxValues.__abstractmethods__ lxml.html.CheckboxValues-class.html#__abstractmethods__ -lxml.html.CheckboxValues.add lxml.html.CheckboxValues-class.html#add -lxml.html.CheckboxValues.__iter__ lxml.html.CheckboxValues-class.html#__iter__ -lxml.html.CheckboxValues.remove lxml.html.CheckboxValues-class.html#remove -lxml.html.CheckboxValues.__repr__ lxml.html.CheckboxValues-class.html#__repr__ -lxml.html.Classes lxml.html.Classes-class.html -_abcoll.Sized.__metaclass__ abc.ABCMeta-class.html -lxml.html.Classes._abc_negative_cache lxml.html.Classes-class.html#_abc_negative_cache -lxml.html.Classes.toggle lxml.html.Classes-class.html#toggle -lxml.html.Classes.__init__ lxml.html.Classes-class.html#__init__ -lxml.html.Classes.__contains__ lxml.html.Classes-class.html#__contains__ -lxml.html.Classes.__abstractmethods__ lxml.html.Classes-class.html#__abstractmethods__ -lxml.html.Classes.add lxml.html.Classes-class.html#add -lxml.html.Classes.__len__ lxml.html.Classes-class.html#__len__ -lxml.html.Classes.update lxml.html.Classes-class.html#update -lxml.html.Classes.__iter__ lxml.html.Classes-class.html#__iter__ -lxml.html.Classes.remove lxml.html.Classes-class.html#remove -lxml.html.Classes._abc_negative_cache_version lxml.html.Classes-class.html#_abc_negative_cache_version -lxml.html.Classes.discard lxml.html.Classes-class.html#discard -lxml.html.Classes._abc_registry lxml.html.Classes-class.html#_abc_registry -lxml.html.FieldsDict lxml.html.FieldsDict-class.html -_abcoll.Sized.__metaclass__ abc.ABCMeta-class.html -lxml.html.FieldsDict._abc_negative_cache lxml.html.FieldsDict-class.html#_abc_negative_cache -lxml.html.FieldsDict.__init__ lxml.html.FieldsDict-class.html#__init__ -lxml.html.FieldsDict.__contains__ lxml.html.FieldsDict-class.html#__contains__ -lxml.html.FieldsDict.__abstractmethods__ lxml.html.FieldsDict-class.html#__abstractmethods__ -lxml.html.FieldsDict.__len__ lxml.html.FieldsDict-class.html#__len__ -lxml.html.FieldsDict.__getitem__ lxml.html.FieldsDict-class.html#__getitem__ -lxml.html.FieldsDict.keys lxml.html.FieldsDict-class.html#keys -lxml.html.FieldsDict.__iter__ lxml.html.FieldsDict-class.html#__iter__ -lxml.html.FieldsDict.__delitem__ lxml.html.FieldsDict-class.html#__delitem__ -lxml.html.FieldsDict.__setitem__ lxml.html.FieldsDict-class.html#__setitem__ -lxml.html.FieldsDict._abc_negative_cache_version lxml.html.FieldsDict-class.html#_abc_negative_cache_version -lxml.html.FieldsDict.__repr__ lxml.html.FieldsDict-class.html#__repr__ -lxml.html.FieldsDict._abc_registry lxml.html.FieldsDict-class.html#_abc_registry -lxml.html.FormElement lxml.html.FormElement-class.html -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.html.FormElement.fields lxml.html.FormElement-class.html#fields -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.html.FormElement.method lxml.html.FormElement-class.html#method -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.html.HtmlElement.set lxml.html.HtmlElement-class.html#set -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.html.FormElement._name lxml.html.FormElement-class.html#_name -lxml.html.HtmlElement.cssselect lxml.html.HtmlElement-class.html#cssselect -lxml.etree._Element.__repr__ lxml.etree._Element-class.html#__repr__ -lxml.html.FormElement.action lxml.html.FormElement-class.html#action -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.html.FormElement.form_values lxml.html.FormElement-class.html#form_values -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.html.FormElement.inputs lxml.html.FormElement-class.html#inputs -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.html.HTMLParser lxml.html.HTMLParser-class.html -lxml.etree._FeedParser.feed lxml.etree._FeedParser-class.html#feed -lxml.etree._FeedParser.close lxml.etree._FeedParser-class.html#close -lxml.html.HTMLParser.__init__ lxml.html.HTMLParser-class.html#__init__ -lxml.etree.HTMLParser.__new__ lxml.etree.HTMLParser-class.html#__new__ -lxml.etree._FeedParser.feed_error_log lxml.etree._FeedParser-class.html#feed_error_log -lxml.html.HtmlComment lxml.html.HtmlComment-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Comment.tag lxml.etree._Comment-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.etree.CommentBase.__new__ lxml.etree.CommentBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.CommentBase.__init__ lxml.etree.CommentBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.etree._Comment.__repr__ lxml.etree._Comment-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.html.HtmlElement lxml.html.HtmlElement-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.html.HtmlElement.set lxml.html.HtmlElement-class.html#set -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.html.HtmlElement.cssselect lxml.html.HtmlElement-class.html#cssselect -lxml.etree._Element.__repr__ lxml.etree._Element-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.html.HtmlElementClassLookup lxml.html.HtmlElementClassLookup-class.html -lxml.html.HtmlElementClassLookup._default_element_classes lxml.html.HtmlElementClassLookup-class.html#_default_element_classes -lxml.etree.CustomElementClassLookup.__new__ lxml.etree.CustomElementClassLookup-class.html#__new__ -lxml.html.HtmlElementClassLookup.lookup lxml.html.HtmlElementClassLookup-class.html#lookup -lxml.etree.FallbackElementClassLookup.fallback lxml.etree.FallbackElementClassLookup-class.html#fallback -lxml.etree.FallbackElementClassLookup.set_fallback lxml.etree.FallbackElementClassLookup-class.html#set_fallback -lxml.html.HtmlElementClassLookup.__init__ lxml.html.HtmlElementClassLookup-class.html#__init__ -lxml.html.HtmlEntity lxml.html.HtmlEntity-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Entity.text lxml.etree._Entity-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Entity.tag lxml.etree._Entity-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.etree.EntityBase.__new__ lxml.etree.EntityBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.EntityBase.__init__ lxml.etree.EntityBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Entity.name lxml.etree._Entity-class.html#name -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.etree._Entity.__repr__ lxml.etree._Entity-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.html.HtmlMixin lxml.html.HtmlMixin-class.html -lxml.html.HtmlMixin.set lxml.html.HtmlMixin-class.html#set -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.html.HtmlMixin.cssselect lxml.html.HtmlMixin-class.html#cssselect -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.html.HtmlProcessingInstruction lxml.html.HtmlProcessingInstruction-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._ProcessingInstruction.tag lxml.etree._ProcessingInstruction-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.etree.PIBase.__new__ lxml.etree.PIBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.PIBase.__init__ lxml.etree.PIBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.etree._ProcessingInstruction.get lxml.etree._ProcessingInstruction-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._ProcessingInstruction.target lxml.etree._ProcessingInstruction-class.html#target -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.etree._ProcessingInstruction.__repr__ lxml.etree._ProcessingInstruction-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.etree._ProcessingInstruction.attrib lxml.etree._ProcessingInstruction-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.html.InputElement lxml.html.InputElement-class.html -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.html.InputMixin.name lxml.html.InputMixin-class.html#name -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.html.HtmlElement.set lxml.html.HtmlElement-class.html#set -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.html.HtmlElement.cssselect lxml.html.HtmlElement-class.html#cssselect -lxml.html.InputMixin.__repr__ lxml.html.InputMixin-class.html#__repr__ -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.html.InputElement.checked lxml.html.InputElement-class.html#checked -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.html.InputElement.type lxml.html.InputElement-class.html#type -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.html.InputElement.checkable lxml.html.InputElement-class.html#checkable -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.html.InputElement.value lxml.html.InputElement-class.html#value -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.html.InputGetter lxml.html.InputGetter-class.html -lxml.html.InputGetter.__getitem__ lxml.html.InputGetter-class.html#__getitem__ -lxml.html.InputGetter.__contains__ lxml.html.InputGetter-class.html#__contains__ -lxml.html.InputGetter.keys lxml.html.InputGetter-class.html#keys -lxml.html.InputGetter.__iter__ lxml.html.InputGetter-class.html#__iter__ -lxml.html.InputGetter.__repr__ lxml.html.InputGetter-class.html#__repr__ -lxml.html.InputGetter._all_xpath lxml.html.InputGetter-class.html#_all_xpath -lxml.html.InputGetter.__init__ lxml.html.InputGetter-class.html#__init__ -lxml.html.InputGetter._name_xpath lxml.html.InputGetter-class.html#_name_xpath -lxml.html.InputMixin lxml.html.InputMixin-class.html -lxml.html.InputMixin.__repr__ lxml.html.InputMixin-class.html#__repr__ -lxml.html.InputMixin.name lxml.html.InputMixin-class.html#name -lxml.html.LabelElement lxml.html.LabelElement-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.html.HtmlElement.set lxml.html.HtmlElement-class.html#set -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.html.LabelElement.for_element lxml.html.LabelElement-class.html#for_element -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.html.HtmlElement.cssselect lxml.html.HtmlElement-class.html#cssselect -lxml.etree._Element.__repr__ lxml.etree._Element-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.html.MultipleSelectOptions lxml.html.MultipleSelectOptions-class.html -_abcoll.Sized.__metaclass__ abc.ABCMeta-class.html -lxml.html.MultipleSelectOptions.__init__ lxml.html.MultipleSelectOptions-class.html#__init__ -lxml.html.MultipleSelectOptions.__abstractmethods__ lxml.html.MultipleSelectOptions-class.html#__abstractmethods__ -lxml.html.MultipleSelectOptions.add lxml.html.MultipleSelectOptions-class.html#add -lxml.html.MultipleSelectOptions.__iter__ lxml.html.MultipleSelectOptions-class.html#__iter__ -lxml.html.MultipleSelectOptions.remove lxml.html.MultipleSelectOptions-class.html#remove -lxml.html.MultipleSelectOptions.__repr__ lxml.html.MultipleSelectOptions-class.html#__repr__ -lxml.html.MultipleSelectOptions.options lxml.html.MultipleSelectOptions-class.html#options -lxml.html.RadioGroup lxml.html.RadioGroup-class.html -lxml.html.RadioGroup.value_options lxml.html.RadioGroup-class.html#value_options -lxml.html.RadioGroup.value lxml.html.RadioGroup-class.html#value -lxml.html.RadioGroup.__repr__ lxml.html.RadioGroup-class.html#__repr__ -lxml.html.SelectElement lxml.html.SelectElement-class.html -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.html.InputMixin.name lxml.html.InputMixin-class.html#name -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.html.HtmlElement.set lxml.html.HtmlElement-class.html#set -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.html.HtmlElement.cssselect lxml.html.HtmlElement-class.html#cssselect -lxml.html.InputMixin.__repr__ lxml.html.InputMixin-class.html#__repr__ -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.html.SelectElement.value_options lxml.html.SelectElement-class.html#value_options -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.html.SelectElement.value lxml.html.SelectElement-class.html#value -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.html.SelectElement.multiple lxml.html.SelectElement-class.html#multiple -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.html.TextareaElement lxml.html.TextareaElement-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.html.HtmlMixin.body lxml.html.HtmlMixin-class.html#body -lxml.html.HtmlElement.set lxml.html.HtmlElement-class.html#set -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.html.HtmlMixin.iterlinks lxml.html.HtmlMixin-class.html#iterlinks -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.html.TextareaElement.value lxml.html.TextareaElement-class.html#value -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.html.HtmlMixin.drop_tag lxml.html.HtmlMixin-class.html#drop_tag -lxml.html.HtmlMixin.label lxml.html.HtmlMixin-class.html#label -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.html.HtmlMixin.make_links_absolute lxml.html.HtmlMixin-class.html#make_links_absolute -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.html.HtmlMixin.text_content lxml.html.HtmlMixin-class.html#text_content -lxml.html.HtmlMixin.get_element_by_id lxml.html.HtmlMixin-class.html#get_element_by_id -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.html.HtmlMixin.base_url lxml.html.HtmlMixin-class.html#base_url -lxml.html.HtmlMixin.drop_tree lxml.html.HtmlMixin-class.html#drop_tree -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.html.HtmlMixin.forms lxml.html.HtmlMixin-class.html#forms -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.html.HtmlMixin.resolve_base_href lxml.html.HtmlMixin-class.html#resolve_base_href -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.html.HtmlMixin.rewrite_links lxml.html.HtmlMixin-class.html#rewrite_links -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.html.HtmlMixin.head lxml.html.HtmlMixin-class.html#head -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.html.HtmlMixin.find_class lxml.html.HtmlMixin-class.html#find_class -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.html.InputMixin.name lxml.html.InputMixin-class.html#name -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.html.HtmlMixin.classes lxml.html.HtmlMixin-class.html#classes -lxml.html.HtmlElement.cssselect lxml.html.HtmlElement-class.html#cssselect -lxml.html.InputMixin.__repr__ lxml.html.InputMixin-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.html.HtmlMixin.find_rel_links lxml.html.HtmlMixin-class.html#find_rel_links -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.html.XHTMLParser lxml.html.XHTMLParser-class.html -lxml.etree._FeedParser.feed lxml.etree._FeedParser-class.html#feed -lxml.etree._FeedParser.close lxml.etree._FeedParser-class.html#close -lxml.html.XHTMLParser.__init__ lxml.html.XHTMLParser-class.html#__init__ -lxml.etree.XMLParser.__new__ lxml.etree.XMLParser-class.html#__new__ -lxml.etree._FeedParser.feed_error_log lxml.etree._FeedParser-class.html#feed_error_log -lxml.html._MethodFunc lxml.html._MethodFunc-class.html -lxml.html._MethodFunc.__call__ lxml.html._MethodFunc-class.html#__call__ -lxml.html._MethodFunc.__init__ lxml.html._MethodFunc-class.html#__init__ -lxml.html.clean.Cleaner lxml.html.clean.Cleaner-class.html -lxml.html.clean.Cleaner.annoying_tags lxml.html.clean.Cleaner-class.html#annoying_tags -lxml.html.clean.Cleaner.links lxml.html.clean.Cleaner-class.html#links -lxml.html.clean.Cleaner.allow_embedded_url lxml.html.clean.Cleaner-class.html#allow_embedded_url -lxml.html.clean.Cleaner.remove_unknown_tags lxml.html.clean.Cleaner-class.html#remove_unknown_tags -lxml.html.clean.Cleaner.clean_html lxml.html.clean.Cleaner-class.html#clean_html -lxml.html.clean.Cleaner.kill_tags lxml.html.clean.Cleaner-class.html#kill_tags -lxml.html.clean.Cleaner.meta lxml.html.clean.Cleaner-class.html#meta -lxml.html.clean.Cleaner.page_structure lxml.html.clean.Cleaner-class.html#page_structure -lxml.html.clean.Cleaner.frames lxml.html.clean.Cleaner-class.html#frames -lxml.html.clean.Cleaner.allow_follow lxml.html.clean.Cleaner-class.html#allow_follow -lxml.html.clean.Cleaner.__init__ lxml.html.clean.Cleaner-class.html#__init__ -lxml.html.clean.Cleaner.style lxml.html.clean.Cleaner-class.html#style -lxml.html.clean.Cleaner.allow_tags lxml.html.clean.Cleaner-class.html#allow_tags -lxml.html.clean.Cleaner._remove_javascript_link lxml.html.clean.Cleaner-class.html#_remove_javascript_link -lxml.html.clean.Cleaner.comments lxml.html.clean.Cleaner-class.html#comments -lxml.html.clean.Cleaner.forms lxml.html.clean.Cleaner-class.html#forms -lxml.html.clean.Cleaner._substitute_comments lxml.html.clean.Cleaner-class.html#_substitute_comments -lxml.html.clean.Cleaner.kill_conditional_comments lxml.html.clean.Cleaner-class.html#kill_conditional_comments -lxml.html.clean.Cleaner.host_whitelist lxml.html.clean.Cleaner-class.html#host_whitelist -lxml.html.clean.Cleaner.whitelist_tags lxml.html.clean.Cleaner-class.html#whitelist_tags -lxml.html.clean.Cleaner.__call__ lxml.html.clean.Cleaner-class.html#__call__ -lxml.html.clean.Cleaner.remove_tags lxml.html.clean.Cleaner-class.html#remove_tags -lxml.html.clean.Cleaner._kill_elements lxml.html.clean.Cleaner-class.html#_kill_elements -lxml.html.clean.Cleaner.inline_style lxml.html.clean.Cleaner-class.html#inline_style -lxml.html.clean.Cleaner._has_sneaky_javascript lxml.html.clean.Cleaner-class.html#_has_sneaky_javascript -lxml.html.clean.Cleaner.processing_instructions lxml.html.clean.Cleaner-class.html#processing_instructions -lxml.html.clean.Cleaner.javascript lxml.html.clean.Cleaner-class.html#javascript -lxml.html.clean.Cleaner.safe_attrs lxml.html.clean.Cleaner-class.html#safe_attrs -lxml.html.clean.Cleaner.add_nofollow lxml.html.clean.Cleaner-class.html#add_nofollow -lxml.html.clean.Cleaner.allow_element lxml.html.clean.Cleaner-class.html#allow_element -lxml.html.clean.Cleaner.scripts lxml.html.clean.Cleaner-class.html#scripts -lxml.html.clean.Cleaner._tag_link_attrs lxml.html.clean.Cleaner-class.html#_tag_link_attrs -lxml.html.clean.Cleaner.safe_attrs_only lxml.html.clean.Cleaner-class.html#safe_attrs_only -lxml.html.clean.Cleaner.embedded lxml.html.clean.Cleaner-class.html#embedded -lxml.html.clean.Cleaner.__qualname__ lxml.html.clean.Cleaner-class.html#__qualname__ -lxml.html.diff.DEL_END lxml.html.diff.DEL_END-class.html -lxml.html.diff.DEL_END.__qualname__ lxml.html.diff.DEL_END-class.html#__qualname__ -lxml.html.diff.DEL_START lxml.html.diff.DEL_START-class.html -lxml.html.diff.DEL_START.__qualname__ lxml.html.diff.DEL_START-class.html#__qualname__ -lxml.html.diff.InsensitiveSequenceMatcher lxml.html.diff.InsensitiveSequenceMatcher-class.html -lxml.html.diff.InsensitiveSequenceMatcher.get_matching_blocks lxml.html.diff.InsensitiveSequenceMatcher-class.html#get_matching_blocks -lxml.html.diff.InsensitiveSequenceMatcher.__qualname__ lxml.html.diff.InsensitiveSequenceMatcher-class.html#__qualname__ -lxml.html.diff.InsensitiveSequenceMatcher.threshold lxml.html.diff.InsensitiveSequenceMatcher-class.html#threshold -lxml.html.diff.NoDeletes lxml.html.diff.NoDeletes-class.html -lxml.html.diff.NoDeletes.__qualname__ lxml.html.diff.NoDeletes-class.html#__qualname__ -lxml.html.diff.href_token lxml.html.diff.href_token-class.html -lxml.html.diff.href_token.hide_when_equal lxml.html.diff.href_token-class.html#hide_when_equal -lxml.html.diff.token.__new__ lxml.html.diff.token-class.html#__new__ -lxml.html.diff.href_token.html lxml.html.diff.href_token-class.html#html -lxml.html.diff.href_token.__qualname__ lxml.html.diff.href_token-class.html#__qualname__ -lxml.html.diff.token.__repr__ lxml.html.diff.token-class.html#__repr__ -lxml.html.diff.tag_token lxml.html.diff.tag_token-class.html -lxml.html.diff.token.hide_when_equal lxml.html.diff.token-class.html#hide_when_equal -lxml.html.diff.tag_token.__new__ lxml.html.diff.tag_token-class.html#__new__ -lxml.html.diff.tag_token.html lxml.html.diff.tag_token-class.html#html -lxml.html.diff.tag_token.__qualname__ lxml.html.diff.tag_token-class.html#__qualname__ -lxml.html.diff.tag_token.__repr__ lxml.html.diff.tag_token-class.html#__repr__ -lxml.html.diff.token lxml.html.diff.token-class.html -lxml.html.diff.token.hide_when_equal lxml.html.diff.token-class.html#hide_when_equal -lxml.html.diff.token.__new__ lxml.html.diff.token-class.html#__new__ -lxml.html.diff.token.html lxml.html.diff.token-class.html#html -lxml.html.diff.token.__qualname__ lxml.html.diff.token-class.html#__qualname__ -lxml.html.diff.token.__repr__ lxml.html.diff.token-class.html#__repr__ -lxml.html.formfill.DefaultErrorCreator lxml.html.formfill.DefaultErrorCreator-class.html -lxml.html.formfill.DefaultErrorCreator.error_container_tag lxml.html.formfill.DefaultErrorCreator-class.html#error_container_tag -lxml.html.formfill.DefaultErrorCreator.default_message lxml.html.formfill.DefaultErrorCreator-class.html#default_message -lxml.html.formfill.DefaultErrorCreator.insert_before lxml.html.formfill.DefaultErrorCreator-class.html#insert_before -lxml.html.formfill.DefaultErrorCreator.error_message_class lxml.html.formfill.DefaultErrorCreator-class.html#error_message_class -lxml.html.formfill.DefaultErrorCreator.__call__ lxml.html.formfill.DefaultErrorCreator-class.html#__call__ -lxml.html.formfill.DefaultErrorCreator.block_inside lxml.html.formfill.DefaultErrorCreator-class.html#block_inside -lxml.html.formfill.DefaultErrorCreator.error_block_class lxml.html.formfill.DefaultErrorCreator-class.html#error_block_class -lxml.html.formfill.DefaultErrorCreator.__init__ lxml.html.formfill.DefaultErrorCreator-class.html#__init__ -lxml.html.formfill.FormNotFound lxml.html.formfill.FormNotFound-class.html -lxml.html.html5parser.HTMLParser lxml.html.html5parser.HTMLParser-class.html -lxml.html.html5parser.HTMLParser.__init__ lxml.html.html5parser.HTMLParser-class.html#__init__ -lxml.html.html5parser.XHTMLParser lxml.html.html5parser.XHTMLParser-class.html -lxml.html.html5parser.XHTMLParser.__init__ lxml.html.html5parser.XHTMLParser-class.html#__init__ -lxml.html.soupparser._PseudoTag lxml.html.soupparser._PseudoTag-class.html -lxml.html.soupparser._PseudoTag.__iter__ lxml.html.soupparser._PseudoTag-class.html#__iter__ -lxml.html.soupparser._PseudoTag.__init__ lxml.html.soupparser._PseudoTag-class.html#__init__ -lxml.isoschematron.Schematron lxml.isoschematron.Schematron-class.html -lxml.isoschematron.Schematron._extract_rng lxml.isoschematron.Schematron-class.html#_extract_rng -lxml.etree._Validator._append_log_message lxml.etree._Validator-class.html#_append_log_message -lxml.isoschematron.Schematron.validation_report lxml.isoschematron.Schematron-class.html#validation_report -lxml.isoschematron.Schematron.validator_xslt lxml.isoschematron.Schematron-class.html#validator_xslt -lxml.isoschematron.Schematron._expand lxml.isoschematron.Schematron-class.html#_expand -lxml.etree._Validator.validate lxml.etree._Validator-class.html#validate -lxml.isoschematron.Schematron.__init__ lxml.isoschematron.Schematron-class.html#__init__ -lxml.etree._Validator.__new__ lxml.etree._Validator-class.html#__new__ -lxml.etree._Validator._clear_error_log lxml.etree._Validator-class.html#_clear_error_log -lxml.isoschematron.Schematron._extract lxml.isoschematron.Schematron-class.html#_extract -lxml.isoschematron.Schematron.__call__ lxml.isoschematron.Schematron-class.html#__call__ -lxml.isoschematron.Schematron._compile lxml.isoschematron.Schematron-class.html#_compile -lxml.isoschematron.Schematron.schematron lxml.isoschematron.Schematron-class.html#schematron -lxml.isoschematron.Schematron._validation_errors lxml.isoschematron.Schematron-class.html#_validation_errors -lxml.isoschematron.Schematron._include lxml.isoschematron.Schematron-class.html#_include -lxml.isoschematron.Schematron.ASSERTS_ONLY lxml.isoschematron.Schematron-class.html#ASSERTS_ONLY -lxml.etree._Validator.assert_ lxml.etree._Validator-class.html#assert_ -lxml.isoschematron.Schematron._level lxml.isoschematron.Schematron-class.html#_level -lxml.isoschematron.Schematron._domain lxml.isoschematron.Schematron-class.html#_domain -lxml.etree._Validator.assertValid lxml.etree._Validator-class.html#assertValid -lxml.isoschematron.Schematron.ASSERTS_AND_REPORTS lxml.isoschematron.Schematron-class.html#ASSERTS_AND_REPORTS -lxml.isoschematron.Schematron._error_type lxml.isoschematron.Schematron-class.html#_error_type -lxml.etree._Validator.error_log lxml.etree._Validator-class.html#error_log -lxml.isoschematron.Schematron._extract_xsd lxml.isoschematron.Schematron-class.html#_extract_xsd -lxml.objectify.BoolElement lxml.objectify.BoolElement-class.html -lxml.objectify.NumberElement.__int__ lxml.objectify.NumberElement-class.html#__int__ -lxml.objectify.NumberElement.__ror__ lxml.objectify.NumberElement-class.html#__ror__ -lxml.objectify.ObjectifiedElement.addattr lxml.objectify.ObjectifiedElement-class.html#addattr -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.objectify.ObjectifiedElement.text lxml.objectify.ObjectifiedElement-class.html#text -lxml.objectify.BoolElement.__str__ lxml.objectify.BoolElement-class.html#__str__ -lxml.objectify.BoolElement._init lxml.objectify.BoolElement-class.html#_init -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.objectify.NumberElement.__rdiv__ lxml.objectify.NumberElement-class.html#__rdiv__ -lxml.objectify.NumberElement.__rmul__ lxml.objectify.NumberElement-class.html#__rmul__ -lxml.objectify.BoolElement.__lt__ lxml.objectify.BoolElement-class.html#__lt__ -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.objectify.NumberElement.__rshift__ lxml.objectify.NumberElement-class.html#__rshift__ -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.objectify.ObjectifiedElement.__getitem__ lxml.objectify.ObjectifiedElement-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.objectify.NumberElement.__pow__ lxml.objectify.NumberElement-class.html#__pow__ -lxml.objectify.BoolElement.__gt__ lxml.objectify.BoolElement-class.html#__gt__ -lxml.objectify.NumberElement.__oct__ lxml.objectify.NumberElement-class.html#__oct__ -lxml.objectify.NumberElement.__rxor__ lxml.objectify.NumberElement-class.html#__rxor__ -lxml.objectify.ObjectifiedElement.__delitem__ lxml.objectify.ObjectifiedElement-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.objectify.BoolElement.__nonzero__ lxml.objectify.BoolElement-class.html#__nonzero__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.objectify.ObjectifiedElement.descendantpaths lxml.objectify.ObjectifiedElement-class.html#descendantpaths -lxml.objectify.NumberElement.__long__ lxml.objectify.NumberElement-class.html#__long__ -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.objectify.NumberElement.__truediv__ lxml.objectify.NumberElement-class.html#__truediv__ -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.objectify.NumberElement.__rmod__ lxml.objectify.NumberElement-class.html#__rmod__ -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.objectify.NumberElement.__rand__ lxml.objectify.NumberElement-class.html#__rand__ -lxml.objectify.ObjectifiedElement.__setattr__ lxml.objectify.ObjectifiedElement-class.html#__setattr__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.objectify.ObjectifiedDataElement._setText lxml.objectify.ObjectifiedDataElement-class.html#_setText -lxml.objectify.ObjectifiedElement.__getattr__ lxml.objectify.ObjectifiedElement-class.html#__getattr__ -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.objectify.ObjectifiedElement.getchildren lxml.objectify.ObjectifiedElement-class.html#getchildren -lxml.objectify.BoolElement.__le__ lxml.objectify.BoolElement-class.html#__le__ -lxml.objectify.NumberElement.__float__ lxml.objectify.NumberElement-class.html#__float__ -lxml.objectify.BoolElement.__ne__ lxml.objectify.BoolElement-class.html#__ne__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.objectify.ObjectifiedElement.__setitem__ lxml.objectify.ObjectifiedElement-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.objectify.NumberElement.__hex__ lxml.objectify.NumberElement-class.html#__hex__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.objectify.NumberElement.__xor__ lxml.objectify.NumberElement-class.html#__xor__ -lxml.objectify.ObjectifiedElement.__delattr__ lxml.objectify.ObjectifiedElement-class.html#__delattr__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.objectify.NumberElement.__mul__ lxml.objectify.NumberElement-class.html#__mul__ -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.objectify.NumberElement.__rlshift__ lxml.objectify.NumberElement-class.html#__rlshift__ -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.objectify.NumberElement.__rsub__ lxml.objectify.NumberElement-class.html#__rsub__ -lxml.objectify.NumberElement.__and__ lxml.objectify.NumberElement-class.html#__and__ -lxml.objectify.NumberElement.__complex__ lxml.objectify.NumberElement-class.html#__complex__ -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.objectify.NumberElement.__abs__ lxml.objectify.NumberElement-class.html#__abs__ -lxml.objectify.ObjectifiedElement.__len__ lxml.objectify.ObjectifiedElement-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.objectify.NumberElement.__invert__ lxml.objectify.NumberElement-class.html#__invert__ -lxml.objectify.ObjectifiedElement.__reduce__ lxml.objectify.ObjectifiedElement-class.html#__reduce__ -lxml.objectify.ObjectifiedElement.__iter__ lxml.objectify.ObjectifiedElement-class.html#__iter__ -lxml.objectify.ObjectifiedElement.countchildren lxml.objectify.ObjectifiedElement-class.html#countchildren -lxml.objectify.NumberElement.__lshift__ lxml.objectify.NumberElement-class.html#__lshift__ -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.objectify.BoolElement.__eq__ lxml.objectify.BoolElement-class.html#__eq__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.objectify.NumberElement.__mod__ lxml.objectify.NumberElement-class.html#__mod__ -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.objectify.BoolElement.__hash__ lxml.objectify.BoolElement-class.html#__hash__ -lxml.objectify.NumberElement.__sub__ lxml.objectify.NumberElement-class.html#__sub__ -lxml.objectify.BoolElement.__ge__ lxml.objectify.BoolElement-class.html#__ge__ -lxml.objectify.NumberElement.__rtruediv__ lxml.objectify.NumberElement-class.html#__rtruediv__ -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.objectify.ObjectifiedElement.__getattribute__ lxml.objectify.ObjectifiedElement-class.html#__getattribute__ -lxml.objectify.NumberElement.__radd__ lxml.objectify.NumberElement-class.html#__radd__ -lxml.objectify.NumberElement.__rrshift__ lxml.objectify.NumberElement-class.html#__rrshift__ -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.objectify.BoolElement.__new__ lxml.objectify.BoolElement-class.html#__new__ -lxml.objectify.NumberElement._setValueParser lxml.objectify.NumberElement-class.html#_setValueParser -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.objectify.NumberElement.__pos__ lxml.objectify.NumberElement-class.html#__pos__ -lxml.objectify.NumberElement.__rpow__ lxml.objectify.NumberElement-class.html#__rpow__ -lxml.objectify.BoolElement.pyval lxml.objectify.BoolElement-class.html#pyval -lxml.objectify.BoolElement.__repr__ lxml.objectify.BoolElement-class.html#__repr__ -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.objectify.NumberElement.__or__ lxml.objectify.NumberElement-class.html#__or__ -lxml.objectify.NumberElement.__add__ lxml.objectify.NumberElement-class.html#__add__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.objectify.NumberElement.__div__ lxml.objectify.NumberElement-class.html#__div__ -lxml.objectify.NumberElement.__neg__ lxml.objectify.NumberElement-class.html#__neg__ -lxml.objectify.ElementMaker lxml.objectify.ElementMaker-class.html -lxml.objectify.ElementMaker.__new__ lxml.objectify.ElementMaker-class.html#__new__ -lxml.objectify.ElementMaker.__getattribute__ lxml.objectify.ElementMaker-class.html#__getattribute__ -lxml.objectify.ElementMaker.__getattr__ lxml.objectify.ElementMaker-class.html#__getattr__ -lxml.objectify.ElementMaker.__call__ lxml.objectify.ElementMaker-class.html#__call__ -lxml.objectify.ElementMaker.__init__ lxml.objectify.ElementMaker-class.html#__init__ -lxml.objectify.FloatElement lxml.objectify.FloatElement-class.html -lxml.objectify.NumberElement.__int__ lxml.objectify.NumberElement-class.html#__int__ -lxml.objectify.NumberElement.__ror__ lxml.objectify.NumberElement-class.html#__ror__ -lxml.objectify.ObjectifiedElement.addattr lxml.objectify.ObjectifiedElement-class.html#addattr -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.objectify.ObjectifiedElement.text lxml.objectify.ObjectifiedElement-class.html#text -lxml.objectify.NumberElement.__str__ lxml.objectify.NumberElement-class.html#__str__ -lxml.objectify.FloatElement._init lxml.objectify.FloatElement-class.html#_init -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.objectify.NumberElement.__rdiv__ lxml.objectify.NumberElement-class.html#__rdiv__ -lxml.objectify.NumberElement.__rmul__ lxml.objectify.NumberElement-class.html#__rmul__ -lxml.objectify.NumberElement.__lt__ lxml.objectify.NumberElement-class.html#__lt__ -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.objectify.NumberElement.__rshift__ lxml.objectify.NumberElement-class.html#__rshift__ -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.objectify.ObjectifiedElement.__getitem__ lxml.objectify.ObjectifiedElement-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.objectify.NumberElement.__pow__ lxml.objectify.NumberElement-class.html#__pow__ -lxml.objectify.NumberElement.__gt__ lxml.objectify.NumberElement-class.html#__gt__ -lxml.objectify.NumberElement.__oct__ lxml.objectify.NumberElement-class.html#__oct__ -lxml.objectify.NumberElement.__rxor__ lxml.objectify.NumberElement-class.html#__rxor__ -lxml.objectify.ObjectifiedElement.__delitem__ lxml.objectify.ObjectifiedElement-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.objectify.NumberElement.__nonzero__ lxml.objectify.NumberElement-class.html#__nonzero__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.objectify.ObjectifiedElement.descendantpaths lxml.objectify.ObjectifiedElement-class.html#descendantpaths -lxml.objectify.NumberElement.__long__ lxml.objectify.NumberElement-class.html#__long__ -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.objectify.NumberElement.__truediv__ lxml.objectify.NumberElement-class.html#__truediv__ -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.objectify.NumberElement.__rmod__ lxml.objectify.NumberElement-class.html#__rmod__ -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.objectify.NumberElement.__rand__ lxml.objectify.NumberElement-class.html#__rand__ -lxml.objectify.ObjectifiedElement.__setattr__ lxml.objectify.ObjectifiedElement-class.html#__setattr__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.objectify.ObjectifiedDataElement._setText lxml.objectify.ObjectifiedDataElement-class.html#_setText -lxml.objectify.ObjectifiedElement.__getattr__ lxml.objectify.ObjectifiedElement-class.html#__getattr__ -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.objectify.ObjectifiedElement.getchildren lxml.objectify.ObjectifiedElement-class.html#getchildren -lxml.objectify.NumberElement.__le__ lxml.objectify.NumberElement-class.html#__le__ -lxml.objectify.NumberElement.__complex__ lxml.objectify.NumberElement-class.html#__complex__ -lxml.objectify.NumberElement.__ne__ lxml.objectify.NumberElement-class.html#__ne__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.objectify.ObjectifiedElement.__setitem__ lxml.objectify.ObjectifiedElement-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.objectify.NumberElement.__hex__ lxml.objectify.NumberElement-class.html#__hex__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.objectify.NumberElement.__xor__ lxml.objectify.NumberElement-class.html#__xor__ -lxml.objectify.ObjectifiedElement.__delattr__ lxml.objectify.ObjectifiedElement-class.html#__delattr__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.objectify.NumberElement.__mul__ lxml.objectify.NumberElement-class.html#__mul__ -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.objectify.NumberElement.__rlshift__ lxml.objectify.NumberElement-class.html#__rlshift__ -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.objectify.NumberElement.__rsub__ lxml.objectify.NumberElement-class.html#__rsub__ -lxml.objectify.NumberElement.__and__ lxml.objectify.NumberElement-class.html#__and__ -lxml.objectify.NumberElement.__float__ lxml.objectify.NumberElement-class.html#__float__ -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.objectify.NumberElement.__abs__ lxml.objectify.NumberElement-class.html#__abs__ -lxml.objectify.ObjectifiedElement.__len__ lxml.objectify.ObjectifiedElement-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.objectify.NumberElement.__invert__ lxml.objectify.NumberElement-class.html#__invert__ -lxml.objectify.ObjectifiedElement.__reduce__ lxml.objectify.ObjectifiedElement-class.html#__reduce__ -lxml.objectify.ObjectifiedElement.__iter__ lxml.objectify.ObjectifiedElement-class.html#__iter__ -lxml.objectify.ObjectifiedElement.countchildren lxml.objectify.ObjectifiedElement-class.html#countchildren -lxml.objectify.NumberElement.__lshift__ lxml.objectify.NumberElement-class.html#__lshift__ -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.objectify.NumberElement.__eq__ lxml.objectify.NumberElement-class.html#__eq__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.objectify.NumberElement.__mod__ lxml.objectify.NumberElement-class.html#__mod__ -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.objectify.NumberElement.__hash__ lxml.objectify.NumberElement-class.html#__hash__ -lxml.objectify.NumberElement.__sub__ lxml.objectify.NumberElement-class.html#__sub__ -lxml.objectify.NumberElement.__ge__ lxml.objectify.NumberElement-class.html#__ge__ -lxml.objectify.NumberElement.__rtruediv__ lxml.objectify.NumberElement-class.html#__rtruediv__ -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.objectify.ObjectifiedElement.__getattribute__ lxml.objectify.ObjectifiedElement-class.html#__getattribute__ -lxml.objectify.NumberElement.__radd__ lxml.objectify.NumberElement-class.html#__radd__ -lxml.objectify.NumberElement.__rrshift__ lxml.objectify.NumberElement-class.html#__rrshift__ -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.objectify.FloatElement.__new__ lxml.objectify.FloatElement-class.html#__new__ -lxml.objectify.NumberElement._setValueParser lxml.objectify.NumberElement-class.html#_setValueParser -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.objectify.NumberElement.__pos__ lxml.objectify.NumberElement-class.html#__pos__ -lxml.objectify.NumberElement.__rpow__ lxml.objectify.NumberElement-class.html#__rpow__ -lxml.objectify.NumberElement.pyval lxml.objectify.NumberElement-class.html#pyval -lxml.objectify.NumberElement.__repr__ lxml.objectify.NumberElement-class.html#__repr__ -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.objectify.NumberElement.__or__ lxml.objectify.NumberElement-class.html#__or__ -lxml.objectify.NumberElement.__add__ lxml.objectify.NumberElement-class.html#__add__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.objectify.NumberElement.__div__ lxml.objectify.NumberElement-class.html#__div__ -lxml.objectify.NumberElement.__neg__ lxml.objectify.NumberElement-class.html#__neg__ -lxml.objectify.IntElement lxml.objectify.IntElement-class.html -lxml.objectify.NumberElement.__int__ lxml.objectify.NumberElement-class.html#__int__ -lxml.objectify.NumberElement.__ror__ lxml.objectify.NumberElement-class.html#__ror__ -lxml.objectify.ObjectifiedElement.addattr lxml.objectify.ObjectifiedElement-class.html#addattr -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.objectify.ObjectifiedElement.text lxml.objectify.ObjectifiedElement-class.html#text -lxml.objectify.NumberElement.__str__ lxml.objectify.NumberElement-class.html#__str__ -lxml.objectify.IntElement._init lxml.objectify.IntElement-class.html#_init -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.objectify.NumberElement.__rdiv__ lxml.objectify.NumberElement-class.html#__rdiv__ -lxml.objectify.NumberElement.__rmul__ lxml.objectify.NumberElement-class.html#__rmul__ -lxml.objectify.NumberElement.__lt__ lxml.objectify.NumberElement-class.html#__lt__ -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.objectify.NumberElement.__rshift__ lxml.objectify.NumberElement-class.html#__rshift__ -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.objectify.ObjectifiedElement.__getitem__ lxml.objectify.ObjectifiedElement-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.objectify.NumberElement.__pow__ lxml.objectify.NumberElement-class.html#__pow__ -lxml.objectify.NumberElement.__gt__ lxml.objectify.NumberElement-class.html#__gt__ -lxml.objectify.NumberElement.__oct__ lxml.objectify.NumberElement-class.html#__oct__ -lxml.objectify.NumberElement.__rxor__ lxml.objectify.NumberElement-class.html#__rxor__ -lxml.objectify.ObjectifiedElement.__delitem__ lxml.objectify.ObjectifiedElement-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.objectify.NumberElement.__nonzero__ lxml.objectify.NumberElement-class.html#__nonzero__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.objectify.ObjectifiedElement.descendantpaths lxml.objectify.ObjectifiedElement-class.html#descendantpaths -lxml.objectify.NumberElement.__long__ lxml.objectify.NumberElement-class.html#__long__ -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.objectify.NumberElement.__truediv__ lxml.objectify.NumberElement-class.html#__truediv__ -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.objectify.NumberElement.__rmod__ lxml.objectify.NumberElement-class.html#__rmod__ -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.objectify.NumberElement.__rand__ lxml.objectify.NumberElement-class.html#__rand__ -lxml.objectify.ObjectifiedElement.__setattr__ lxml.objectify.ObjectifiedElement-class.html#__setattr__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.objectify.ObjectifiedDataElement._setText lxml.objectify.ObjectifiedDataElement-class.html#_setText -lxml.objectify.ObjectifiedElement.__getattr__ lxml.objectify.ObjectifiedElement-class.html#__getattr__ -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.objectify.ObjectifiedElement.getchildren lxml.objectify.ObjectifiedElement-class.html#getchildren -lxml.objectify.NumberElement.__le__ lxml.objectify.NumberElement-class.html#__le__ -lxml.objectify.NumberElement.__complex__ lxml.objectify.NumberElement-class.html#__complex__ -lxml.objectify.NumberElement.__ne__ lxml.objectify.NumberElement-class.html#__ne__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.objectify.ObjectifiedElement.__setitem__ lxml.objectify.ObjectifiedElement-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.objectify.NumberElement.__hex__ lxml.objectify.NumberElement-class.html#__hex__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.objectify.NumberElement.__xor__ lxml.objectify.NumberElement-class.html#__xor__ -lxml.objectify.ObjectifiedElement.__delattr__ lxml.objectify.ObjectifiedElement-class.html#__delattr__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.objectify.NumberElement.__mul__ lxml.objectify.NumberElement-class.html#__mul__ -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.objectify.NumberElement.__rlshift__ lxml.objectify.NumberElement-class.html#__rlshift__ -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.objectify.NumberElement.__rsub__ lxml.objectify.NumberElement-class.html#__rsub__ -lxml.objectify.NumberElement.__and__ lxml.objectify.NumberElement-class.html#__and__ -lxml.objectify.NumberElement.__float__ lxml.objectify.NumberElement-class.html#__float__ -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.objectify.NumberElement.__abs__ lxml.objectify.NumberElement-class.html#__abs__ -lxml.objectify.ObjectifiedElement.__len__ lxml.objectify.ObjectifiedElement-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.objectify.NumberElement.__invert__ lxml.objectify.NumberElement-class.html#__invert__ -lxml.objectify.ObjectifiedElement.__reduce__ lxml.objectify.ObjectifiedElement-class.html#__reduce__ -lxml.objectify.ObjectifiedElement.__iter__ lxml.objectify.ObjectifiedElement-class.html#__iter__ -lxml.objectify.ObjectifiedElement.countchildren lxml.objectify.ObjectifiedElement-class.html#countchildren -lxml.objectify.NumberElement.__lshift__ lxml.objectify.NumberElement-class.html#__lshift__ -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.objectify.NumberElement.__eq__ lxml.objectify.NumberElement-class.html#__eq__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.objectify.NumberElement.__mod__ lxml.objectify.NumberElement-class.html#__mod__ -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.objectify.NumberElement.__hash__ lxml.objectify.NumberElement-class.html#__hash__ -lxml.objectify.NumberElement.__sub__ lxml.objectify.NumberElement-class.html#__sub__ -lxml.objectify.NumberElement.__ge__ lxml.objectify.NumberElement-class.html#__ge__ -lxml.objectify.NumberElement.__rtruediv__ lxml.objectify.NumberElement-class.html#__rtruediv__ -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.objectify.ObjectifiedElement.__getattribute__ lxml.objectify.ObjectifiedElement-class.html#__getattribute__ -lxml.objectify.NumberElement.__radd__ lxml.objectify.NumberElement-class.html#__radd__ -lxml.objectify.NumberElement.__rrshift__ lxml.objectify.NumberElement-class.html#__rrshift__ -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.objectify.IntElement.__new__ lxml.objectify.IntElement-class.html#__new__ -lxml.objectify.NumberElement._setValueParser lxml.objectify.NumberElement-class.html#_setValueParser -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.objectify.NumberElement.__pos__ lxml.objectify.NumberElement-class.html#__pos__ -lxml.objectify.NumberElement.__rpow__ lxml.objectify.NumberElement-class.html#__rpow__ -lxml.objectify.NumberElement.pyval lxml.objectify.NumberElement-class.html#pyval -lxml.objectify.NumberElement.__repr__ lxml.objectify.NumberElement-class.html#__repr__ -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.objectify.NumberElement.__or__ lxml.objectify.NumberElement-class.html#__or__ -lxml.objectify.NumberElement.__add__ lxml.objectify.NumberElement-class.html#__add__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.objectify.NumberElement.__div__ lxml.objectify.NumberElement-class.html#__div__ -lxml.objectify.NumberElement.__neg__ lxml.objectify.NumberElement-class.html#__neg__ -lxml.objectify.LongElement lxml.objectify.LongElement-class.html -lxml.objectify.NumberElement.__int__ lxml.objectify.NumberElement-class.html#__int__ -lxml.objectify.NumberElement.__ror__ lxml.objectify.NumberElement-class.html#__ror__ -lxml.objectify.ObjectifiedElement.addattr lxml.objectify.ObjectifiedElement-class.html#addattr -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.objectify.ObjectifiedElement.text lxml.objectify.ObjectifiedElement-class.html#text -lxml.objectify.NumberElement.__str__ lxml.objectify.NumberElement-class.html#__str__ -lxml.objectify.LongElement._init lxml.objectify.LongElement-class.html#_init -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.objectify.NumberElement.__rdiv__ lxml.objectify.NumberElement-class.html#__rdiv__ -lxml.objectify.NumberElement.__rmul__ lxml.objectify.NumberElement-class.html#__rmul__ -lxml.objectify.NumberElement.__lt__ lxml.objectify.NumberElement-class.html#__lt__ -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.objectify.NumberElement.__rshift__ lxml.objectify.NumberElement-class.html#__rshift__ -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.objectify.ObjectifiedElement.__getitem__ lxml.objectify.ObjectifiedElement-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.objectify.NumberElement.__pow__ lxml.objectify.NumberElement-class.html#__pow__ -lxml.objectify.NumberElement.__gt__ lxml.objectify.NumberElement-class.html#__gt__ -lxml.objectify.NumberElement.__oct__ lxml.objectify.NumberElement-class.html#__oct__ -lxml.objectify.NumberElement.__rxor__ lxml.objectify.NumberElement-class.html#__rxor__ -lxml.objectify.ObjectifiedElement.__delitem__ lxml.objectify.ObjectifiedElement-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.objectify.NumberElement.__nonzero__ lxml.objectify.NumberElement-class.html#__nonzero__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.objectify.ObjectifiedElement.descendantpaths lxml.objectify.ObjectifiedElement-class.html#descendantpaths -lxml.objectify.NumberElement.__long__ lxml.objectify.NumberElement-class.html#__long__ -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.objectify.NumberElement.__truediv__ lxml.objectify.NumberElement-class.html#__truediv__ -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.objectify.NumberElement.__rmod__ lxml.objectify.NumberElement-class.html#__rmod__ -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.objectify.NumberElement.__rand__ lxml.objectify.NumberElement-class.html#__rand__ -lxml.objectify.ObjectifiedElement.__setattr__ lxml.objectify.ObjectifiedElement-class.html#__setattr__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.objectify.ObjectifiedDataElement._setText lxml.objectify.ObjectifiedDataElement-class.html#_setText -lxml.objectify.ObjectifiedElement.__getattr__ lxml.objectify.ObjectifiedElement-class.html#__getattr__ -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.objectify.ObjectifiedElement.getchildren lxml.objectify.ObjectifiedElement-class.html#getchildren -lxml.objectify.NumberElement.__le__ lxml.objectify.NumberElement-class.html#__le__ -lxml.objectify.NumberElement.__complex__ lxml.objectify.NumberElement-class.html#__complex__ -lxml.objectify.NumberElement.__ne__ lxml.objectify.NumberElement-class.html#__ne__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.objectify.ObjectifiedElement.__setitem__ lxml.objectify.ObjectifiedElement-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.objectify.NumberElement.__hex__ lxml.objectify.NumberElement-class.html#__hex__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.objectify.NumberElement.__xor__ lxml.objectify.NumberElement-class.html#__xor__ -lxml.objectify.ObjectifiedElement.__delattr__ lxml.objectify.ObjectifiedElement-class.html#__delattr__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.objectify.NumberElement.__mul__ lxml.objectify.NumberElement-class.html#__mul__ -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.objectify.NumberElement.__rlshift__ lxml.objectify.NumberElement-class.html#__rlshift__ -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.objectify.NumberElement.__rsub__ lxml.objectify.NumberElement-class.html#__rsub__ -lxml.objectify.NumberElement.__and__ lxml.objectify.NumberElement-class.html#__and__ -lxml.objectify.NumberElement.__float__ lxml.objectify.NumberElement-class.html#__float__ -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.objectify.NumberElement.__abs__ lxml.objectify.NumberElement-class.html#__abs__ -lxml.objectify.ObjectifiedElement.__len__ lxml.objectify.ObjectifiedElement-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.objectify.NumberElement.__invert__ lxml.objectify.NumberElement-class.html#__invert__ -lxml.objectify.ObjectifiedElement.__reduce__ lxml.objectify.ObjectifiedElement-class.html#__reduce__ -lxml.objectify.ObjectifiedElement.__iter__ lxml.objectify.ObjectifiedElement-class.html#__iter__ -lxml.objectify.ObjectifiedElement.countchildren lxml.objectify.ObjectifiedElement-class.html#countchildren -lxml.objectify.NumberElement.__lshift__ lxml.objectify.NumberElement-class.html#__lshift__ -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.objectify.NumberElement.__eq__ lxml.objectify.NumberElement-class.html#__eq__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.objectify.NumberElement.__mod__ lxml.objectify.NumberElement-class.html#__mod__ -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.objectify.NumberElement.__hash__ lxml.objectify.NumberElement-class.html#__hash__ -lxml.objectify.NumberElement.__sub__ lxml.objectify.NumberElement-class.html#__sub__ -lxml.objectify.NumberElement.__ge__ lxml.objectify.NumberElement-class.html#__ge__ -lxml.objectify.NumberElement.__rtruediv__ lxml.objectify.NumberElement-class.html#__rtruediv__ -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.objectify.ObjectifiedElement.__getattribute__ lxml.objectify.ObjectifiedElement-class.html#__getattribute__ -lxml.objectify.NumberElement.__radd__ lxml.objectify.NumberElement-class.html#__radd__ -lxml.objectify.NumberElement.__rrshift__ lxml.objectify.NumberElement-class.html#__rrshift__ -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.objectify.LongElement.__new__ lxml.objectify.LongElement-class.html#__new__ -lxml.objectify.NumberElement._setValueParser lxml.objectify.NumberElement-class.html#_setValueParser -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.objectify.NumberElement.__pos__ lxml.objectify.NumberElement-class.html#__pos__ -lxml.objectify.NumberElement.__rpow__ lxml.objectify.NumberElement-class.html#__rpow__ -lxml.objectify.NumberElement.pyval lxml.objectify.NumberElement-class.html#pyval -lxml.objectify.NumberElement.__repr__ lxml.objectify.NumberElement-class.html#__repr__ -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.objectify.NumberElement.__or__ lxml.objectify.NumberElement-class.html#__or__ -lxml.objectify.NumberElement.__add__ lxml.objectify.NumberElement-class.html#__add__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.objectify.NumberElement.__div__ lxml.objectify.NumberElement-class.html#__div__ -lxml.objectify.NumberElement.__neg__ lxml.objectify.NumberElement-class.html#__neg__ -lxml.objectify.NoneElement lxml.objectify.NoneElement-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.objectify.ObjectifiedElement.addattr lxml.objectify.ObjectifiedElement-class.html#addattr -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.objectify.ObjectifiedElement.text lxml.objectify.ObjectifiedElement-class.html#text -lxml.objectify.NoneElement.__str__ lxml.objectify.NoneElement-class.html#__str__ -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.objectify.ObjectifiedElement.__getattribute__ lxml.objectify.ObjectifiedElement-class.html#__getattribute__ -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.objectify.NoneElement.__lt__ lxml.objectify.NoneElement-class.html#__lt__ -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.objectify.ObjectifiedElement.__setattr__ lxml.objectify.ObjectifiedElement-class.html#__setattr__ -lxml.objectify.NoneElement.__new__ lxml.objectify.NoneElement-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.objectify.ObjectifiedDataElement._setText lxml.objectify.ObjectifiedDataElement-class.html#_setText -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.objectify.ObjectifiedElement.__getattr__ lxml.objectify.ObjectifiedElement-class.html#__getattr__ -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.objectify.ObjectifiedElement.getchildren lxml.objectify.ObjectifiedElement-class.html#getchildren -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.objectify.NoneElement.pyval lxml.objectify.NoneElement-class.html#pyval -lxml.objectify.ObjectifiedElement.__len__ lxml.objectify.ObjectifiedElement-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.objectify.NoneElement.__ne__ lxml.objectify.NoneElement-class.html#__ne__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.objectify.ObjectifiedElement.__getitem__ lxml.objectify.ObjectifiedElement-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.objectify.ObjectifiedElement.__reduce__ lxml.objectify.ObjectifiedElement-class.html#__reduce__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.objectify.ObjectifiedElement.__iter__ lxml.objectify.ObjectifiedElement-class.html#__iter__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.objectify.ObjectifiedElement.countchildren lxml.objectify.ObjectifiedElement-class.html#countchildren -lxml.objectify.NoneElement.__gt__ lxml.objectify.NoneElement-class.html#__gt__ -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.objectify.NoneElement.__eq__ lxml.objectify.NoneElement-class.html#__eq__ -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.objectify.ObjectifiedElement.__delitem__ lxml.objectify.ObjectifiedElement-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.objectify.NoneElement.__nonzero__ lxml.objectify.NoneElement-class.html#__nonzero__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.objectify.ObjectifiedElement.__setitem__ lxml.objectify.ObjectifiedElement-class.html#__setitem__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.objectify.ObjectifiedElement.__delattr__ lxml.objectify.ObjectifiedElement-class.html#__delattr__ -lxml.objectify.NoneElement.__le__ lxml.objectify.NoneElement-class.html#__le__ -lxml.objectify.ObjectifiedElement.descendantpaths lxml.objectify.ObjectifiedElement-class.html#descendantpaths -lxml.objectify.NoneElement.__repr__ lxml.objectify.NoneElement-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.objectify.NoneElement.__hash__ lxml.objectify.NoneElement-class.html#__hash__ -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.objectify.NoneElement.__ge__ lxml.objectify.NoneElement-class.html#__ge__ -lxml.objectify.NumberElement lxml.objectify.NumberElement-class.html -lxml.objectify.NumberElement.__int__ lxml.objectify.NumberElement-class.html#__int__ -lxml.objectify.NumberElement.__ror__ lxml.objectify.NumberElement-class.html#__ror__ -lxml.objectify.ObjectifiedElement.addattr lxml.objectify.ObjectifiedElement-class.html#addattr -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.objectify.ObjectifiedElement.text lxml.objectify.ObjectifiedElement-class.html#text -lxml.objectify.NumberElement.__str__ lxml.objectify.NumberElement-class.html#__str__ -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.objectify.NumberElement.__rdiv__ lxml.objectify.NumberElement-class.html#__rdiv__ -lxml.objectify.NumberElement.__rmul__ lxml.objectify.NumberElement-class.html#__rmul__ -lxml.objectify.NumberElement.__lt__ lxml.objectify.NumberElement-class.html#__lt__ -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.objectify.NumberElement.__rshift__ lxml.objectify.NumberElement-class.html#__rshift__ -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.objectify.ObjectifiedElement.__getitem__ lxml.objectify.ObjectifiedElement-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.objectify.NumberElement.__pow__ lxml.objectify.NumberElement-class.html#__pow__ -lxml.objectify.NumberElement.__gt__ lxml.objectify.NumberElement-class.html#__gt__ -lxml.objectify.NumberElement.__oct__ lxml.objectify.NumberElement-class.html#__oct__ -lxml.objectify.NumberElement.__rxor__ lxml.objectify.NumberElement-class.html#__rxor__ -lxml.objectify.ObjectifiedElement.__delitem__ lxml.objectify.ObjectifiedElement-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.objectify.NumberElement.__nonzero__ lxml.objectify.NumberElement-class.html#__nonzero__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.objectify.ObjectifiedElement.descendantpaths lxml.objectify.ObjectifiedElement-class.html#descendantpaths -lxml.objectify.NumberElement.__long__ lxml.objectify.NumberElement-class.html#__long__ -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.objectify.NumberElement.__truediv__ lxml.objectify.NumberElement-class.html#__truediv__ -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.objectify.NumberElement.__rmod__ lxml.objectify.NumberElement-class.html#__rmod__ -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.objectify.NumberElement.__rand__ lxml.objectify.NumberElement-class.html#__rand__ -lxml.objectify.ObjectifiedElement.__setattr__ lxml.objectify.ObjectifiedElement-class.html#__setattr__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.objectify.ObjectifiedDataElement._setText lxml.objectify.ObjectifiedDataElement-class.html#_setText -lxml.objectify.ObjectifiedElement.__getattr__ lxml.objectify.ObjectifiedElement-class.html#__getattr__ -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.objectify.ObjectifiedElement.getchildren lxml.objectify.ObjectifiedElement-class.html#getchildren -lxml.objectify.NumberElement.__le__ lxml.objectify.NumberElement-class.html#__le__ -lxml.objectify.NumberElement.__complex__ lxml.objectify.NumberElement-class.html#__complex__ -lxml.objectify.NumberElement.__ne__ lxml.objectify.NumberElement-class.html#__ne__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.objectify.ObjectifiedElement.__setitem__ lxml.objectify.ObjectifiedElement-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.objectify.NumberElement.__hex__ lxml.objectify.NumberElement-class.html#__hex__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.objectify.NumberElement.__xor__ lxml.objectify.NumberElement-class.html#__xor__ -lxml.objectify.ObjectifiedElement.__delattr__ lxml.objectify.ObjectifiedElement-class.html#__delattr__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.objectify.NumberElement.__repr__ lxml.objectify.NumberElement-class.html#__repr__ -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.objectify.NumberElement.__rpow__ lxml.objectify.NumberElement-class.html#__rpow__ -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.objectify.NumberElement.__rsub__ lxml.objectify.NumberElement-class.html#__rsub__ -lxml.objectify.NumberElement.__and__ lxml.objectify.NumberElement-class.html#__and__ -lxml.objectify.NumberElement.__float__ lxml.objectify.NumberElement-class.html#__float__ -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.objectify.NumberElement.__abs__ lxml.objectify.NumberElement-class.html#__abs__ -lxml.objectify.ObjectifiedElement.__len__ lxml.objectify.ObjectifiedElement-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.objectify.NumberElement.__invert__ lxml.objectify.NumberElement-class.html#__invert__ -lxml.objectify.ObjectifiedElement.__reduce__ lxml.objectify.ObjectifiedElement-class.html#__reduce__ -lxml.objectify.ObjectifiedElement.__iter__ lxml.objectify.ObjectifiedElement-class.html#__iter__ -lxml.objectify.ObjectifiedElement.countchildren lxml.objectify.ObjectifiedElement-class.html#countchildren -lxml.objectify.NumberElement.__lshift__ lxml.objectify.NumberElement-class.html#__lshift__ -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.objectify.NumberElement.__eq__ lxml.objectify.NumberElement-class.html#__eq__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.objectify.NumberElement.__mod__ lxml.objectify.NumberElement-class.html#__mod__ -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.objectify.NumberElement.__hash__ lxml.objectify.NumberElement-class.html#__hash__ -lxml.objectify.NumberElement.__sub__ lxml.objectify.NumberElement-class.html#__sub__ -lxml.objectify.NumberElement.__ge__ lxml.objectify.NumberElement-class.html#__ge__ -lxml.objectify.NumberElement.__rtruediv__ lxml.objectify.NumberElement-class.html#__rtruediv__ -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.objectify.ObjectifiedElement.__getattribute__ lxml.objectify.ObjectifiedElement-class.html#__getattribute__ -lxml.objectify.NumberElement.__radd__ lxml.objectify.NumberElement-class.html#__radd__ -lxml.objectify.NumberElement.__rrshift__ lxml.objectify.NumberElement-class.html#__rrshift__ -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.objectify.NumberElement.__new__ lxml.objectify.NumberElement-class.html#__new__ -lxml.objectify.NumberElement._setValueParser lxml.objectify.NumberElement-class.html#_setValueParser -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.objectify.NumberElement.__pos__ lxml.objectify.NumberElement-class.html#__pos__ -lxml.objectify.NumberElement.__or__ lxml.objectify.NumberElement-class.html#__or__ -lxml.objectify.NumberElement.pyval lxml.objectify.NumberElement-class.html#pyval -lxml.objectify.NumberElement.__mul__ lxml.objectify.NumberElement-class.html#__mul__ -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.objectify.NumberElement.__rlshift__ lxml.objectify.NumberElement-class.html#__rlshift__ -lxml.objectify.NumberElement.__add__ lxml.objectify.NumberElement-class.html#__add__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.objectify.NumberElement.__div__ lxml.objectify.NumberElement-class.html#__div__ -lxml.objectify.NumberElement.__neg__ lxml.objectify.NumberElement-class.html#__neg__ -lxml.objectify.ObjectPath lxml.objectify.ObjectPath-class.html -lxml.objectify.ObjectPath.addattr lxml.objectify.ObjectPath-class.html#addattr -lxml.objectify.ObjectPath.__new__ lxml.objectify.ObjectPath-class.html#__new__ -lxml.objectify.ObjectPath.setattr lxml.objectify.ObjectPath-class.html#setattr -lxml.objectify.ObjectPath.__str__ lxml.objectify.ObjectPath-class.html#__str__ -lxml.objectify.ObjectPath.hasattr lxml.objectify.ObjectPath-class.html#hasattr -lxml.objectify.ObjectPath.__call__ lxml.objectify.ObjectPath-class.html#__call__ -lxml.objectify.ObjectPath.find lxml.objectify.ObjectPath-class.html#find -lxml.objectify.ObjectPath.__init__ lxml.objectify.ObjectPath-class.html#__init__ -lxml.objectify.ObjectifiedDataElement lxml.objectify.ObjectifiedDataElement-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.objectify.ObjectifiedElement.addattr lxml.objectify.ObjectifiedElement-class.html#addattr -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.objectify.ObjectifiedElement.text lxml.objectify.ObjectifiedElement-class.html#text -lxml.objectify.ObjectifiedDataElement.__str__ lxml.objectify.ObjectifiedDataElement-class.html#__str__ -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.objectify.ObjectifiedElement.__getattribute__ lxml.objectify.ObjectifiedElement-class.html#__getattribute__ -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.objectify.ObjectifiedElement.__setattr__ lxml.objectify.ObjectifiedElement-class.html#__setattr__ -lxml.objectify.ObjectifiedDataElement.__new__ lxml.objectify.ObjectifiedDataElement-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.objectify.ObjectifiedDataElement._setText lxml.objectify.ObjectifiedDataElement-class.html#_setText -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.objectify.ObjectifiedElement.__getattr__ lxml.objectify.ObjectifiedElement-class.html#__getattr__ -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.objectify.ObjectifiedElement.getchildren lxml.objectify.ObjectifiedElement-class.html#getchildren -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.objectify.ObjectifiedDataElement.pyval lxml.objectify.ObjectifiedDataElement-class.html#pyval -lxml.objectify.ObjectifiedElement.__len__ lxml.objectify.ObjectifiedElement-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.objectify.ObjectifiedElement.__getitem__ lxml.objectify.ObjectifiedElement-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.objectify.ObjectifiedElement.__reduce__ lxml.objectify.ObjectifiedElement-class.html#__reduce__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.objectify.ObjectifiedElement.__setitem__ lxml.objectify.ObjectifiedElement-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.objectify.ObjectifiedElement.countchildren lxml.objectify.ObjectifiedElement-class.html#countchildren -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.objectify.ObjectifiedElement.__delitem__ lxml.objectify.ObjectifiedElement-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.objectify.ObjectifiedElement.__iter__ lxml.objectify.ObjectifiedElement-class.html#__iter__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.objectify.ObjectifiedElement.__delattr__ lxml.objectify.ObjectifiedElement-class.html#__delattr__ -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.objectify.ObjectifiedElement.descendantpaths lxml.objectify.ObjectifiedElement-class.html#descendantpaths -lxml.objectify.ObjectifiedDataElement.__repr__ lxml.objectify.ObjectifiedDataElement-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.objectify.ObjectifiedElement lxml.objectify.ObjectifiedElement-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.objectify.ObjectifiedElement.addattr lxml.objectify.ObjectifiedElement-class.html#addattr -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.objectify.ObjectifiedElement.text lxml.objectify.ObjectifiedElement-class.html#text -lxml.objectify.ObjectifiedElement.__str__ lxml.objectify.ObjectifiedElement-class.html#__str__ -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.objectify.ObjectifiedElement.__getattribute__ lxml.objectify.ObjectifiedElement-class.html#__getattribute__ -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.objectify.ObjectifiedElement.__setattr__ lxml.objectify.ObjectifiedElement-class.html#__setattr__ -lxml.objectify.ObjectifiedElement.__new__ lxml.objectify.ObjectifiedElement-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.objectify.ObjectifiedElement.__getattr__ lxml.objectify.ObjectifiedElement-class.html#__getattr__ -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.objectify.ObjectifiedElement.getchildren lxml.objectify.ObjectifiedElement-class.html#getchildren -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.objectify.ObjectifiedElement.__len__ lxml.objectify.ObjectifiedElement-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.objectify.ObjectifiedElement.__getitem__ lxml.objectify.ObjectifiedElement-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.objectify.ObjectifiedElement.__reduce__ lxml.objectify.ObjectifiedElement-class.html#__reduce__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.objectify.ObjectifiedElement.__iter__ lxml.objectify.ObjectifiedElement-class.html#__iter__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.objectify.ObjectifiedElement.countchildren lxml.objectify.ObjectifiedElement-class.html#countchildren -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.objectify.ObjectifiedElement.__delitem__ lxml.objectify.ObjectifiedElement-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.objectify.ObjectifiedElement.__setitem__ lxml.objectify.ObjectifiedElement-class.html#__setitem__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.objectify.ObjectifiedElement.__delattr__ lxml.objectify.ObjectifiedElement-class.html#__delattr__ -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.objectify.ObjectifiedElement.descendantpaths lxml.objectify.ObjectifiedElement-class.html#descendantpaths -lxml.etree._Element.__repr__ lxml.etree._Element-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.objectify.ObjectifyElementClassLookup lxml.objectify.ObjectifyElementClassLookup-class.html -lxml.objectify.ObjectifyElementClassLookup.__new__ lxml.objectify.ObjectifyElementClassLookup-class.html#__new__ -lxml.objectify.ObjectifyElementClassLookup.__init__ lxml.objectify.ObjectifyElementClassLookup-class.html#__init__ -lxml.objectify.PyType lxml.objectify.PyType-class.html -lxml.objectify.PyType.stringify lxml.objectify.PyType-class.html#stringify -lxml.objectify.PyType.__new__ lxml.objectify.PyType-class.html#__new__ -lxml.objectify.PyType.xmlSchemaTypes lxml.objectify.PyType-class.html#xmlSchemaTypes -lxml.objectify.PyType.unregister lxml.objectify.PyType-class.html#unregister -lxml.objectify.PyType.register lxml.objectify.PyType-class.html#register -lxml.objectify.PyType.__repr__ lxml.objectify.PyType-class.html#__repr__ -lxml.objectify.PyType.type_check lxml.objectify.PyType-class.html#type_check -lxml.objectify.PyType.__init__ lxml.objectify.PyType-class.html#__init__ -lxml.objectify.PyType.name lxml.objectify.PyType-class.html#name -lxml.objectify.StringElement lxml.objectify.StringElement-class.html -lxml.objectify.StringElement.__int__ lxml.objectify.StringElement-class.html#__int__ -lxml.objectify.ObjectifiedElement.addattr lxml.objectify.ObjectifiedElement-class.html#addattr -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.objectify.ObjectifiedElement.text lxml.objectify.ObjectifiedElement-class.html#text -lxml.objectify.ObjectifiedDataElement.__str__ lxml.objectify.ObjectifiedDataElement-class.html#__str__ -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.objectify.StringElement.__rmul__ lxml.objectify.StringElement-class.html#__rmul__ -lxml.objectify.StringElement.__lt__ lxml.objectify.StringElement-class.html#__lt__ -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.objectify.ObjectifiedElement.__getitem__ lxml.objectify.ObjectifiedElement-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.objectify.StringElement.__gt__ lxml.objectify.StringElement-class.html#__gt__ -lxml.objectify.ObjectifiedElement.__delitem__ lxml.objectify.ObjectifiedElement-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.objectify.StringElement.__nonzero__ lxml.objectify.StringElement-class.html#__nonzero__ -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.objectify.ObjectifiedElement.descendantpaths lxml.objectify.ObjectifiedElement-class.html#descendantpaths -lxml.objectify.StringElement.__long__ lxml.objectify.StringElement-class.html#__long__ -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.objectify.StringElement.__rmod__ lxml.objectify.StringElement-class.html#__rmod__ -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.objectify.ObjectifiedElement.__setattr__ lxml.objectify.ObjectifiedElement-class.html#__setattr__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.objectify.ObjectifiedDataElement._setText lxml.objectify.ObjectifiedDataElement-class.html#_setText -lxml.objectify.ObjectifiedElement.__getattr__ lxml.objectify.ObjectifiedElement-class.html#__getattr__ -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.objectify.ObjectifiedElement.getchildren lxml.objectify.ObjectifiedElement-class.html#getchildren -lxml.objectify.StringElement.__float__ lxml.objectify.StringElement-class.html#__float__ -lxml.objectify.StringElement.__ne__ lxml.objectify.StringElement-class.html#__ne__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.objectify.ObjectifiedElement.__setitem__ lxml.objectify.ObjectifiedElement-class.html#__setitem__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.objectify.ObjectifiedElement.__delattr__ lxml.objectify.ObjectifiedElement-class.html#__delattr__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.objectify.StringElement.__mul__ lxml.objectify.StringElement-class.html#__mul__ -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.objectify.StringElement.__complex__ lxml.objectify.StringElement-class.html#__complex__ -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.objectify.ObjectifiedElement.__len__ lxml.objectify.ObjectifiedElement-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.objectify.ObjectifiedElement.__reduce__ lxml.objectify.ObjectifiedElement-class.html#__reduce__ -lxml.objectify.ObjectifiedElement.__iter__ lxml.objectify.ObjectifiedElement-class.html#__iter__ -lxml.objectify.ObjectifiedElement.countchildren lxml.objectify.ObjectifiedElement-class.html#countchildren -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.objectify.StringElement.__eq__ lxml.objectify.StringElement-class.html#__eq__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.objectify.StringElement.__mod__ lxml.objectify.StringElement-class.html#__mod__ -lxml.objectify.StringElement.__le__ lxml.objectify.StringElement-class.html#__le__ -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.objectify.StringElement.__hash__ lxml.objectify.StringElement-class.html#__hash__ -lxml.objectify.StringElement.__ge__ lxml.objectify.StringElement-class.html#__ge__ -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.objectify.ObjectifiedElement.__getattribute__ lxml.objectify.ObjectifiedElement-class.html#__getattribute__ -lxml.objectify.StringElement.__radd__ lxml.objectify.StringElement-class.html#__radd__ -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.objectify.StringElement.strlen lxml.objectify.StringElement-class.html#strlen -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.objectify.StringElement.__new__ lxml.objectify.StringElement-class.html#__new__ -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.objectify.StringElement.pyval lxml.objectify.StringElement-class.html#pyval -lxml.objectify.StringElement.__repr__ lxml.objectify.StringElement-class.html#__repr__ -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.objectify.StringElement.__add__ lxml.objectify.StringElement-class.html#__add__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.sax.ElementTreeContentHandler lxml.sax.ElementTreeContentHandler-class.html -lxml.sax.ElementTreeContentHandler.startPrefixMapping lxml.sax.ElementTreeContentHandler-class.html#startPrefixMapping -lxml.sax.ElementTreeContentHandler.endPrefixMapping lxml.sax.ElementTreeContentHandler-class.html#endPrefixMapping -lxml.sax.ElementTreeContentHandler.etree lxml.sax.ElementTreeContentHandler-class.html#etree -lxml.sax.ElementTreeContentHandler.processingInstruction lxml.sax.ElementTreeContentHandler-class.html#processingInstruction -lxml.sax.ElementTreeContentHandler.endElement lxml.sax.ElementTreeContentHandler-class.html#endElement -lxml.sax.ElementTreeContentHandler._get_etree lxml.sax.ElementTreeContentHandler-class.html#_get_etree -lxml.sax.ElementTreeContentHandler.startElement lxml.sax.ElementTreeContentHandler-class.html#startElement -lxml.sax.ElementTreeContentHandler.setDocumentLocator lxml.sax.ElementTreeContentHandler-class.html#setDocumentLocator -lxml.sax.ElementTreeContentHandler.startDocument lxml.sax.ElementTreeContentHandler-class.html#startDocument -lxml.sax.ElementTreeContentHandler.startElementNS lxml.sax.ElementTreeContentHandler-class.html#startElementNS -lxml.sax.ElementTreeContentHandler.characters lxml.sax.ElementTreeContentHandler-class.html#characters -lxml.sax.ElementTreeContentHandler.endDocument lxml.sax.ElementTreeContentHandler-class.html#endDocument -lxml.sax.ElementTreeContentHandler.ignorableWhitespace lxml.sax.ElementTreeContentHandler-class.html#ignorableWhitespace -lxml.sax.ElementTreeContentHandler._buildTag lxml.sax.ElementTreeContentHandler-class.html#_buildTag -lxml.sax.ElementTreeContentHandler.__init__ lxml.sax.ElementTreeContentHandler-class.html#__init__ -lxml.sax.ElementTreeContentHandler.endElementNS lxml.sax.ElementTreeContentHandler-class.html#endElementNS -lxml.sax.ElementTreeProducer lxml.sax.ElementTreeProducer-class.html -lxml.sax.ElementTreeProducer._build_qname lxml.sax.ElementTreeProducer-class.html#_build_qname -lxml.sax.ElementTreeProducer.saxify lxml.sax.ElementTreeProducer-class.html#saxify -lxml.sax.ElementTreeProducer.__init__ lxml.sax.ElementTreeProducer-class.html#__init__ -lxml.sax.ElementTreeProducer._recursive_saxify lxml.sax.ElementTreeProducer-class.html#_recursive_saxify -lxml.sax.SaxError lxml.sax.SaxError-class.html -lxml.etree.LxmlError.__init__ lxml.etree.LxmlError-class.html#__init__ -lxml.etree.LxmlError.__new__ lxml.etree.LxmlError-class.html#__new__ -lxml.tests.common_imports.HelperTestCase lxml.tests.common_imports.HelperTestCase-class.html -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.common_imports.LargeFileLike lxml.tests.common_imports.LargeFileLike-class.html -lxml.tests.common_imports.LargeFileLike.read lxml.tests.common_imports.LargeFileLike-class.html#read -lxml.tests.common_imports.LargeFileLike.iterelements lxml.tests.common_imports.LargeFileLike-class.html#iterelements -lxml.tests.common_imports.LargeFileLike.__init__ lxml.tests.common_imports.LargeFileLike-class.html#__init__ -lxml.tests.common_imports.LargeFileLikeUnicode lxml.tests.common_imports.LargeFileLikeUnicode-class.html -lxml.tests.common_imports.LargeFileLike.read lxml.tests.common_imports.LargeFileLike-class.html#read -lxml.tests.common_imports.LargeFileLikeUnicode.iterelements lxml.tests.common_imports.LargeFileLikeUnicode-class.html#iterelements -lxml.tests.common_imports.LargeFileLikeUnicode.__init__ lxml.tests.common_imports.LargeFileLikeUnicode-class.html#__init__ -lxml.tests.common_imports.SillyFileLike lxml.tests.common_imports.SillyFileLike-class.html -lxml.tests.common_imports.SillyFileLike.read lxml.tests.common_imports.SillyFileLike-class.html#read -lxml.tests.common_imports.SillyFileLike.__init__ lxml.tests.common_imports.SillyFileLike-class.html#__init__ -lxml.tests.common_imports.skipif lxml.tests.common_imports.skipif-class.html -lxml.tests.common_imports.skipif.__call__ lxml.tests.common_imports.skipif-class.html#__call__ -lxml.tests.common_imports.skipif.__init__ lxml.tests.common_imports.skipif-class.html#__init__ -lxml.tests.dummy_http_server.HTTPRequestCollector lxml.tests.dummy_http_server.HTTPRequestCollector-class.html -lxml.tests.dummy_http_server.HTTPRequestCollector.__call__ lxml.tests.dummy_http_server.HTTPRequestCollector-class.html#__call__ -lxml.tests.dummy_http_server.HTTPRequestCollector.__init__ lxml.tests.dummy_http_server.HTTPRequestCollector-class.html#__init__ -lxml.tests.dummy_http_server.WebServer lxml.tests.dummy_http_server.WebServer-class.html -lxml.tests.dummy_http_server._RequestHandler lxml.tests.dummy_http_server._RequestHandler-class.html -lxml.tests.dummy_http_server._RequestHandler.log_message lxml.tests.dummy_http_server._RequestHandler-class.html#log_message -BaseHTTPServer.BaseHTTPRequestHandler.MessageClass mimetools.Message-class.html -lxml.tests.dummy_http_server._RequestHandler.get_stderr lxml.tests.dummy_http_server._RequestHandler-class.html#get_stderr -lxml.tests.test_builder.BuilderTestCase lxml.tests.test_builder.BuilderTestCase-class.html -lxml.tests.test_builder.BuilderTestCase.etree lxml.etree-module.html -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_builder.BuilderTestCase.test_cdata lxml.tests.test_builder.BuilderTestCase-class.html#test_cdata -lxml.tests.test_builder.BuilderTestCase.test_cdata_solo lxml.tests.test_builder.BuilderTestCase-class.html#test_cdata_solo -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_builder.BuilderTestCase.test_build_from_xpath_result lxml.tests.test_builder.BuilderTestCase-class.html#test_build_from_xpath_result -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_builder.BuilderTestCase.test_unknown_type_raises lxml.tests.test_builder.BuilderTestCase-class.html#test_unknown_type_raises -lxml.tests.test_classlookup.ClassLookupTestCase lxml.tests.test_classlookup.ClassLookupTestCase-class.html -lxml.tests.test_classlookup.ClassLookupTestCase.test_namespace_lookup lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_namespace_lookup -lxml.tests.test_classlookup.ClassLookupTestCase.test_default_class_lookup lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_default_class_lookup -lxml.tests.test_classlookup.ClassLookupTestCase.test_custom_lookup lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_custom_lookup -lxml.tests.test_classlookup.ClassLookupTestCase.etree lxml.etree-module.html -lxml.tests.test_classlookup.ClassLookupTestCase.tearDown lxml.tests.test_classlookup.ClassLookupTestCase-class.html#tearDown -lxml.tests.test_classlookup.ClassLookupTestCase.test_class_lookup_reentry lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_class_lookup_reentry -lxml.tests.test_classlookup.ClassLookupTestCase.test_lookup_without_fallback lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_lookup_without_fallback -lxml.tests.test_classlookup.ClassLookupTestCase.test_custom_lookup_ns_fallback lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_custom_lookup_ns_fallback -lxml.tests.test_classlookup.ClassLookupTestCase.test_class_lookup_type_mismatch lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_class_lookup_type_mismatch -lxml.tests.test_classlookup.ClassLookupTestCase.test_default_class_lookup_pull_parser lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_default_class_lookup_pull_parser -lxml.tests.test_classlookup.ClassLookupTestCase.test_attribute_based_lookup lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_attribute_based_lookup -lxml.tests.test_classlookup.ClassLookupTestCase.test_parser_based_lookup lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_parser_based_lookup -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_classlookup.ClassLookupTestCase.test_evil_class_lookup lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_evil_class_lookup -lxml.tests.test_classlookup.ProxyTestCase lxml.tests.test_classlookup.ProxyTestCase-class.html -lxml.tests.test_classlookup.ProxyTestCase.test_proxy_reuse_after_del_root lxml.tests.test_classlookup.ProxyTestCase-class.html#test_proxy_reuse_after_del_root -lxml.tests.test_classlookup.ProxyTestCase.etree lxml.etree-module.html -lxml.tests.test_classlookup.ProxyTestCase.test_proxy_hashing lxml.tests.test_classlookup.ProxyTestCase-class.html#test_proxy_hashing -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_classlookup.ProxyTestCase.test_element_base_children lxml.tests.test_classlookup.ProxyTestCase-class.html#test_element_base_children -lxml.tests.test_classlookup.ProxyTestCase.test_pi_base lxml.tests.test_classlookup.ProxyTestCase-class.html#test_pi_base -lxml.tests.test_classlookup.ProxyTestCase.test_comment_base lxml.tests.test_classlookup.ProxyTestCase-class.html#test_comment_base -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_classlookup.ProxyTestCase.test_proxy_reuse_after_gc lxml.tests.test_classlookup.ProxyTestCase-class.html#test_proxy_reuse_after_gc -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_classlookup.ProxyTestCase.test_element_base lxml.tests.test_classlookup.ProxyTestCase-class.html#test_element_base -lxml.tests.test_classlookup.ProxyTestCase.test_proxy_reuse lxml.tests.test_classlookup.ProxyTestCase-class.html#test_proxy_reuse -lxml.tests.test_css.CSSTestCase lxml.tests.test_css.CSSTestCase-class.html -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_css.CSSTestCase.pytestmark lxml.tests.test_css.CSSTestCase-class.html#pytestmark -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_css.CSSTestCase.test_cssselect lxml.tests.test_css.CSSTestCase-class.html#test_cssselect -lxml.tests.test_doctestcompare.DoctestCompareTest lxml.tests.test_doctestcompare.DoctestCompareTest-class.html -lxml.tests.test_doctestcompare.DoctestCompareTest.test_missing_attributes lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_missing_attributes -lxml.tests.test_doctestcompare.DoctestCompareTest.test_differing_tags lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_differing_tags -lxml.tests.test_doctestcompare.DoctestCompareTest.test_tags_upper_lower_case lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_tags_upper_lower_case -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_doctestcompare.DoctestCompareTest.assert_diff lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#assert_diff -lxml.tests.test_doctestcompare.DoctestCompareTest.test_differing_attributes lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_differing_attributes -lxml.tests.test_doctestcompare.DoctestCompareTest._checker lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#_checker -lxml.tests.test_doctestcompare.DoctestCompareTest.test_equal_input lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_equal_input -lxml.tests.test_doctestcompare.DoctestCompareTest.test_missing_children lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_missing_children -lxml.tests.test_doctestcompare.DoctestCompareTest.test_extra_children lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_extra_children -lxml.tests.test_doctestcompare.DoctestCompareTest.test_tags_upper_lower_case_html lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_tags_upper_lower_case_html -lxml.tests.test_doctestcompare.DoctestCompareTest.test_extra_attributes lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_extra_attributes -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_doctestcompare.DoctestCompareTest.assert_nodiff lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#assert_nodiff -lxml.tests.test_doctestcompare.DoctestCompareTest.compare lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#compare -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_doctestcompare.DummyInput lxml.tests.test_doctestcompare.DummyInput-class.html -lxml.tests.test_doctestcompare.DummyInput.__init__ lxml.tests.test_doctestcompare.DummyInput-class.html#__init__ -lxml.tests.test_dtd.ETreeDtdTestCase lxml.tests.test_dtd.ETreeDtdTestCase-class.html -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_parse_invalid lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_parse_invalid -lxml.tests.test_dtd.ETreeDtdTestCase.test_declaration_escape_quote_pid lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_declaration_escape_quote_pid -lxml.tests.test_dtd.ETreeDtdTestCase.test_internal_dtds lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_internal_dtds -lxml.tests.test_dtd.ETreeDtdTestCase.test_iterparse_file_dtd_start lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_iterparse_file_dtd_start -lxml.tests.test_dtd.ETreeDtdTestCase.test_comment_before_dtd lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_comment_before_dtd -lxml.tests.test_dtd.ETreeDtdTestCase.test_clean_doctype lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_clean_doctype -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_file lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_file -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_api_internal lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_api_internal -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_dtd.ETreeDtdTestCase.test_parse_file_dtd lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_parse_file_dtd -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_invalid_duplicate_id lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_invalid_duplicate_id -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_parse_valid_file_url lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_parse_valid_file_url -lxml.tests.test_dtd.ETreeDtdTestCase.test_iterparse_file_dtd_end lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_iterparse_file_dtd_end -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_stringio lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_stringio -lxml.tests.test_dtd.ETreeDtdTestCase.test_declaration_quote_withoutpid lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_declaration_quote_withoutpid -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_assertValid lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_assertValid -lxml.tests.test_dtd.ETreeDtdTestCase.test_declaration_apos lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_declaration_apos -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_dtd.ETreeDtdTestCase.test_set_decl_public lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_set_decl_public -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_attrs lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_attrs -lxml.tests.test_dtd.ETreeDtdTestCase.test_set_decl_system lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_set_decl_system -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_parse_valid lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_parse_valid -lxml.tests.test_dtd.ETreeDtdTestCase.test_html_decl lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_html_decl -lxml.tests.test_dtd.ETreeDtdTestCase.test_ietf_decl lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_ietf_decl -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_broken lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_broken -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_internal_invalid lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_internal_invalid -lxml.tests.test_dtd.ETreeDtdTestCase.test_empty_decl lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_empty_decl -lxml.tests.test_dtd.ETreeDtdTestCase.test_invalid_decl_1 lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_invalid_decl_1 -lxml.tests.test_dtd.ETreeDtdTestCase.test_invalid_decl_2 lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_invalid_decl_2 -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_parse_file_not_found lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_parse_file_not_found -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_parse_valid_relative lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_parse_valid_relative -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_internal lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_internal -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_invalid lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_invalid -lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_parse_valid_relative_file_url lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_dtd_parse_valid_relative_file_url -lxml.tests.test_elementpath.EtreeElementPathTestCase lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html -lxml.tests.test_elementpath.EtreeElementPathTestCase.etree lxml.etree-module.html -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_elementpath.EtreeElementPathTestCase.test_find lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_find -lxml.tests.test_elementpath.EtreeElementPathTestCase.test_tokenizer_predicates lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_tokenizer_predicates -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_elementpath.EtreeElementPathTestCase.test_tokenizer lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_tokenizer -lxml.tests.test_elementpath.EtreeElementPathTestCase.test_cache lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_cache -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_elementpath.EtreeElementPathTestCase._assert_tokens lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#_assert_tokens -lxml.tests.test_elementtree.CElementTreeTestCase lxml.tests.test_elementtree.CElementTreeTestCase-class.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_iter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_iter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_pi lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_pi -lxml.tests.test_elementtree._ETreeTestCaseBase._writeElement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_end_exact lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end_exact -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_namespace_roundtrip lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_extra_duplicate lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_extra_duplicate -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_start_and_close lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_start_and_close -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_cdata lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_cdata -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_close_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_close_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_keywords lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_keywords -lxml.tests.test_elementtree._ETreeTestCaseBase.test_findall_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall_ns -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_with_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_with_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_beyond_index lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_beyond_index -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_getiterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_method_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_method_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_dict lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_dict -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_set_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_set_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_itertext_child lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext_child -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_empty_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_empty_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_indexerror lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_indexerror -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_namespace_roundtrip_replaced lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip_replaced -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_whitespace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_whitespace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_crash lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_crash -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_encoding_8bit_override lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_encoding_8bit_override -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_encoding_8bit_explicit lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_encoding_8bit_explicit -lxml.tests.test_elementtree._ETreeTestCaseBase.test_simple lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_simple -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_fail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_fail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_sub_tostring_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_sub_tostring_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_treebuilder lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_treebuilder -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_makeelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_makeelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_single lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_single -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_memory lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_memory -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_close lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_close -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_append lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_append -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_copy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_copy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_register_namespace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_register_namespace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_shallowcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_unicode lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_unicode -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_reference lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_reference -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_stringio lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_stringio -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_dict lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_dict -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_start_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_close_incomplete lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_close_incomplete -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_other lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_other -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed -lxml.tests.test_elementtree._ETreeTestCaseBase.test_treebuilder_target lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_treebuilder_target -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_large lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_large -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_tag_parse lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_tag_parse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_position lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_position -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_with_attributes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_reversed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_reversed -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_only_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_only_text -lxml.tests.test_elementtree._ETreeTestCaseBase._writeElementFile lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElementFile -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_nonexistent lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_nonexistent -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_double lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_double -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_negative -lxml.tests.test_elementtree.CElementTreeTestCase.etree lxml.tests.test_elementtree.CElementTreeTestCase-class.html#etree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_latin1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_latin1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_shallowcopy_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_tag lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_tag -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_with_attributes_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_attrib_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_attrib_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_step lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_step -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_child_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_child_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_getset lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_getset -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_broken lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_broken -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_parse_stringio lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_parse_stringio -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_utf8_bom lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_utf8_bom -lxml.tests.test_elementtree._ETreeTestCaseBase._test_wrong_unicode_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_wrong_unicode_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_itertext lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_attr lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_attr -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_property lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_property -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_iterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_iterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_values lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values -lxml.tests.test_elementtree._ETreeTestCaseBase._check_element_tree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element_tree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_xmlns_move lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_xmlns_move -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delitem_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delitem_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_replace_slice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_replace_slice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase._rootstring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_rootstring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_set_twice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_twice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_start lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ElementTree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ElementTree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_str lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_str -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_xml lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_xml -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_values_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_append lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_append -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_attribute_ns_parsed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_attribute_ns_parsed -lxml.tests.test_elementtree._ETreeTestCaseBase._test_del_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_del_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_extra lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_extra -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_ElementTreeDoctest lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_ElementTreeDoctest -lxml.tests.test_elementtree._ETreeTestCaseBase.test_XMLID lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_XMLID -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_access2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_access2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_start lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_start -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_tail -lxml.tests.test_elementtree._ETreeTestCaseBase._check_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_weird_dict_interaction lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_weird_dict_interaction -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_pi lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_pi -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_crash lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_crash -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_attribute_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_attribute_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_setslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_setslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_getitem_getslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_getitem_getslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_contains lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_contains -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iselement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iselement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_sequence lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_sequence -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attrib_resolve lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attrib_resolve -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_entity lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_entity -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_replace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_replace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text_empty -lxml.tests.test_elementtree._ETreeTestCaseBase._test_element_boolean lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_element_boolean -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write -lxml.tests.test_elementtree._ETreeTestCaseBase.test_findall lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall -lxml.tests.test_elementtree._ETreeTestCaseBase.XMLParser lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#XMLParser -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_merge_namespaced_subtree_as_slice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_merge_namespaced_subtree_as_slice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys -lxml.tests.test_elementtree._ETreeTestCaseBase.test_namespaces_after_serialize lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_namespaces_after_serialize -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_invalid_args lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_invalid_args -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_move lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_move -lxml.tests.test_elementtree._ETreeTestCaseBase.test_XML lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_XML -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_contains lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_contains -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_all lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_all -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_set_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_object_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_object_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear_sub lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_sub -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_reset_root_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_root_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_resolve_new lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_resolve_new -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_set lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_set -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_extend lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_extend -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_sub lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_sub -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.assertEncodingDeclaration lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#assertEncodingDeclaration -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_write_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_write_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_element_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_element_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_out lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_out -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_get lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_get -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_with_text2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_with_text2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_version lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_version -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_parser_target lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_parser_target -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_move_elements lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_move_elements -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_ns_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_ns_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_getiterator -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_as_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_as_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_negative1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_negative1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_root lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_root -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_namespaces lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_namespaces -lxml.tests.test_elementtree._ETreeTestCaseBase._test_getchildren lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_getchildren -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_manipulation lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_manipulation -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_in lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_in -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_method_html lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_method_html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist_characters lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_characters -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_data lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_data -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_access lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_access -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_cdata lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_cdata -lxml.tests.test_elementtree._ETreeTestCaseBase.required_versions_ET lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#required_versions_ET -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_entity_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_entity_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_incomplete lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_incomplete -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_bytes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_bytes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_insert lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_insert -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_method_html lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_method_html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace -lxml.tests.test_elementtree._ETreeTestCaseBase._check_mapping lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_mapping -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attributes_get lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attributes_get -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_write lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_write -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_file -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error_from_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error_from_file -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_object lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_object -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_setting lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_setting -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_reset_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_nonexisting lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_nonexisting -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist_single lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_single -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_elementtree_root lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_elementtree_root -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_text_only lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_text_only -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_resolve lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_resolve -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_pi_nonsense lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_pi_nonsense -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_getiterator_filter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_getiterator_filter -lxml.tests.test_elementtree._ETreeTestCaseBase.required_versions_cET lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#required_versions_cET -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_method_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_method_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_sub_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_sub_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_cmp lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_cmp -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_multiple_elementrees lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_multiple_elementrees -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_nonsense lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_nonsense -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_del_child lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_del_child -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_exact lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_exact -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_setitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_setitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed_ns1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed_ns2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_processinginstruction lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_processinginstruction -lxml.tests.test_elementtree._ETreeTestCaseBase.assertXML lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#assertXML -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file -lxml.tests.test_elementtree._ETreeTestCaseBase._check_string lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_string -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_deepcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_deepcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_text -lxml.tests.test_elementtree.ETreePullTestCase lxml.tests.test_elementtree.ETreePullTestCase-class.html -lxml.tests.test_elementtree.ETreePullTestCase.etree lxml.etree-module.html -lxml.tests.test_elementtree._XMLPullParserTest.test_feed_while_iterating lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_feed_while_iterating -lxml.tests.test_elementtree._XMLPullParserTest.test_events_sequence lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_events_sequence -lxml.tests.test_elementtree._XMLPullParserTest.test_simple_xml_with_ns lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_simple_xml_with_ns -lxml.tests.test_elementtree._XMLPullParserTest._feed lxml.tests.test_elementtree._XMLPullParserTest-class.html#_feed -lxml.tests.test_elementtree._XMLPullParserTest._close_and_return_root lxml.tests.test_elementtree._XMLPullParserTest-class.html#_close_and_return_root -lxml.tests.test_elementtree._XMLPullParserTest.test_events lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_events -lxml.tests.test_elementtree._XMLPullParserTest.test_unknown_event lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_unknown_event -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_elementtree._XMLPullParserTest.test_ns_events lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_ns_events -lxml.tests.test_elementtree._XMLPullParserTest.test_simple_xml lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_simple_xml -lxml.tests.test_elementtree._XMLPullParserTest.assert_event_tags lxml.tests.test_elementtree._XMLPullParserTest-class.html#assert_event_tags -lxml.tests.test_elementtree.ETreeTestCase lxml.tests.test_elementtree.ETreeTestCase-class.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_iter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_iter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_pi lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_pi -lxml.tests.test_elementtree._ETreeTestCaseBase._writeElement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_end_exact lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end_exact -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_namespace_roundtrip lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_extra_duplicate lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_extra_duplicate -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_start_and_close lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_start_and_close -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_cdata lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_cdata -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_close_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_close_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_keywords lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_keywords -lxml.tests.test_elementtree._ETreeTestCaseBase.test_findall_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall_ns -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_with_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_with_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_beyond_index lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_beyond_index -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_getiterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_method_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_method_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_dict lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_dict -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_set_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_set_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_itertext_child lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext_child -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_empty_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_empty_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_indexerror lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_indexerror -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_namespace_roundtrip_replaced lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip_replaced -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_whitespace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_whitespace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_crash lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_crash -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_encoding_8bit_override lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_encoding_8bit_override -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_encoding_8bit_explicit lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_encoding_8bit_explicit -lxml.tests.test_elementtree._ETreeTestCaseBase.test_simple lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_simple -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_fail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_fail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_sub_tostring_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_sub_tostring_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_treebuilder lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_treebuilder -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_makeelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_makeelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_single lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_single -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_memory lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_memory -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_close lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_close -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_append lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_append -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_copy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_copy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_register_namespace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_register_namespace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_shallowcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_unicode lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_unicode -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_reference lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_reference -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_stringio lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_stringio -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_dict lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_dict -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_start_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_close_incomplete lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_close_incomplete -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_other lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_other -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed -lxml.tests.test_elementtree._ETreeTestCaseBase.test_treebuilder_target lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_treebuilder_target -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_large lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_large -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_tag_parse lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_tag_parse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_position lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_position -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_with_attributes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_reversed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_reversed -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_only_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_only_text -lxml.tests.test_elementtree._ETreeTestCaseBase._writeElementFile lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElementFile -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_nonexistent lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_nonexistent -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_double lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_double -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_negative -lxml.tests.test_elementtree.ETreeTestCase.etree lxml.etree-module.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_latin1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_latin1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_shallowcopy_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_tag lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_tag -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_with_attributes_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_attrib_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_attrib_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_step lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_step -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_child_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_child_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_getset lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_getset -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_broken lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_broken -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_parse_stringio lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_parse_stringio -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_utf8_bom lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_utf8_bom -lxml.tests.test_elementtree._ETreeTestCaseBase._test_wrong_unicode_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_wrong_unicode_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_itertext lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_attr lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_attr -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_property lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_property -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_iterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_iterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_values lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values -lxml.tests.test_elementtree._ETreeTestCaseBase._check_element_tree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element_tree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_xmlns_move lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_xmlns_move -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delitem_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delitem_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_replace_slice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_replace_slice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase._rootstring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_rootstring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_set_twice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_twice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_start lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ElementTree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ElementTree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_str lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_str -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_xml lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_xml -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_values_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_append lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_append -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_attribute_ns_parsed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_attribute_ns_parsed -lxml.tests.test_elementtree._ETreeTestCaseBase._test_del_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_del_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_extra lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_extra -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_ElementTreeDoctest lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_ElementTreeDoctest -lxml.tests.test_elementtree._ETreeTestCaseBase.test_XMLID lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_XMLID -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_access2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_access2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_start lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_start -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_tail -lxml.tests.test_elementtree._ETreeTestCaseBase._check_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_weird_dict_interaction lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_weird_dict_interaction -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_pi lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_pi -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_crash lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_crash -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_attribute_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_attribute_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_setslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_setslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_getitem_getslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_getitem_getslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_contains lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_contains -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iselement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iselement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_sequence lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_sequence -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attrib_resolve lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attrib_resolve -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_entity lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_entity -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_replace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_replace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text_empty -lxml.tests.test_elementtree._ETreeTestCaseBase._test_element_boolean lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_element_boolean -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write -lxml.tests.test_elementtree._ETreeTestCaseBase.test_findall lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall -lxml.tests.test_elementtree._ETreeTestCaseBase.XMLParser lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#XMLParser -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_merge_namespaced_subtree_as_slice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_merge_namespaced_subtree_as_slice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys -lxml.tests.test_elementtree._ETreeTestCaseBase.test_namespaces_after_serialize lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_namespaces_after_serialize -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_invalid_args lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_invalid_args -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_move lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_move -lxml.tests.test_elementtree._ETreeTestCaseBase.test_XML lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_XML -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_contains lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_contains -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_all lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_all -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_set_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_object_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_object_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear_sub lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_sub -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_reset_root_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_root_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_resolve_new lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_resolve_new -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_set lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_set -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_extend lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_extend -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_sub lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_sub -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.assertEncodingDeclaration lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#assertEncodingDeclaration -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_write_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_write_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_element_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_element_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_out lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_out -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_get lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_get -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_with_text2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_with_text2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_version lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_version -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_parser_target lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_parser_target -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_move_elements lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_move_elements -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_ns_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_ns_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_getiterator -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_as_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_as_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_negative1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_negative1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_root lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_root -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_namespaces lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_namespaces -lxml.tests.test_elementtree._ETreeTestCaseBase._test_getchildren lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_getchildren -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_manipulation lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_manipulation -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_in lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_in -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_method_html lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_method_html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist_characters lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_characters -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_data lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_data -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_access lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_access -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_cdata lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_cdata -lxml.tests.test_elementtree._ETreeTestCaseBase.required_versions_ET lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#required_versions_ET -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_entity_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_entity_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_incomplete lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_incomplete -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_bytes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_bytes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_insert lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_insert -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_method_html lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_method_html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace -lxml.tests.test_elementtree._ETreeTestCaseBase._check_mapping lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_mapping -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attributes_get lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attributes_get -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_write lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_write -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_file -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error_from_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error_from_file -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_object lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_object -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_setting lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_setting -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_reset_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_nonexisting lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_nonexisting -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist_single lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_single -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_elementtree_root lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_elementtree_root -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_text_only lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_text_only -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_resolve lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_resolve -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_pi_nonsense lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_pi_nonsense -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_getiterator_filter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_getiterator_filter -lxml.tests.test_elementtree._ETreeTestCaseBase.required_versions_cET lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#required_versions_cET -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_method_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_method_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_sub_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_sub_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_cmp lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_cmp -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_multiple_elementrees lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_multiple_elementrees -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_nonsense lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_nonsense -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_del_child lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_del_child -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_exact lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_exact -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_setitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_setitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed_ns1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed_ns2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_processinginstruction lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_processinginstruction -lxml.tests.test_elementtree._ETreeTestCaseBase.assertXML lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#assertXML -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file -lxml.tests.test_elementtree._ETreeTestCaseBase._check_string lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_string -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_deepcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_deepcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_text -lxml.tests.test_elementtree.ElementTreeTestCase lxml.tests.test_elementtree.ElementTreeTestCase-class.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_iter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_iter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_pi lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_pi -lxml.tests.test_elementtree._ETreeTestCaseBase._writeElement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_end_exact lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end_exact -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_namespace_roundtrip lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_extra_duplicate lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_extra_duplicate -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_start_and_close lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_start_and_close -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_cdata lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_cdata -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_close_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_close_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_keywords lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_keywords -lxml.tests.test_elementtree._ETreeTestCaseBase.test_findall_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall_ns -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_with_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_with_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_beyond_index lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_beyond_index -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_getiterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_method_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_method_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_dict lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_dict -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_set_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_set_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_itertext_child lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext_child -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_empty_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_empty_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_indexerror lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_indexerror -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_namespace_roundtrip_replaced lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip_replaced -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_whitespace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_whitespace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_crash lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_crash -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_encoding_8bit_override lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_encoding_8bit_override -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_encoding_8bit_explicit lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_encoding_8bit_explicit -lxml.tests.test_elementtree._ETreeTestCaseBase.test_simple lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_simple -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_fail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_fail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_sub_tostring_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_sub_tostring_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_treebuilder lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_treebuilder -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_makeelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_makeelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_single lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_single -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_memory lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_memory -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_close lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_close -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_append lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_append -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_copy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_copy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_register_namespace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_register_namespace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_shallowcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_unicode lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_unicode -lxml.tests.test_elementtree.ElementTreeTestCase.setUpClass lxml.tests.test_elementtree.ElementTreeTestCase-class.html#setUpClass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_reference lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_reference -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_stringio lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_stringio -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_dict lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_dict -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_start_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_close_incomplete lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_close_incomplete -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_other lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_other -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed -lxml.tests.test_elementtree._ETreeTestCaseBase.test_treebuilder_target lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_treebuilder_target -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_large lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_large -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_tag_parse lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_tag_parse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_position lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_position -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_with_attributes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_reversed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_reversed -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_only_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_only_text -lxml.tests.test_elementtree._ETreeTestCaseBase._writeElementFile lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElementFile -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_nonexistent lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_nonexistent -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_double lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_double -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_negative -lxml.tests.test_elementtree.ElementTreeTestCase.etree xml.etree.ElementTree-module.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_latin1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_latin1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_shallowcopy_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_tag lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_tag -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_with_attributes_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_attrib_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_attrib_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_step lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_step -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_child_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_child_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_getset lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_getset -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_broken lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_broken -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_parse_stringio lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_parse_stringio -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_utf8_bom lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_utf8_bom -lxml.tests.test_elementtree._ETreeTestCaseBase._test_wrong_unicode_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_wrong_unicode_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_itertext lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_attr lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_attr -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_property lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_property -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_iterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_iterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_values lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values -lxml.tests.test_elementtree._ETreeTestCaseBase._check_element_tree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element_tree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_xmlns_move lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_xmlns_move -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delitem_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delitem_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_replace_slice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_replace_slice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase._rootstring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_rootstring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_set_twice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_twice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_start lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ElementTree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ElementTree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_str lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_str -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_xml lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_xml -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_values_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_append lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_append -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_attribute_ns_parsed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_attribute_ns_parsed -lxml.tests.test_elementtree._ETreeTestCaseBase._test_del_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_del_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_extra lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_extra -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_ElementTreeDoctest lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_ElementTreeDoctest -lxml.tests.test_elementtree._ETreeTestCaseBase.test_XMLID lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_XMLID -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_access2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_access2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_start lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_start -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_tail -lxml.tests.test_elementtree._ETreeTestCaseBase._check_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_weird_dict_interaction lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_weird_dict_interaction -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_pi lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_pi -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_crash lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_crash -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_attribute_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_attribute_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_setslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_setslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_getitem_getslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_getitem_getslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_contains lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_contains -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iselement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iselement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_sequence lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_sequence -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attrib_resolve lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attrib_resolve -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_entity lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_entity -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_replace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_replace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text_empty -lxml.tests.test_elementtree._ETreeTestCaseBase._test_element_boolean lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_element_boolean -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write -lxml.tests.test_elementtree._ETreeTestCaseBase.test_findall lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall -lxml.tests.test_elementtree._ETreeTestCaseBase.XMLParser lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#XMLParser -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_merge_namespaced_subtree_as_slice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_merge_namespaced_subtree_as_slice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys -lxml.tests.test_elementtree._ETreeTestCaseBase.test_namespaces_after_serialize lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_namespaces_after_serialize -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_invalid_args lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_invalid_args -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_move lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_move -lxml.tests.test_elementtree._ETreeTestCaseBase.test_XML lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_XML -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_contains lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_contains -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_all lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_all -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_set_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_object_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_object_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear_sub lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_sub -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_reset_root_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_root_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_resolve_new lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_resolve_new -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_set lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_set -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_extend lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_extend -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_sub lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_sub -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.assertEncodingDeclaration lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#assertEncodingDeclaration -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_write_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_write_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_element_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_element_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_out lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_out -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_get lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_get -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_with_text2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_with_text2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_version lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_version -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_parser_target lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_parser_target -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_move_elements lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_move_elements -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_ns_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_ns_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_getiterator -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_as_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_as_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_negative1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_negative1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_root lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_root -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_namespaces lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_namespaces -lxml.tests.test_elementtree._ETreeTestCaseBase._test_getchildren lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_getchildren -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_manipulation lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_manipulation -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_in lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_in -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_method_html lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_method_html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist_characters lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_characters -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_data lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_data -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_access lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_access -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_cdata lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_cdata -lxml.tests.test_elementtree._ETreeTestCaseBase.required_versions_ET lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#required_versions_ET -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_entity_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_entity_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_incomplete lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_incomplete -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_bytes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_bytes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_insert lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_insert -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_method_html lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_method_html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace -lxml.tests.test_elementtree._ETreeTestCaseBase._check_mapping lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_mapping -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attributes_get lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attributes_get -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_write lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_write -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_file -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error_from_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error_from_file -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_object lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_object -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_setting lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_setting -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_reset_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_nonexisting lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_nonexisting -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist_single lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_single -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_elementtree_root lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_elementtree_root -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_text_only lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_text_only -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_resolve lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_resolve -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_pi_nonsense lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_pi_nonsense -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_getiterator_filter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_getiterator_filter -lxml.tests.test_elementtree._ETreeTestCaseBase.required_versions_cET lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#required_versions_cET -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_method_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_method_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_sub_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_sub_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_cmp lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_cmp -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_multiple_elementrees lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_multiple_elementrees -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_nonsense lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_nonsense -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_del_child lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_del_child -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_exact lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_exact -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_setitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_setitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed_ns1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed_ns2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_processinginstruction lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_processinginstruction -lxml.tests.test_elementtree._ETreeTestCaseBase.assertXML lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#assertXML -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file -lxml.tests.test_elementtree._ETreeTestCaseBase._check_string lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_string -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_deepcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_deepcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_text -lxml.tests.test_elementtree._ETreeTestCaseBase lxml.tests.test_elementtree._ETreeTestCaseBase-class.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_iter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_iter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_pi lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_pi -lxml.tests.test_elementtree._ETreeTestCaseBase._writeElement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_end_exact lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end_exact -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_namespace_roundtrip lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_extra_duplicate lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_extra_duplicate -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_start_and_close lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_start_and_close -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_cdata lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_cdata -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_close_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_close_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_keywords lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_keywords -lxml.tests.test_elementtree._ETreeTestCaseBase.test_findall_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall_ns -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_with_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_with_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_stringio lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_stringio -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_getiterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_method_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_method_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_dict lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_dict -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_set_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_set_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_empty_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_empty_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_indexerror lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_indexerror -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_namespace_roundtrip_replaced lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip_replaced -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_whitespace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_whitespace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_crash lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_crash -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_encoding_8bit_override lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_encoding_8bit_override -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_encoding_8bit_explicit lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_encoding_8bit_explicit -lxml.tests.test_elementtree._ETreeTestCaseBase.test_simple lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_simple -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_fail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_fail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_sub_tostring_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_sub_tostring_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_makeelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_makeelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_single lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_single -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_memory lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_memory -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_close lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_close -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_append lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_append -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_copy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_copy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_register_namespace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_register_namespace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_shallowcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_unicode lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_unicode -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_reference lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_reference -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_beyond_index lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_beyond_index -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_dict lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_dict -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_start_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_close_incomplete lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_close_incomplete -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_other lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_other -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed -lxml.tests.test_elementtree._ETreeTestCaseBase.test_treebuilder_target lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_treebuilder_target -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_large lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_large -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_tag_parse lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_tag_parse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_position lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_position -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_XMLID lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_XMLID -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_with_attributes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_reversed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_reversed -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_end lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_only_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_only_text -lxml.tests.test_elementtree._ETreeTestCaseBase._writeElementFile lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElementFile -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_nonexistent lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_nonexistent -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_double lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_double -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.etree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#etree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_latin1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_latin1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_shallowcopy_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_tag lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_tag -lxml.tests.test_elementtree._ETreeTestCaseBase.test_subelement_with_attributes_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_attrib_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_attrib_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_step lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_step -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_child_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_child_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_getset lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_getset -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_error_broken lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_error_broken -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_parse_stringio lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_parse_stringio -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_utf8_bom lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_utf8_bom -lxml.tests.test_elementtree._ETreeTestCaseBase._test_wrong_unicode_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_wrong_unicode_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_treebuilder lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_treebuilder -lxml.tests.test_elementtree._ETreeTestCaseBase.test_itertext lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_attr lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_attr -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_property lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_property -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_iterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_iterator -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_values lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values -lxml.tests.test_elementtree._ETreeTestCaseBase._check_element_tree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element_tree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_xmlns_move lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_xmlns_move -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delitem_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delitem_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_replace_slice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_replace_slice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase._rootstring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_rootstring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_set_twice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_twice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_start lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ElementTree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ElementTree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_str lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_str -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_8bit_xml lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_8bit_xml -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_parser_target lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_parser_target -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_values_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_append lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_append -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_attribute_ns_parsed lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_attribute_ns_parsed -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_extra lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_extra -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_ElementTreeDoctest lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_ElementTreeDoctest -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_access2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_access2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_error_in_start lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_error_in_start -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_tail -lxml.tests.test_elementtree._ETreeTestCaseBase._check_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_pi lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_pi -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_crash lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_crash -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_attribute_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_attribute_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_setslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_setslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_getitem_getslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_getitem_getslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_subelement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_subelement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_contains lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_contains -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iselement lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iselement -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_sequence lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_sequence -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attrib_resolve lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attrib_resolve -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_entity lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_entity -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_replace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_replace -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist -lxml.tests.test_elementtree._ETreeTestCaseBase.test_set_text_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_set_text_empty -lxml.tests.test_elementtree._ETreeTestCaseBase._test_element_boolean lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_element_boolean -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write -lxml.tests.test_elementtree._ETreeTestCaseBase.test_findall lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall -lxml.tests.test_elementtree._ETreeTestCaseBase.XMLParser lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#XMLParser -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_merge_namespaced_subtree_as_slice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_merge_namespaced_subtree_as_slice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys -lxml.tests.test_elementtree._ETreeTestCaseBase.test_namespaces_after_serialize lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_namespaces_after_serialize -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop_invalid_args lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_invalid_args -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_move lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_move -lxml.tests.test_elementtree._ETreeTestCaseBase.test_XML lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_XML -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_elementtree lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_elementtree -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_contains lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_contains -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_set_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_object_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_object_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_clear_sub lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_sub -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error_none lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error_none -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_resolve_new lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_resolve_new -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_set lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_set -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_extend lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_extend -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_pop lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_sub lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_sub -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_items2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_insert_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.assertEncodingDeclaration lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#assertEncodingDeclaration -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_str_subclass lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_str_subclass -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_write_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_write_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_element_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_element_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_out lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_out -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_get lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_get -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_indexing_with_text2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_indexing_with_text2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_version lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_version -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_move_elements lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_move_elements -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_ns_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_ns_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_getiterator lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_getiterator -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_as_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_as_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_negative1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_negative1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_root lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_root -lxml.tests.test_elementtree._ETreeTestCaseBase.test_deepcopy_namespaces lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_deepcopy_namespaces -lxml.tests.test_elementtree._ETreeTestCaseBase._test_getchildren lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_getchildren -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_manipulation lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_manipulation -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_escape_in lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_in -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_reset_root_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_root_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_method_html lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_method_html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist_characters lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_characters -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_data lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_data -lxml.tests.test_elementtree._ETreeTestCaseBase.test_weird_dict_interaction lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_weird_dict_interaction -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_access lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_access -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_cdata lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_cdata -lxml.tests.test_elementtree._ETreeTestCaseBase.required_versions_ET lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#required_versions_ET -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parser_target_entity_unknown lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parser_target_entity_unknown -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_clear lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_clear -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_empty -lxml.tests.test_elementtree._ETreeTestCaseBase._test_del_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_del_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_incomplete lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_incomplete -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove -lxml.tests.test_elementtree._ETreeTestCaseBase.test_feed_parser_bytes lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_feed_parser_bytes -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_negative lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_negative -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_default_encoding lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_default_encoding -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_insert lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_insert -lxml.tests.test_elementtree._ETreeTestCaseBase.test_text_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.test_write_method_html lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_write_method_html -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace -lxml.tests.test_elementtree._ETreeTestCaseBase._check_mapping lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_mapping -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step -lxml.tests.test_elementtree._ETreeTestCaseBase.test_processinginstruction lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_processinginstruction -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attributes_get lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attributes_get -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_decl_tostring_default lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_decl_tostring_default -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_write lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_write -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iterparse_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_file -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_error_from_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_error_from_file -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file_object lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file_object -lxml.tests.test_elementtree._ETreeTestCaseBase.test_itertext_child lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext_child -lxml.tests.test_elementtree._ETreeTestCaseBase.test_ns_setting lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_ns_setting -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tag_reset_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_nonexisting lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_nonexisting -lxml.tests.test_elementtree._ETreeTestCaseBase.test_fromstringlist_single lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_single -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tail_elementtree_root lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_elementtree_root -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_keys_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_element_with_attributes_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_element_with_attributes_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_text_only lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_text_only -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_attribute_resolve lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_attribute_resolve -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_attrib lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_attrib -lxml.tests.test_elementtree._ETreeTestCaseBase.test_pi_nonsense lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_pi_nonsense -lxml.tests.test_elementtree._ETreeTestCaseBase.test_elementtree_getiterator_filter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_elementtree_getiterator_filter -lxml.tests.test_elementtree._ETreeTestCaseBase.required_versions_cET lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#required_versions_cET -lxml.tests.test_elementtree._ETreeTestCaseBase.test_tostring_method_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_method_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getslice_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_tostring_sub_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_tostring_sub_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter -lxml.tests.test_elementtree._ETreeTestCaseBase.test_qname_cmp lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_qname_cmp -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_all lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_all -lxml.tests.test_elementtree._ETreeTestCaseBase.test_multiple_elementrees lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_multiple_elementrees -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_nonsense lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_nonsense -lxml.tests.test_elementtree._ETreeTestCaseBase.test_iteration_del_child lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_del_child -lxml.tests.test_elementtree._ETreeTestCaseBase.test_encoding_exact lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_encoding_exact -lxml.tests.test_elementtree._ETreeTestCaseBase.test_del_setitem lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_del_setitem -lxml.tests.test_elementtree._ETreeTestCaseBase.test_remove_ns lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_remove_ns -lxml.tests.test_elementtree._ETreeTestCaseBase.test_delslice_step_negative2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_delslice_step_negative2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed_ns1 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns1 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_all_replace_reversed_ns2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem_tail lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_tail -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setslice_empty lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_empty -lxml.tests.test_elementtree._ETreeTestCaseBase.assertXML lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#assertXML -lxml.tests.test_elementtree._ETreeTestCaseBase.test_parse_file lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_parse_file -lxml.tests.test_elementtree._ETreeTestCaseBase._check_string lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_string -lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_with_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_with_text -lxml.tests.test_elementtree._ETreeTestCaseBase.test_attrib_deepcopy lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_deepcopy -lxml.tests.test_elementtree._ETreeTestCaseBase.test_setitem2 lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem2 -lxml.tests.test_elementtree._ETreeTestCaseBase.test_comment_text lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_text -lxml.tests.test_elementtree._XMLPullParserTest lxml.tests.test_elementtree._XMLPullParserTest-class.html -lxml.tests.test_elementtree._XMLPullParserTest.etree lxml.tests.test_elementtree._XMLPullParserTest-class.html#etree -lxml.tests.test_elementtree._XMLPullParserTest.test_feed_while_iterating lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_feed_while_iterating -lxml.tests.test_elementtree._XMLPullParserTest.test_events_sequence lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_events_sequence -lxml.tests.test_elementtree._XMLPullParserTest.test_simple_xml_with_ns lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_simple_xml_with_ns -lxml.tests.test_elementtree._XMLPullParserTest._feed lxml.tests.test_elementtree._XMLPullParserTest-class.html#_feed -lxml.tests.test_elementtree._XMLPullParserTest._close_and_return_root lxml.tests.test_elementtree._XMLPullParserTest-class.html#_close_and_return_root -lxml.tests.test_elementtree._XMLPullParserTest.test_events lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_events -lxml.tests.test_elementtree._XMLPullParserTest.test_unknown_event lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_unknown_event -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_elementtree._XMLPullParserTest.test_ns_events lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_ns_events -lxml.tests.test_elementtree._XMLPullParserTest.test_simple_xml lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_simple_xml -lxml.tests.test_elementtree._XMLPullParserTest.assert_event_tags lxml.tests.test_elementtree._XMLPullParserTest-class.html#assert_event_tags -lxml.tests.test_errors.ErrorTestCase lxml.tests.test_errors.ErrorTestCase-class.html -lxml.tests.test_errors.ErrorTestCase.etree lxml.etree-module.html -lxml.tests.test_errors.ErrorTestCase.test_empty_parse lxml.tests.test_errors.ErrorTestCase-class.html#test_empty_parse -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_errors.ErrorTestCase.test_bad_element lxml.tests.test_errors.ErrorTestCase-class.html#test_bad_element -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_errors.ErrorTestCase.test_xmlsyntaxerror_has_info lxml.tests.test_errors.ErrorTestCase-class.html#test_xmlsyntaxerror_has_info -lxml.tests.test_errors.ErrorTestCase.test_element_cyclic_gc_none lxml.tests.test_errors.ErrorTestCase-class.html#test_element_cyclic_gc_none -lxml.tests.test_etree.ETreeC14NTestCase lxml.tests.test_etree.ETreeC14NTestCase-class.html -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_tostring_inclusive_ns_prefixes lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_tostring_inclusive_ns_prefixes -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_gzip lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_gzip -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_tostring_with_comments lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_tostring_with_comments -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_exclusive lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_exclusive -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_element_tostring_with_comments lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_element_tostring_with_comments -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_with_comments lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_with_comments -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_element_tostring_exclusive lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_element_tostring_exclusive -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_tostring_exclusive lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_tostring_exclusive -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_file lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_file -lxml.tests.test_etree.ETreeC14NTestCase.test_c14n_file_gzip lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_file_gzip -lxml.tests.test_etree.ETreeErrorLogTest lxml.tests.test_etree.ETreeErrorLogTest-class.html -lxml.tests.test_etree.ETreeErrorLogTest.etree lxml.etree-module.html -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_etree.ETreeErrorLogTest._test_python_error_logging lxml.tests.test_etree.ETreeErrorLogTest-class.html#_test_python_error_logging -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_etree.ETreeErrorLogTest.test_parse_error_logging lxml.tests.test_etree.ETreeErrorLogTest-class.html#test_parse_error_logging -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_etree.ETreeOnlyTestCase lxml.tests.test_etree.ETreeOnlyTestCase-class.html -lxml.tests.test_etree.ETreeOnlyTestCase.test_addnext_root lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_root -lxml.tests.test_etree.ETreeOnlyTestCase.test_unicode_byte_invalid_sequence lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_unicode_byte_invalid_sequence -lxml.tests.test_etree.ETreeOnlyTestCase._writeElement lxml.tests.test_etree.ETreeOnlyTestCase-class.html#_writeElement -lxml.tests.test_etree.ETreeOnlyTestCase.test_comment_parse_empty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_parse_empty -lxml.tests.test_etree.ETreeOnlyTestCase.test_addprevious lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious -lxml.tests.test_etree.ETreeOnlyTestCase.test_element_name_space lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_element_name_space -lxml.tests.test_etree.ETreeOnlyTestCase.test_attribute_gets_namespace_prefix_on_merge lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_gets_namespace_prefix_on_merge -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_end_skip lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_end_skip -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterchildren_tag_multiple_reversed lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_multiple_reversed -lxml.tests.test_etree.ETreeOnlyTestCase.test_append_error lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_append_error -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_getiterator lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_getiterator -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_unicode_pretty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_unicode_pretty -lxml.tests.test_etree.ETreeOnlyTestCase.test_standalone lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_standalone -lxml.tests.test_etree.ETreeOnlyTestCase.test_addnext_cycle_long lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_cycle_long -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_broken lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_broken -lxml.tests.test_etree.ETreeOnlyTestCase.test_findall_ns lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_ns -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_etree.ETreeOnlyTestCase.test_comment_empty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_empty -lxml.tests.test_etree.ETreeOnlyTestCase.test_XML_set_base_url_docinfo lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_XML_set_base_url_docinfo -lxml.tests.test_etree.ETreeOnlyTestCase.test_setitem_assert lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setitem_assert -lxml.tests.test_etree.ETreeOnlyTestCase.test_setslice_step_overrun lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_step_overrun -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_tag lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag -lxml.tests.test_etree.ETreeOnlyTestCase.test_subelement_name_empty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_name_empty -lxml.tests.test_etree.ETreeOnlyTestCase.test_getparent lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getparent -lxml.tests.test_etree.ETreeOnlyTestCase.test_itersiblings_tag lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_itersiblings_tag -lxml.tests.test_etree.ETreeOnlyTestCase.test_addprevious_cycle_long lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_cycle_long -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_start_end_skip lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_start_end_skip -lxml.tests.test_etree.ETreeOnlyTestCase.test_resolve_string_dtd lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_resolve_string_dtd -lxml.tests.test_etree.ETreeOnlyTestCase.test_addnext_cycle lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_cycle -lxml.tests.test_etree.ETreeOnlyTestCase.test_cdata lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata -lxml.tests.test_etree.ETreeOnlyTestCase.test_resolve_filelike_dtd lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_resolve_filelike_dtd -lxml.tests.test_etree.ETreeOnlyTestCase.test_element_names lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_element_names -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_none lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_none -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_attributes lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_attributes -lxml.tests.test_etree.ETreeOnlyTestCase.test_sourceline_iterparse_end lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_iterparse_end -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterchildren_tag_reversed lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_reversed -lxml.tests.test_etree.ETreeOnlyTestCase.test_parse_fileobject_unicode lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parse_fileobject_unicode -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_tag_ns lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_ns -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_tags_pi_comment_all lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_pi_comment_all -lxml.tests.test_etree.ETreeOnlyTestCase.test_byte_zero lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_byte_zero -lxml.tests.test_etree.ETreeOnlyTestCase.test_parse_parser_type_error lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parse_parser_type_error -lxml.tests.test_etree.ETreeOnlyTestCase.test_encoding_tostring_utf16 lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_encoding_tostring_utf16 -lxml.tests.test_etree.ETreeOnlyTestCase.test_parser_target_cdata lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parser_target_cdata -lxml.tests.test_etree.ETreeOnlyTestCase.test_cdata_errors lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_errors -lxml.tests.test_etree.ETreeOnlyTestCase.test_tounicode_element lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tounicode_element -lxml.tests.test_etree.ETreeOnlyTestCase.test_doctype_output_override lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_doctype_output_override -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterdescendants_tag lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterdescendants_tag -lxml.tests.test_etree.ETreeOnlyTestCase.test_docinfo_name_only lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_docinfo_name_only -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_etree.ETreeOnlyTestCase.test_element_refcycle lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_element_refcycle -lxml.tests.test_etree.ETreeOnlyTestCase.test_include_paths lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_include_paths -lxml.tests.test_etree.ETreeOnlyTestCase.test_docinfo_empty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_docinfo_empty -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespaces_reuse_after_move lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespaces_reuse_after_move -lxml.tests.test_etree.ETreeOnlyTestCase.test_attribute_keeps_namespace_prefix_on_merge_with_nons lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_keeps_namespace_prefix_on_merge_with_nons -lxml.tests.test_etree.ETreeOnlyTestCase.test_deepcopy_pi lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_deepcopy_pi -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_tags_doc_style lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_doc_style -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterancestors_tag lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterancestors_tag -lxml.tests.test_etree.ETreeOnlyTestCase.test_dtd_io lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_dtd_io -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterancestors lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterancestors -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_tag_all lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_tag_all -lxml.tests.test_etree.ETreeOnlyTestCase.test_html_base lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_html_base -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterdescendants lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterdescendants -lxml.tests.test_etree.ETreeOnlyTestCase.test_dump_none lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_dump_none -lxml.tests.test_etree.ETreeOnlyTestCase.test_attribute_has_key lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_has_key -lxml.tests.test_etree.ETreeOnlyTestCase.test_nsmap_prefix_invalid lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_nsmap_prefix_invalid -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespaces_elementtree lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespaces_elementtree -lxml.tests.test_etree.ETreeOnlyTestCase.test_getiterator_filter_multiple_tuple lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_multiple_tuple -lxml.tests.test_etree.ETreeOnlyTestCase.test_subelement_name_quote lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_name_quote -lxml.tests.test_etree.ETreeOnlyTestCase.test_pi_pseudo_attributes_get lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_pi_pseudo_attributes_get -lxml.tests.test_etree.ETreeOnlyTestCase.test_xml_base_attribute lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_xml_base_attribute -lxml.tests.test_etree.ETreeOnlyTestCase.test_getiterator_filter_all_comment_pi lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_all_comment_pi -lxml.tests.test_etree.ETreeOnlyTestCase.etree lxml.etree-module.html -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_tag_ns_all lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_ns_all -lxml.tests.test_etree.ETreeOnlyTestCase.test_pi_pseudo_attributes_attrib lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_pi_pseudo_attributes_attrib -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_elements_ns lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_elements_ns -lxml.tests.test_etree.ETreeOnlyTestCase.test_XMLDTDID_no_id_dict lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_XMLDTDID_no_id_dict -lxml.tests.test_etree.ETreeOnlyTestCase.test_addnext lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext -lxml.tests.test_etree.ETreeOnlyTestCase.test_sourceline_iterparse_start lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_iterparse_start -lxml.tests.test_etree.ETreeOnlyTestCase.test_parse_remove_pis lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parse_remove_pis -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespace_cleanup_deep_to_top lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespace_cleanup_deep_to_top -lxml.tests.test_etree.ETreeOnlyTestCase.test_qname_text_resolve lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_qname_text_resolve -lxml.tests.test_etree.ETreeOnlyTestCase.test_comment_immutable lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_immutable -lxml.tests.test_etree.ETreeOnlyTestCase.test_getnext lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getnext -lxml.tests.test_etree.ETreeOnlyTestCase.test_parser_target_feed_exception lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parser_target_feed_exception -lxml.tests.test_etree.ETreeOnlyTestCase.test_qname_element lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_qname_element -lxml.tests.test_etree.ETreeOnlyTestCase.test_sourceline_parse lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_parse -lxml.tests.test_etree.ETreeOnlyTestCase.test_cdata_tail lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_tail -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespace_cleanup lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespace_cleanup -lxml.tests.test_etree.ETreeOnlyTestCase.test_feed_parser_recover_no_id_dict lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_feed_parser_recover_no_id_dict -lxml.tests.test_etree.ETreeOnlyTestCase.test_attribute_set_nonstring lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_set_nonstring -lxml.tests.test_etree.ETreeOnlyTestCase.test_html_prefix_nsmap lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_html_prefix_nsmap -lxml.tests.test_etree.ETreeOnlyTestCase.test_resolve_filename_dtd_relative lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_resolve_filename_dtd_relative -lxml.tests.test_etree.ETreeOnlyTestCase.test_element_nsmap lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_element_nsmap -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_unicode_element lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_unicode_element -lxml.tests.test_etree.ETreeOnlyTestCase.test_addnext_comment lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_comment -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_clear lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_clear -lxml.tests.test_etree.ETreeOnlyTestCase.test_element_name_colon lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_element_name_colon -lxml.tests.test_etree.ETreeOnlyTestCase.test_replace_new lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_replace_new -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_tags_ns lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_ns -lxml.tests.test_etree.ETreeOnlyTestCase.test_attribute_values lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_values -lxml.tests.test_etree.ETreeOnlyTestCase.test_addprevious_root_pi lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_root_pi -lxml.tests.test_etree.ETreeOnlyTestCase.test_findall_syntax_error lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_syntax_error -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespaces_default lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespaces_default -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_broken_recover lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_broken_recover -lxml.tests.test_etree.ETreeOnlyTestCase.test_XMLDTDID lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_XMLDTDID -lxml.tests.test_etree.ETreeOnlyTestCase.test_getiterator_filter_local_name lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_local_name -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_method_text_encoding lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_method_text_encoding -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_etree.ETreeOnlyTestCase.test_XMLDTDID_empty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_XMLDTDID_empty -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterchildren_tag_posarg lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_posarg -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_attributes_ns lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_attributes_ns -lxml.tests.test_etree.ETreeOnlyTestCase.test_elementtree_getelementpath_ns lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_elementtree_getelementpath_ns -lxml.tests.test_etree.ETreeOnlyTestCase.test_c_api lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_c_api -lxml.tests.test_etree.ETreeOnlyTestCase.test_parse_stringio_base_url lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parse_stringio_base_url -lxml.tests.test_etree.ETreeOnlyTestCase.test_parser_encoding lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parser_encoding -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespaces_default_and_other lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespaces_default_and_other -lxml.tests.test_etree.ETreeOnlyTestCase.test_unicode_byte_invalid lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_unicode_byte_invalid -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk -lxml.tests.test_etree.ETreeOnlyTestCase.test_prefix_default_ns lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_prefix_default_ns -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterchildren_tag_multiple lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_multiple -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_start_end_tags_with_root lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_start_end_tags_with_root -lxml.tests.test_etree.ETreeOnlyTestCase.test_index lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_index -lxml.tests.test_etree.ETreeOnlyTestCase.test_element_name_quote lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_element_name_quote -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterancestors_tag_multiple lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterancestors_tag_multiple -lxml.tests.test_etree.ETreeOnlyTestCase.test_byte_invalid lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_byte_invalid -lxml.tests.test_etree.ETreeOnlyTestCase.test_setslice_step lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_step -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_standalone_in_out lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_standalone_in_out -lxml.tests.test_etree.ETreeOnlyTestCase.test_resolve_bytes_dtd lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_resolve_bytes_dtd -lxml.tests.test_etree.ETreeOnlyTestCase.test_elementtree_findall_ns_qname lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_elementtree_findall_ns_qname -lxml.tests.test_etree.ETreeOnlyTestCase.test_large_sourceline_XML lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_large_sourceline_XML -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterchildren_tag_multiple_posarg lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_multiple_posarg -lxml.tests.test_etree.ETreeOnlyTestCase.test_xml_base lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_xml_base -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_start lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_start -lxml.tests.test_etree.ETreeOnlyTestCase.test_addnext_root_pi lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_root_pi -lxml.tests.test_etree.ETreeOnlyTestCase.test_parser_target_pi lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parser_target_pi -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_start_end lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_start_end -lxml.tests.test_etree.ETreeOnlyTestCase.test_parseid lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parseid -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_strip lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_strip -lxml.tests.test_etree.ETreeOnlyTestCase.test_html_base_tag lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_html_base_tag -lxml.tests.test_etree.ETreeOnlyTestCase.test_cdata_type lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_type -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_remove_comments lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_remove_comments -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_with_tail lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_with_tail -lxml.tests.test_etree.ETreeOnlyTestCase.test_getiterator_filter_element lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_element -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_tags_and_remove lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_and_remove -lxml.tests.test_etree.ETreeOnlyTestCase.test_entity_error lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_entity_error -lxml.tests.test_etree.ETreeOnlyTestCase.test_itersiblings_tag_multiple lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_itersiblings_tag_multiple -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterdescendants_tag_multiple lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterdescendants_tag_multiple -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_encoding_8bit_override lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_encoding_8bit_override -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_tags lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_elements lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_elements -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_method_html_with_tail lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_method_html_with_tail -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterchildren lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren -lxml.tests.test_etree.ETreeOnlyTestCase.test_pi_parse lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_pi_parse -lxml.tests.test_etree.ETreeOnlyTestCase.test_deepcopy_pi_dtd lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_deepcopy_pi_dtd -lxml.tests.test_etree.ETreeOnlyTestCase.test_tounicode_element_tail lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tounicode_element_tail -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_pis lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_pis -lxml.tests.test_etree.ETreeOnlyTestCase.test_comment_no_proxy_yet lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_no_proxy_yet -lxml.tests.test_etree.ETreeOnlyTestCase.test_qname_space lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_qname_space -lxml.tests.test_etree.ETreeOnlyTestCase.test_doctype_name_only_roundtrip lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_doctype_name_only_roundtrip -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespace_cleanup_keep_prefixes lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespace_cleanup_keep_prefixes -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_ns_skip lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_ns_skip -lxml.tests.test_etree.ETreeOnlyTestCase.test_setslice_all_empty_reversed lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_all_empty_reversed -lxml.tests.test_etree.ETreeOnlyTestCase.test_sourceline_XML lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_XML -lxml.tests.test_etree.ETreeOnlyTestCase.test_proxy_collect_siblings lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_proxy_collect_siblings -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespaces_default_and_attr lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespaces_default_and_attr -lxml.tests.test_etree.ETreeOnlyTestCase.test_itersiblings lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_itersiblings -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespace_cleanup_attributes lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespace_cleanup_attributes -lxml.tests.test_etree.ETreeOnlyTestCase.test_attribute_set lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_set -lxml.tests.test_etree.ETreeOnlyTestCase.test_getroottree lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getroottree -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_unicode_none lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_unicode_none -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_tree_comments lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tree_comments -lxml.tests.test_etree.ETreeOnlyTestCase.test_addprevious_pi lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_pi -lxml.tests.test_etree.ETreeOnlyTestCase.test_elementtree_findall_qname lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_elementtree_findall_qname -lxml.tests.test_etree.ETreeOnlyTestCase.test_getiterator_filter_namespace lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_namespace -lxml.tests.test_etree.ETreeOnlyTestCase.test_cdata_parser lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_parser -lxml.tests.test_etree.ETreeOnlyTestCase.test_docinfo_system lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_docinfo_system -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespaces lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespaces -lxml.tests.test_etree.ETreeOnlyTestCase.test_qname_colon lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_qname_colon -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_tag_ns_empty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_ns_empty -lxml.tests.test_etree.ETreeOnlyTestCase.test_unicode_byte_zero lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_unicode_byte_zero -lxml.tests.test_etree.ETreeOnlyTestCase.test_proxy_collect_siblings_text lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_proxy_collect_siblings_text -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespace_cleanup_deep lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespace_cleanup_deep -lxml.tests.test_etree.ETreeOnlyTestCase.test_subelement_name_colon lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_name_colon -lxml.tests.test_etree.ETreeOnlyTestCase.test_tounicode_none lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tounicode_none -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_etree.ETreeOnlyTestCase.test_XML_base_url_docinfo lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_XML_base_url_docinfo -lxml.tests.test_etree.ETreeOnlyTestCase.test_parse_remove_comments lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parse_remove_comments -lxml.tests.test_etree.ETreeOnlyTestCase.test_setslice_step_negative lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_step_negative -lxml.tests.test_etree.ETreeOnlyTestCase.test_getiterator_filter_multiple lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_multiple -lxml.tests.test_etree.ETreeOnlyTestCase.test_addprevious_comment lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_comment -lxml.tests.test_etree.ETreeOnlyTestCase.test_feed_parser_recover lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_feed_parser_recover -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterchildren_reversed lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_reversed -lxml.tests.test_etree.ETreeOnlyTestCase.test_version lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_version -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_start_end_tags lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_start_end_tags -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespace_cleanup_keep_prefixes_top lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespace_cleanup_keep_prefixes_top -lxml.tests.test_etree.ETreeOnlyTestCase.test_entity_restructure lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_entity_restructure -lxml.tests.test_etree.ETreeOnlyTestCase.test_addprevious_cycle lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_cycle -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterchildren_tag lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag -lxml.tests.test_etree.ETreeOnlyTestCase.test_attribute_gets_namespace_prefix_on_merge_with_nons lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_gets_namespace_prefix_on_merge_with_nons -lxml.tests.test_etree.ETreeOnlyTestCase.test_addnext_pi lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_pi -lxml.tests.test_etree.ETreeOnlyTestCase.test_deepcopy_elementtree_pi lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_deepcopy_elementtree_pi -lxml.tests.test_etree.ETreeOnlyTestCase.test_elementtree_getelementpath lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_elementtree_getelementpath -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_standalone lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_standalone -lxml.tests.test_etree.ETreeOnlyTestCase.test_addnext_root_comment lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_root_comment -lxml.tests.test_etree.ETreeOnlyTestCase.test_parser_target_comment lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parser_target_comment -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_unicode_element_tail lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_unicode_element_tail -lxml.tests.test_etree.ETreeOnlyTestCase.test_qname_empty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_qname_empty -lxml.tests.test_etree.ETreeOnlyTestCase.test_replace lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_replace -lxml.tests.test_etree.ETreeOnlyTestCase.test_addnext_noops lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_noops -lxml.tests.test_etree.ETreeOnlyTestCase.test_comment_immutable_attrib lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_immutable_attrib -lxml.tests.test_etree.ETreeOnlyTestCase.test_elementtree_parser_target_type_error lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_elementtree_parser_target_type_error -lxml.tests.test_etree.ETreeOnlyTestCase.test_qname_none lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_qname_none -lxml.tests.test_etree.ETreeOnlyTestCase.test_qname_namespace_localname lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_qname_namespace_localname -lxml.tests.test_etree.ETreeOnlyTestCase.test_attribute_set_invalid lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_set_invalid -lxml.tests.test_etree.ETreeOnlyTestCase.test_subelement_nsmap lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_nsmap -lxml.tests.test_etree.ETreeOnlyTestCase.test_append_recursive_error lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_append_recursive_error -lxml.tests.test_etree.ETreeOnlyTestCase.test_parse_base_url_docinfo lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parse_base_url_docinfo -lxml.tests.test_etree.ETreeOnlyTestCase.test_resolve_error lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_resolve_error -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_attrib_ns lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_attrib_ns -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_tag lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_tag -lxml.tests.test_etree.ETreeOnlyTestCase.test_tounicode_pretty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tounicode_pretty -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_pretty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_pretty -lxml.tests.test_etree.ETreeOnlyTestCase.test_strip_tags_pi_comment lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_pi_comment -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_broken_multi_recover lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_broken_multi_recover -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_keep_cdata lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_keep_cdata -lxml.tests.test_etree.ETreeOnlyTestCase.test_addprevious_noops lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_noops -lxml.tests.test_etree.ETreeOnlyTestCase.test_attrib_order lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attrib_order -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_unicode lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_unicode -lxml.tests.test_etree.ETreeOnlyTestCase.test_setslice_step_negative2 lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_step_negative2 -lxml.tests.test_etree.ETreeOnlyTestCase.test_parser_target_fromstring_exception lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parser_target_fromstring_exception -lxml.tests.test_etree.ETreeOnlyTestCase.test_entity_values lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_entity_values -lxml.tests.test_etree.ETreeOnlyTestCase.test_subelement_attribute_invalid lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_attribute_invalid -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespaces_copy_element lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespaces_copy_element -lxml.tests.test_etree.ETreeOnlyTestCase.test_parser_encoding_unknown lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parser_encoding_unknown -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespaces_default_copy_element lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespaces_default_copy_element -lxml.tests.test_etree.ETreeOnlyTestCase.test_element_name_empty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_element_name_empty -lxml.tests.test_etree.ETreeOnlyTestCase.test_tostring_method_text_unicode lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_method_text_unicode -lxml.tests.test_etree.ETreeOnlyTestCase.test_parser_target_recover lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parser_target_recover -lxml.tests.test_etree.ETreeOnlyTestCase.test_deepcopy_elementtree_dtd lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_deepcopy_elementtree_dtd -lxml.tests.test_etree.ETreeOnlyTestCase.test_sourceline_element lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_element -lxml.tests.test_etree.ETreeOnlyTestCase.test_cdata_xpath lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_xpath -lxml.tests.test_etree.ETreeOnlyTestCase.test_parser_target_feed_no_id_dict lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_parser_target_feed_no_id_dict -lxml.tests.test_etree.ETreeOnlyTestCase.test_elementtree_find_qname lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_elementtree_find_qname -lxml.tests.test_etree.ETreeOnlyTestCase.test_getiterator_filter_entities lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_entities -lxml.tests.test_etree.ETreeOnlyTestCase.test_findall_different_nsmaps lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_different_nsmaps -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_encoding_error lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_encoding_error -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_tag_ns_empty_all lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_ns_empty_all -lxml.tests.test_etree.ETreeOnlyTestCase.test_docinfo_public lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_docinfo_public -lxml.tests.test_etree.ETreeOnlyTestCase.test_resolve_empty lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_resolve_empty -lxml.tests.test_etree.ETreeOnlyTestCase.test_attrib_and_keywords lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attrib_and_keywords -lxml.tests.test_etree.ETreeOnlyTestCase.test_getprevious lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getprevious -lxml.tests.test_etree.ETreeOnlyTestCase.test_tounicode lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tounicode -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_comments lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_comments -lxml.tests.test_etree.ETreeOnlyTestCase.test_entity_append lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_entity_append -lxml.tests.test_etree.ETreeOnlyTestCase.test_HTML_base_url_docinfo lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_HTML_base_url_docinfo -lxml.tests.test_etree.ETreeOnlyTestCase.test_subelement_name_space lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_name_space -lxml.tests.test_etree.ETreeOnlyTestCase.test_prefix lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_prefix -lxml.tests.test_etree.ETreeOnlyTestCase._checkIDDict lxml.tests.test_etree.ETreeOnlyTestCase-class.html#_checkIDDict -lxml.tests.test_etree.ETreeOnlyTestCase.test_findall_empty_prefix lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_empty_prefix -lxml.tests.test_etree.ETreeOnlyTestCase.test_resolve_file_dtd lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_resolve_file_dtd -lxml.tests.test_etree.ETreeOnlyTestCase.test_entity_parse lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_entity_parse -lxml.tests.test_etree.ETreeOnlyTestCase.test_resolve_filename_dtd lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_resolve_filename_dtd -lxml.tests.test_etree.ETreeOnlyTestCase.test_pypy_proxy_collect lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_pypy_proxy_collect -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterparse_tag_all lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_all -lxml.tests.test_etree.ETreeOnlyTestCase.test_attribute_keeps_namespace_prefix_on_merge lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_keeps_namespace_prefix_on_merge -lxml.tests.test_etree.ETreeOnlyTestCase.test_addprevious_root_comment lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_root_comment -lxml.tests.test_etree.ETreeOnlyTestCase.test_namespace_cleanup_many lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_namespace_cleanup_many -lxml.tests.test_etree.ETreeOnlyTestCase.test_pi lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_pi -lxml.tests.test_etree.ETreeOnlyTestCase.test_iterwalk_start_tags lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_start_tags -lxml.tests.test_etree.ETreeWriteTestCase lxml.tests.test_etree.ETreeWriteTestCase-class.html -lxml.tests.test_etree.ETreeWriteTestCase.test_write_file_gzipfile_parse lxml.tests.test_etree.ETreeWriteTestCase-class.html#test_write_file_gzipfile_parse -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_etree.ETreeWriteTestCase.test_write lxml.tests.test_etree.ETreeWriteTestCase-class.html#test_write -lxml.tests.test_etree.ETreeWriteTestCase.test_write_gzip lxml.tests.test_etree.ETreeWriteTestCase-class.html#test_write_gzip -lxml.tests.test_etree.ETreeWriteTestCase.test_write_doctype lxml.tests.test_etree.ETreeWriteTestCase-class.html#test_write_doctype -lxml.tests.test_etree.ETreeWriteTestCase.test_write_file_gzip_parse lxml.tests.test_etree.ETreeWriteTestCase-class.html#test_write_file_gzip_parse -lxml.tests.test_etree.ETreeWriteTestCase.test_write_file lxml.tests.test_etree.ETreeWriteTestCase-class.html#test_write_file -lxml.tests.test_etree.ETreeWriteTestCase.test_write_gzip_level lxml.tests.test_etree.ETreeWriteTestCase-class.html#test_write_gzip_level -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_etree.ETreeWriteTestCase.test_write_file_gzip lxml.tests.test_etree.ETreeWriteTestCase-class.html#test_write_file_gzip -lxml.tests.test_etree.ETreeWriteTestCase.test_write_gzip_doctype lxml.tests.test_etree.ETreeWriteTestCase-class.html#test_write_gzip_doctype -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_etree.ETreeXIncludeTestCase lxml.tests.test_etree.ETreeXIncludeTestCase-class.html -lxml.tests.test_etree._XIncludeTestCase.test_xinclude_resolver_recursive lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude_resolver_recursive -lxml.tests.test_etree.ETreeXIncludeTestCase.include lxml.tests.test_etree.ETreeXIncludeTestCase-class.html#include -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_etree._XIncludeTestCase.test_xinclude lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_etree._XIncludeTestCase.test_xinclude_resolver lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude_resolver -lxml.tests.test_etree._XIncludeTestCase.test_xinclude_text lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude_text -lxml.tests.test_etree.ElementIncludeTestCase lxml.tests.test_etree.ElementIncludeTestCase-class.html -lxml.tests.test_etree._XIncludeTestCase.test_xinclude_resolver_recursive lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude_resolver_recursive -lxml.tests.test_etree.ElementIncludeTestCase.include lxml.tests.test_etree.ElementIncludeTestCase-class.html#include -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_etree.ElementIncludeTestCase.ElementInclude lxml.ElementInclude-module.html -lxml.tests.test_etree._XIncludeTestCase.test_xinclude lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_etree._XIncludeTestCase.test_xinclude_resolver lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude_resolver -lxml.tests.test_etree._XIncludeTestCase.test_xinclude_text lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude_text -lxml.tests.test_etree.XMLPullParserTest lxml.tests.test_etree.XMLPullParserTest-class.html -lxml.tests.test_etree.XMLPullParserTest.etree lxml.etree-module.html -lxml.tests.test_etree.XMLPullParserTest.test_pull_from_tree_builder lxml.tests.test_etree.XMLPullParserTest-class.html#test_pull_from_tree_builder -lxml.tests.test_etree.XMLPullParserTest.test_pull_from_simple_target lxml.tests.test_etree.XMLPullParserTest-class.html#test_pull_from_simple_target -lxml.tests.test_etree.XMLPullParserTest.test_pull_from_tree_builder_subclass lxml.tests.test_etree.XMLPullParserTest-class.html#test_pull_from_tree_builder_subclass -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_etree.XMLPullParserTest.test_pull_from_simple_target_start_end lxml.tests.test_etree.XMLPullParserTest-class.html#test_pull_from_simple_target_start_end -lxml.tests.test_etree.XMLPullParserTest.assert_event_tags lxml.tests.test_etree.XMLPullParserTest-class.html#assert_event_tags -lxml.tests.test_etree._XIncludeTestCase lxml.tests.test_etree._XIncludeTestCase-class.html -lxml.tests.test_etree._XIncludeTestCase.test_xinclude_resolver_recursive lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude_resolver_recursive -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_etree._XIncludeTestCase.test_xinclude lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_etree._XIncludeTestCase.test_xinclude_resolver lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude_resolver -lxml.tests.test_etree._XIncludeTestCase.test_xinclude_text lxml.tests.test_etree._XIncludeTestCase-class.html#test_xinclude_text -lxml.tests.test_external_document.ExternalDocumentTestCase lxml.tests.test_external_document.ExternalDocumentTestCase-class.html -lxml.tests.test_external_document.ExternalDocumentTestCase.as_capsule lxml.tests.test_external_document.ExternalDocumentTestCase-class.html#as_capsule -lxml.tests.test_external_document.ExternalDocumentTestCase.test_external_document_adoption lxml.tests.test_external_document.ExternalDocumentTestCase-class.html#test_external_document_adoption -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_external_document.ExternalDocumentTestCase.setUp lxml.tests.test_external_document.ExternalDocumentTestCase-class.html#setUp -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_htmlparser.HtmlParserTestCase lxml.tests.test_htmlparser.HtmlParserTestCase-class.html -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_HTML_broken lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_HTML_broken -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_element_name_quote lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_quote -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_parser_target_doctype_empty lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_doctype_empty -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_iterparse_broken lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_broken -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_parse_html_norecover lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_parse_html_norecover -lxml.tests.test_htmlparser.HtmlParserTestCase.test_boolean_attribute_xml_adds_empty_string lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_boolean_attribute_xml_adds_empty_string -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_subelement_name_space lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_space -lxml.tests.test_htmlparser.HtmlParserTestCase.etree lxml.etree-module.html -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_parser_target_exceptions lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_exceptions -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_fromstring_target_exceptions lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_fromstring_target_exceptions -lxml.tests.test_htmlparser.HtmlParserTestCase.test_default_parser_HTML_broken lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_default_parser_HTML_broken -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_parser_target_doctype_html_full lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_doctype_html_full -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_element_name_colon lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_colon -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_subelement_name_quote lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_quote -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_feed_parser lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_feed_parser -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_iterparse lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse -lxml.tests.test_htmlparser.HtmlParserTestCase.test_boolean_attribute lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_boolean_attribute -lxml.tests.test_htmlparser.HtmlParserTestCase.test_set_decl_html lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_set_decl_html -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_feed_parser_more_tags lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_feed_parser_more_tags -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_iterparse_start lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_start -lxml.tests.test_htmlparser.HtmlParserTestCase.tearDown lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#tearDown -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_subelement_name_colon lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_colon -lxml.tests.test_htmlparser.HtmlParserTestCase.uhtml_str lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#uhtml_str -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_HTML_pretty_print lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_HTML_pretty_print -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_HTML_unicode lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_HTML_unicode -lxml.tests.test_htmlparser.HtmlParserTestCase.test_parse_encoding_8bit_override lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_parse_encoding_8bit_override -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_ids lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_ids -lxml.tests.test_htmlparser.HtmlParserTestCase.test_parse_encoding_8bit_explicit lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_parse_encoding_8bit_explicit -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_HTML lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_HTML -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_parse_html_error lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_parse_html_error -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_HTML_cdata lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_HTML_cdata -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_parser_target_tag lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_tag -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_htmlparser.HtmlParserTestCase.html_str_pretty lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#html_str_pretty -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html5_doctype lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html5_doctype -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_HTML_access lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_HTML_access -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_element_name_empty lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_empty -lxml.tests.test_htmlparser.HtmlParserTestCase.test_ietf_decl lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_ietf_decl -lxml.tests.test_htmlparser.HtmlParserTestCase.broken_html_str lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#broken_html_str -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_parse_html_filelike lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_parse_html_filelike -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_subelement_name_empty lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_empty -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_parser_target_doctype_html lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_doctype_html -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_parse_html lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_parse_html -lxml.tests.test_htmlparser.HtmlParserTestCase.test_boolean_attribute_round_trip lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_boolean_attribute_round_trip -lxml.tests.test_htmlparser.HtmlParserTestCase.test_wide_unicode_xml lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_wide_unicode_xml -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_file_error lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_file_error -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_ids_no_collect_ids lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_ids_no_collect_ids -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_iterparse_broken_no_recover lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_broken_no_recover -lxml.tests.test_htmlparser.HtmlParserTestCase.html_str lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#html_str -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_iterparse_stop_short lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_stop_short -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_iterparse_file lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_file -lxml.tests.test_htmlparser.HtmlParserTestCase.test_module_parse_html_default_doctype lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_module_parse_html_default_doctype -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_feed_parser_chunky lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_feed_parser_chunky -lxml.tests.test_htmlparser.HtmlParserTestCase.test_html_element_name_space lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_space -lxml.tests.test_http_io.HttpIOTestCase lxml.tests.test_http_io.HttpIOTestCase-class.html -lxml.tests.test_http_io.HttpIOTestCase.etree lxml.etree-module.html -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_http_io.HttpIOTestCase._parse_from_http lxml.tests.test_http_io.HttpIOTestCase-class.html#_parse_from_http -lxml.tests.test_http_io.HttpIOTestCase.test_http_client lxml.tests.test_http_io.HttpIOTestCase-class.html#test_http_client -lxml.tests.test_http_io.HttpIOTestCase.test_network_dtd lxml.tests.test_http_io.HttpIOTestCase-class.html#test_network_dtd -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_http_io.HttpIOTestCase.test_http_client_404 lxml.tests.test_http_io.HttpIOTestCase-class.html#test_http_client_404 -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_http_io.HttpIOTestCase.test_http_client_gzip lxml.tests.test_http_io.HttpIOTestCase-class.html#test_http_client_gzip -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_http_io.HttpIOTestCase.test_parser_input_mix lxml.tests.test_http_io.HttpIOTestCase-class.html#test_parser_input_mix -lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html -lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase.test_async lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html#test_async -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase._run_async lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html#_run_async -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase.test_async_api lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html#test_async_api -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._parse_file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_parse_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace_and_other lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace_and_other -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_generator_close_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_generator_close_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_non_io_exception_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_non_io_exception_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_escaping lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_escaping -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.tearDown lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#tearDown -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element_repeatedly lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element_repeatedly -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested_with_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested_with_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_encoding lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_encoding -lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase.setUp lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html#setUp -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_closing_out_of_order_in_error_case lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_closing_out_of_order_in_error_case -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._read_file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_read_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra_duplicate lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra_duplicate -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_comment lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_comment -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_preceding_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_preceding_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_anonymous lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_anonymous -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.assertXml lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#assertXml -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_empty lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_empty -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase.test_filelike_close lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html#test_filelike_close -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_flush lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_flush -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_buffering lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_buffering -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_anonymous_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_anonymous_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_pi lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_pi -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._parse_file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_parse_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_text -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_open_namespaced_element lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_open_namespaced_element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace_and_other lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace_and_other -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_generator_close_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_generator_close_continues_closing -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_write_namespaced_element lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_write_namespaced_element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_non_io_exception_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_non_io_exception_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_escaping lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_escaping -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.tearDown lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#tearDown -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_default_namespace -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_write_declaration lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_write_declaration -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element_repeatedly lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element_repeatedly -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested_with_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested_with_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_encoding lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_encoding -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.setUp lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#setUp -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_void_elements lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_void_elements -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_closing_out_of_order_in_error_case lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_closing_out_of_order_in_error_case -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._read_file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_read_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra_duplicate lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra_duplicate -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_comment lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_comment -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_method_context_manager_misuse lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_method_context_manager_misuse -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_xml_mode_write_inside_html lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_xml_mode_write_inside_html -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_unescaped_script lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_unescaped_script -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_unescaped_script_incremental lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_unescaped_script_incremental -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_preceding_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_preceding_text -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_attribute_quoting_unicode lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_attribute_quoting_unicode -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_anonymous lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_anonymous -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_xml_mode_element_inside_html lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_xml_mode_element_inside_html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.assertXml lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#assertXml -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_empty lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_empty -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_incremental_xmlfile.HtmlFileTestCase.test_attribute_quoting lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_attribute_quoting -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_flush lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_flush -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_buffering lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_buffering -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_anonymous_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_anonymous_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_pi lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_pi -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase._parse_file lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#_parse_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace_and_other lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace_and_other -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_generator_close_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_generator_close_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_non_io_exception_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_non_io_exception_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_escaping lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_escaping -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.tearDown lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#tearDown -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element_repeatedly lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element_repeatedly -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested_with_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested_with_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_encoding lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_encoding -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.setUp lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#setUp -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_closing_out_of_order_in_error_case lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_closing_out_of_order_in_error_case -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase._read_file lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#_read_file -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.test_write_fails lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#test_write_fails -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra_duplicate lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra_duplicate -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.test_filelike_not_closing lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#test_filelike_not_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_comment lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_comment -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_preceding_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_preceding_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_anonymous lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_anonymous -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.assertXml lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#assertXml -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_empty lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_empty -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.test_filelike_close lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#test_filelike_close -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_flush lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_flush -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_buffering lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_buffering -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_anonymous_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_anonymous_namespace -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_pi lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_pi -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike.close lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html#close -lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike.__init__ lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html#__init__ -lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html -lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase._parse_file lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#_parse_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace_and_other lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace_and_other -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_generator_close_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_generator_close_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_non_io_exception_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_non_io_exception_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_escaping lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_escaping -lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase.tearDown lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#tearDown -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element_repeatedly lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element_repeatedly -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested_with_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested_with_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_encoding lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_encoding -lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase.setUp lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#setUp -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_closing_out_of_order_in_error_case lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_closing_out_of_order_in_error_case -lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase._read_file lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#_read_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra_duplicate lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra_duplicate -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_comment lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_comment -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_preceding_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_preceding_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_anonymous lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_anonymous -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.assertXml lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#assertXml -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_empty lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_empty -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase.test_flush lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#test_flush -lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase.test_buffering lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#test_buffering -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_anonymous_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_anonymous_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_pi lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_pi -lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._parse_file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_parse_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace_and_other lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace_and_other -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_generator_close_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_generator_close_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_non_io_exception_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_non_io_exception_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_escaping lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_escaping -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.tearDown lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#tearDown -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element_repeatedly lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element_repeatedly -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested_with_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested_with_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_encoding lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_encoding -lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase.setUp lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html#setUp -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_closing_out_of_order_in_error_case lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_closing_out_of_order_in_error_case -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._read_file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_read_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra_duplicate lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra_duplicate -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_comment lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_comment -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_preceding_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_preceding_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_anonymous lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_anonymous -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.assertXml lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#assertXml -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_empty lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_empty -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_flush lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_flush -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_buffering lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_buffering -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_anonymous_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_anonymous_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_pi lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_pi -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._parse_file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_parse_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace_and_other lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace_and_other -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_generator_close_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_generator_close_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_non_io_exception_continues_closing lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_non_io_exception_continues_closing -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_escaping lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_escaping -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.tearDown lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#tearDown -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element_repeatedly lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element_repeatedly -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested_with_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested_with_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_encoding lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_encoding -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_closing_out_of_order_in_error_case lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_closing_out_of_order_in_error_case -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase._read_file lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_read_file -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra_duplicate lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra_duplicate -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_trailing_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_trailing_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_attribute_extra lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_comment lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_comment -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_nested lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_nested -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nsmap lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nsmap -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_failure_preceding_text lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_failure_preceding_text -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_write_Element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_write_Element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_namespace_nested_anonymous lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_namespace_nested_anonymous -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.assertXml lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#assertXml -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element_write_empty lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element_write_empty -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_flush lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_flush -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_buffering lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_buffering -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_nested_default_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_nested_default_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_anonymous_namespace lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_anonymous_namespace -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_element lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_element -lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase.test_pi lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_pi -lxml.tests.test_io.ETreeIOTestCase lxml.tests.test_io.ETreeIOTestCase-class.html -lxml.tests.test_io._IOTestCaseBase.test_iterparse_utf8_bom lxml.tests.test_io._IOTestCaseBase-class.html#test_iterparse_utf8_bom -lxml.tests.test_io._IOTestCaseBase.test_class_parse_fileobject lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_fileobject -lxml.tests.test_io._IOTestCaseBase.test_module_parse_gzipobject lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_gzipobject -lxml.tests.test_io._IOTestCaseBase.test_iterparse_utf16_bom lxml.tests.test_io._IOTestCaseBase-class.html#test_iterparse_utf16_bom -lxml.tests.test_io.ETreeIOTestCase.test_write_compressed_text lxml.tests.test_io.ETreeIOTestCase-class.html#test_write_compressed_text -lxml.tests.test_io.ETreeIOTestCase.etree lxml.etree-module.html -lxml.tests.test_io._IOTestCaseBase.test_class_parse_filename lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename -lxml.tests.test_io._IOTestCaseBase.test_write_invalid_filename lxml.tests.test_io._IOTestCaseBase-class.html#test_write_invalid_filename -lxml.tests.test_io._IOTestCaseBase.test_module_parse_fileobject_type_error lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_fileobject_type_error -lxml.tests.test_io._IOTestCaseBase.buildNodes lxml.tests.test_io._IOTestCaseBase-class.html#buildNodes -lxml.tests.test_io._IOTestCaseBase.tearDown lxml.tests.test_io._IOTestCaseBase-class.html#tearDown -lxml.tests.test_io._IOTestCaseBase.test_write_filename lxml.tests.test_io._IOTestCaseBase-class.html#test_write_filename -lxml.tests.test_io._IOTestCaseBase.test_tree_io_latin1 lxml.tests.test_io._IOTestCaseBase-class.html#test_tree_io_latin1 -lxml.tests.test_io._IOTestCaseBase.setUp lxml.tests.test_io._IOTestCaseBase-class.html#setUp -lxml.tests.test_io._IOTestCaseBase.test_class_parse_unamed_fileobject lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_unamed_fileobject -lxml.tests.test_io._IOTestCaseBase.test_parse_utf8_bom lxml.tests.test_io._IOTestCaseBase-class.html#test_parse_utf8_bom -lxml.tests.test_io._IOTestCaseBase.test_etree_parse_io_error lxml.tests.test_io._IOTestCaseBase-class.html#test_etree_parse_io_error -lxml.tests.test_io._IOTestCaseBase.test_module_parse_fileobject_error lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_fileobject_error -lxml.tests.test_io._IOTestCaseBase.test_module_parse_large_fileobject lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_large_fileobject -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_io._IOTestCaseBase.getTestFilePath lxml.tests.test_io._IOTestCaseBase-class.html#getTestFilePath -lxml.tests.test_io._IOTestCaseBase.test_class_parse_filename_remove_previous lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename_remove_previous -lxml.tests.test_io._IOTestCaseBase.test_tree_io lxml.tests.test_io._IOTestCaseBase-class.html#test_tree_io -lxml.tests.test_io._IOTestCaseBase.test_module_parse_fileobject_late_error lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_fileobject_late_error -lxml.tests.test_io.ElementTreeIOTestCase lxml.tests.test_io.ElementTreeIOTestCase-class.html -lxml.tests.test_io._IOTestCaseBase.test_iterparse_utf8_bom lxml.tests.test_io._IOTestCaseBase-class.html#test_iterparse_utf8_bom -lxml.tests.test_io._IOTestCaseBase.test_class_parse_fileobject lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_fileobject -lxml.tests.test_io._IOTestCaseBase.test_module_parse_gzipobject lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_gzipobject -lxml.tests.test_io._IOTestCaseBase.test_iterparse_utf16_bom lxml.tests.test_io._IOTestCaseBase-class.html#test_iterparse_utf16_bom -lxml.tests.test_io.ElementTreeIOTestCase.etree xml.etree.ElementTree-module.html -lxml.tests.test_io._IOTestCaseBase.test_class_parse_filename lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename -lxml.tests.test_io._IOTestCaseBase.test_write_invalid_filename lxml.tests.test_io._IOTestCaseBase-class.html#test_write_invalid_filename -lxml.tests.test_io._IOTestCaseBase.test_module_parse_fileobject_type_error lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_fileobject_type_error -lxml.tests.test_io._IOTestCaseBase.buildNodes lxml.tests.test_io._IOTestCaseBase-class.html#buildNodes -lxml.tests.test_io._IOTestCaseBase.tearDown lxml.tests.test_io._IOTestCaseBase-class.html#tearDown -lxml.tests.test_io._IOTestCaseBase.test_write_filename lxml.tests.test_io._IOTestCaseBase-class.html#test_write_filename -lxml.tests.test_io._IOTestCaseBase.test_tree_io_latin1 lxml.tests.test_io._IOTestCaseBase-class.html#test_tree_io_latin1 -lxml.tests.test_io._IOTestCaseBase.setUp lxml.tests.test_io._IOTestCaseBase-class.html#setUp -lxml.tests.test_io._IOTestCaseBase.test_class_parse_unamed_fileobject lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_unamed_fileobject -lxml.tests.test_io._IOTestCaseBase.test_parse_utf8_bom lxml.tests.test_io._IOTestCaseBase-class.html#test_parse_utf8_bom -lxml.tests.test_io._IOTestCaseBase.test_etree_parse_io_error lxml.tests.test_io._IOTestCaseBase-class.html#test_etree_parse_io_error -lxml.tests.test_io._IOTestCaseBase.test_module_parse_fileobject_error lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_fileobject_error -lxml.tests.test_io._IOTestCaseBase.test_module_parse_large_fileobject lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_large_fileobject -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_io._IOTestCaseBase.getTestFilePath lxml.tests.test_io._IOTestCaseBase-class.html#getTestFilePath -lxml.tests.test_io._IOTestCaseBase.test_class_parse_filename_remove_previous lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename_remove_previous -lxml.tests.test_io._IOTestCaseBase.test_tree_io lxml.tests.test_io._IOTestCaseBase-class.html#test_tree_io -lxml.tests.test_io._IOTestCaseBase.test_module_parse_fileobject_late_error lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_fileobject_late_error -lxml.tests.test_io._IOTestCaseBase lxml.tests.test_io._IOTestCaseBase-class.html -lxml.tests.test_io._IOTestCaseBase.test_iterparse_utf8_bom lxml.tests.test_io._IOTestCaseBase-class.html#test_iterparse_utf8_bom -lxml.tests.test_io._IOTestCaseBase.test_class_parse_fileobject lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_fileobject -lxml.tests.test_io._IOTestCaseBase.test_module_parse_gzipobject lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_gzipobject -lxml.tests.test_io._IOTestCaseBase.test_iterparse_utf16_bom lxml.tests.test_io._IOTestCaseBase-class.html#test_iterparse_utf16_bom -lxml.tests.test_io._IOTestCaseBase.etree lxml.tests.test_io._IOTestCaseBase-class.html#etree -lxml.tests.test_io._IOTestCaseBase.test_class_parse_filename lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename -lxml.tests.test_io._IOTestCaseBase.test_write_invalid_filename lxml.tests.test_io._IOTestCaseBase-class.html#test_write_invalid_filename -lxml.tests.test_io._IOTestCaseBase.test_module_parse_fileobject_type_error lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_fileobject_type_error -lxml.tests.test_io._IOTestCaseBase.buildNodes lxml.tests.test_io._IOTestCaseBase-class.html#buildNodes -lxml.tests.test_io._IOTestCaseBase.tearDown lxml.tests.test_io._IOTestCaseBase-class.html#tearDown -lxml.tests.test_io._IOTestCaseBase.test_write_filename lxml.tests.test_io._IOTestCaseBase-class.html#test_write_filename -lxml.tests.test_io._IOTestCaseBase.test_tree_io_latin1 lxml.tests.test_io._IOTestCaseBase-class.html#test_tree_io_latin1 -lxml.tests.test_io._IOTestCaseBase.setUp lxml.tests.test_io._IOTestCaseBase-class.html#setUp -lxml.tests.test_io._IOTestCaseBase.test_class_parse_unamed_fileobject lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_unamed_fileobject -lxml.tests.test_io._IOTestCaseBase.test_parse_utf8_bom lxml.tests.test_io._IOTestCaseBase-class.html#test_parse_utf8_bom -lxml.tests.test_io._IOTestCaseBase.test_etree_parse_io_error lxml.tests.test_io._IOTestCaseBase-class.html#test_etree_parse_io_error -lxml.tests.test_io._IOTestCaseBase.test_module_parse_fileobject_error lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_fileobject_error -lxml.tests.test_io._IOTestCaseBase.test_module_parse_large_fileobject lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_large_fileobject -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_io._IOTestCaseBase.getTestFilePath lxml.tests.test_io._IOTestCaseBase-class.html#getTestFilePath -lxml.tests.test_io._IOTestCaseBase.test_class_parse_filename_remove_previous lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename_remove_previous -lxml.tests.test_io._IOTestCaseBase.test_tree_io lxml.tests.test_io._IOTestCaseBase-class.html#test_tree_io -lxml.tests.test_io._IOTestCaseBase.test_module_parse_fileobject_late_error lxml.tests.test_io._IOTestCaseBase-class.html#test_module_parse_fileobject_late_error -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_from_file lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_from_file -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_invalid_args lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_invalid_args -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_error_log lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_error_log -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_customization lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_customization -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_phases_kwarg lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_phases_kwarg -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_xmlschema_embedded lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_xmlschema_embedded -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_from_tree lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_from_tree -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_store_xslt lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_store_xslt -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_validate lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_validate -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_from_element lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_from_element -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_assertValid lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_assertValid -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_result_report lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_result_report -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_empty_pattern lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_empty_pattern -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_store_schematron lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_store_schematron -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_elementtree_error lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_elementtree_error -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_abstract lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_abstract -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_phases lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_phases -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_call lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_call -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_invalid_schema_empty lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_invalid_schema_empty -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_relaxng_embedded lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_relaxng_embedded -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_fail_on_report lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_fail_on_report -lxml.tests.test_isoschematron.ETreeISOSchematronTestCase.test_schematron_invalid_schema_namespace lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html#test_schematron_invalid_schema_namespace -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.test_create_element lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#test_create_element -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.test_element_creation lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#test_element_creation -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.tearDown lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#tearDown -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.test_default_tagname lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#test_default_tagname -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class-class.html -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.setUp lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#setUp -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class-class.html -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.test_ns_classes lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#test_ns_classes -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.test_create_element_default lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#test_create_element_default -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class-class.html -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.test_registry lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#test_registry -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class.bluff lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class-class.html#bluff -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.etree._Element.__repr__ lxml.etree._Element-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.etree._Element.__repr__ lxml.etree._Element-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class-class.html -lxml.etree._Element.getprevious lxml.etree._Element-class.html#getprevious -lxml.etree._Element.set lxml.etree._Element-class.html#set -lxml.etree._Element.getparent lxml.etree._Element-class.html#getparent -lxml.etree._Element.sourceline lxml.etree._Element-class.html#sourceline -lxml.etree._Element.text lxml.etree._Element-class.html#text -lxml.etree._Element.iterfind lxml.etree._Element-class.html#iterfind -lxml.etree._Element._init lxml.etree._Element-class.html#_init -lxml.etree._Element.nsmap lxml.etree._Element-class.html#nsmap -lxml.etree._Element.replace lxml.etree._Element-class.html#replace -lxml.etree._Element.prefix lxml.etree._Element-class.html#prefix -lxml.etree._Element.tag lxml.etree._Element-class.html#tag -lxml.etree._Element.iter lxml.etree._Element-class.html#iter -lxml.etree._Element.addnext lxml.etree._Element-class.html#addnext -lxml.etree._Element.addprevious lxml.etree._Element-class.html#addprevious -lxml.etree._Element.find lxml.etree._Element-class.html#find -lxml.etree._Element.append lxml.etree._Element-class.html#append -lxml.etree._Element.getnext lxml.etree._Element-class.html#getnext -lxml.etree._Element.index lxml.etree._Element-class.html#index -lxml.etree.ElementBase.__new__ lxml.etree.ElementBase-class.html#__new__ -lxml.etree._Element.__contains__ lxml.etree._Element-class.html#__contains__ -lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class.maeh lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class-class.html#maeh -lxml.etree._Element.findtext lxml.etree._Element-class.html#findtext -lxml.etree._Element.tail lxml.etree._Element-class.html#tail -lxml.etree._Element.getroottree lxml.etree._Element-class.html#getroottree -lxml.etree._Element.iterdescendants lxml.etree._Element-class.html#iterdescendants -lxml.etree._Element.getchildren lxml.etree._Element-class.html#getchildren -lxml.etree.ElementBase.__init__ lxml.etree.ElementBase-class.html#__init__ -lxml.etree._Element.cssselect lxml.etree._Element-class.html#cssselect -lxml.etree._Element.__len__ lxml.etree._Element-class.html#__len__ -lxml.etree._Element.xpath lxml.etree._Element-class.html#xpath -lxml.etree._Element.__getitem__ lxml.etree._Element-class.html#__getitem__ -lxml.etree._Element.get lxml.etree._Element-class.html#get -lxml.etree._Element.keys lxml.etree._Element-class.html#keys -lxml.etree._Element.__deepcopy__ lxml.etree._Element-class.html#__deepcopy__ -lxml.etree._Element.makeelement lxml.etree._Element-class.html#makeelement -lxml.etree._Element.__iter__ lxml.etree._Element-class.html#__iter__ -lxml.etree._Element.base lxml.etree._Element-class.html#base -lxml.etree._Element.insert lxml.etree._Element-class.html#insert -lxml.etree._Element.iterchildren lxml.etree._Element-class.html#iterchildren -lxml.etree._Element.iterancestors lxml.etree._Element-class.html#iterancestors -lxml.etree._Element.extend lxml.etree._Element-class.html#extend -lxml.etree._Element.__delitem__ lxml.etree._Element-class.html#__delitem__ -lxml.etree._Element.__reversed__ lxml.etree._Element-class.html#__reversed__ -lxml.etree._Element.itersiblings lxml.etree._Element-class.html#itersiblings -lxml.etree._Element.__nonzero__ lxml.etree._Element-class.html#__nonzero__ -lxml.etree._Element.items lxml.etree._Element-class.html#items -lxml.etree._Element.clear lxml.etree._Element-class.html#clear -lxml.etree._Element.itertext lxml.etree._Element-class.html#itertext -lxml.etree._Element.findall lxml.etree._Element-class.html#findall -lxml.etree._Element.__setitem__ lxml.etree._Element-class.html#__setitem__ -lxml.etree._Element.remove lxml.etree._Element-class.html#remove -lxml.etree._Element.values lxml.etree._Element-class.html#values -lxml.etree._Element.__repr__ lxml.etree._Element-class.html#__repr__ -lxml.etree._Element.getiterator lxml.etree._Element-class.html#getiterator -lxml.etree._Element.attrib lxml.etree._Element-class.html#attrib -lxml.etree._Element.__copy__ lxml.etree._Element-class.html#__copy__ -lxml.tests.test_objectify.ObjectifyTestCase lxml.tests.test_objectify.ObjectifyTestCase-class.html -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_nested lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_nested -lxml.tests.test_objectify.ObjectifyTestCase.test_setslice_partial_allneg lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_partial_allneg -lxml.tests.test_objectify.ObjectifyTestCase.test_type_bool_cmp lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_bool_cmp -lxml.tests.test_objectify.ObjectifyTestCase.test_pickle_floattelement lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pickle_floattelement -lxml.tests.test_objectify.ObjectifyTestCase.test_type_unregistered lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_unregistered -lxml.tests.test_objectify.ObjectifyTestCase.test_xml_base lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_xml_base -lxml.tests.test_objectify.ObjectifyTestCase.test_pytype_annotation_use_old lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pytype_annotation_use_old -lxml.tests.test_objectify.ObjectifyTestCase.test_registered_types lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_registered_types -lxml.tests.test_objectify.ObjectifyTestCase.test_sub_data_element_nsmap_custom lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_data_element_nsmap_custom -lxml.tests.test_objectify.ObjectifyTestCase.test_sub_element_nsmap_default lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_element_nsmap_default -lxml.tests.test_objectify.ObjectifyTestCase.test_child_nonexistant lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_nonexistant -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_list lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_list -lxml.tests.test_objectify.ObjectifyTestCase.test_xsiannotate_ignore_old lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_xsiannotate_ignore_old -lxml.tests.test_objectify.ObjectifyTestCase.test_schema_types lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_schema_types -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_attrib_attributes_precedence lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_attrib_attributes_precedence -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_dot lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_dot -lxml.tests.test_objectify.ObjectifyTestCase.test_pyannotate_use_old lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pyannotate_use_old -lxml.tests.test_objectify.ObjectifyTestCase.test_build_tree lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_build_tree -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str -lxml.tests.test_objectify.ObjectifyTestCase.test_element_nsmap_empty lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_element_nsmap_empty -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_dot_root_list lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_dot_root_list -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_float_hash lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_float_hash -lxml.tests.test_objectify.ObjectifyTestCase.test_setitem_string lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setitem_string -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_hash lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_hash -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_dot_list lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_dot_list -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_pytypes lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_pytypes -lxml.tests.test_objectify.ObjectifyTestCase.test_xml_base_attribute lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_xml_base_attribute -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_addattr_create_element lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_addattr_create_element -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_data_element_arg_invalid_pytype lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_data_element_arg_invalid_pytype -lxml.tests.test_objectify.ObjectifyTestCase.etree lxml.etree-module.html -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_nsmap_custom_prefixes lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_nsmap_custom_prefixes -lxml.tests.test_objectify.ObjectifyTestCase.test_xsitype_deannotate lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_xsitype_deannotate -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_default_relative lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_default_relative -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_nsmap_custom lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_nsmap_custom -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_as_complex lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_as_complex -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_fail_parse_empty lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_fail_parse_empty -lxml.tests.test_objectify.ObjectifyTestCase.test_addattr_element lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_addattr_element -lxml.tests.test_objectify.ObjectifyTestCase.test_pyannotate_ignore_old lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pyannotate_ignore_old -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_fail lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_fail -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_ns lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_ns -lxml.tests.test_objectify.ObjectifyTestCase.test_pyannotate_empty lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pyannotate_empty -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_attrib lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_attrib -lxml.tests.test_objectify.ObjectifyTestCase.test_class_lookup lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_class_lookup -lxml.tests.test_objectify.ObjectifyTestCase.test_change_pytype_attribute lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_change_pytype_attribute -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_index_fail_lookup lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_index_fail_lookup -lxml.tests.test_objectify.ObjectifyTestCase.test_setslice_partial lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_partial -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path -lxml.tests.test_objectify.ObjectifyTestCase.test_addattr_list lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_addattr_list -lxml.tests.test_objectify.ObjectifyTestCase.test_setslice_partial_wrong_length lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_partial_wrong_length -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_default_absolute lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_default_absolute -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_index_fail_parse lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_index_fail_parse -lxml.tests.test_objectify.ObjectifyTestCase.test_findall_ns lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_findall_ns -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_ns_list lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_ns_list -lxml.tests.test_objectify.ObjectifyTestCase.test_descendant_paths_prefix lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_descendant_paths_prefix -lxml.tests.test_objectify.ObjectifyTestCase.tearDown lxml.tests.test_objectify.ObjectifyTestCase-class.html#tearDown -lxml.tests.test_objectify.ObjectifyTestCase.test_pytype_xsitype_annotation lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pytype_xsitype_annotation -lxml.tests.test_objectify.ObjectifyTestCase.test_pickle_elementtree lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pickle_elementtree -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_int_hash lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_int_hash -lxml.tests.test_objectify.ObjectifyTestCase.test_parse_stringio_base_url lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_parse_stringio_base_url -lxml.tests.test_objectify.ObjectifyTestCase.test_setitem_string_special lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setitem_string_special -lxml.tests.test_objectify.ObjectifyTestCase.test_type_ustr_intliteral lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_ustr_intliteral -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_set_create_list lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_set_create_list -lxml.tests.test_objectify.ObjectifyTestCase.test_date_element_efactory_text lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_date_element_efactory_text -lxml.tests.test_objectify.ObjectifyTestCase.test_root lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_root -lxml.tests.test_objectify.ObjectifyTestCase.test_type_float_precision lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_float_precision -lxml.tests.test_objectify.ObjectifyTestCase.test_setslice_empty lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_empty -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_as_int lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_as_int -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_ustr_floatliteral lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_ustr_floatliteral -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_bool lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_bool -lxml.tests.test_objectify.ObjectifyTestCase.test_pickle_intelement lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pickle_intelement -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_xsitypes lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_xsitypes -lxml.tests.test_objectify.ObjectifyTestCase.test_pickle lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pickle -lxml.tests.test_objectify.ObjectifyTestCase._test_pickle lxml.tests.test_objectify.ObjectifyTestCase-class.html#_test_pickle -lxml.tests.test_objectify.ObjectifyTestCase.test_date_element_efactory_tail lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_date_element_efactory_tail -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_index lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_index -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_set_create lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_set_create -lxml.tests.test_objectify.ObjectifyTestCase.test_sub_element_nsmap_custom lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_element_nsmap_custom -lxml.tests.test_objectify.ObjectifyTestCase.test_type_ustr lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_ustr -lxml.tests.test_objectify.ObjectifyTestCase.test_xsinil_deannotate lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_xsinil_deannotate -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_float lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_float -lxml.tests.test_objectify.ObjectifyTestCase.test_dataelement_xsi_prefix_error lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_dataelement_xsi_prefix_error -lxml.tests.test_objectify.ObjectifyTestCase.setUp lxml.tests.test_objectify.ObjectifyTestCase-class.html#setUp -lxml.tests.test_objectify.ObjectifyTestCase.test_setattr lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setattr -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_cmp lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_cmp -lxml.tests.test_objectify.ObjectifyTestCase.test_child_ns_nons lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_ns_nons -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_data_element_arg_pytype_none lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_data_element_arg_pytype_none -lxml.tests.test_objectify.ObjectifyTestCase.test_sub_element_nsmap_custom_prefixes lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_element_nsmap_custom_prefixes -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_index_list lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_index_list -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_addattr_element lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_addattr_element -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_nsmap_default lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_nsmap_default -lxml.tests.test_objectify.ObjectifyTestCase.test_dataelement_xsi_nsmap lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_dataelement_xsi_nsmap -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_subtype lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_subtype -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_float_hash_repr lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_float_hash_repr -lxml.tests.test_objectify.ObjectifyTestCase.test_setslice_elements lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_elements -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_mod lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_mod -lxml.tests.test_objectify.ObjectifyTestCase.test_child_index lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_index -lxml.tests.test_objectify.ObjectifyTestCase.test_sub_data_element_nsmap_empty lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_data_element_nsmap_empty -lxml.tests.test_objectify.ObjectifyTestCase.test_getslice_partial lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_getslice_partial -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_str lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_str -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_addattr lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_addattr -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_data_element_arg_xsitype lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_data_element_arg_xsitype -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_sequence lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_sequence -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_addattr_create lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_addattr_create -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_set_element lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_set_element -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_str_intliteral lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_str_intliteral -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_str lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_str -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_ustr lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_ustr -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_none lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_none -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_objectify.ObjectifyTestCase.test_str lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_str -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_syntax lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_syntax -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_NoneType lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_NoneType -lxml.tests.test_objectify.ObjectifyTestCase.test_type_NoneType lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_NoneType -lxml.tests.test_objectify.ObjectifyTestCase.test_child_getattr_empty_ns lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_getattr_empty_ns -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_xsitypes_xsdprefixed lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_xsitypes_xsdprefixed -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_float lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_float -lxml.tests.test_objectify.ObjectifyTestCase.test_element_nsmap_default lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_element_nsmap_default -lxml.tests.test_objectify.ObjectifyTestCase.test_pytype_annotation_empty lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pytype_annotation_empty -lxml.tests.test_objectify.ObjectifyTestCase.test_child_addattr lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_addattr -lxml.tests.test_objectify.ObjectifyTestCase.test_setslice_complete lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_complete -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_xsitypes_prefixed lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_xsitypes_prefixed -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_addattr_create_list lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_addattr_create_list -lxml.tests.test_objectify.ObjectifyTestCase.XML lxml.tests.test_objectify.ObjectifyTestCase-class.html#XML -lxml.tests.test_objectify.ObjectifyTestCase.test_sub_data_element_nsmap_custom_prefixes lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_data_element_nsmap_custom_prefixes -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_invalid_xsi lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_invalid_xsi -lxml.tests.test_objectify.ObjectifyTestCase.test_pickle_boolelement lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pickle_boolelement -lxml.tests.test_objectify.ObjectifyTestCase.test_dataelement_xsi lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_dataelement_xsi -lxml.tests.test_objectify.ObjectifyTestCase.test_getslice_partial_neg lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_getslice_partial_neg -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_element_arg lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_element_arg -lxml.tests.test_objectify.ObjectifyTestCase.test_type_none_cmp lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_none_cmp -lxml.tests.test_objectify.ObjectifyTestCase.test_type_float_instantiation_precision lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_float_instantiation_precision -lxml.tests.test_objectify.ObjectifyTestCase.test_child_len lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_len -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_pytype_none lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_pytype_none -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_mod_data_elements lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_mod_data_elements -lxml.tests.test_objectify.ObjectifyTestCase.test_setslice_insert lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_insert -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_nsmap_empty lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_nsmap_empty -lxml.tests.test_objectify.ObjectifyTestCase.test_schema_types_prefixed lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_schema_types_prefixed -lxml.tests.test_objectify.ObjectifyTestCase.test_type_ustr_floatliteral lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_ustr_floatliteral -lxml.tests.test_objectify.ObjectifyTestCase.test_pickle_noneelement lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pickle_noneelement -lxml.tests.test_objectify.ObjectifyTestCase.test_addattr lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_addattr -lxml.tests.test_objectify.ObjectifyTestCase.test_XML_set_base_url_docinfo lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_XML_set_base_url_docinfo -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_set lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_set -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_int lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_int -lxml.tests.test_objectify.ObjectifyTestCase.test_registered_type_stringify lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_registered_type_stringify -lxml.tests.test_objectify.ObjectifyTestCase.test_dir lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_dir -lxml.tests.test_objectify.ObjectifyTestCase.test_findall lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_findall -lxml.tests.test_objectify.ObjectifyTestCase.test_type_ustr_add lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_ustr_add -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_dot_root lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_dot_root -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_hasattr lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_hasattr -lxml.tests.test_objectify.ObjectifyTestCase.test_XML_base_url_docinfo lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_XML_base_url_docinfo -lxml.tests.test_objectify.ObjectifyTestCase.test_type_float_precision_consistency lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_float_precision_consistency -lxml.tests.test_objectify.ObjectifyTestCase.test_xsiannotate_use_old lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_xsiannotate_use_old -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_pytype_none_compat lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_pytype_none_compat -lxml.tests.test_objectify.ObjectifyTestCase.test_type_int lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_int -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_unregistered lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_unregistered -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_mul lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_mul -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_str_floatliteral lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_str_floatliteral -lxml.tests.test_objectify.ObjectifyTestCase.test_type_bool lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_bool -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_ustr_intliteral lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_ustr_intliteral -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_set_create_element lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_set_create_element -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_add lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_add -lxml.tests.test_objectify.ObjectifyTestCase.test_type_float lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_float -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_data_element_arg_pytype lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_data_element_arg_pytype -lxml.tests.test_objectify.ObjectifyTestCase.test_type_ustr_mul lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_ustr_mul -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_data_element_arg_invalid_xsi lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_data_element_arg_invalid_xsi -lxml.tests.test_objectify.ObjectifyTestCase.test_child_getattr lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_getattr -lxml.tests.test_objectify.ObjectifyTestCase.test_sub_data_element_nsmap_default lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_data_element_nsmap_default -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_objectify.ObjectifyTestCase.test_descendant_paths_child lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_descendant_paths_child -lxml.tests.test_objectify.ObjectifyTestCase.test_object_path_fail_parse_empty_list lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_object_path_fail_parse_empty_list -lxml.tests.test_objectify.ObjectifyTestCase.test_pytype_annotation lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pytype_annotation -lxml.tests.test_objectify.ObjectifyTestCase.test_type_int_cmp lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_int_cmp -lxml.tests.test_objectify.ObjectifyTestCase.test_pickle_strelement lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pickle_strelement -lxml.tests.test_objectify.ObjectifyTestCase.test_child_set_ro lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_set_ro -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_intliteral lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_intliteral -lxml.tests.test_objectify.ObjectifyTestCase.test_element_nsmap_custom_prefixes lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_element_nsmap_custom_prefixes -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_data_element_arg lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_data_element_arg -lxml.tests.test_objectify.ObjectifyTestCase.test_vars lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_vars -lxml.tests.test_objectify.ObjectifyTestCase.test_child lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_floatliteral lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_floatliteral -lxml.tests.test_objectify.ObjectifyTestCase.test_parse_base_url_docinfo lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_parse_base_url_docinfo -lxml.tests.test_objectify.ObjectifyTestCase.test_element_nsmap_custom lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_element_nsmap_custom -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_float_precision lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_float_precision -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_bool lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_bool -lxml.tests.test_objectify.ObjectifyTestCase.test_setslice_insert_neg lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_insert_neg -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_value_concatenation lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_value_concatenation -lxml.tests.test_objectify.ObjectifyTestCase.test_pytype_deannotate lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_pytype_deannotate -lxml.tests.test_objectify.ObjectifyTestCase.test_setslice_partial_neg lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_partial_neg -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_int lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_int -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_data_element_arg_pytype_xsitype lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_data_element_arg_pytype_xsitype -lxml.tests.test_objectify.ObjectifyTestCase.test_data_element_invalid_pytype lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_data_element_invalid_pytype -lxml.tests.test_objectify.ObjectifyTestCase.test_setattr_nonunicode lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setattr_nonunicode -lxml.tests.test_objectify.ObjectifyTestCase.test_sub_element_nsmap_empty lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_element_nsmap_empty -lxml.tests.test_objectify.ObjectifyTestCase.test_descendant_paths lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_descendant_paths -lxml.tests.test_objectify.ObjectifyTestCase.test_type_str_as_float lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_as_float -lxml.tests.test_objectify.ObjectifyTestCase.test_deannotate lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_deannotate -lxml.tests.test_objectify.ObjectifyTestCase.test_getslice_complete lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_getslice_complete -lxml.tests.test_objectify.ObjectifyTestCase.test_efactory_unicode lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_efactory_unicode -lxml.tests.test_objectify.ObjectifyTestCase.test_set_string lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_set_string -lxml.tests.test_objectify.ObjectifyTestCase.test_child_index_neg lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_index_neg -lxml.tests.test_objectify.ObjectifyTestCase.test_standard_lookup lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_standard_lookup -lxml.tests.test_objectify.ObjectifyTestCase.test_child_iter lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_iter -lxml.tests.test_objectify.ObjectifyTestCase.test_countchildren lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_countchildren -lxml.tests.test_pyclasslookup.PyClassLookupTestCase lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_get_default lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_get_default -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getitem_neg lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getitem_neg -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_comments_fallback lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_comments_fallback -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_iterchildren lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_iterchildren -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_len lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_len -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_prefix lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_prefix -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.etree lxml.etree-module.html -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.tearDown lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#tearDown -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_keep_ref_assertion lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_keep_ref_assertion -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getparent lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getparent -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_iterchildren_tag lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_iterchildren_tag -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_tag lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_tag -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getitem lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getitem -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_get lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_get -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_sourceline lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_sourceline -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_attrib lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_attrib -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_bool lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_bool -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getnext lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getnext -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getprevious lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getprevious -lxml.tests.test_pyclasslookup.PyClassLookupTestCase._buildElementClass lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#_buildElementClass -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#XML -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getslice lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getslice -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.parser lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#parser -lxml.tests.test_pyclasslookup.PyClassLookupTestCase._setClassLookup lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#_setClassLookup -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_text lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_text -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#Element -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getchildren lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getchildren -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_tail lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_tail -lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_iter_children lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_iter_children -lxml.tests.test_relaxng.ETreeRelaxNGTestCase lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_stringio lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_stringio -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_elementtree_error lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_elementtree_error -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_include lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_include -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_invalid_schema lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_invalid_schema -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_shortcut lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_shortcut -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_invalid_schema4 lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_invalid_schema4 -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_invalid_schema2 lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_invalid_schema2 -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_invalid_schema3 lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_invalid_schema3 -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_generic_error lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_generic_error -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_multiple_elementrees lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_multiple_elementrees -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng -lxml.tests.test_relaxng.ETreeRelaxNGTestCase.test_relaxng_error lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html#test_relaxng_error -lxml.tests.test_relaxng.RelaxNGCompactTestCase lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_relaxng.RelaxNGCompactTestCase.pytestmark lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html#pytestmark -lxml.tests.test_relaxng.RelaxNGCompactTestCase.test_relaxng_compact lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html#test_relaxng_compact -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_relaxng.RelaxNGCompactTestCase.test_relaxng_compact_file_obj lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html#test_relaxng_compact_file_obj -lxml.tests.test_relaxng.RelaxNGCompactTestCase.test_relaxng_compact_str lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html#test_relaxng_compact_str -lxml.tests.test_sax.ETreeSaxTestCase lxml.tests.test_sax.ETreeSaxTestCase-class.html -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_no_ns_attributes lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_no_ns_attributes -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_pi lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_pi -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_simple lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_simple -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_redefine_ns lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_redefine_ns -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_no_ns lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_no_ns -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_comment lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_comment -lxml.tests.test_sax.ETreeSaxTestCase.test_element_sax_ns lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_element_sax_ns -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_handler_default_ns_None lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_handler_default_ns_None -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_sax.ETreeSaxTestCase._saxify_unsaxify lxml.tests.test_sax.ETreeSaxTestCase-class.html#_saxify_unsaxify -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_error lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_error -lxml.tests.test_sax.ETreeSaxTestCase._saxify_serialize lxml.tests.test_sax.ETreeSaxTestCase-class.html#_saxify_serialize -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_ns1 lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_ns1 -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_attributes lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_attributes -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_ns2 lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_ns2 -lxml.tests.test_sax.ETreeSaxTestCase.test_sax_to_pulldom lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_sax_to_pulldom -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_handler_default_ns lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_handler_default_ns -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_comment_root lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_comment_root -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_error2 lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_error2 -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_pi_root lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_pi_root -lxml.tests.test_sax.ETreeSaxTestCase.test_element_sax lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_element_sax -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_double lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_double -lxml.tests.test_sax.ETreeSaxTestCase.test_etree_sax_ns_attributes lxml.tests.test_sax.ETreeSaxTestCase-class.html#test_etree_sax_ns_attributes -lxml.tests.test_schematron.ETreeSchematronTestCase lxml.tests.test_schematron.ETreeSchematronTestCase-class.html -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_schematron.ETreeSchematronTestCase.test_schematron_elementtree_error lxml.tests.test_schematron.ETreeSchematronTestCase-class.html#test_schematron_elementtree_error -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_schematron.ETreeSchematronTestCase.test_schematron lxml.tests.test_schematron.ETreeSchematronTestCase-class.html#test_schematron -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_schematron.ETreeSchematronTestCase.test_schematron_invalid_schema_empty lxml.tests.test_schematron.ETreeSchematronTestCase-class.html#test_schematron_invalid_schema_empty -lxml.tests.test_schematron.ETreeSchematronTestCase.test_schematron_invalid_schema lxml.tests.test_schematron.ETreeSchematronTestCase-class.html#test_schematron_invalid_schema -lxml.tests.test_schematron.ETreeSchematronTestCase.test_schematron_invalid_schema_namespace lxml.tests.test_schematron.ETreeSchematronTestCase-class.html#test_schematron_invalid_schema_namespace -lxml.tests.test_threading.ThreadPipelineTestCase lxml.tests.test_threading.ThreadPipelineTestCase-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.xml lxml.tests.test_threading.ThreadPipelineTestCase-class.html#xml -lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.Validate lxml.tests.test_threading.ThreadPipelineTestCase.Validate-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.test_thread_pipeline_global_parse lxml.tests.test_threading.ThreadPipelineTestCase-class.html#test_thread_pipeline_global_parse -lxml.tests.test_threading.ThreadPipelineTestCase.etree lxml.etree-module.html -lxml.tests.test_threading.ThreadPipelineTestCase.test_thread_pipeline_thread_parse lxml.tests.test_threading.ThreadPipelineTestCase-class.html#test_thread_pipeline_thread_parse -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_threading.ThreadPipelineTestCase.Worker lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.item_count lxml.tests.test_threading.ThreadPipelineTestCase-class.html#item_count -lxml.tests.test_threading.ThreadPipelineTestCase._build_pipeline lxml.tests.test_threading.ThreadPipelineTestCase-class.html#_build_pipeline -lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker-class.html -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.__init__ lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#__init__ -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.run lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#run -lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker.handle lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker-class.html#handle -lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.__init__ lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#__init__ -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.run lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#run -lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker.handle lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker-class.html#handle -lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.__init__ lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#__init__ -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.run lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#run -lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker.handle lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker-class.html#handle -lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.__init__ lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#__init__ -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.run lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#run -lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker.handle lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker-class.html#handle -lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.__init__ lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#__init__ -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.run lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#run -lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker.handle lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker-class.html#handle -lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.__init__ lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#__init__ -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.run lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#run -lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker.handle lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker-class.html#handle -lxml.tests.test_threading.ThreadPipelineTestCase.Validate lxml.tests.test_threading.ThreadPipelineTestCase.Validate-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.__init__ lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#__init__ -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.run lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#run -lxml.tests.test_threading.ThreadPipelineTestCase.Validate.handle lxml.tests.test_threading.ThreadPipelineTestCase.Validate-class.html#handle -lxml.tests.test_threading.ThreadPipelineTestCase.Worker lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.__init__ lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#__init__ -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.run lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#run -lxml.tests.test_threading.ThreadPipelineTestCase.Worker.handle lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#handle -lxml.tests.test_threading.ThreadingTestCase lxml.tests.test_threading.ThreadingTestCase-class.html -lxml.tests.test_threading.ThreadingTestCase.test_concurrent_class_lookup lxml.tests.test_threading.ThreadingTestCase-class.html#test_concurrent_class_lookup -lxml.tests.test_threading.ThreadingTestCase.test_main_xslt_in_thread lxml.tests.test_threading.ThreadingTestCase-class.html#test_main_xslt_in_thread -lxml.tests.test_threading.ThreadingTestCase._run_thread lxml.tests.test_threading.ThreadingTestCase-class.html#_run_thread -lxml.tests.test_threading.ThreadingTestCase.test_thread_xslt_parsing_error_log lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_xslt_parsing_error_log -lxml.tests.test_threading.ThreadingTestCase.etree lxml.etree-module.html -lxml.tests.test_threading.ThreadingTestCase.test_thread_mix lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_mix -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_threading.ThreadingTestCase.test_concurrent_proxies lxml.tests.test_threading.ThreadingTestCase-class.html#test_concurrent_proxies -lxml.tests.test_threading.ThreadingTestCase.test_thread_xslt_attr_replace lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_xslt_attr_replace -lxml.tests.test_threading.ThreadingTestCase.test_thread_xslt lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_xslt -lxml.tests.test_threading.ThreadingTestCase.test_subtree_copy_thread lxml.tests.test_threading.ThreadingTestCase-class.html#test_subtree_copy_thread -lxml.tests.test_threading.ThreadingTestCase.test_concurrent_attribute_names_in_dicts lxml.tests.test_threading.ThreadingTestCase-class.html#test_concurrent_attribute_names_in_dicts -lxml.tests.test_threading.ThreadingTestCase.test_thread_create_xslt lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_create_xslt -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_threading.ThreadingTestCase.test_thread_error_log lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_error_log -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_threading.ThreadingTestCase.test_thread_xslt_apply_error_log lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_xslt_apply_error_log -lxml.tests.test_threading.ThreadingTestCase._run_threads lxml.tests.test_threading.ThreadingTestCase-class.html#_run_threads -lxml.tests.test_unicode.EncodingsTestCase lxml.tests.test_unicode.EncodingsTestCase-class.html -lxml.tests.test_unicode.EncodingsTestCase.test_utf8sig_fromstring lxml.tests.test_unicode.EncodingsTestCase-class.html#test_utf8sig_fromstring -lxml.tests.test_unicode.EncodingsTestCase.test_utf16BE_fromstring lxml.tests.test_unicode.EncodingsTestCase-class.html#test_utf16BE_fromstring -lxml.tests.test_unicode.EncodingsTestCase._test_encoding lxml.tests.test_unicode.EncodingsTestCase-class.html#_test_encoding -lxml.tests.test_unicode.EncodingsTestCase.test_utf32LE_fromstring lxml.tests.test_unicode.EncodingsTestCase-class.html#test_utf32LE_fromstring -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_unicode.EncodingsTestCase.test_illegal_utf8_recover lxml.tests.test_unicode.EncodingsTestCase-class.html#test_illegal_utf8_recover -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_unicode.EncodingsTestCase.test_illegal_utf8 lxml.tests.test_unicode.EncodingsTestCase-class.html#test_illegal_utf8 -lxml.tests.test_unicode.EncodingsTestCase.test_utf32BE_fromstring lxml.tests.test_unicode.EncodingsTestCase-class.html#test_utf32BE_fromstring -lxml.tests.test_unicode.EncodingsTestCase.test_utf16LE_fromstring lxml.tests.test_unicode.EncodingsTestCase-class.html#test_utf16LE_fromstring -lxml.tests.test_unicode.EncodingsTestCase.test_utf8_fromstring lxml.tests.test_unicode.EncodingsTestCase-class.html#test_utf8_fromstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_unicode.EncodingsTestCase.test_utf32_fromstring lxml.tests.test_unicode.EncodingsTestCase-class.html#test_utf32_fromstring -lxml.tests.test_unicode.EncodingsTestCase.test_utf16_fromstring lxml.tests.test_unicode.EncodingsTestCase-class.html#test_utf16_fromstring -lxml.tests.test_unicode.UnicodeTestCase lxml.tests.test_unicode.UnicodeTestCase-class.html -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_xml_broken lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_xml_broken -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_text lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_text -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_nstag_invalid lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_nstag_invalid -lxml.tests.test_unicode.UnicodeTestCase.test_uniname lxml.tests.test_unicode.UnicodeTestCase-class.html#test_uniname -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_nstag lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_nstag -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_attr lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_attr -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_qname lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_qname -lxml.tests.test_unicode.UnicodeTestCase.test__str lxml.tests.test_unicode.UnicodeTestCase-class.html#test__str -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_qname_invalid lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_qname_invalid -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_comment lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_comment -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_xml lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_xml -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_repr1 lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_repr1 -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_repr2 lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_repr2 -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_repr3 lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_repr3 -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_repr4 lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_repr4 -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_ns_invalid lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_ns_invalid -lxml.tests.test_unicode.UnicodeTestCase.test_wide_unicode_xml lxml.tests.test_unicode.UnicodeTestCase-class.html#test_wide_unicode_xml -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_tag lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_tag -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_parse_stringio lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_parse_stringio -lxml.tests.test_unicode.UnicodeTestCase.test_unicode_tag_invalid lxml.tests.test_unicode.UnicodeTestCase-class.html#test_unicode_tag_invalid -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.resolver_schema_int2 lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html#resolver_schema_int2 -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.test_xmlschema_resolvers_noroot lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html#test_xmlschema_resolvers_noroot -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.test_xmlschema_resolvers_root lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html#test_xmlschema_resolvers_root -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.test_xmlschema_nested_resolvers lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html#test_xmlschema_nested_resolvers -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.test_xmlschema_resolvers lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html#test_xmlschema_resolvers -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.resolver_schema_ext lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html#resolver_schema_ext -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.resolver_schema_int lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html#resolver_schema_int -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver.resolve lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html#resolve -lxml.etree.Resolver.resolve_filename lxml.etree.Resolver-class.html#resolve_filename -lxml.etree.Resolver.__new__ lxml.etree.Resolver-class.html#__new__ -lxml.etree.Resolver.resolve_string lxml.etree.Resolver-class.html#resolve_string -lxml.etree.Resolver.resolve_file lxml.etree.Resolver-class.html#resolve_file -lxml.etree.Resolver.resolve_empty lxml.etree.Resolver-class.html#resolve_empty -lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver.__init__ lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html#__init__ -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_import_file lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_import_file -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_shortcut lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_shortcut -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_default_attributes lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_default_attributes -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_parse lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_parse -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_iterparse_fail lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_iterparse_fail -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_parse_default_attributes lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_parse_default_attributes -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_iterparse_incomplete lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_iterparse_incomplete -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_stringio lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_stringio -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_illegal_validation_error lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_illegal_validation_error -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_invalid_schema2 lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_invalid_schema2 -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_invalid_schema1 lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_invalid_schema1 -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_comment_error lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_comment_error -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_elementtree_error lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_elementtree_error -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_file lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_file -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_parse_default_attributes_schema_config lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_parse_default_attributes_schema_config -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_error_log_path lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_error_log_path -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_error_log lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_error_log -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_iterparse lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_iterparse -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_create_from_partial_doc lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_create_from_partial_doc -lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase.test_xmlschema_parse_fixed_attributes lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html#test_xmlschema_parse_fixed_attributes -lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase._test_xpath_compile_unicode lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html#_test_xpath_compile_unicode -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase.test_xpath_compile_ns lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html#test_xpath_compile_ns -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html -lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase.test_xpath_compile_element lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_compile_element -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase.test_xpath_compile_vars lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_compile_vars -lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase.test_xpath_compile_doc lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_compile_doc -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase.test_xpath_elementtree_error lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_elementtree_error -lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase.test_xpath_compile_error lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_compile_error -lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html -lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase.test_xpath_exslt_functions_strings lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html#test_xpath_exslt_functions_strings -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase.NSMAP lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html#NSMAP -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase.test_xpath_exslt_functions_date lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html#test_xpath_exslt_functions_date -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xpathevaluator.ETreeXPathTestCase lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_comment lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_comment -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_boolean lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_boolean -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_prefix_error lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_prefix_error -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_elementtree_getpath_partial lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_elementtree_getpath_partial -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_evaluator_element lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_evaluator_element -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_attribute_parent lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_attribute_parent -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_elementtree_getpath lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_elementtree_getpath -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_text_parent lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_text_parent -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_error lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_error -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_variables lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_variables -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_eval_context_propagation lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_eval_context_propagation -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_elements lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_elements -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_namespace lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_namespace -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_evaluator_tree lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_evaluator_tree -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_unicode_text_parent lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_unicode_text_parent -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_extensions_mix lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_mix -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_namespace_empty lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_namespace_empty -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_eval_context_clear lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_eval_context_clear -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_nothing lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_nothing -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_class_error lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_class_error -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_extensions_nodes lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_nodes -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_extensions_nodes_append lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_nodes_append -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_variables_nodeset lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_variables_nodeset -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_extensions_nodes_append2 lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_nodes_append2 -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_string lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_string -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_extensions lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_ns_none lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_ns_none -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_text lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_text -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_attribute_parent_no_smart_strings lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_attribute_parent_no_smart_strings -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_document_root lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_document_root -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_extensions_wrong_args lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_wrong_args -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_attribute lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_attribute -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_evaluator lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_evaluator -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_text_from_other_document lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_text_from_other_document -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_number lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_number -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_ns_empty lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_ns_empty -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_rel_xpath_list_elements lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_rel_xpath_list_elements -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_list_text_parent_no_smart_strings lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_text_parent_no_smart_strings -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_rel_xpath_boolean lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_rel_xpath_boolean -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_evaluator_tree_absolute lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_evaluator_tree_absolute -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_class_prefix_error lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_class_prefix_error -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_context_node lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_context_node -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_extensions_error lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_error -lxml.tests.test_xpathevaluator.ETreeXPathTestCase.test_xpath_ns lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_ns -lxml.tests.test_xslt.ETreeEXSLTTestCase lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html -lxml.tests.test_xslt.ETreeEXSLTTestCase.test_exslt_regexp_match lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#test_exslt_regexp_match -lxml.tests.test_xslt.ETreeEXSLTTestCase.test_exslt_regexp_match1 lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#test_exslt_regexp_match1 -lxml.tests.test_xslt.ETreeEXSLTTestCase.test_exslt_regexp_match2 lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#test_exslt_regexp_match2 -lxml.tests.test_xslt.ETreeEXSLTTestCase.test_exslt_str lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#test_exslt_str -lxml.tests.test_xslt.ETreeEXSLTTestCase._test_exslt_regexp_match4 lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#_test_exslt_regexp_match4 -lxml.tests.test_xslt.ETreeEXSLTTestCase._test_exslt_regexp_match3 lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#_test_exslt_regexp_match3 -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xslt.ETreeEXSLTTestCase.test_exslt_regexp_replace lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#test_exslt_regexp_replace -lxml.tests.test_xslt.ETreeEXSLTTestCase.test_exslt_regexp_test lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#test_exslt_regexp_test -lxml.tests.test_xslt.ETreeEXSLTTestCase.test_exslt_math lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#test_exslt_math -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_xslt.ETreeEXSLTTestCase.test_exslt_str_attribute_replace lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#test_exslt_str_attribute_replace -lxml.tests.test_xslt.ETreeEXSLTTestCase.test_exslt_regexp_match_groups lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#test_exslt_regexp_match_groups -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase._test_extension_element_attribute_context lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#_test_extension_element_attribute_context -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_apply_templates_elements_only lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_apply_templates_elements_only -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_apply_templates_target_node lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_apply_templates_target_node -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_apply_templates lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_apply_templates -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_apply_templates_remove_blank_text lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_apply_templates_remove_blank_text -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_content lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_content -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_process_children_to_append_only lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_process_children_to_append_only -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_process_children lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_process_children -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_process_children_to_read_only_raise lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_process_children_to_read_only_raise -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_comment_pi_context lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_comment_pi_context -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_apply_templates_target_node_doc lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_apply_templates_target_node_doc -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_raise lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_raise -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_process_children_with_subextension_element lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_process_children_with_subextension_element -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase._test_multiple_extension_elements_with_output_parent lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#_test_multiple_extension_elements_with_output_parent -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element_doc_context lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element_doc_context -lxml.tests.test_xslt.ETreeXSLTExtElementTestCase.test_extension_element lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#test_extension_element -lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html -lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase.test_variable_result_tree_fragment lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html#test_variable_result_tree_fragment -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase.test_xpath_on_context_node lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html#test_xpath_on_context_node -lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase.test_extensions2 lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html#test_extensions2 -lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase.test_extensions1 lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html#test_extensions1 -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase.test_xpath_on_foreign_context_node lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html#test_xpath_on_foreign_context_node -lxml.tests.test_xslt.ETreeXSLTTestCase lxml.tests.test_xslt.ETreeXSLTTestCase-class.html -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_parameter_xpath lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_parameter_xpath -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_default_parameters lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_default_parameters -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_repeat_transform lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_repeat_transform -lxml.tests.test_xslt.ETreeXSLTTestCase._xslt_setup lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#_xslt_setup -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_pi_set_replace lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_pi_set_replace -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_pi_get_all lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_pi_get_all -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_html_output lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_html_output -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_parsing_error_log lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_parsing_error_log -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_access_control_repr lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_access_control_repr -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_parameter_invalid lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_parameter_invalid -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_shortcut lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_shortcut -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_document_parse_allow lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_document_parse_allow -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_message lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_message -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_write_output_file_path lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_write_output_file_path -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_write_output_bytesio lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_write_output_bytesio -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_unicode lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_unicode -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_write_output_file lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_write_output_file -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_message_terminate lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_message_terminate -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_input lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_input -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_resolver_url_building lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_resolver_url_building -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_broken lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_broken -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_copy lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_copy -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_apply_error_log lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_apply_error_log -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_input_none lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_input_none -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_pi_get lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_pi_get -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_unicode_standalone lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_unicode_standalone -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_parameter_xpath_object lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_parameter_xpath_object -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_pi_get_unknown lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_pi_get_unknown -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_multiple_transforms lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_multiple_transforms -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_write_output_failure lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_write_output_failure -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_document_error lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_document_error -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_empty lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_empty -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_parameter_missing lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_parameter_missing -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_invalid_stylesheet lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_invalid_stylesheet -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_encoding_override lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_encoding_override -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_include_from_filelike lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_include_from_filelike -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_elementtree_error lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_elementtree_error -lxml.tests.test_xslt.ETreeXSLTTestCase.test_multiple_elementrees lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_multiple_elementrees -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_input_partial_doc lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_input_partial_doc -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_include lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_include -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_pi_embedded_id lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_pi_embedded_id -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_document_parse_deny lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_document_parse_deny -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_document_XML_resolver lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_document_XML_resolver -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_move_result lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_move_result -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_string_parameters lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_string_parameters -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_document_parse_deny_all lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_document_parse_deny_all -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_document_elementtree lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_document_elementtree -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_multiple_parameters lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_multiple_parameters -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_parameters lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_parameters -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_document_XML lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_document_XML -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_pi_embedded_xmlid lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_pi_embedded_xmlid -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_pi lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_pi -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_pi_set_new lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_pi_set_new -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_document_parse lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_document_parse -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_utf8 lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_utf8 -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_encoding lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_encoding -lxml.tests.test_xslt.ETreeXSLTTestCase.test_xslt_pi_get_all_reversed lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#test_xslt_pi_get_all_reversed -lxml.tests.test_xslt.Py3XSLTTestCase lxml.tests.test_xslt.Py3XSLTTestCase-class.html -lxml.tests.test_xslt.Py3XSLTTestCase.test_xslt_result_bytes lxml.tests.test_xslt.Py3XSLTTestCase-class.html#test_xslt_result_bytes -lxml.tests.common_imports.HelperTestCase.tearDown lxml.tests.common_imports.HelperTestCase-class.html#tearDown -lxml.tests.test_xslt.Py3XSLTTestCase.pytestmark lxml.tests.test_xslt.Py3XSLTTestCase-class.html#pytestmark -lxml.tests.test_xslt.Py3XSLTTestCase.test_xslt_result_bytearray lxml.tests.test_xslt.Py3XSLTTestCase-class.html#test_xslt_result_bytearray -lxml.tests.test_xslt.Py3XSLTTestCase.test_xslt_result_memoryview lxml.tests.test_xslt.Py3XSLTTestCase-class.html#test_xslt_result_memoryview -lxml.tests.common_imports.HelperTestCase._rootstring lxml.tests.common_imports.HelperTestCase-class.html#_rootstring -lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse -unittest.case.TestCase.failureException exceptions.AssertionError-class.html -mimetools.Message mimetools.Message-class.html -mimetools.Message.getmaintype mimetools.Message-class.html#getmaintype -mimetools.Message.getsubtype mimetools.Message-class.html#getsubtype -mimetools.Message.parseplist mimetools.Message-class.html#parseplist -mimetools.Message.__init__ mimetools.Message-class.html#__init__ -mimetools.Message.getparamnames mimetools.Message-class.html#getparamnames -mimetools.Message.getencoding mimetools.Message-class.html#getencoding -mimetools.Message.getparam mimetools.Message-class.html#getparam -mimetools.Message.parsetype mimetools.Message-class.html#parsetype -mimetools.Message.getplist mimetools.Message-class.html#getplist -mimetools.Message.gettype mimetools.Message-class.html#gettype -str str-class.html -str.upper str-class.html#upper -str.__getslice__ str-class.html#__getslice__ -str.__ne__ str-class.html#__ne__ -str.lstrip str-class.html#lstrip -str.__str__ str-class.html#__str__ -str.__getattribute__ str-class.html#__getattribute__ -str.rpartition str-class.html#rpartition -str.replace str-class.html#replace -str.isdigit str-class.html#isdigit -str.endswith str-class.html#endswith -str.splitlines str-class.html#splitlines -str.rfind str-class.html#rfind -str.strip str-class.html#strip -str.__rmul__ str-class.html#__rmul__ -str.__lt__ str-class.html#__lt__ -str.__getnewargs__ str-class.html#__getnewargs__ -str.__rmod__ str-class.html#__rmod__ -str.index str-class.html#index -str.ljust str-class.html#ljust -str.__new__ str-class.html#__new__ -str.isalnum str-class.html#isalnum -str.__contains__ str-class.html#__contains__ -str.rindex str-class.html#rindex -str.rsplit str-class.html#rsplit -str.__format__ str-class.html#__format__ -str.find str-class.html#find -str.decode str-class.html#decode -str.isalpha str-class.html#isalpha -str.__eq__ str-class.html#__eq__ -str.split str-class.html#split -str.rstrip str-class.html#rstrip -str.encode str-class.html#encode -str._formatter_parser str-class.html#_formatter_parser -str.translate str-class.html#translate -str.isspace str-class.html#isspace -str.__len__ str-class.html#__len__ -str.__repr__ str-class.html#__repr__ -str.startswith str-class.html#startswith -str.__getitem__ str-class.html#__getitem__ -str.format str-class.html#format -str.rjust str-class.html#rjust -str.swapcase str-class.html#swapcase -str.__hash__ str-class.html#__hash__ -str.zfill str-class.html#zfill -str.__add__ str-class.html#__add__ -str.__gt__ str-class.html#__gt__ -str.capitalize str-class.html#capitalize -str.__sizeof__ str-class.html#__sizeof__ -str.count str-class.html#count -str.lower str-class.html#lower -str.join str-class.html#join -str.center str-class.html#center -str.__mod__ str-class.html#__mod__ -str.partition str-class.html#partition -str.expandtabs str-class.html#expandtabs -str.istitle str-class.html#istitle -str.__le__ str-class.html#__le__ -str.__mul__ str-class.html#__mul__ -str._formatter_field_name_split str-class.html#_formatter_field_name_split -str.islower str-class.html#islower -str.title str-class.html#title -str.isupper str-class.html#isupper -str.__ge__ str-class.html#__ge__ -xml.etree.ElementTree.Element xml.etree.ElementTree.Element-class.html -xml.etree.ElementTree.Element.set xml.etree.ElementTree.Element-class.html#set -xml.etree.ElementTree.Element.text xml.etree.ElementTree.Element-class.html#text -xml.etree.ElementTree.Element.iterfind xml.etree.ElementTree.Element-class.html#iterfind -xml.etree.ElementTree.Element.tag xml.etree.ElementTree.Element-class.html#tag -xml.etree.ElementTree.Element.iter xml.etree.ElementTree.Element-class.html#iter -xml.etree.ElementTree.Element.findall xml.etree.ElementTree.Element-class.html#findall -xml.etree.ElementTree.Element.append xml.etree.ElementTree.Element-class.html#append -xml.etree.ElementTree.Element.__getitem__ xml.etree.ElementTree.Element-class.html#__getitem__ -xml.etree.ElementTree.Element.itertext xml.etree.ElementTree.Element-class.html#itertext -xml.etree.ElementTree.Element.findtext xml.etree.ElementTree.Element-class.html#findtext -xml.etree.ElementTree.Element.tail xml.etree.ElementTree.Element-class.html#tail -xml.etree.ElementTree.Element.find xml.etree.ElementTree.Element-class.html#find -xml.etree.ElementTree.Element.getchildren xml.etree.ElementTree.Element-class.html#getchildren -xml.etree.ElementTree.Element.__init__ xml.etree.ElementTree.Element-class.html#__init__ -xml.etree.ElementTree.Element.__delitem__ xml.etree.ElementTree.Element-class.html#__delitem__ -xml.etree.ElementTree.Element.__len__ xml.etree.ElementTree.Element-class.html#__len__ -xml.etree.ElementTree.Element.extend xml.etree.ElementTree.Element-class.html#extend -xml.etree.ElementTree.Element.get xml.etree.ElementTree.Element-class.html#get -xml.etree.ElementTree.Element.keys xml.etree.ElementTree.Element-class.html#keys -xml.etree.ElementTree.Element.makeelement xml.etree.ElementTree.Element-class.html#makeelement -xml.etree.ElementTree.Element.__setitem__ xml.etree.ElementTree.Element-class.html#__setitem__ -xml.etree.ElementTree.Element.copy xml.etree.ElementTree.Element-class.html#copy -xml.etree.ElementTree.Element.insert xml.etree.ElementTree.Element-class.html#insert -xml.etree.ElementTree.Element.__nonzero__ xml.etree.ElementTree.Element-class.html#__nonzero__ -xml.etree.ElementTree.Element.items xml.etree.ElementTree.Element-class.html#items -xml.etree.ElementTree.Element.clear xml.etree.ElementTree.Element-class.html#clear -xml.etree.ElementTree.Element.remove xml.etree.ElementTree.Element-class.html#remove -xml.etree.ElementTree.Element.__repr__ xml.etree.ElementTree.Element-class.html#__repr__ -xml.etree.ElementTree.Element.getiterator xml.etree.ElementTree.Element-class.html#getiterator -xml.etree.ElementTree.Element.attrib xml.etree.ElementTree.Element-class.html#attrib -xml.etree.ElementTree.ElementTree xml.etree.ElementTree.ElementTree-class.html -xml.etree.ElementTree.ElementTree.getroot xml.etree.ElementTree.ElementTree-class.html#getroot -xml.etree.ElementTree.ElementTree.iterfind xml.etree.ElementTree.ElementTree-class.html#iterfind -xml.etree.ElementTree.ElementTree.parse xml.etree.ElementTree.ElementTree-class.html#parse -xml.etree.ElementTree.ElementTree.findall xml.etree.ElementTree.ElementTree-class.html#findall -xml.etree.ElementTree.ElementTree.__init__ xml.etree.ElementTree.ElementTree-class.html#__init__ -xml.etree.ElementTree.ElementTree.findtext xml.etree.ElementTree.ElementTree-class.html#findtext -xml.etree.ElementTree.ElementTree.find xml.etree.ElementTree.ElementTree-class.html#find -xml.etree.ElementTree.ElementTree.write xml.etree.ElementTree.ElementTree-class.html#write -xml.etree.ElementTree.ElementTree._setroot xml.etree.ElementTree.ElementTree-class.html#_setroot -xml.etree.ElementTree.ElementTree.write_c14n xml.etree.ElementTree.ElementTree-class.html#write_c14n -xml.etree.ElementTree.ElementTree.getiterator xml.etree.ElementTree.ElementTree-class.html#getiterator -xml.etree.ElementTree.ElementTree.iter xml.etree.ElementTree.ElementTree-class.html#iter -xml.etree.ElementTree.ParseError xml.etree.ElementTree.ParseError-class.html -xml.etree.ElementTree.QName xml.etree.ElementTree.QName-class.html -xml.etree.ElementTree.QName.__str__ xml.etree.ElementTree.QName-class.html#__str__ -xml.etree.ElementTree.QName.__cmp__ xml.etree.ElementTree.QName-class.html#__cmp__ -xml.etree.ElementTree.QName.__hash__ xml.etree.ElementTree.QName-class.html#__hash__ -xml.etree.ElementTree.QName.__init__ xml.etree.ElementTree.QName-class.html#__init__ -xml.etree.ElementTree.TreeBuilder xml.etree.ElementTree.TreeBuilder-class.html -xml.etree.ElementTree.TreeBuilder.end xml.etree.ElementTree.TreeBuilder-class.html#end -xml.etree.ElementTree.TreeBuilder.start xml.etree.ElementTree.TreeBuilder-class.html#start -xml.etree.ElementTree.TreeBuilder._flush xml.etree.ElementTree.TreeBuilder-class.html#_flush -xml.etree.ElementTree.TreeBuilder.close xml.etree.ElementTree.TreeBuilder-class.html#close -xml.etree.ElementTree.TreeBuilder.data xml.etree.ElementTree.TreeBuilder-class.html#data -xml.etree.ElementTree.TreeBuilder.__init__ xml.etree.ElementTree.TreeBuilder-class.html#__init__ -xml.etree.ElementTree.XMLParser xml.etree.ElementTree.XMLParser-class.html -xml.etree.ElementTree.XMLParser.feed xml.etree.ElementTree.XMLParser-class.html#feed -xml.etree.ElementTree.XMLParser.__doctype xml.etree.ElementTree.XMLParser-class.html#__doctype -xml.etree.ElementTree.XMLParser._fixtext xml.etree.ElementTree.XMLParser-class.html#_fixtext -xml.etree.ElementTree.XMLParser._fixname xml.etree.ElementTree.XMLParser-class.html#_fixname -xml.etree.ElementTree.XMLParser.close xml.etree.ElementTree.XMLParser-class.html#close -xml.etree.ElementTree.XMLParser._start xml.etree.ElementTree.XMLParser-class.html#_start -xml.etree.ElementTree.XMLParser.__init__ xml.etree.ElementTree.XMLParser-class.html#__init__ -xml.etree.ElementTree.XMLParser._pi xml.etree.ElementTree.XMLParser-class.html#_pi -xml.etree.ElementTree.XMLParser._end xml.etree.ElementTree.XMLParser-class.html#_end -xml.etree.ElementTree.XMLParser._default xml.etree.ElementTree.XMLParser-class.html#_default -xml.etree.ElementTree.XMLParser._start_list xml.etree.ElementTree.XMLParser-class.html#_start_list -xml.etree.ElementTree.XMLParser._data xml.etree.ElementTree.XMLParser-class.html#_data -xml.etree.ElementTree.XMLParser._raiseerror xml.etree.ElementTree.XMLParser-class.html#_raiseerror -xml.etree.ElementTree.XMLParser._comment xml.etree.ElementTree.XMLParser-class.html#_comment -xml.etree.ElementTree.XMLParser.doctype xml.etree.ElementTree.XMLParser-class.html#doctype -xml.etree.ElementTree._IterParseIterator xml.etree.ElementTree._IterParseIterator-class.html -xml.etree.ElementTree._IterParseIterator.next xml.etree.ElementTree._IterParseIterator-class.html#next -xml.etree.ElementTree._IterParseIterator.__iter__ xml.etree.ElementTree._IterParseIterator-class.html#__iter__ -xml.etree.ElementTree._IterParseIterator.__init__ xml.etree.ElementTree._IterParseIterator-class.html#__init__ -xml.etree.ElementTree._SimpleElementPath xml.etree.ElementTree._SimpleElementPath-class.html -xml.etree.ElementTree._SimpleElementPath.iterfind xml.etree.ElementTree._SimpleElementPath-class.html#iterfind -xml.etree.ElementTree._SimpleElementPath.findtext xml.etree.ElementTree._SimpleElementPath-class.html#findtext -xml.etree.ElementTree._SimpleElementPath.find xml.etree.ElementTree._SimpleElementPath-class.html#find -xml.etree.ElementTree._SimpleElementPath.findall xml.etree.ElementTree._SimpleElementPath-class.html#findall diff --git a/doc/html/api/class-tree.html b/doc/html/api/class-tree.html deleted file mode 100644 index 5dcbdd71..00000000 --- a/doc/html/api/class-tree.html +++ /dev/null @@ -1,1355 +0,0 @@ - - - - - Class Hierarchy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
- [ Module Hierarchy - | Class Hierarchy ] -

-

Class Hierarchy

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/cssselect.parser.SelectorError-class.html b/doc/html/api/cssselect.parser.SelectorError-class.html deleted file mode 100644 index ea4435c2..00000000 --- a/doc/html/api/cssselect.parser.SelectorError-class.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - cssselect.parser.SelectorError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - cssselect :: - parser :: - SelectorError :: - Class SelectorError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SelectorError

-
-              object --+        
-                       |        
-exceptions.BaseException --+    
-                           |    
-        exceptions.Exception --+
-                               |
-                              SelectorError
-
- -
Known Subclasses:
-
- -
- -
-
-Common parent for :class:`SelectorSyntaxError` and
-:class:`ExpressionError`.
-
-You can just use ``except SelectorError:`` when calling
-:meth:`~GenericTranslator.css_to_xpath` and handle both exceptions types.
-
-
- - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from exceptions.Exception: - __init__, - __new__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/cssselect.parser.SelectorSyntaxError-class.html b/doc/html/api/cssselect.parser.SelectorSyntaxError-class.html deleted file mode 100644 index c5873a5e..00000000 --- a/doc/html/api/cssselect.parser.SelectorSyntaxError-class.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - cssselect.parser.SelectorSyntaxError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - cssselect :: - parser :: - SelectorSyntaxError :: - Class SelectorSyntaxError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SelectorSyntaxError

-
-                  object --+            
-                           |            
-    exceptions.BaseException --+        
-                               |        
-            exceptions.Exception --+    
-                                   |    
-                       SelectorError --+
-                                       |
-              object --+               |
-                       |               |
-exceptions.BaseException --+           |
-                           |           |
-        exceptions.Exception --+       |
-                               |       |
-        exceptions.StandardError --+   |
-                                   |   |
-              exceptions.SyntaxError --+
-                                       |
-                                      SelectorSyntaxError
-
- -
-Parsing a selector that does not match the grammar. - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from exceptions.SyntaxError: - __init__, - __new__, - __str__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.SyntaxError: - filename, - lineno, - msg, - offset, - print_file_and_line, - text -

-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/cssselect.xpath.ExpressionError-class.html b/doc/html/api/cssselect.xpath.ExpressionError-class.html deleted file mode 100644 index e3f944fc..00000000 --- a/doc/html/api/cssselect.xpath.ExpressionError-class.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - cssselect.xpath.ExpressionError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - cssselect :: - xpath :: - ExpressionError :: - Class ExpressionError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ExpressionError

-
-                  object --+            
-                           |            
-    exceptions.BaseException --+        
-                               |        
-            exceptions.Exception --+    
-                                   |    
-                parser.SelectorError --+
-                                       |
-              object --+               |
-                       |               |
-exceptions.BaseException --+           |
-                           |           |
-        exceptions.Exception --+       |
-                               |       |
-        exceptions.StandardError --+   |
-                                   |   |
-             exceptions.RuntimeError --+
-                                       |
-                                      ExpressionError
-
- -
-Unknown or unsupported selector (eg. pseudo-class). - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from exceptions.RuntimeError: - __init__, - __new__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/cssselect.xpath.XPathExpr-class.html b/doc/html/api/cssselect.xpath.XPathExpr-class.html deleted file mode 100644 index 9eccc917..00000000 --- a/doc/html/api/cssselect.xpath.XPathExpr-class.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - - cssselect.xpath.XPathExpr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - cssselect :: - xpath :: - XPathExpr :: - Class XPathExpr - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XPathExpr

-
-object --+
-         |
-        XPathExpr
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - path='', - element='*', - condition='', - star_prefix=False)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- - -
- -
-   - - - - - - -
__str__(self)
- str(x)
- - -
- -
-   - - - - - - -
add_condition(self, - condition) - - -
- -
-   - - - - - - -
add_name_test(self) - - -
- -
-   - - - - - - -
add_star_prefix(self)
- Append '*/' to the path to keep the context constrained -to a single parent.
- - -
- -
-   - - - - - - -
join(self, - combiner, - other) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - path='', - element='*', - condition='', - star_prefix=False) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__str__(self) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/deprecated-index.html b/doc/html/api/deprecated-index.html deleted file mode 100644 index 465805a0..00000000 --- a/doc/html/api/deprecated-index.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - Deprecation List - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

-

Deprecation List

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/epydoc.css b/doc/html/api/epydoc.css deleted file mode 100644 index 86d41706..00000000 --- a/doc/html/api/epydoc.css +++ /dev/null @@ -1,322 +0,0 @@ - - -/* Epydoc CSS Stylesheet - * - * This stylesheet can be used to customize the appearance of epydoc's - * HTML output. - * - */ - -/* Default Colors & Styles - * - Set the default foreground & background color with 'body'; and - * link colors with 'a:link' and 'a:visited'. - * - Use bold for decision list terms. - * - The heading styles defined here are used for headings *within* - * docstring descriptions. All headings used by epydoc itself use - * either class='epydoc' or class='toc' (CSS styles for both - * defined below). - */ -body { background: #ffffff; color: #000000; } -p { margin-top: 0.5em; margin-bottom: 0.5em; } -a:link { color: #0000ff; } -a:visited { color: #204080; } -dt { font-weight: bold; } -h1 { font-size: +140%; font-style: italic; - font-weight: bold; } -h2 { font-size: +125%; font-style: italic; - font-weight: bold; } -h3 { font-size: +110%; font-style: italic; - font-weight: normal; } -code { font-size: 100%; } -/* N.B.: class, not pseudoclass */ -a.link { font-family: monospace; } - -/* Page Header & Footer - * - The standard page header consists of a navigation bar (with - * pointers to standard pages such as 'home' and 'trees'); a - * breadcrumbs list, which can be used to navigate to containing - * classes or modules; options links, to show/hide private - * variables and to show/hide frames; and a page title (using - *

). The page title may be followed by a link to the - * corresponding source code (using 'span.codelink'). - * - The footer consists of a navigation bar, a timestamp, and a - * pointer to epydoc's homepage. - */ -h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; } -h2.epydoc { font-size: +130%; font-weight: bold; } -h3.epydoc { font-size: +115%; font-weight: bold; - margin-top: 0.2em; } -td h3.epydoc { font-size: +115%; font-weight: bold; - margin-bottom: 0; } -table.navbar { background: #a0c0ff; color: #000000; - border: 2px groove #c0d0d0; } -table.navbar table { color: #000000; } -th.navbar-select { background: #70b0ff; - color: #000000; } -table.navbar a { text-decoration: none; } -table.navbar a:link { color: #0000ff; } -table.navbar a:visited { color: #204080; } -span.breadcrumbs { font-size: 85%; font-weight: bold; } -span.options { font-size: 70%; } -span.codelink { font-size: 85%; } -td.footer { font-size: 85%; } - -/* Table Headers - * - Each summary table and details section begins with a 'header' - * row. This row contains a section title (marked by - * 'span.table-header') as well as a show/hide private link - * (marked by 'span.options', defined above). - * - Summary tables that contain user-defined groups mark those - * groups using 'group header' rows. - */ -td.table-header { background: #70b0ff; color: #000000; - border: 1px solid #608090; } -td.table-header table { color: #000000; } -td.table-header table a:link { color: #0000ff; } -td.table-header table a:visited { color: #204080; } -span.table-header { font-size: 120%; font-weight: bold; } -th.group-header { background: #c0e0f8; color: #000000; - text-align: left; font-style: italic; - font-size: 115%; - border: 1px solid #608090; } - -/* Summary Tables (functions, variables, etc) - * - Each object is described by a single row of the table with - * two cells. The left cell gives the object's type, and is - * marked with 'code.summary-type'. The right cell gives the - * object's name and a summary description. - * - CSS styles for the table's header and group headers are - * defined above, under 'Table Headers' - */ -table.summary { border-collapse: collapse; - background: #e8f0f8; color: #000000; - border: 1px solid #608090; - margin-bottom: 0.5em; } -td.summary { border: 1px solid #608090; } -code.summary-type { font-size: 85%; } -table.summary a:link { color: #0000ff; } -table.summary a:visited { color: #204080; } - - -/* Details Tables (functions, variables, etc) - * - Each object is described in its own div. - * - A single-row summary table w/ table-header is used as - * a header for each details section (CSS style for table-header - * is defined above, under 'Table Headers'). - */ -table.details { border-collapse: collapse; - background: #e8f0f8; color: #000000; - border: 1px solid #608090; - margin: .2em 0 0 0; } -table.details table { color: #000000; } -table.details a:link { color: #0000ff; } -table.details a:visited { color: #204080; } - -/* Fields */ -dl.fields { margin-left: 2em; margin-top: 1em; - margin-bottom: 1em; } -dl.fields dd ul { margin-left: 0em; padding-left: 0em; } -dl.fields dd ul li ul { margin-left: 2em; padding-left: 0em; } -div.fields { margin-left: 2em; } -div.fields p { margin-bottom: 0.5em; } - -/* Index tables (identifier index, term index, etc) - * - link-index is used for indices containing lists of links - * (namely, the identifier index & term index). - * - index-where is used in link indices for the text indicating - * the container/source for each link. - * - metadata-index is used for indices containing metadata - * extracted from fields (namely, the bug index & todo index). - */ -table.link-index { border-collapse: collapse; - background: #e8f0f8; color: #000000; - border: 1px solid #608090; } -td.link-index { border-width: 0px; } -table.link-index a:link { color: #0000ff; } -table.link-index a:visited { color: #204080; } -span.index-where { font-size: 70%; } -table.metadata-index { border-collapse: collapse; - background: #e8f0f8; color: #000000; - border: 1px solid #608090; - margin: .2em 0 0 0; } -td.metadata-index { border-width: 1px; border-style: solid; } -table.metadata-index a:link { color: #0000ff; } -table.metadata-index a:visited { color: #204080; } - -/* Function signatures - * - sig* is used for the signature in the details section. - * - .summary-sig* is used for the signature in the summary - * table, and when listing property accessor functions. - * */ -.sig-name { color: #006080; } -.sig-arg { color: #008060; } -.sig-default { color: #602000; } -.summary-sig { font-family: monospace; } -.summary-sig-name { color: #006080; font-weight: bold; } -table.summary a.summary-sig-name:link - { color: #006080; font-weight: bold; } -table.summary a.summary-sig-name:visited - { color: #006080; font-weight: bold; } -.summary-sig-arg { color: #006040; } -.summary-sig-default { color: #501800; } - -/* Subclass list - */ -ul.subclass-list { display: inline; } -ul.subclass-list li { display: inline; } - -/* To render variables, classes etc. like functions */ -table.summary .summary-name { color: #006080; font-weight: bold; - font-family: monospace; } -table.summary - a.summary-name:link { color: #006080; font-weight: bold; - font-family: monospace; } -table.summary - a.summary-name:visited { color: #006080; font-weight: bold; - font-family: monospace; } - -/* Variable values - * - In the 'variable details' sections, each varaible's value is - * listed in a 'pre.variable' box. The width of this box is - * restricted to 80 chars; if the value's repr is longer than - * this it will be wrapped, using a backslash marked with - * class 'variable-linewrap'. If the value's repr is longer - * than 3 lines, the rest will be ellided; and an ellipsis - * marker ('...' marked with 'variable-ellipsis') will be used. - * - If the value is a string, its quote marks will be marked - * with 'variable-quote'. - * - If the variable is a regexp, it is syntax-highlighted using - * the re* CSS classes. - */ -pre.variable { padding: .5em; margin: 0; - background: #dce4ec; color: #000000; - border: 1px solid #708890; } -.variable-linewrap { color: #604000; font-weight: bold; } -.variable-ellipsis { color: #604000; font-weight: bold; } -.variable-quote { color: #604000; font-weight: bold; } -.variable-group { color: #008000; font-weight: bold; } -.variable-op { color: #604000; font-weight: bold; } -.variable-string { color: #006030; } -.variable-unknown { color: #a00000; font-weight: bold; } -.re { color: #000000; } -.re-char { color: #006030; } -.re-op { color: #600000; } -.re-group { color: #003060; } -.re-ref { color: #404040; } - -/* Base tree - * - Used by class pages to display the base class hierarchy. - */ -pre.base-tree { font-size: 80%; margin: 0; } - -/* Frames-based table of contents headers - * - Consists of two frames: one for selecting modules; and - * the other listing the contents of the selected module. - * - h1.toc is used for each frame's heading - * - h2.toc is used for subheadings within each frame. - */ -h1.toc { text-align: center; font-size: 105%; - margin: 0; font-weight: bold; - padding: 0; } -h2.toc { font-size: 100%; font-weight: bold; - margin: 0.5em 0 0 -0.3em; } - -/* Syntax Highlighting for Source Code - * - doctest examples are displayed in a 'pre.py-doctest' block. - * If the example is in a details table entry, then it will use - * the colors specified by the 'table pre.py-doctest' line. - * - Source code listings are displayed in a 'pre.py-src' block. - * Each line is marked with 'span.py-line' (used to draw a line - * down the left margin, separating the code from the line - * numbers). Line numbers are displayed with 'span.py-lineno'. - * The expand/collapse block toggle button is displayed with - * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not - * modify the font size of the text.) - * - If a source code page is opened with an anchor, then the - * corresponding code block will be highlighted. The code - * block's header is highlighted with 'py-highlight-hdr'; and - * the code block's body is highlighted with 'py-highlight'. - * - The remaining py-* classes are used to perform syntax - * highlighting (py-string for string literals, py-name for names, - * etc.) - */ -pre.py-doctest { padding: .5em; margin: 1em; - background: #e8f0f8; color: #000000; - border: 1px solid #708890; } -table pre.py-doctest { background: #dce4ec; - color: #000000; } -pre.py-src { border: 2px solid #000000; - background: #f0f0f0; color: #000000; } -.py-line { border-left: 2px solid #000000; - margin-left: .2em; padding-left: .4em; } -.py-lineno { font-style: italic; font-size: 90%; - padding-left: .5em; } -a.py-toggle { text-decoration: none; } -div.py-highlight-hdr { border-top: 2px solid #000000; - border-bottom: 2px solid #000000; - background: #d8e8e8; } -div.py-highlight { border-bottom: 2px solid #000000; - background: #d0e0e0; } -.py-prompt { color: #005050; font-weight: bold;} -.py-more { color: #005050; font-weight: bold;} -.py-string { color: #006030; } -.py-comment { color: #003060; } -.py-keyword { color: #600000; } -.py-output { color: #404040; } -.py-name { color: #000050; } -.py-name:link { color: #000050 !important; } -.py-name:visited { color: #000050 !important; } -.py-number { color: #005000; } -.py-defname { color: #000060; font-weight: bold; } -.py-def-name { color: #000060; font-weight: bold; } -.py-base-class { color: #000060; } -.py-param { color: #000060; } -.py-docstring { color: #006030; } -.py-decorator { color: #804020; } -/* Use this if you don't want links to names underlined: */ -/*a.py-name { text-decoration: none; }*/ - -/* Graphs & Diagrams - * - These CSS styles are used for graphs & diagrams generated using - * Graphviz dot. 'img.graph-without-title' is used for bare - * diagrams (to remove the border created by making the image - * clickable). - */ -img.graph-without-title { border: none; } -img.graph-with-title { border: 1px solid #000000; } -span.graph-title { font-weight: bold; } -span.graph-caption { } - -/* General-purpose classes - * - 'p.indent-wrapped-lines' defines a paragraph whose first line - * is not indented, but whose subsequent lines are. - * - The 'nomargin-top' class is used to remove the top margin (e.g. - * from lists). The 'nomargin' class is used to remove both the - * top and bottom margin (but not the left or right margin -- - * for lists, that would cause the bullets to disappear.) - */ -p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em; - margin: 0; } -.nomargin-top { margin-top: 0; } -.nomargin { margin-top: 0; margin-bottom: 0; } - -/* HTML Log */ -div.log-block { padding: 0; margin: .5em 0 .5em 0; - background: #e8f0f8; color: #000000; - border: 1px solid #000000; } -div.log-error { padding: .1em .3em .1em .3em; margin: 4px; - background: #ffb0b0; color: #000000; - border: 1px solid #000000; } -div.log-warning { padding: .1em .3em .1em .3em; margin: 4px; - background: #ffffb0; color: #000000; - border: 1px solid #000000; } -div.log-info { padding: .1em .3em .1em .3em; margin: 4px; - background: #b0ffb0; color: #000000; - border: 1px solid #000000; } -h2.log-hdr { background: #70b0ff; color: #000000; - margin: 0; padding: 0em 0.5em 0em 0.5em; - border-bottom: 1px solid #000000; font-size: 110%; } -p.log { font-weight: bold; margin: .5em 0 .5em 0; } -tr.opt-changed { color: #000000; font-weight: bold; } -tr.opt-default { color: #606060; } -pre.log { margin: 0; padding: 0; padding-left: 1em; } diff --git a/doc/html/api/exceptions.AssertionError-class.html b/doc/html/api/exceptions.AssertionError-class.html deleted file mode 100644 index a7181e82..00000000 --- a/doc/html/api/exceptions.AssertionError-class.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - exceptions.AssertionError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - exceptions :: - AssertionError :: - Class AssertionError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class AssertionError

-
-   object --+            
-            |            
-BaseException --+        
-                |        
-        Exception --+    
-                    |    
-        StandardError --+
-                        |
-                       AssertionError
-
- -
-Assertion failed. - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/frames.html b/doc/html/api/frames.html deleted file mode 100644 index 7c416686..00000000 --- a/doc/html/api/frames.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - lxml API - - - - - - - - - diff --git a/doc/html/api/help.html b/doc/html/api/help.html deleted file mode 100644 index 64214066..00000000 --- a/doc/html/api/help.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - Help - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
- -

API Documentation

- -

This document contains the API (Application Programming Interface) -documentation for lxml API. Documentation for the Python -objects defined by the project is divided into separate pages for each -package, module, and class. The API documentation also includes two -pages containing information about the project as a whole: a trees -page, and an index page.

- -

Object Documentation

- -

Each Package Documentation page contains:

- - -

Each Module Documentation page contains:

- - -

Each Class Documentation page contains:

- - -

Project Documentation

- -

The Trees page contains the module and class hierarchies:

- - -

The Index page contains indices of terms and - identifiers:

- - -

The Table of Contents

- -

The table of contents occupies the two frames on the left side of -the window. The upper-left frame displays the project -contents, and the lower-left frame displays the module -contents:

- - - - - - - - - -
- Project
Contents
...
- API
Documentation
Frame


-
- Module
Contents
 
...
  -

- -

The project contents frame contains a list of all packages -and modules that are defined by the project. Clicking on an entry -will display its contents in the module contents frame. Clicking on a -special entry, labeled "Everything," will display the contents of -the entire project.

- -

The module contents frame contains a list of every -submodule, class, type, exception, function, and variable defined by a -module or package. Clicking on an entry will display its -documentation in the API documentation frame. Clicking on the name of -the module, at the top of the frame, will display the documentation -for the module itself.

- -

The "frames" and "no frames" buttons below the top -navigation bar can be used to control whether the table of contents is -displayed or not.

- -

The Navigation Bar

- -

A navigation bar is located at the top and bottom of every page. -It indicates what type of page you are currently viewing, and allows -you to go to related pages. The following table describes the labels -on the navigation bar. Note that not some labels (such as -[Parent]) are not displayed on all pages.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LabelHighlighted when...Links to...
[Parent](never highlighted) the parent of the current package
[Package]viewing a packagethe package containing the current object -
[Module]viewing a modulethe module containing the current object -
[Class]viewing a class the class containing the current object
[Trees]viewing the trees page the trees page
[Index]viewing the index page the index page
[Help]viewing the help page the help page
- -

The "show private" and "hide private" buttons below -the top navigation bar can be used to control whether documentation -for private objects is displayed. Private objects are usually defined -as objects whose (short) names begin with a single underscore, but do -not end with an underscore. For example, "_x", -"__pprint", and "epydoc.epytext._tokenize" -are private objects; but "re.sub", -"__init__", and "type_" are not. However, -if a module defines the "__all__" variable, then its -contents are used to decide which objects are private.

- -

A timestamp below the bottom navigation bar indicates when each -page was last updated.

- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-A.html b/doc/html/api/identifier-index-A.html deleted file mode 100644 index 96f58884..00000000 --- a/doc/html/api/identifier-index-A.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-B.html b/doc/html/api/identifier-index-B.html deleted file mode 100644 index 674e6b3b..00000000 --- a/doc/html/api/identifier-index-B.html +++ /dev/null @@ -1,241 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

B

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-C.html b/doc/html/api/identifier-index-C.html deleted file mode 100644 index 7ba78c10..00000000 --- a/doc/html/api/identifier-index-C.html +++ /dev/null @@ -1,502 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

C

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-D.html b/doc/html/api/identifier-index-D.html deleted file mode 100644 index 516883ca..00000000 --- a/doc/html/api/identifier-index-D.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

D

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-E.html b/doc/html/api/identifier-index-E.html deleted file mode 100644 index 3d9f63a0..00000000 --- a/doc/html/api/identifier-index-E.html +++ /dev/null @@ -1,732 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

E

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-F.html b/doc/html/api/identifier-index-F.html deleted file mode 100644 index b44f58b1..00000000 --- a/doc/html/api/identifier-index-F.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

F

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-G.html b/doc/html/api/identifier-index-G.html deleted file mode 100644 index 62be6d49..00000000 --- a/doc/html/api/identifier-index-G.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

G

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-H.html b/doc/html/api/identifier-index-H.html deleted file mode 100644 index 92ed17e7..00000000 --- a/doc/html/api/identifier-index-H.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

H

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-I.html b/doc/html/api/identifier-index-I.html deleted file mode 100644 index b5e1df12..00000000 --- a/doc/html/api/identifier-index-I.html +++ /dev/null @@ -1,517 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

I

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-J.html b/doc/html/api/identifier-index-J.html deleted file mode 100644 index e4ac10cc..00000000 --- a/doc/html/api/identifier-index-J.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

J

- - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-K.html b/doc/html/api/identifier-index-K.html deleted file mode 100644 index 7f9e88ee..00000000 --- a/doc/html/api/identifier-index-K.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

K

- - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-L.html b/doc/html/api/identifier-index-L.html deleted file mode 100644 index c1096519..00000000 --- a/doc/html/api/identifier-index-L.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

L

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-M.html b/doc/html/api/identifier-index-M.html deleted file mode 100644 index 35d2f3d6..00000000 --- a/doc/html/api/identifier-index-M.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

M

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-N.html b/doc/html/api/identifier-index-N.html deleted file mode 100644 index c3583603..00000000 --- a/doc/html/api/identifier-index-N.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

N

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-O.html b/doc/html/api/identifier-index-O.html deleted file mode 100644 index 7abcd4b7..00000000 --- a/doc/html/api/identifier-index-O.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

O

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-P.html b/doc/html/api/identifier-index-P.html deleted file mode 100644 index 8145f2b4..00000000 --- a/doc/html/api/identifier-index-P.html +++ /dev/null @@ -1,326 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

P

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-Q.html b/doc/html/api/identifier-index-Q.html deleted file mode 100644 index 16d5a2bc..00000000 --- a/doc/html/api/identifier-index-Q.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

Q

- - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-R.html b/doc/html/api/identifier-index-R.html deleted file mode 100644 index 09909e59..00000000 --- a/doc/html/api/identifier-index-R.html +++ /dev/null @@ -1,750 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

R

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-S.html b/doc/html/api/identifier-index-S.html deleted file mode 100644 index 04158380..00000000 --- a/doc/html/api/identifier-index-S.html +++ /dev/null @@ -1,1211 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

S

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-T.html b/doc/html/api/identifier-index-T.html deleted file mode 100644 index 3094db7d..00000000 --- a/doc/html/api/identifier-index-T.html +++ /dev/null @@ -1,3877 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

T

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-U.html b/doc/html/api/identifier-index-U.html deleted file mode 100644 index 18ff2d39..00000000 --- a/doc/html/api/identifier-index-U.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

U

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-V.html b/doc/html/api/identifier-index-V.html deleted file mode 100644 index 8cbe9676..00000000 --- a/doc/html/api/identifier-index-V.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

V

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-W.html b/doc/html/api/identifier-index-W.html deleted file mode 100644 index 13346e17..00000000 --- a/doc/html/api/identifier-index-W.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

W

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-X.html b/doc/html/api/identifier-index-X.html deleted file mode 100644 index 8cefb4a3..00000000 --- a/doc/html/api/identifier-index-X.html +++ /dev/null @@ -1,476 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

X

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-Y.html b/doc/html/api/identifier-index-Y.html deleted file mode 100644 index 4fad1ffe..00000000 --- a/doc/html/api/identifier-index-Y.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
-
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-Z.html b/doc/html/api/identifier-index-Z.html deleted file mode 100644 index b10f0617..00000000 --- a/doc/html/api/identifier-index-Z.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
-
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index-_.html b/doc/html/api/identifier-index-_.html deleted file mode 100644 index ebaa149d..00000000 --- a/doc/html/api/identifier-index-_.html +++ /dev/null @@ -1,2060 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

_

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/identifier-index.html b/doc/html/api/identifier-index.html deleted file mode 100644 index 24fa1b58..00000000 --- a/doc/html/api/identifier-index.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - - Identifier Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
[ - Identifiers -| Deprecations -]

- -
-

Identifier Index

-
-[ - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - _ -] -
- - - -

A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/index.html b/doc/html/api/index.html deleted file mode 100644 index 7c416686..00000000 --- a/doc/html/api/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - lxml API - - - - - - - - - diff --git a/doc/html/api/lxml-module.html b/doc/html/api/lxml-module.html deleted file mode 100644 index b503d208..00000000 --- a/doc/html/api/lxml-module.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - lxml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Package lxml

source code

- - - - - - - -
- - - - - -
Submodules[hide private]
-
-
- -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
get_include()
- Returns a list of header include paths (for lxml itself, libxml2 -and libxslt) needed to compile C code against lxml if it was built -with statically linked libraries.
- source code - -
- -
- - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __package__ = None
- hash(x) -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml-pysrc.html b/doc/html/api/lxml-pysrc.html deleted file mode 100644 index 4e789b32..00000000 --- a/doc/html/api/lxml-pysrc.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - lxml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Package lxml

-
- 1  # this is a package 
- 2   
-
3 -def get_include(): -
4 """ - 5 Returns a list of header include paths (for lxml itself, libxml2 - 6 and libxslt) needed to compile C code against lxml if it was built - 7 with statically linked libraries. - 8 """ - 9 import os -10 lxml_path = __path__[0] -11 include_path = os.path.join(lxml_path, 'includes') -12 includes = [include_path, lxml_path] -13 -14 for name in os.listdir(include_path): -15 path = os.path.join(include_path, name) -16 if os.path.isdir(path): -17 includes.append(path) -18 -19 return includes -
20 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.ElementInclude-module.html b/doc/html/api/lxml.ElementInclude-module.html deleted file mode 100644 index 8facdcc3..00000000 --- a/doc/html/api/lxml.ElementInclude-module.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - lxml.ElementInclude - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module ElementInclude - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module ElementInclude

source code

-

Limited XInclude support for the ElementTree package.

-

While lxml.etree has full support for XInclude (see -etree.ElementTree.xinclude()), this module provides a simpler, pure -Python, ElementTree compatible implementation that supports a simple -form of custom URL resolvers.

- - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - FatalIncludeError -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
default_loader(href, - parse, - encoding=None) - source code - -
- -
-   - - - - - - -
_lxml_default_loader(href, - parse, - encoding=None, - parser=None) - source code - -
- -
-   - - - - - - -
_wrap_et_loader(loader) - source code - -
- -
-   - - - - - - -
include(elem, - loader=None, - base_url=None) - source code - -
- -
-   - - - - - - -
_include(elem, - loader=None, - _parent_hrefs=None, - base_url=None) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - XINCLUDE = '{http://www.w3.org/2001/XInclude}' -
-   - - XINCLUDE_INCLUDE = '{http://www.w3.org/2001/XInclude}include' -
-   - - XINCLUDE_FALLBACK = '{http://www.w3.org/2001/XInclude}fallback' -
-   - - XINCLUDE_ITER_TAG = '{http://www.w3.org/2001/XInclude}*' -
-   - - __package__ = 'lxml' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.ElementInclude-pysrc.html b/doc/html/api/lxml.ElementInclude-pysrc.html deleted file mode 100644 index e1ec75d0..00000000 --- a/doc/html/api/lxml.ElementInclude-pysrc.html +++ /dev/null @@ -1,559 +0,0 @@ - - - - - lxml.ElementInclude - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module ElementInclude - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.ElementInclude

-
-  1  # 
-  2  # ElementTree 
-  3  # $Id: ElementInclude.py 1862 2004-06-18 07:31:02Z Fredrik $ 
-  4  # 
-  5  # limited xinclude support for element trees 
-  6  # 
-  7  # history: 
-  8  # 2003-08-15 fl   created 
-  9  # 2003-11-14 fl   fixed default loader 
- 10  # 
- 11  # Copyright (c) 2003-2004 by Fredrik Lundh.  All rights reserved. 
- 12  # 
- 13  # fredrik@pythonware.com 
- 14  # http://www.pythonware.com 
- 15  # 
- 16  # -------------------------------------------------------------------- 
- 17  # The ElementTree toolkit is 
- 18  # 
- 19  # Copyright (c) 1999-2004 by Fredrik Lundh 
- 20  # 
- 21  # By obtaining, using, and/or copying this software and/or its 
- 22  # associated documentation, you agree that you have read, understood, 
- 23  # and will comply with the following terms and conditions: 
- 24  # 
- 25  # Permission to use, copy, modify, and distribute this software and 
- 26  # its associated documentation for any purpose and without fee is 
- 27  # hereby granted, provided that the above copyright notice appears in 
- 28  # all copies, and that both that copyright notice and this permission 
- 29  # notice appear in supporting documentation, and that the name of 
- 30  # Secret Labs AB or the author not be used in advertising or publicity 
- 31  # pertaining to distribution of the software without specific, written 
- 32  # prior permission. 
- 33  # 
- 34  # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD 
- 35  # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- 
- 36  # ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR 
- 37  # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
- 38  # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
- 39  # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
- 40  # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
- 41  # OF THIS SOFTWARE. 
- 42  # -------------------------------------------------------------------- 
- 43   
- 44  """ 
- 45  Limited XInclude support for the ElementTree package. 
- 46   
- 47  While lxml.etree has full support for XInclude (see 
- 48  `etree.ElementTree.xinclude()`), this module provides a simpler, pure 
- 49  Python, ElementTree compatible implementation that supports a simple 
- 50  form of custom URL resolvers. 
- 51  """ 
- 52   
- 53  from lxml import etree 
- 54  try: 
- 55      from urlparse import urljoin 
- 56      from urllib2 import urlopen 
- 57  except ImportError: 
- 58      # Python 3 
- 59      from urllib.parse import urljoin 
- 60      from urllib.request import urlopen 
- 61   
- 62  XINCLUDE = "{http://www.w3.org/2001/XInclude}" 
- 63   
- 64  XINCLUDE_INCLUDE = XINCLUDE + "include" 
- 65  XINCLUDE_FALLBACK = XINCLUDE + "fallback" 
- 66  XINCLUDE_ITER_TAG = XINCLUDE + "*" 
- 67   
- 68  ## 
- 69  # Fatal include error. 
- 70   
-
71 -class FatalIncludeError(etree.LxmlSyntaxError): -
72 pass -
73 - 74 ## - 75 # ET compatible default loader. - 76 # This loader reads an included resource from disk. - 77 # - 78 # @param href Resource reference. - 79 # @param parse Parse mode. Either "xml" or "text". - 80 # @param encoding Optional text encoding. - 81 # @return The expanded resource. If the parse mode is "xml", this - 82 # is an ElementTree instance. If the parse mode is "text", this - 83 # is a Unicode string. If the loader fails, it can return None - 84 # or raise an IOError exception. - 85 # @throws IOError If the loader fails to load the resource. - 86 -
87 -def default_loader(href, parse, encoding=None): -
88 file = open(href, 'rb') - 89 if parse == "xml": - 90 data = etree.parse(file).getroot() - 91 else: - 92 data = file.read() - 93 if not encoding: - 94 encoding = 'utf-8' - 95 data = data.decode(encoding) - 96 file.close() - 97 return data -
98 - 99 ## -100 # Default loader used by lxml.etree - handles custom resolvers properly -101 # -102 -
103 -def _lxml_default_loader(href, parse, encoding=None, parser=None): -
104 if parse == "xml": -105 data = etree.parse(href, parser).getroot() -106 else: -107 if "://" in href: -108 f = urlopen(href) -109 else: -110 f = open(href, 'rb') -111 data = f.read() -112 f.close() -113 if not encoding: -114 encoding = 'utf-8' -115 data = data.decode(encoding) -116 return data -
117 -118 ## -119 # Wrapper for ET compatibility - drops the parser -120 -
121 -def _wrap_et_loader(loader): -
122 def load(href, parse, encoding=None, parser=None): -123 return loader(href, parse, encoding) -
124 return load -125 -126 -127 ## -128 # Expand XInclude directives. -129 # -130 # @param elem Root element. -131 # @param loader Optional resource loader. If omitted, it defaults -132 # to {@link default_loader}. If given, it should be a callable -133 # that implements the same interface as <b>default_loader</b>. -134 # @param base_url The base URL of the original file, to resolve -135 # relative include file references. -136 # @throws FatalIncludeError If the function fails to include a given -137 # resource, or if the tree contains malformed XInclude elements. -138 # @throws IOError If the function fails to load a given resource. -139 # @returns the node or its replacement if it was an XInclude node -140 -
141 -def include(elem, loader=None, base_url=None): -
142 if base_url is None: -143 if hasattr(elem, 'getroot'): -144 tree = elem -145 elem = elem.getroot() -146 else: -147 tree = elem.getroottree() -148 if hasattr(tree, 'docinfo'): -149 base_url = tree.docinfo.URL -150 elif hasattr(elem, 'getroot'): -151 elem = elem.getroot() -152 _include(elem, loader, base_url=base_url) -
153 -
154 -def _include(elem, loader=None, _parent_hrefs=None, base_url=None): -
155 if loader is not None: -156 load_include = _wrap_et_loader(loader) -157 else: -158 load_include = _lxml_default_loader -159 -160 if _parent_hrefs is None: -161 _parent_hrefs = set() -162 -163 parser = elem.getroottree().parser -164 -165 include_elements = list( -166 elem.iter(XINCLUDE_ITER_TAG)) -167 -168 for e in include_elements: -169 if e.tag == XINCLUDE_INCLUDE: -170 # process xinclude directive -171 href = urljoin(base_url, e.get("href")) -172 parse = e.get("parse", "xml") -173 parent = e.getparent() -174 if parse == "xml": -175 if href in _parent_hrefs: -176 raise FatalIncludeError( -177 "recursive include of %r detected" % href -178 ) -179 _parent_hrefs.add(href) -180 node = load_include(href, parse, parser=parser) -181 if node is None: -182 raise FatalIncludeError( -183 "cannot load %r as %r" % (href, parse) -184 ) -185 node = _include(node, loader, _parent_hrefs) -186 if e.tail: -187 node.tail = (node.tail or "") + e.tail -188 if parent is None: -189 return node # replaced the root node! -190 parent.replace(e, node) -191 elif parse == "text": -192 text = load_include(href, parse, encoding=e.get("encoding")) -193 if text is None: -194 raise FatalIncludeError( -195 "cannot load %r as %r" % (href, parse) -196 ) -197 predecessor = e.getprevious() -198 if predecessor is not None: -199 predecessor.tail = (predecessor.tail or "") + text -200 elif parent is None: -201 return text # replaced the root node! -202 else: -203 parent.text = (parent.text or "") + text + (e.tail or "") -204 parent.remove(e) -205 else: -206 raise FatalIncludeError( -207 "unknown parse type in xi:include tag (%r)" % parse -208 ) -209 elif e.tag == XINCLUDE_FALLBACK: -210 parent = e.getparent() -211 if parent is not None and parent.tag != XINCLUDE_INCLUDE: -212 raise FatalIncludeError( -213 "xi:fallback tag must be child of xi:include (%r)" % e.tag -214 ) -215 else: -216 raise FatalIncludeError( -217 "Invalid element found in XInclude namespace (%r)" % e.tag -218 ) -219 return elem -
220 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.ElementInclude.FatalIncludeError-class.html b/doc/html/api/lxml.ElementInclude.FatalIncludeError-class.html deleted file mode 100644 index f9062d2c..00000000 --- a/doc/html/api/lxml.ElementInclude.FatalIncludeError-class.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - lxml.ElementInclude.FatalIncludeError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module ElementInclude :: - Class FatalIncludeError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class FatalIncludeError

source code

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                     etree.Error --+        
-                                   |        
-                     etree.LxmlError --+    
-                                       |    
-              object --+               |    
-                       |               |    
-exceptions.BaseException --+           |    
-                           |           |    
-        exceptions.Exception --+       |    
-                               |       |    
-        exceptions.StandardError --+   |    
-                                   |   |    
-              exceptions.SyntaxError --+    
-                                       |    
-                   etree.LxmlSyntaxError --+
-                                           |
-                                          FatalIncludeError
-
- -
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from etree.LxmlError: - __init__, - __new__ -

-

Inherited from exceptions.SyntaxError: - __str__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from etree.LxmlSyntaxError: - __qualname__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.SyntaxError: - filename, - lineno, - msg, - offset, - print_file_and_line, - text -

-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.builder-module.html b/doc/html/api/lxml.builder-module.html deleted file mode 100644 index 06cb83fa..00000000 --- a/doc/html/api/lxml.builder-module.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - lxml.builder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module builder - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module builder

source code

-The E Element factory for generating XML documents. - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - basestring
- str(object='') -> string -
-   - - unicode
- str(object='') -> string -
-   - - ElementMaker
- Element generator factory. -
- - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
__pyx_unpickle_ElementMaker(...) - source code - -
- -
-   - - - - - - -
__reduce_cython__(...) - source code - -
- -
-   - - - - - - -
__setstate_cython__(...) - source code - -
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - E = <lxml.builder.ElementMaker object> -
-   - - __package__ = 'lxml' -
-   - - __pyx_capi__ = {'ET': <capsule object "PyObject *" at 0x7f42b3... -
-   - - __test__ = {} -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

__pyx_capi__

- -
-
-
-
Value:
-
-{'ET': <capsule object "PyObject *" at 0x7f42b3a44510>,
- 'partial': <capsule object "PyObject *" at 0x7f42b3a445a0>}
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.builder-pysrc.html b/doc/html/api/lxml.builder-pysrc.html deleted file mode 100644 index b6ea0596..00000000 --- a/doc/html/api/lxml.builder-pysrc.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - - lxml.builder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module builder - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.builder

-
-  1  # 
-  2  # Element generator factory by Fredrik Lundh. 
-  3  # 
-  4  # Source: 
-  5  #    http://online.effbot.org/2006_11_01_archive.htm#et-builder 
-  6  #    http://effbot.python-hosting.com/file/stuff/sandbox/elementlib/builder.py 
-  7  # 
-  8  # -------------------------------------------------------------------- 
-  9  # The ElementTree toolkit is 
- 10  # 
- 11  # Copyright (c) 1999-2004 by Fredrik Lundh 
- 12  # 
- 13  # By obtaining, using, and/or copying this software and/or its 
- 14  # associated documentation, you agree that you have read, understood, 
- 15  # and will comply with the following terms and conditions: 
- 16  # 
- 17  # Permission to use, copy, modify, and distribute this software and 
- 18  # its associated documentation for any purpose and without fee is 
- 19  # hereby granted, provided that the above copyright notice appears in 
- 20  # all copies, and that both that copyright notice and this permission 
- 21  # notice appear in supporting documentation, and that the name of 
- 22  # Secret Labs AB or the author not be used in advertising or publicity 
- 23  # pertaining to distribution of the software without specific, written 
- 24  # prior permission. 
- 25  # 
- 26  # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD 
- 27  # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- 
- 28  # ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR 
- 29  # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
- 30  # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
- 31  # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
- 32  # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
- 33  # OF THIS SOFTWARE. 
- 34  # -------------------------------------------------------------------- 
- 35   
- 36  """ 
- 37  The ``E`` Element factory for generating XML documents. 
- 38  """ 
- 39   
- 40  import lxml.etree as ET 
- 41   
- 42  from functools import partial 
- 43   
- 44  try: 
- 45      basestring 
- 46  except NameError: 
- 47      basestring = str 
- 48   
- 49  try: 
- 50      unicode 
- 51  except NameError: 
- 52      unicode = str 
- 53   
- 54   
-
55 -class ElementMaker(object): -
56 """Element generator factory. - 57 - 58 Unlike the ordinary Element factory, the E factory allows you to pass in - 59 more than just a tag and some optional attributes; you can also pass in - 60 text and other elements. The text is added as either text or tail - 61 attributes, and elements are inserted at the right spot. Some small - 62 examples:: - 63 - 64 >>> from lxml import etree as ET - 65 >>> from lxml.builder import E - 66 - 67 >>> ET.tostring(E("tag")) - 68 '<tag/>' - 69 >>> ET.tostring(E("tag", "text")) - 70 '<tag>text</tag>' - 71 >>> ET.tostring(E("tag", "text", key="value")) - 72 '<tag key="value">text</tag>' - 73 >>> ET.tostring(E("tag", E("subtag", "text"), "tail")) - 74 '<tag><subtag>text</subtag>tail</tag>' - 75 - 76 For simple tags, the factory also allows you to write ``E.tag(...)`` instead - 77 of ``E('tag', ...)``:: - 78 - 79 >>> ET.tostring(E.tag()) - 80 '<tag/>' - 81 >>> ET.tostring(E.tag("text")) - 82 '<tag>text</tag>' - 83 >>> ET.tostring(E.tag(E.subtag("text"), "tail")) - 84 '<tag><subtag>text</subtag>tail</tag>' - 85 - 86 Here's a somewhat larger example; this shows how to generate HTML - 87 documents, using a mix of prepared factory functions for inline elements, - 88 nested ``E.tag`` calls, and embedded XHTML fragments:: - 89 - 90 # some common inline elements - 91 A = E.a - 92 I = E.i - 93 B = E.b - 94 - 95 def CLASS(v): - 96 # helper function, 'class' is a reserved word - 97 return {'class': v} - 98 - 99 page = ( -100 E.html( -101 E.head( -102 E.title("This is a sample document") -103 ), -104 E.body( -105 E.h1("Hello!", CLASS("title")), -106 E.p("This is a paragraph with ", B("bold"), " text in it!"), -107 E.p("This is another paragraph, with a ", -108 A("link", href="http://www.python.org"), "."), -109 E.p("Here are some reserved characters: <spam&egg>."), -110 ET.XML("<p>And finally, here is an embedded XHTML fragment.</p>"), -111 ) -112 ) -113 ) -114 -115 print ET.tostring(page) -116 -117 Here's a prettyprinted version of the output from the above script:: -118 -119 <html> -120 <head> -121 <title>This is a sample document</title> -122 </head> -123 <body> -124 <h1 class="title">Hello!</h1> -125 <p>This is a paragraph with <b>bold</b> text in it!</p> -126 <p>This is another paragraph, with <a href="http://www.python.org">link</a>.</p> -127 <p>Here are some reserved characters: &lt;spam&amp;egg&gt;.</p> -128 <p>And finally, here is an embedded XHTML fragment.</p> -129 </body> -130 </html> -131 -132 For namespace support, you can pass a namespace map (``nsmap``) -133 and/or a specific target ``namespace`` to the ElementMaker class:: -134 -135 >>> E = ElementMaker(namespace="http://my.ns/") -136 >>> print(ET.tostring( E.test )) -137 <test xmlns="http://my.ns/"/> -138 -139 >>> E = ElementMaker(namespace="http://my.ns/", nsmap={'p':'http://my.ns/'}) -140 >>> print(ET.tostring( E.test )) -141 <p:test xmlns:p="http://my.ns/"/> -142 """ -143 -
144 - def __init__(self, typemap=None, -145 namespace=None, nsmap=None, makeelement=None): -
146 if namespace is not None: -147 self._namespace = '{' + namespace + '}' -148 else: -149 self._namespace = None -150 -151 if nsmap: -152 self._nsmap = dict(nsmap) -153 else: -154 self._nsmap = None -155 -156 if makeelement is not None: -157 assert callable(makeelement) -158 self._makeelement = makeelement -159 else: -160 self._makeelement = ET.Element -161 -162 # initialize type map for this element factory -163 -164 if typemap: -165 typemap = dict(typemap) -166 else: -167 typemap = {} -168 -169 def add_text(elem, item): -170 try: -171 elem[-1].tail = (elem[-1].tail or "") + item -172 except IndexError: -173 elem.text = (elem.text or "") + item -
174 -175 def add_cdata(elem, cdata): -176 if elem.text: -177 raise ValueError("Can't add a CDATA section. Element already has some text: %r" % elem.text) -178 elem.text = cdata -
179 -180 if str not in typemap: -181 typemap[str] = add_text -182 if unicode not in typemap: -183 typemap[unicode] = add_text -184 if ET.CDATA not in typemap: -185 typemap[ET.CDATA] = add_cdata -186 -187 def add_dict(elem, item): -188 attrib = elem.attrib -189 for k, v in item.items(): -190 if isinstance(v, basestring): -191 attrib[k] = v -192 else: -193 attrib[k] = typemap[type(v)](None, v) -194 if dict not in typemap: -195 typemap[dict] = add_dict -196 -197 self._typemap = typemap -198 -
199 - def __call__(self, tag, *children, **attrib): -
200 typemap = self._typemap -201 -202 if self._namespace is not None and tag[0] != '{': -203 tag = self._namespace + tag -204 elem = self._makeelement(tag, nsmap=self._nsmap) -205 if attrib: -206 typemap[dict](elem, attrib) -207 -208 for item in children: -209 if callable(item): -210 item = item() -211 t = typemap.get(type(item)) -212 if t is None: -213 if ET.iselement(item): -214 elem.append(item) -215 continue -216 for basetype in type(item).__mro__: -217 # See if the typemap knows of any of this type's bases. -218 t = typemap.get(basetype) -219 if t is not None: -220 break -221 else: -222 raise TypeError("bad argument type: %s(%r)" % -223 (type(item).__name__, item)) -224 v = t(elem, item) -225 if v: -226 typemap.get(type(v))(elem, v) -227 -228 return elem -
229 -
230 - def __getattr__(self, tag): -
231 return partial(self, tag) -
232 -233 -234 # create factory object -235 E = ElementMaker() -236 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.builder.ElementMaker-class.html b/doc/html/api/lxml.builder.ElementMaker-class.html deleted file mode 100644 index 9e186312..00000000 --- a/doc/html/api/lxml.builder.ElementMaker-class.html +++ /dev/null @@ -1,536 +0,0 @@ - - - - - lxml.builder.ElementMaker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module builder :: - Class ElementMaker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementMaker

source code

-
-object --+
-         |
-        ElementMaker
-
- -
-

Element generator factory.

-

Unlike the ordinary Element factory, the E factory allows you to pass in -more than just a tag and some optional attributes; you can also pass in -text and other elements. The text is added as either text or tail -attributes, and elements are inserted at the right spot. Some small -examples:

-
->>> from lxml import etree as ET
->>> from lxml.builder import E
-
->>> ET.tostring(E("tag"))
-'<tag/>'
->>> ET.tostring(E("tag", "text"))
-'<tag>text</tag>'
->>> ET.tostring(E("tag", "text", key="value"))
-'<tag key="value">text</tag>'
->>> ET.tostring(E("tag", E("subtag", "text"), "tail"))
-'<tag><subtag>text</subtag>tail</tag>'
-
-

For simple tags, the factory also allows you to write E.tag(...) instead -of E('tag', ...):

-
->>> ET.tostring(E.tag())
-'<tag/>'
->>> ET.tostring(E.tag("text"))
-'<tag>text</tag>'
->>> ET.tostring(E.tag(E.subtag("text"), "tail"))
-'<tag><subtag>text</subtag>tail</tag>'
-
-

Here's a somewhat larger example; this shows how to generate HTML -documents, using a mix of prepared factory functions for inline elements, -nested E.tag calls, and embedded XHTML fragments:

-
-# some common inline elements
-A = E.a
-I = E.i
-B = E.b
-
-def CLASS(v):
-    # helper function, 'class' is a reserved word
-    return {'class': v}
-
-page = (
-    E.html(
-        E.head(
-            E.title("This is a sample document")
-        ),
-        E.body(
-            E.h1("Hello!", CLASS("title")),
-            E.p("This is a paragraph with ", B("bold"), " text in it!"),
-            E.p("This is another paragraph, with a ",
-                A("link", href="http://www.python.org"), "."),
-            E.p("Here are some reserved characters: <spam&egg>."),
-            ET.XML("<p>And finally, here is an embedded XHTML fragment.</p>"),
-        )
-    )
-)
-
-print ET.tostring(page)
-
-

Here's a prettyprinted version of the output from the above script:

-
-<html>
-  <head>
-    <title>This is a sample document</title>
-  </head>
-  <body>
-    <h1 class="title">Hello!</h1>
-    <p>This is a paragraph with <b>bold</b> text in it!</p>
-    <p>This is another paragraph, with <a href="http://www.python.org">link</a>.</p>
-    <p>Here are some reserved characters: &lt;spam&amp;egg&gt;.</p>
-    <p>And finally, here is an embedded XHTML fragment.</p>
-  </body>
-</html>
-
-

For namespace support, you can pass a namespace map (nsmap) -and/or a specific target namespace to the ElementMaker class:

-
->>> E = ElementMaker(namespace="http://my.ns/")
->>> print(ET.tostring( E.test ))
-<test xmlns="http://my.ns/"/>
-
->>> E = ElementMaker(namespace="http://my.ns/", nsmap={'p':'http://my.ns/'})
->>> print(ET.tostring( E.test ))
-<p:test xmlns:p="http://my.ns/"/>
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - typemap=None, - namespace=None, - nsmap=None, - makeelement=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__call__(x, - ...)
- x(...)
- source code - -
- -
-   - - - - - - -
__getattr__(self, - tag) - source code - -
- -
-   - - - - - - -
__getattribute__(...)
- x.__getattribute__('name') <==> x.name
- source code - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - source code - -
- -
-   - - - - - - -
__reduce__(...)
- helper for pickle
- source code - -
- -
-   - - - - - - -
__setstate__(...) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __hash__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - _makeelement -
-   - - _namespace -
-   - - _nsmap -
-   - - _typemap -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - typemap=None, - namespace=None, - nsmap=None, - makeelement=None) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__getattribute__(...) -

-
source code  -
- - x.__getattribute__('name') <==> x.name -
-
Overrides: - object.__getattribute__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
source code  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__reduce__(...) -

-
source code  -
- - helper for pickle -
-
Overrides: - object.__reduce__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.cssselect-module.html b/doc/html/api/lxml.cssselect-module.html deleted file mode 100644 index 04cf864a..00000000 --- a/doc/html/api/lxml.cssselect-module.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - lxml.cssselect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module cssselect - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module cssselect

source code

-

CSS Selectors based on XPath.

-

This module supports selecting XML/HTML tags based on CSS selectors. -See the CSSSelector class for details.

-

This is a thin wrapper around cssselect 0.7 or later.

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - SelectorSyntaxError
- Parsing a selector that does not match the grammar. -
-   - - ExpressionError
- Unknown or unsupported selector (eg. pseudo-class). -
-   - - SelectorError
- Common parent for :class:`SelectorSyntaxError` and -:class:`ExpressionError`. -
-   - - LxmlTranslator
- A custom CSS selector to XPath translator with lxml-specific extensions. -
-   - - LxmlHTMLTranslator
- lxml extensions + HTML support. -
-   - - CSSSelector
- A CSS selector. -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
_make_lower_case(context, - s) - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - ns = FunctionNamespace('http://codespeak.net/lxml/css/') -
-   - - __package__ = 'lxml' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.cssselect-pysrc.html b/doc/html/api/lxml.cssselect-pysrc.html deleted file mode 100644 index 3bb3e257..00000000 --- a/doc/html/api/lxml.cssselect-pysrc.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - lxml.cssselect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module cssselect - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.cssselect

-
-  1  """CSS Selectors based on XPath. 
-  2   
-  3  This module supports selecting XML/HTML tags based on CSS selectors. 
-  4  See the `CSSSelector` class for details. 
-  5   
-  6  This is a thin wrapper around cssselect 0.7 or later. 
-  7  """ 
-  8   
-  9  from __future__ import absolute_import 
- 10   
- 11  from . import etree 
- 12  try: 
- 13      import cssselect as external_cssselect 
- 14  except ImportError: 
- 15      raise ImportError( 
- 16          'cssselect does not seem to be installed. ' 
- 17          'See http://packages.python.org/cssselect/') 
- 18   
- 19   
- 20  SelectorSyntaxError = external_cssselect.SelectorSyntaxError 
- 21  ExpressionError = external_cssselect.ExpressionError 
- 22  SelectorError = external_cssselect.SelectorError 
- 23   
- 24   
- 25  __all__ = ['SelectorSyntaxError', 'ExpressionError', 'SelectorError', 
- 26             'CSSSelector'] 
- 27   
- 28   
-
29 -class LxmlTranslator(external_cssselect.GenericTranslator): -
30 """ - 31 A custom CSS selector to XPath translator with lxml-specific extensions. - 32 """ -
33 - def xpath_contains_function(self, xpath, function): -
34 # Defined there, removed in later drafts: - 35 # http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#content-selectors - 36 if function.argument_types() not in (['STRING'], ['IDENT']): - 37 raise ExpressionError( - 38 "Expected a single string or ident for :contains(), got %r" - 39 % function.arguments) - 40 value = function.arguments[0].value - 41 return xpath.add_condition( - 42 'contains(__lxml_internal_css:lower-case(string(.)), %s)' - 43 % self.xpath_literal(value.lower())) -
44 - 45 -
46 -class LxmlHTMLTranslator(LxmlTranslator, external_cssselect.HTMLTranslator): -
47 """ - 48 lxml extensions + HTML support. - 49 """ -
50 - 51 -
52 -def _make_lower_case(context, s): -
53 return s.lower() -
54 - 55 ns = etree.FunctionNamespace('http://codespeak.net/lxml/css/') - 56 ns.prefix = '__lxml_internal_css' - 57 ns['lower-case'] = _make_lower_case - 58 - 59 -
60 -class CSSSelector(etree.XPath): -
61 """A CSS selector. - 62 - 63 Usage:: - 64 - 65 >>> from lxml import etree, cssselect - 66 >>> select = cssselect.CSSSelector("a tag > child") - 67 - 68 >>> root = etree.XML("<a><b><c/><tag><child>TEXT</child></tag></b></a>") - 69 >>> [ el.tag for el in select(root) ] - 70 ['child'] - 71 - 72 To use CSS namespaces, you need to pass a prefix-to-namespace - 73 mapping as ``namespaces`` keyword argument:: - 74 - 75 >>> rdfns = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' - 76 >>> select_ns = cssselect.CSSSelector('root > rdf|Description', - 77 ... namespaces={'rdf': rdfns}) - 78 - 79 >>> rdf = etree.XML(( - 80 ... '<root xmlns:rdf="%s">' - 81 ... '<rdf:Description>blah</rdf:Description>' - 82 ... '</root>') % rdfns) - 83 >>> [(el.tag, el.text) for el in select_ns(rdf)] - 84 [('{http://www.w3.org/1999/02/22-rdf-syntax-ns#}Description', 'blah')] - 85 - 86 """ -
87 - def __init__(self, css, namespaces=None, translator='xml'): -
88 if translator == 'xml': - 89 translator = LxmlTranslator() - 90 elif translator == 'html': - 91 translator = LxmlHTMLTranslator() - 92 elif translator == 'xhtml': - 93 translator = LxmlHTMLTranslator(xhtml=True) - 94 path = translator.css_to_xpath(css) - 95 etree.XPath.__init__(self, path, namespaces=namespaces) - 96 self.css = css -
97 -
98 - def __repr__(self): -
99 return '<%s %s for %r>' % ( -100 self.__class__.__name__, -101 hex(abs(id(self)))[2:], -102 self.css) -
103 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.cssselect.CSSSelector-class.html b/doc/html/api/lxml.cssselect.CSSSelector-class.html deleted file mode 100644 index e92bab86..00000000 --- a/doc/html/api/lxml.cssselect.CSSSelector-class.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - lxml.cssselect.CSSSelector - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module cssselect :: - Class CSSSelector - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class CSSSelector

source code

-
-               object --+        
-                        |        
-etree._XPathEvaluatorBase --+    
-                            |    
-                  etree.XPath --+
-                                |
-                               CSSSelector
-
- -
-

A CSS selector.

-

Usage:

-
->>> from lxml import etree, cssselect
->>> select = cssselect.CSSSelector("a tag > child")
-
->>> root = etree.XML("<a><b><c/><tag><child>TEXT</child></tag></b></a>")
->>> [ el.tag for el in select(root) ]
-['child']
-
-

To use CSS namespaces, you need to pass a prefix-to-namespace -mapping as namespaces keyword argument:

-
->>> rdfns = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
->>> select_ns = cssselect.CSSSelector('root > rdf|Description',
-...                                   namespaces={'rdf': rdfns})
-
->>> rdf = etree.XML((
-...     '<root xmlns:rdf="%s">'
-...       '<rdf:Description>blah</rdf:Description>'
-...     '</root>') % rdfns)
->>> [(el.tag, el.text) for el in select_ns(rdf)]
-[('{http://www.w3.org/1999/02/22-rdf-syntax-ns#}Description', 'blah')]
-
- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - css, - namespaces=None, - translator='xml')
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-

Inherited from etree.XPath: - __call__, - __new__ -

-

Inherited from etree._XPathEvaluatorBase: - evaluate -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree.XPath: - path -

-

Inherited from etree._XPathEvaluatorBase: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - css, - namespaces=None, - translator='xml') -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.cssselect.LxmlHTMLTranslator-class.html b/doc/html/api/lxml.cssselect.LxmlHTMLTranslator-class.html deleted file mode 100644 index 876df226..00000000 --- a/doc/html/api/lxml.cssselect.LxmlHTMLTranslator-class.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - lxml.cssselect.LxmlHTMLTranslator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module cssselect :: - Class LxmlHTMLTranslator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LxmlHTMLTranslator

source code

-
-                       object --+        
-                                |        
-cssselect.xpath.GenericTranslator --+    
-                                    |    
-                       LxmlTranslator --+
-                                        |
-                       object --+       |
-                                |       |
-cssselect.xpath.GenericTranslator --+   |
-                                    |   |
-       cssselect.xpath.HTMLTranslator --+
-                                        |
-                                       LxmlHTMLTranslator
-
- -
-lxml extensions + HTML support. - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from cssselect.xpath.GenericTranslator: - xpathexpr_cls -

-
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from LxmlTranslator: - xpath_contains_function -

-

Inherited from cssselect.xpath.HTMLTranslator: - __init__, - xpath_checked_pseudo, - xpath_disabled_pseudo, - xpath_enabled_pseudo, - xpath_lang_function, - xpath_link_pseudo -

-

Inherited from cssselect.xpath.GenericTranslator: - css_to_xpath, - pseudo_never_matches, - selector_to_xpath, - xpath, - xpath_active_pseudo, - xpath_attrib, - xpath_attrib_dashmatch, - xpath_attrib_different, - xpath_attrib_equals, - xpath_attrib_exists, - xpath_attrib_includes, - xpath_attrib_prefixmatch, - xpath_attrib_substringmatch, - xpath_attrib_suffixmatch, - xpath_child_combinator, - xpath_class, - xpath_combinedselector, - xpath_descendant_combinator, - xpath_direct_adjacent_combinator, - xpath_element, - xpath_empty_pseudo, - xpath_first_child_pseudo, - xpath_first_of_type_pseudo, - xpath_focus_pseudo, - xpath_function, - xpath_hash, - xpath_hover_pseudo, - xpath_indirect_adjacent_combinator, - xpath_last_child_pseudo, - xpath_last_of_type_pseudo, - xpath_negation, - xpath_nth_child_function, - xpath_nth_last_child_function, - xpath_nth_last_of_type_function, - xpath_nth_of_type_function, - xpath_only_child_pseudo, - xpath_only_of_type_pseudo, - xpath_pseudo, - xpath_pseudo_element, - xpath_root_pseudo, - xpath_target_pseudo, - xpath_visited_pseudo -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Static Methods[hide private]
-
-

Inherited from cssselect.xpath.GenericTranslator: - xpath_literal -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from cssselect.xpath.HTMLTranslator: - lang_attribute -

-

Inherited from cssselect.xpath.GenericTranslator: - attribute_operator_mapping, - combinator_mapping, - id_attribute, - lower_case_attribute_names, - lower_case_attribute_values, - lower_case_element_names -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.cssselect.LxmlTranslator-class.html b/doc/html/api/lxml.cssselect.LxmlTranslator-class.html deleted file mode 100644 index 5fff0043..00000000 --- a/doc/html/api/lxml.cssselect.LxmlTranslator-class.html +++ /dev/null @@ -1,386 +0,0 @@ - - - - - lxml.cssselect.LxmlTranslator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module cssselect :: - Class LxmlTranslator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LxmlTranslator

source code

-
-                       object --+    
-                                |    
-cssselect.xpath.GenericTranslator --+
-                                    |
-                                   LxmlTranslator
-
- -
Known Subclasses:
-
- -
- -
-A custom CSS selector to XPath translator with lxml-specific extensions. - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from cssselect.xpath.GenericTranslator: - xpathexpr_cls -

-
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
xpath_contains_function(self, - xpath, - function) - source code - -
- -
-

Inherited from cssselect.xpath.GenericTranslator: - css_to_xpath, - pseudo_never_matches, - selector_to_xpath, - xpath, - xpath_active_pseudo, - xpath_attrib, - xpath_attrib_dashmatch, - xpath_attrib_different, - xpath_attrib_equals, - xpath_attrib_exists, - xpath_attrib_includes, - xpath_attrib_prefixmatch, - xpath_attrib_substringmatch, - xpath_attrib_suffixmatch, - xpath_checked_pseudo, - xpath_child_combinator, - xpath_class, - xpath_combinedselector, - xpath_descendant_combinator, - xpath_direct_adjacent_combinator, - xpath_disabled_pseudo, - xpath_element, - xpath_empty_pseudo, - xpath_enabled_pseudo, - xpath_first_child_pseudo, - xpath_first_of_type_pseudo, - xpath_focus_pseudo, - xpath_function, - xpath_hash, - xpath_hover_pseudo, - xpath_indirect_adjacent_combinator, - xpath_lang_function, - xpath_last_child_pseudo, - xpath_last_of_type_pseudo, - xpath_link_pseudo, - xpath_negation, - xpath_nth_child_function, - xpath_nth_last_child_function, - xpath_nth_last_of_type_function, - xpath_nth_of_type_function, - xpath_only_child_pseudo, - xpath_only_of_type_pseudo, - xpath_pseudo, - xpath_pseudo_element, - xpath_root_pseudo, - xpath_target_pseudo, - xpath_visited_pseudo -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Static Methods[hide private]
-
-

Inherited from cssselect.xpath.GenericTranslator: - xpath_literal -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from cssselect.xpath.GenericTranslator: - attribute_operator_mapping, - combinator_mapping, - id_attribute, - lang_attribute, - lower_case_attribute_names, - lower_case_attribute_values, - lower_case_element_names -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

xpath_contains_function(self, - xpath, - function) -

-
source code  -
- - -
-
Overrides: - cssselect.xpath.GenericTranslator.xpath_contains_function -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.doctestcompare-module.html b/doc/html/api/lxml.doctestcompare-module.html deleted file mode 100644 index 356b6198..00000000 --- a/doc/html/api/lxml.doctestcompare-module.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - lxml.doctestcompare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module doctestcompare - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module doctestcompare

source code

-

lxml-based doctest output comparison.

-

Note: normally, you should just import the lxml.usedoctest and -lxml.html.usedoctest modules from within a doctest, instead of this -one:

-
->>> import lxml.usedoctest # for XML output
-
->>> import lxml.html.usedoctest # for HTML output
-
-

To use this module directly, you must call lxmldoctest.install(), -which will cause doctest to use this in all subsequent calls.

-

This changes the way output is checked and comparisons are made for -XML or HTML-like content.

-

XML or HTML content is noticed because the example starts with < -(it's HTML if it starts with <html). You can also use the -PARSE_HTML and PARSE_XML flags to force parsing.

-

Some rough wildcard-like things are allowed. Whitespace is generally -ignored (except in attributes). In text (attributes and text in the -body) you can use ... as a wildcard. In an example it also -matches any trailing tags in the element, though it does not match -leading tags. You may create a tag <any> or include an any -attribute in the tag. An any tag matches any tag, while the -attribute matches any and all attributes.

-

When a match fails, the reformatted example and gotten text is -displayed (indented), and a rough diff-like output is given. Anything -marked with + is in the output but wasn't supposed to be, and -similarly - means its in the example but wasn't in the output.

-

You can disable parsing on one line with # doctest:+NOPARSE_MARKUP

- - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - LXMLOutputChecker -
-   - - LHTMLOutputChecker -
-   - - _RestoreChecker -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
strip(v) - source code - -
- -
-   - - - - - - -
norm_whitespace(v) - source code - -
- -
-   - - - - - - -
html_fromstring(html) - source code - -
- -
-   - - - - - - -
install(html=False)
- Install doctestcompare for all future doctests.
- source code - -
- -
-   - - - - - - -
temp_install(html=False, - del_module=None)
- Use this inside a doctest to enable this checker for this -doctest only.
- source code - -
- -
-   - - - - - - -
_find_doctest_frame() - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - _IS_PYTHON_3 = False -
-   - - PARSE_HTML = 1024 -
-   - - PARSE_XML = 2048 -
-   - - NOPARSE_MARKUP = 4096 -
-   - - _html_parser = <lxml.etree.HTMLParser object> -
-   - - _repr_re = re.compile(r'^<[^>]+ (at|object) ') -
-   - - _norm_whitespace_re = re.compile(r'[ \t\n][ \t\n]+') -
-   - - __test__ = {'basic': '\n >>> temp_install()\n >>> print ... -
-   - - __package__ = 'lxml' -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

install(html=False) -

-
source code  -
- -

Install doctestcompare for all future doctests.

-

If html is true, then by default the HTML parser will be used; -otherwise the XML parser is used.

-
-
-
-
- -
- -
- - -
-

temp_install(html=False, - del_module=None) -

-
source code  -
- -

Use this inside a doctest to enable this checker for this -doctest only.

-

If html is true, then by default the HTML parser will be used; -otherwise the XML parser is used.

-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

__test__

- -
-
-
-
Value:
-
-{'basic': '''
-    >>> temp_install()
-    >>> print """<xml a="1" b="2">stuff</xml>"""
-    <xml b="2" a="1">...</xml>
-    >>> print """<xml xmlns="http://example.com"><tag   attr="bar"   /\
-></xml>"""
-    <xml xmlns="...">
-      <tag attr="..." />
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.doctestcompare-pysrc.html b/doc/html/api/lxml.doctestcompare-pysrc.html deleted file mode 100644 index 3f088a4e..00000000 --- a/doc/html/api/lxml.doctestcompare-pysrc.html +++ /dev/null @@ -1,1149 +0,0 @@ - - - - - lxml.doctestcompare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module doctestcompare - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.doctestcompare

-
-  1  """ 
-  2  lxml-based doctest output comparison. 
-  3   
-  4  Note: normally, you should just import the `lxml.usedoctest` and 
-  5  `lxml.html.usedoctest` modules from within a doctest, instead of this 
-  6  one:: 
-  7   
-  8      >>> import lxml.usedoctest # for XML output 
-  9   
- 10      >>> import lxml.html.usedoctest # for HTML output 
- 11   
- 12  To use this module directly, you must call ``lxmldoctest.install()``, 
- 13  which will cause doctest to use this in all subsequent calls. 
- 14   
- 15  This changes the way output is checked and comparisons are made for 
- 16  XML or HTML-like content. 
- 17   
- 18  XML or HTML content is noticed because the example starts with ``<`` 
- 19  (it's HTML if it starts with ``<html``).  You can also use the 
- 20  ``PARSE_HTML`` and ``PARSE_XML`` flags to force parsing. 
- 21   
- 22  Some rough wildcard-like things are allowed.  Whitespace is generally 
- 23  ignored (except in attributes).  In text (attributes and text in the 
- 24  body) you can use ``...`` as a wildcard.  In an example it also 
- 25  matches any trailing tags in the element, though it does not match 
- 26  leading tags.  You may create a tag ``<any>`` or include an ``any`` 
- 27  attribute in the tag.  An ``any`` tag matches any tag, while the 
- 28  attribute matches any and all attributes. 
- 29   
- 30  When a match fails, the reformatted example and gotten text is 
- 31  displayed (indented), and a rough diff-like output is given.  Anything 
- 32  marked with ``+`` is in the output but wasn't supposed to be, and 
- 33  similarly ``-`` means its in the example but wasn't in the output. 
- 34   
- 35  You can disable parsing on one line with ``# doctest:+NOPARSE_MARKUP`` 
- 36  """ 
- 37   
- 38  from lxml import etree 
- 39  import sys 
- 40  import re 
- 41  import doctest 
- 42  try: 
- 43      from html import escape as html_escape 
- 44  except ImportError: 
- 45      from cgi import escape as html_escape 
- 46   
- 47  __all__ = ['PARSE_HTML', 'PARSE_XML', 'NOPARSE_MARKUP', 'LXMLOutputChecker', 
- 48             'LHTMLOutputChecker', 'install', 'temp_install'] 
- 49   
- 50  try: 
- 51      _basestring = basestring 
- 52  except NameError: 
- 53      _basestring = (str, bytes) 
- 54   
- 55  _IS_PYTHON_3 = sys.version_info[0] >= 3 
- 56   
- 57  PARSE_HTML = doctest.register_optionflag('PARSE_HTML') 
- 58  PARSE_XML = doctest.register_optionflag('PARSE_XML') 
- 59  NOPARSE_MARKUP = doctest.register_optionflag('NOPARSE_MARKUP') 
- 60   
- 61  OutputChecker = doctest.OutputChecker 
- 62   
-
63 -def strip(v): -
64 if v is None: - 65 return None - 66 else: - 67 return v.strip() -
68 -
69 -def norm_whitespace(v): -
70 return _norm_whitespace_re.sub(' ', v) -
71 - 72 _html_parser = etree.HTMLParser(recover=False, remove_blank_text=True) - 73 -
74 -def html_fromstring(html): -
76 - 77 # We use this to distinguish repr()s from elements: - 78 _repr_re = re.compile(r'^<[^>]+ (at|object) ') - 79 _norm_whitespace_re = re.compile(r'[ \t\n][ \t\n]+') - 80 -
81 -class LXMLOutputChecker(OutputChecker): -
82 - 83 empty_tags = ( - 84 'param', 'img', 'area', 'br', 'basefont', 'input', - 85 'base', 'meta', 'link', 'col') - 86 -
87 - def get_default_parser(self): -
88 return etree.XML -
89 -
90 - def check_output(self, want, got, optionflags): -
91 alt_self = getattr(self, '_temp_override_self', None) - 92 if alt_self is not None: - 93 super_method = self._temp_call_super_check_output - 94 self = alt_self - 95 else: - 96 super_method = OutputChecker.check_output - 97 parser = self.get_parser(want, got, optionflags) - 98 if not parser: - 99 return super_method( -100 self, want, got, optionflags) -101 try: -102 want_doc = parser(want) -103 except etree.XMLSyntaxError: -104 return False -105 try: -106 got_doc = parser(got) -107 except etree.XMLSyntaxError: -108 return False -109 return self.compare_docs(want_doc, got_doc) -
110 -
111 - def get_parser(self, want, got, optionflags): -
112 parser = None -113 if NOPARSE_MARKUP & optionflags: -114 return None -115 if PARSE_HTML & optionflags: -116 parser = html_fromstring -117 elif PARSE_XML & optionflags: -118 parser = etree.XML -119 elif (want.strip().lower().startswith('<html') -120 and got.strip().startswith('<html')): -121 parser = html_fromstring -122 elif (self._looks_like_markup(want) -123 and self._looks_like_markup(got)): -124 parser = self.get_default_parser() -125 return parser -
126 -
127 - def _looks_like_markup(self, s): -
128 s = s.strip() -129 return (s.startswith('<') -130 and not _repr_re.search(s)) -
131 -
132 - def compare_docs(self, want, got): -
133 if not self.tag_compare(want.tag, got.tag): -134 return False -135 if not self.text_compare(want.text, got.text, True): -136 return False -137 if not self.text_compare(want.tail, got.tail, True): -138 return False -139 if 'any' not in want.attrib: -140 want_keys = sorted(want.attrib.keys()) -141 got_keys = sorted(got.attrib.keys()) -142 if want_keys != got_keys: -143 return False -144 for key in want_keys: -145 if not self.text_compare(want.attrib[key], got.attrib[key], False): -146 return False -147 if want.text != '...' or len(want): -148 want_children = list(want) -149 got_children = list(got) -150 while want_children or got_children: -151 if not want_children or not got_children: -152 return False -153 want_first = want_children.pop(0) -154 got_first = got_children.pop(0) -155 if not self.compare_docs(want_first, got_first): -156 return False -157 if not got_children and want_first.tail == '...': -158 break -159 return True -
160 -
161 - def text_compare(self, want, got, strip): -
162 want = want or '' -163 got = got or '' -164 if strip: -165 want = norm_whitespace(want).strip() -166 got = norm_whitespace(got).strip() -167 want = '^%s$' % re.escape(want) -168 want = want.replace(r'\.\.\.', '.*') -169 if re.search(want, got): -170 return True -171 else: -172 return False -
173 -
174 - def tag_compare(self, want, got): -
175 if want == 'any': -176 return True -177 if (not isinstance(want, _basestring) -178 or not isinstance(got, _basestring)): -179 return want == got -180 want = want or '' -181 got = got or '' -182 if want.startswith('{...}'): -183 # Ellipsis on the namespace -184 return want.split('}')[-1] == got.split('}')[-1] -185 else: -186 return want == got -
187 -
188 - def output_difference(self, example, got, optionflags): -
189 want = example.want -190 parser = self.get_parser(want, got, optionflags) -191 errors = [] -192 if parser is not None: -193 try: -194 want_doc = parser(want) -195 except etree.XMLSyntaxError: -196 e = sys.exc_info()[1] -197 errors.append('In example: %s' % e) -198 try: -199 got_doc = parser(got) -200 except etree.XMLSyntaxError: -201 e = sys.exc_info()[1] -202 errors.append('In actual output: %s' % e) -203 if parser is None or errors: -204 value = OutputChecker.output_difference( -205 self, example, got, optionflags) -206 if errors: -207 errors.append(value) -208 return '\n'.join(errors) -209 else: -210 return value -211 html = parser is html_fromstring -212 diff_parts = [] -213 diff_parts.append('Expected:') -214 diff_parts.append(self.format_doc(want_doc, html, 2)) -215 diff_parts.append('Got:') -216 diff_parts.append(self.format_doc(got_doc, html, 2)) -217 diff_parts.append('Diff:') -218 diff_parts.append(self.collect_diff(want_doc, got_doc, html, 2)) -219 return '\n'.join(diff_parts) -
220 -
221 - def html_empty_tag(self, el, html=True): -
222 if not html: -223 return False -224 if el.tag not in self.empty_tags: -225 return False -226 if el.text or len(el): -227 # This shouldn't happen (contents in an empty tag) -228 return False -229 return True -
230 -
231 - def format_doc(self, doc, html, indent, prefix=''): -
232 parts = [] -233 if not len(doc): -234 # No children... -235 parts.append(' '*indent) -236 parts.append(prefix) -237 parts.append(self.format_tag(doc)) -238 if not self.html_empty_tag(doc, html): -239 if strip(doc.text): -240 parts.append(self.format_text(doc.text)) -241 parts.append(self.format_end_tag(doc)) -242 if strip(doc.tail): -243 parts.append(self.format_text(doc.tail)) -244 parts.append('\n') -245 return ''.join(parts) -246 parts.append(' '*indent) -247 parts.append(prefix) -248 parts.append(self.format_tag(doc)) -249 if not self.html_empty_tag(doc, html): -250 parts.append('\n') -251 if strip(doc.text): -252 parts.append(' '*indent) -253 parts.append(self.format_text(doc.text)) -254 parts.append('\n') -255 for el in doc: -256 parts.append(self.format_doc(el, html, indent+2)) -257 parts.append(' '*indent) -258 parts.append(self.format_end_tag(doc)) -259 parts.append('\n') -260 if strip(doc.tail): -261 parts.append(' '*indent) -262 parts.append(self.format_text(doc.tail)) -263 parts.append('\n') -264 return ''.join(parts) -
265 -
266 - def format_text(self, text, strip=True): -
267 if text is None: -268 return '' -269 if strip: -270 text = text.strip() -271 return html_escape(text, 1) -
272 -
273 - def format_tag(self, el): -
274 attrs = [] -275 if isinstance(el, etree.CommentBase): -276 # FIXME: probably PIs should be handled specially too? -277 return '<!--' -278 for name, value in sorted(el.attrib.items()): -279 attrs.append('%s="%s"' % (name, self.format_text(value, False))) -280 if not attrs: -281 return '<%s>' % el.tag -282 return '<%s %s>' % (el.tag, ' '.join(attrs)) -
283 -
284 - def format_end_tag(self, el): -
285 if isinstance(el, etree.CommentBase): -286 # FIXME: probably PIs should be handled specially too? -287 return '-->' -288 return '</%s>' % el.tag -
289 -
290 - def collect_diff(self, want, got, html, indent): -
291 parts = [] -292 if not len(want) and not len(got): -293 parts.append(' '*indent) -294 parts.append(self.collect_diff_tag(want, got)) -295 if not self.html_empty_tag(got, html): -296 parts.append(self.collect_diff_text(want.text, got.text)) -297 parts.append(self.collect_diff_end_tag(want, got)) -298 parts.append(self.collect_diff_text(want.tail, got.tail)) -299 parts.append('\n') -300 return ''.join(parts) -301 parts.append(' '*indent) -302 parts.append(self.collect_diff_tag(want, got)) -303 parts.append('\n') -304 if strip(want.text) or strip(got.text): -305 parts.append(' '*indent) -306 parts.append(self.collect_diff_text(want.text, got.text)) -307 parts.append('\n') -308 want_children = list(want) -309 got_children = list(got) -310 while want_children or got_children: -311 if not want_children: -312 parts.append(self.format_doc(got_children.pop(0), html, indent+2, '+')) -313 continue -314 if not got_children: -315 parts.append(self.format_doc(want_children.pop(0), html, indent+2, '-')) -316 continue -317 parts.append(self.collect_diff( -318 want_children.pop(0), got_children.pop(0), html, indent+2)) -319 parts.append(' '*indent) -320 parts.append(self.collect_diff_end_tag(want, got)) -321 parts.append('\n') -322 if strip(want.tail) or strip(got.tail): -323 parts.append(' '*indent) -324 parts.append(self.collect_diff_text(want.tail, got.tail)) -325 parts.append('\n') -326 return ''.join(parts) -
327 -
328 - def collect_diff_tag(self, want, got): -
329 if not self.tag_compare(want.tag, got.tag): -330 tag = '%s (got: %s)' % (want.tag, got.tag) -331 else: -332 tag = got.tag -333 attrs = [] -334 any = want.tag == 'any' or 'any' in want.attrib -335 for name, value in sorted(got.attrib.items()): -336 if name not in want.attrib and not any: -337 attrs.append('+%s="%s"' % (name, self.format_text(value, False))) -338 else: -339 if name in want.attrib: -340 text = self.collect_diff_text(want.attrib[name], value, False) -341 else: -342 text = self.format_text(value, False) -343 attrs.append('%s="%s"' % (name, text)) -344 if not any: -345 for name, value in sorted(want.attrib.items()): -346 if name in got.attrib: -347 continue -348 attrs.append('-%s="%s"' % (name, self.format_text(value, False))) -349 if attrs: -350 tag = '<%s %s>' % (tag, ' '.join(attrs)) -351 else: -352 tag = '<%s>' % tag -353 return tag -
354 -
355 - def collect_diff_end_tag(self, want, got): -
356 if want.tag != got.tag: -357 tag = '%s (got: %s)' % (want.tag, got.tag) -358 else: -359 tag = got.tag -360 return '</%s>' % tag -
361 -
362 - def collect_diff_text(self, want, got, strip=True): -
363 if self.text_compare(want, got, strip): -364 if not got: -365 return '' -366 return self.format_text(got, strip) -367 text = '%s (got: %s)' % (want, got) -368 return self.format_text(text, strip) -
369 -
370 -class LHTMLOutputChecker(LXMLOutputChecker): -
371 - def get_default_parser(self): -
372 return html_fromstring -
373 -
374 -def install(html=False): -
375 """ -376 Install doctestcompare for all future doctests. -377 -378 If html is true, then by default the HTML parser will be used; -379 otherwise the XML parser is used. -380 """ -381 if html: -382 doctest.OutputChecker = LHTMLOutputChecker -383 else: -384 doctest.OutputChecker = LXMLOutputChecker -
385 -
386 -def temp_install(html=False, del_module=None): -
387 """ -388 Use this *inside* a doctest to enable this checker for this -389 doctest only. -390 -391 If html is true, then by default the HTML parser will be used; -392 otherwise the XML parser is used. -393 """ -394 if html: -395 Checker = LHTMLOutputChecker -396 else: -397 Checker = LXMLOutputChecker -398 frame = _find_doctest_frame() -399 dt_self = frame.f_locals['self'] -400 checker = Checker() -401 old_checker = dt_self._checker -402 dt_self._checker = checker -403 # The unfortunate thing is that there is a local variable 'check' -404 # in the function that runs the doctests, that is a bound method -405 # into the output checker. We have to update that. We can't -406 # modify the frame, so we have to modify the object in place. The -407 # only way to do this is to actually change the func_code -408 # attribute of the method. We change it, and then wait for -409 # __record_outcome to be run, which signals the end of the __run -410 # method, at which point we restore the previous check_output -411 # implementation. -412 if _IS_PYTHON_3: -413 check_func = frame.f_locals['check'].__func__ -414 checker_check_func = checker.check_output.__func__ -415 else: -416 check_func = frame.f_locals['check'].im_func -417 checker_check_func = checker.check_output.im_func -418 # Because we can't patch up func_globals, this is the only global -419 # in check_output that we care about: -420 doctest.etree = etree -421 _RestoreChecker(dt_self, old_checker, checker, -422 check_func, checker_check_func, -423 del_module) -
424 -
425 -class _RestoreChecker(object): -
426 - def __init__(self, dt_self, old_checker, new_checker, check_func, clone_func, -427 del_module): -
428 self.dt_self = dt_self -429 self.checker = old_checker -430 self.checker._temp_call_super_check_output = self.call_super -431 self.checker._temp_override_self = new_checker -432 self.check_func = check_func -433 self.clone_func = clone_func -434 self.del_module = del_module -435 self.install_clone() -436 self.install_dt_self() -
437 - def install_clone(self): -
438 if _IS_PYTHON_3: -439 self.func_code = self.check_func.__code__ -440 self.func_globals = self.check_func.__globals__ -441 self.check_func.__code__ = self.clone_func.__code__ -442 else: -443 self.func_code = self.check_func.func_code -444 self.func_globals = self.check_func.func_globals -445 self.check_func.func_code = self.clone_func.func_code -
446 - def uninstall_clone(self): -
447 if _IS_PYTHON_3: -448 self.check_func.__code__ = self.func_code -449 else: -450 self.check_func.func_code = self.func_code -
451 - def install_dt_self(self): -
452 self.prev_func = self.dt_self._DocTestRunner__record_outcome -453 self.dt_self._DocTestRunner__record_outcome = self -
454 - def uninstall_dt_self(self): -
455 self.dt_self._DocTestRunner__record_outcome = self.prev_func -
456 - def uninstall_module(self): -
457 if self.del_module: -458 import sys -459 del sys.modules[self.del_module] -460 if '.' in self.del_module: -461 package, module = self.del_module.rsplit('.', 1) -462 package_mod = sys.modules[package] -463 delattr(package_mod, module) -
464 - def __call__(self, *args, **kw): -
465 self.uninstall_clone() -466 self.uninstall_dt_self() -467 del self.checker._temp_override_self -468 del self.checker._temp_call_super_check_output -469 result = self.prev_func(*args, **kw) -470 self.uninstall_module() -471 return result -
472 - def call_super(self, *args, **kw): -
473 self.uninstall_clone() -474 try: -475 return self.check_func(*args, **kw) -476 finally: -477 self.install_clone() -
478 -
480 import sys -481 frame = sys._getframe(1) -482 while frame: -483 l = frame.f_locals -484 if 'BOOM' in l: -485 # Sign of doctest -486 return frame -487 frame = frame.f_back -488 raise LookupError( -489 "Could not find doctest (only use this function *inside* a doctest)") -
490 -491 __test__ = { -492 'basic': ''' -493 >>> temp_install() -494 >>> print """<xml a="1" b="2">stuff</xml>""" -495 <xml b="2" a="1">...</xml> -496 >>> print """<xml xmlns="http://example.com"><tag attr="bar" /></xml>""" -497 <xml xmlns="..."> -498 <tag attr="..." /> -499 </xml> -500 >>> print """<xml>blahblahblah<foo /></xml>""" # doctest: +NOPARSE_MARKUP, +ELLIPSIS -501 <xml>...foo /></xml> -502 '''} -503 -504 if __name__ == '__main__': -505 import doctest -506 doctest.testmod() -507 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.doctestcompare.LHTMLOutputChecker-class.html b/doc/html/api/lxml.doctestcompare.LHTMLOutputChecker-class.html deleted file mode 100644 index c6829c08..00000000 --- a/doc/html/api/lxml.doctestcompare.LHTMLOutputChecker-class.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - lxml.doctestcompare.LHTMLOutputChecker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module doctestcompare :: - Class LHTMLOutputChecker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LHTMLOutputChecker

source code

-
-doctest.OutputChecker --+    
-                        |    
-        LXMLOutputChecker --+
-                            |
-                           LHTMLOutputChecker
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
get_default_parser(self) - source code - -
- -
-

Inherited from LXMLOutputChecker: - check_output, - collect_diff, - collect_diff_end_tag, - collect_diff_tag, - collect_diff_text, - compare_docs, - format_doc, - format_end_tag, - format_tag, - format_text, - get_parser, - html_empty_tag, - output_difference, - tag_compare, - text_compare -

-

Inherited from LXMLOutputChecker (private): - _looks_like_markup -

-

Inherited from doctest.OutputChecker (private): - _do_a_fancy_diff -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from LXMLOutputChecker: - empty_tags -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

get_default_parser(self) -

-
source code  -
- - -
-
Overrides: - LXMLOutputChecker.get_default_parser -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.doctestcompare.LXMLOutputChecker-class.html b/doc/html/api/lxml.doctestcompare.LXMLOutputChecker-class.html deleted file mode 100644 index f837aeb3..00000000 --- a/doc/html/api/lxml.doctestcompare.LXMLOutputChecker-class.html +++ /dev/null @@ -1,633 +0,0 @@ - - - - - lxml.doctestcompare.LXMLOutputChecker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module doctestcompare :: - Class LXMLOutputChecker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LXMLOutputChecker

source code

-
-doctest.OutputChecker --+
-                        |
-                       LXMLOutputChecker
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
get_default_parser(self) - source code - -
- -
-   - - - - - - -
check_output(self, - want, - got, - optionflags)
- Return True iff the actual output from an example (got) -matches the expected output (want). These strings are -always considered to match if they are identical; but -depending on what option flags the test runner is using, -several non-exact match types are also possible. See the -documentation for TestRunner for more information about -option flags.
- source code - -
- -
-   - - - - - - -
get_parser(self, - want, - got, - optionflags) - source code - -
- -
-   - - - - - - -
_looks_like_markup(self, - s) - source code - -
- -
-   - - - - - - -
compare_docs(self, - want, - got) - source code - -
- -
-   - - - - - - -
text_compare(self, - want, - got, - strip) - source code - -
- -
-   - - - - - - -
tag_compare(self, - want, - got) - source code - -
- -
-   - - - - - - -
output_difference(self, - example, - got, - optionflags)
- Return a string describing the differences between the -expected output for a given example (example) and the actual -output (got). optionflags is the set of option flags used -to compare want and got.
- source code - -
- -
-   - - - - - - -
html_empty_tag(self, - el, - html=True) - source code - -
- -
-   - - - - - - -
format_doc(self, - doc, - html, - indent, - prefix='') - source code - -
- -
-   - - - - - - -
format_text(self, - text, - strip=True) - source code - -
- -
-   - - - - - - -
format_tag(self, - el) - source code - -
- -
-   - - - - - - -
format_end_tag(self, - el) - source code - -
- -
-   - - - - - - -
collect_diff(self, - want, - got, - html, - indent) - source code - -
- -
-   - - - - - - -
collect_diff_tag(self, - want, - got) - source code - -
- -
-   - - - - - - -
collect_diff_end_tag(self, - want, - got) - source code - -
- -
-   - - - - - - -
collect_diff_text(self, - want, - got, - strip=True) - source code - -
- -
-

Inherited from doctest.OutputChecker (private): - _do_a_fancy_diff -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - empty_tags = ('param', 'img', 'area', 'br', 'basefont', 'input... -
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

check_output(self, - want, - got, - optionflags) -

-
source code  -
- - Return True iff the actual output from an example (got) -matches the expected output (want). These strings are -always considered to match if they are identical; but -depending on what option flags the test runner is using, -several non-exact match types are also possible. See the -documentation for TestRunner for more information about -option flags. -
-
Overrides: - doctest.OutputChecker.check_output -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

output_difference(self, - example, - got, - optionflags) -

-
source code  -
- - Return a string describing the differences between the -expected output for a given example (example) and the actual -output (got). optionflags is the set of option flags used -to compare want and got. -
-
Overrides: - doctest.OutputChecker.output_difference -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

empty_tags

- -
-
-
-
Value:
-
-('param',
- 'img',
- 'area',
- 'br',
- 'basefont',
- 'input',
- 'base',
- 'meta',
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.doctestcompare._RestoreChecker-class.html b/doc/html/api/lxml.doctestcompare._RestoreChecker-class.html deleted file mode 100644 index 001d24a2..00000000 --- a/doc/html/api/lxml.doctestcompare._RestoreChecker-class.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - lxml.doctestcompare._RestoreChecker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module doctestcompare :: - Class _RestoreChecker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _RestoreChecker

source code

-
-object --+
-         |
-        _RestoreChecker
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - dt_self, - old_checker, - new_checker, - check_func, - clone_func, - del_module)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
install_clone(self) - source code - -
- -
-   - - - - - - -
uninstall_clone(self) - source code - -
- -
-   - - - - - - -
install_dt_self(self) - source code - -
- -
-   - - - - - - -
uninstall_dt_self(self) - source code - -
- -
-   - - - - - - -
uninstall_module(self) - source code - -
- -
-   - - - - - - -
__call__(self, - *args, - **kw) - source code - -
- -
-   - - - - - - -
call_super(self, - *args, - **kw) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - dt_self, - old_checker, - new_checker, - check_func, - clone_func, - del_module) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree-module.html b/doc/html/api/lxml.etree-module.html deleted file mode 100644 index f1b9813a..00000000 --- a/doc/html/api/lxml.etree-module.html +++ /dev/null @@ -1,2599 +0,0 @@ - - - - - lxml.etree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module etree

-The lxml.etree module implements the extended ElementTree API for XML. - -
-

Version: - 4.2.2 -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - AncestorsIterator
- AncestorsIterator(self, node, tag=None) -Iterates over the ancestors of an element (from parent to parent). -
-   - - AttributeBasedElementClassLookup
- AttributeBasedElementClassLookup(self, attribute_name, class_mapping, fallback=None) -Checks an attribute of an Element and looks up the value in a -class dictionary. -
-   - - C14NError
- Error during C14N serialisation. -
-   - - CDATA
- CDATA(data) -
-   - - CommentBase
- All custom Comment classes must inherit from this one. -
-   - - CustomElementClassLookup
- CustomElementClassLookup(self, fallback=None) -Element class lookup based on a subclass method. -
-   - - DTD
- DTD(self, file=None, external_id=None) -A DTD validator. -
-   - - DTDError
- Base class for DTD errors. -
-   - - DTDParseError
- Error while parsing a DTD. -
-   - - DTDValidateError
- Error while validating an XML document with a DTD. -
-   - - DocInfo
- Document information provided by parser and DTD. -
-   - - DocumentInvalid
- Validation error. -
-   - - ETCompatXMLParser
- ETCompatXMLParser(self, encoding=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, schema=None, huge_tree=False, remove_blank_text=False, resolve_entities=True, remove_comments=True, remove_pis=True, strip_cdata=True, target=None, compact=True) -
-   - - ETXPath
- ETXPath(self, path, extensions=None, regexp=True, smart_strings=True) -Special XPath class that supports the ElementTree {uri} notation for namespaces. -
-   - - ElementBase
- ElementBase(*children, attrib=None, nsmap=None, **_extra) -
-   - - ElementChildIterator
- ElementChildIterator(self, node, tag=None, reversed=False) -Iterates over the children of an element. -
-   - - ElementClassLookup
- ElementClassLookup(self) -Superclass of Element class lookups. -
-   - - ElementDefaultClassLookup
- ElementDefaultClassLookup(self, element=None, comment=None, pi=None, entity=None) -Element class lookup scheme that always returns the default Element -class. -
-   - - ElementDepthFirstIterator
- ElementDepthFirstIterator(self, node, tag=None, inclusive=True) -Iterates over an element and its sub-elements in document order (depth -first pre-order). -
-   - - ElementNamespaceClassLookup
- ElementNamespaceClassLookup(self, fallback=None) -
-   - - ElementTextIterator
- ElementTextIterator(self, element, tag=None, with_tail=True) -Iterates over the text content of a subtree. -
-   - - EntityBase
- All custom Entity classes must inherit from this one. -
-   - - Error -
-   - - ErrorDomains
- Libxml2 error domains -
-   - - ErrorLevels
- Libxml2 error levels -
-   - - ErrorTypes
- Libxml2 error types -
-   - - FallbackElementClassLookup
- FallbackElementClassLookup(self, fallback=None) -
-   - - HTMLParser
- HTMLParser(self, encoding=None, remove_blank_text=False, remove_comments=False, remove_pis=False, strip_cdata=True, no_network=True, target=None, schema: XMLSchema =None, recover=True, compact=True, collect_ids=True, huge_tree=False) -
-   - - HTMLPullParser
- HTMLPullParser(self, events=None, *, tag=None, base_url=None, **kwargs) -
-   - - LxmlError
- Main exception base class for lxml. All other exceptions inherit from -this one. -
-   - - LxmlRegistryError
- Base class of lxml registry errors. -
-   - - LxmlSyntaxError
- Base class for all syntax errors. -
-   - - NamespaceRegistryError
- Error registering a namespace extension. -
-   - - PIBase
- All custom Processing Instruction classes must inherit from this one. -
-   - - ParseError
- Syntax error while parsing an XML document. -
-   - - ParserBasedElementClassLookup
- ParserBasedElementClassLookup(self, fallback=None) -Element class lookup based on the XML parser. -
-   - - ParserError
- Internal lxml parser error. -
-   - - PyErrorLog
- PyErrorLog(self, logger_name=None, logger=None) -A global error log that connects to the Python stdlib logging package. -
-   - - PythonElementClassLookup
- PythonElementClassLookup(self, fallback=None) -Element class lookup based on a subclass method. -
-   - - QName
- QName(text_or_uri_or_element, tag=None) -
-   - - RelaxNG
- RelaxNG(self, etree=None, file=None) -Turn a document into a Relax NG validator. -
-   - - RelaxNGError
- Base class for RelaxNG errors. -
-   - - RelaxNGErrorTypes
- Libxml2 RelaxNG error types -
-   - - RelaxNGParseError
- Error while parsing an XML document as RelaxNG. -
-   - - RelaxNGValidateError
- Error while validating an XML document with a RelaxNG schema. -
-   - - Resolver
- This is the base class of all resolvers. -
-   - - Schematron
- Schematron(self, etree=None, file=None) -A Schematron validator. -
-   - - SchematronError
- Base class of all Schematron errors. -
-   - - SchematronParseError
- Error while parsing an XML document as Schematron schema. -
-   - - SchematronValidateError
- Error while validating an XML document with a Schematron schema. -
-   - - SerialisationError
- A libxml2 error that occurred during serialisation. -
-   - - SiblingsIterator
- SiblingsIterator(self, node, tag=None, preceding=False) -Iterates over the siblings of an element. -
-   - - TreeBuilder
- TreeBuilder(self, element_factory=None, parser=None) -Parser target that builds a tree. -
-   - - XInclude
- XInclude(self) -XInclude processor. -
-   - - XIncludeError
- Error during XInclude processing. -
-   - - XMLParser
- XMLParser(self, encoding=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, schema: XMLSchema =None, huge_tree=False, remove_blank_text=False, resolve_entities=True, remove_comments=False, remove_pis=False, strip_cdata=True, collect_ids=True, target=None, compact=True) -
-   - - XMLPullParser
- XMLPullParser(self, events=None, *, tag=None, **kwargs) -
-   - - XMLSchema
- XMLSchema(self, etree=None, file=None) -Turn a document into an XML Schema validator. -
-   - - XMLSchemaError
- Base class of all XML Schema errors -
-   - - XMLSchemaParseError
- Error while parsing an XML document as XML Schema. -
-   - - XMLSchemaValidateError
- Error while validating an XML document with an XML Schema. -
-   - - XMLSyntaxError
- Syntax error while parsing an XML document. -
-   - - XMLTreeBuilder
- ETCompatXMLParser(self, encoding=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, schema=None, huge_tree=False, remove_blank_text=False, resolve_entities=True, remove_comments=True, remove_pis=True, strip_cdata=True, target=None, compact=True) -
-   - - XPath
- XPath(self, path, namespaces=None, extensions=None, regexp=True, smart_strings=True) -A compiled XPath expression that can be called on Elements and ElementTrees. -
-   - - XPathDocumentEvaluator
- XPathDocumentEvaluator(self, etree, namespaces=None, extensions=None, regexp=True, smart_strings=True) -Create an XPath evaluator for an ElementTree. -
-   - - XPathElementEvaluator
- XPathElementEvaluator(self, element, namespaces=None, extensions=None, regexp=True, smart_strings=True) -Create an XPath evaluator for an element. -
-   - - XPathError
- Base class of all XPath errors. -
-   - - XPathEvalError
- Error during XPath evaluation. -
-   - - XPathFunctionError
- Internal error looking up an XPath extension function. -
-   - - XPathResultError
- Error handling an XPath result. -
-   - - XPathSyntaxError -
-   - - XSLT
- XSLT(self, xslt_input, extensions=None, regexp=True, access_control=None) -
-   - - XSLTAccessControl
- XSLTAccessControl(self, read_file=True, write_file=True, create_dir=True, read_network=True, write_network=True) -
-   - - XSLTApplyError
- Error running an XSL transformation. -
-   - - XSLTError
- Base class of all XSLT errors. -
-   - - XSLTExtension
- Base class of an XSLT extension element. -
-   - - XSLTExtensionError
- Error registering an XSLT extension. -
-   - - XSLTParseError
- Error parsing a stylesheet document. -
-   - - XSLTSaveError
- Error serialising an XSLT result. -
-   - - _Attrib
- A dict-like proxy for the Element.attrib property. -
-   - - _BaseErrorLog -
-   - - _Comment -
-   - - _Document
- Internal base class to reference a libxml document. -
-   - - _DomainErrorLog -
-   - - _Element
- Element class. -
-   - - _ElementIterator
- Dead but public. :) -
-   - - _ElementMatchIterator -
-   - - _ElementStringResult -
-   - - _ElementTagMatcher
- Dead but public. :) -
-   - - _ElementTree -
-   - - _ElementUnicodeResult -
-   - - _Entity -
-   - - _ErrorLog -
-   - - _FeedParser -
-   - - _IDDict
- IDDict(self, etree) -A dictionary-like proxy class that mapps ID attributes to elements. -
-   - - _ListErrorLog
- Immutable base version of a list based error log. -
-   - - _LogEntry
- A log message entry from an error log. -
-   - - _ProcessingInstruction -
-   - - _RotatingErrorLog -
-   - - _SaxParserTarget -
-   - - _TargetParserResult -
-   - - _Validator
- Base class for XML validators. -
-   - - _XPathEvaluatorBase -
-   - - _XSLTProcessingInstruction -
-   - - _XSLTResultTree
- The result of an XSLT evaluation. -
-   - - htmlfile
- htmlfile(self, output_file, encoding=None, compression=None, close=False, buffered=True) -
-   - - iterparse
- iterparse(self, source, events=("end",), tag=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, remove_blank_text=False, remove_comments=False, remove_pis=False, encoding=None, html=False, recover=None, huge_tree=False, schema=None) -
-   - - iterwalk
- iterwalk(self, element_or_tree, events=("end",), tag=None) -
-   - - xmlfile
- xmlfile(self, output_file, encoding=None, compression=None, close=False, buffered=True) -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
Comment(text=None)
- Comment element factory. This factory function creates a special element that will -be serialized as an XML comment.
- - -
- -
-   - - - - - - -
Element(_tag, - attrib=None, - nsmap=None, - **_extra)
- Element factory. This function returns an object implementing the -Element interface.
- - -
- -
-   - - - - - - -
ElementTree(element=None, - file=None, - parser=None)
- ElementTree wrapper class.
- - -
- -
-   - - - - - - -
Entity(name)
- Entity factory. This factory function creates a special element -that will be serialized as an XML entity reference or character -reference. Note, however, that entities will not be automatically -declared in the document. A document that uses entity references -requires a DTD to define the entities.
- - -
- -
-   - - - - - - -
Extension(module, - function_mapping=None, - ns=None)
- Build a dictionary of extension functions from the functions -defined in a module or the methods of an object.
- - -
- -
-   - - - - - - -
FunctionNamespace(ns_uri)
- Retrieve the function namespace object associated with the given -URI.
- - -
- -
-   - - - - - - -
HTML(text, - parser=None, - base_url=None)
- Parses an HTML document from a string constant. Returns the root -node (or the result returned by a parser target). This function -can be used to embed "HTML literals" in Python code.
- - -
- -
-   - - - - - - -
PI(target, - text=None)
- ProcessingInstruction element factory. This factory function creates a -special element that will be serialized as an XML processing instruction.
- - -
- -
-   - - - - - - -
ProcessingInstruction(target, - text=None)
- ProcessingInstruction element factory. This factory function creates a -special element that will be serialized as an XML processing instruction.
- - -
- -
-   - - - - - - -
SubElement(_parent, - _tag, - attrib=None, - nsmap=None, - **_extra)
- Subelement factory. This function creates an element instance, and -appends it to an existing element.
- - -
- -
-   - - - - - - -
XML(text, - parser=None, - base_url=None)
- Parses an XML document or fragment from a string constant. -Returns the root node (or the result returned by a parser target). -This function can be used to embed "XML literals" in Python code, -like in
- - -
- -
-   - - - - - - -
XMLDTDID(text, - parser=None, - base_url=None)
- Parse the text and return a tuple (root node, ID dictionary). The root -node is the same as returned by the XML() function. The dictionary -contains string-element pairs. The dictionary keys are the values of ID -attributes as defined by the DTD. The elements referenced by the ID are -stored as dictionary values.
- - -
- -
-   - - - - - - -
XMLID(text, - parser=None, - base_url=None)
- Parse the text and return a tuple (root node, ID dictionary). The root -node is the same as returned by the XML() function. The dictionary -contains string-element pairs. The dictionary keys are the values of 'id' -attributes. The elements referenced by the ID are stored as dictionary -values.
- - -
- -
-   - - - - - - -
XPathEvaluator(etree_or_element, - namespaces=None, - extensions=None, - regexp=True, - smart_strings=True)
- Creates an XPath evaluator for an ElementTree or an Element.
- - -
- -
-   - - - - - - -
adopt_external_document(capsule, - parser=None)
- Unpack a libxml2 document pointer from a PyCapsule and wrap it in an -lxml ElementTree object.
- - -
- -
-   - - - - - - -
cleanup_namespaces(tree_or_element, - top_nsmap=None, - keep_ns_prefixes=None)
- Remove all namespace declarations from a subtree that are not used -by any of the elements or attributes in that tree.
- - -
- -
-   - - - - - - -
clear_error_log()
- Clear the global error log. Note that this log is already bound to a -fixed size.
- - -
- -
-   - - - - - - -
dump(elem, - pretty_print=True, - with_tail=True)
- Writes an element tree or element structure to sys.stdout. This function -should be used for debugging only.
- - -
- -
-   - - - - - - -
fromstring(text, - parser=None, - base_url=None)
- Parses an XML document or fragment from a string. Returns the -root node (or the result returned by a parser target).
- - -
- -
-   - - - - - - -
fromstringlist(strings, - parser=None)
- Parses an XML document from a sequence of strings. Returns the -root node (or the result returned by a parser target).
- - -
- -
-   - - - - - - -
get_default_parser() - - -
- -
-   - - - - - - -
iselement(element)
- Checks if an object appears to be a valid element object.
- - -
- -
-   - - - - - - -
parse(source, - parser=None, - base_url=None)
- Return an ElementTree object loaded with source elements. If no parser -is provided as second argument, the default parser is used.
- - -
- -
-   - - - - - - -
parseid(source, - parser=None)
- Parses the source into a tuple containing an ElementTree object and an -ID dictionary. If no parser is provided as second argument, the default -parser is used.
- - -
- -
-   - - - - - - -
register_namespace(...)
- Registers a namespace prefix that newly created Elements in that -namespace will use. The registry is global, and any existing -mapping for either the given prefix or the namespace URI will be -removed.
- - -
- -
-   - - - - - - -
set_default_parser(parser=None)
- Set a default parser for the current thread. This parser is used -globally whenever no parser is supplied to the various parse functions of -the lxml API. If this function is called without a parser (or if it is -None), the default parser is reset to the original configuration.
- - -
- -
-   - - - - - - -
set_element_class_lookup(lookup= None)
- Set the global default element class lookup method.
- - -
- -
-   - - - - - - -
strip_attributes(tree_or_element, - *attribute_names)
- Delete all attributes with the provided attribute names from an -Element (or ElementTree) and its descendants.
- - -
- -
-   - - - - - - -
strip_elements(tree_or_element, - with_tail=True, - *tag_names)
- Delete all elements with the provided tag names from a tree or -subtree. This will remove the elements and their entire subtree, -including all their attributes, text content and descendants. It -will also remove the tail text of the element unless you -explicitly set the with_tail keyword argument option to False.
- - -
- -
-   - - - - - - -
strip_tags(tree_or_element, - *tag_names)
- Delete all elements with the provided tag names from a tree or -subtree. This will remove the elements and their attributes, but -not their text/tail content or descendants. Instead, it will -merge the text content and children of the element into its -parent.
- - -
- -
-   - - - - - - -
tostring(element_or_tree, - encoding=None, - method="xml", - xml_declaration=None, - pretty_print=False, - with_tail=True, - standalone=None, - doctype=None, - exclusive=False, - with_comments=True, - inclusive_ns_prefixes=None)
- Serialize an element to an encoded string representation of its XML -tree.
- - -
- -
-   - - - - - - -
tostringlist(element_or_tree, - *args, - **kwargs)
- Serialize an element to an encoded string representation of its XML -tree, stored in a list of partial strings.
- - -
- -
-   - - - - - - -
tounicode(element_or_tree, - method="xml", - pretty_print=False, - with_tail=True, - doctype=None)
- Serialize an element to the Python unicode representation of its XML -tree.
- - -
- -
-   - - - - - - -
use_global_python_log(log)
- Replace the global error log by an etree.PyErrorLog that uses the -standard Python logging package.
- - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - DEBUG = 1 -
-   - - LIBXML_COMPILED_VERSION = (2, 9, 3) -
-   - - LIBXML_VERSION = (2, 9, 3) -
-   - - LIBXSLT_COMPILED_VERSION = (1, 1, 28) -
-   - - LIBXSLT_VERSION = (1, 1, 28) -
-   - - LXML_VERSION = (4, 2, 2, 0) -
-   - - __package__ = None
- hash(x) -
-   - - __pyx_capi__ = {'adoptExternalDocument': <capsule object "stru... -
-   - - __test__ = {u'FunctionNamespace (line 207)': u'FunctionNamespa... -
-   - - memory_debugger = <lxml.etree._MemDebug object> -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

Element(_tag, - attrib=None, - nsmap=None, - **_extra) -

-
  -
- -

Element factory. This function returns an object implementing the -Element interface.

-

Also look at the _Element.makeelement() and -_BaseParser.makeelement() methods, which provide a faster way to -create an Element within a specific document or parser context.

-
-
-
-
- -
- -
- - -
-

Extension(module, - function_mapping=None, - ns=None) -

-
  -
- -

Build a dictionary of extension functions from the functions -defined in a module or the methods of an object.

-

As second argument, you can pass an additional mapping of -attribute names to XPath function names, or a list of function -names that should be taken.

-

The ns keyword argument accepts a namespace URI for the XPath -functions.

-
-
-
-
- -
- -
- - -
-

FunctionNamespace(ns_uri) -

-
  -
- -

Retrieve the function namespace object associated with the given -URI.

-

Creates a new one if it does not yet exist. A function namespace -can only be used to register extension functions.

-

Usage:

-
->>> ns_functions = FunctionNamespace("http://schema.org/Movie")
-
->>> @ns_functions  # uses function name
-... def add2(x):
-...     return x + 2
-
->>> @ns_functions("add3")  # uses explicit name
-... def add_three(x):
-...     return x + 3
-
-
-
-
- -
- -
- - -
-

HTML(text, - parser=None, - base_url=None) -

-
  -
- -

Parses an HTML document from a string constant. Returns the root -node (or the result returned by a parser target). This function -can be used to embed "HTML literals" in Python code.

-

To override the parser with a different HTMLParser you can pass it to -the parser keyword argument.

-

The base_url keyword argument allows to set the original base URL of -the document to support relative Paths when looking up external entities -(DTD, XInclude, ...).

-
-
-
-
- -
- -
- - -
-

XML(text, - parser=None, - base_url=None) -

-
  -
- -

Parses an XML document or fragment from a string constant. -Returns the root node (or the result returned by a parser target). -This function can be used to embed "XML literals" in Python code, -like in

-
-
->>> root = XML("<root><test/></root>")
->>> print(root.tag)
-root
-
-

To override the parser with a different XMLParser you can pass it to -the parser keyword argument.

-

The base_url keyword argument allows to set the original base URL of -the document to support relative Paths when looking up external entities -(DTD, XInclude, ...).

-
-
-
-
- -
- -
- - -
-

XMLDTDID(text, - parser=None, - base_url=None) -

-
  -
- -

Parse the text and return a tuple (root node, ID dictionary). The root -node is the same as returned by the XML() function. The dictionary -contains string-element pairs. The dictionary keys are the values of ID -attributes as defined by the DTD. The elements referenced by the ID are -stored as dictionary values.

-

Note that you must not modify the XML tree if you use the ID dictionary. -The results are undefined.

-
-
-
-
- -
- -
- - -
-

XPathEvaluator(etree_or_element, - namespaces=None, - extensions=None, - regexp=True, - smart_strings=True) -

-
  -
- -

Creates an XPath evaluator for an ElementTree or an Element.

-

The resulting object can be called with an XPath expression as argument -and XPath variables provided as keyword arguments.

-

Additional namespace declarations can be passed with the -'namespace' keyword argument. EXSLT regular expression support -can be disabled with the 'regexp' boolean keyword (defaults to -True). Smart strings will be returned for string results unless -you pass smart_strings=False.

-
-
-
-
- -
- -
- - -
-

adopt_external_document(capsule, - parser=None) -

-
  -
- -

Unpack a libxml2 document pointer from a PyCapsule and wrap it in an -lxml ElementTree object.

-

This allows external libraries to build XML/HTML trees using libxml2 -and then pass them efficiently into lxml for further processing. -Requires Python 2.7 or later.

-

If a parser is provided, it will be used for configuring the -lxml document. No parsing will be done.

-

The capsule must have the name "libxml2:xmlDoc" and its pointer -value must reference a correct libxml2 document of type xmlDoc*. -The creator of the capsule must take care to correctly clean up the -document using an appropriate capsule destructor. By default, the -libxml2 document will be copied to let lxml safely own the memory -of the internal tree that it uses.

-

If the capsule context is non-NULL, it must point to a C string that -can be compared using strcmp(). If the context string equals -"destructor:xmlFreeDoc", the libxml2 document will not be copied -but the capsule invalidated instead by clearing its destructor and -name. That way, lxml takes ownership of the libxml2 document in memory -without creating a copy first, and the capsule destructor will not be -called. The document will then eventually be cleaned up by lxml using -the libxml2 API function xmlFreeDoc() once it is no longer used.

-

If no copy is made, later modifications of the tree outside of lxml -should not be attempted after transferring the ownership.

-
-
-
-
- -
- -
- - -
-

cleanup_namespaces(tree_or_element, - top_nsmap=None, - keep_ns_prefixes=None) -

-
  -
- -

Remove all namespace declarations from a subtree that are not used -by any of the elements or attributes in that tree.

-

If a 'top_nsmap' is provided, it must be a mapping from prefixes -to namespace URIs. These namespaces will be declared on the top -element of the subtree before running the cleanup, which allows -moving namespace declarations to the top of the tree.

-

If a 'keep_ns_prefixes' is provided, it must be a list of prefixes. -These prefixes will not be removed as part of the cleanup.

-
-
-
-
- -
- -
- - -
-

clear_error_log() -

-
  -
- -

Clear the global error log. Note that this log is already bound to a -fixed size.

-

Note: since lxml 2.2, the global error log is local to a thread -and this function will only clear the global error log of the -current thread.

-
-
-
-
- -
- -
- - -
-

fromstring(text, - parser=None, - base_url=None) -

-
  -
- -

Parses an XML document or fragment from a string. Returns the -root node (or the result returned by a parser target).

-

To override the default parser with a different parser you can pass it to -the parser keyword argument.

-

The base_url keyword argument allows to set the original base URL of -the document to support relative Paths when looking up external entities -(DTD, XInclude, ...).

-
-
-
-
- -
- -
- - -
-

fromstringlist(strings, - parser=None) -

-
  -
- -

Parses an XML document from a sequence of strings. Returns the -root node (or the result returned by a parser target).

-

To override the default parser with a different parser you can pass it to -the parser keyword argument.

-
-
-
-
- -
- -
- - -
-

parse(source, - parser=None, - base_url=None) -

-
  -
- -

Return an ElementTree object loaded with source elements. If no parser -is provided as second argument, the default parser is used.

-

The source can be any of the following:

-
    -
  • a file name/path
  • -
  • a file object
  • -
  • a file-like object
  • -
  • a URL using the HTTP or FTP protocol
  • -
-

To parse from a string, use the fromstring() function instead.

-

Note that it is generally faster to parse from a file path or URL -than from an open file object or file-like object. Transparent -decompression from gzip compressed sources is supported (unless -explicitly disabled in libxml2).

-

The base_url keyword allows setting a URL for the document -when parsing from a file-like object. This is needed when looking -up external entities (DTD, XInclude, ...) with relative paths.

-
-
-
-
- -
- -
- - -
-

parseid(source, - parser=None) -

-
  -
- -

Parses the source into a tuple containing an ElementTree object and an -ID dictionary. If no parser is provided as second argument, the default -parser is used.

-

Note that you must not modify the XML tree if you use the ID dictionary. -The results are undefined.

-
-
-
-
- -
- -
- - -
-

set_default_parser(parser=None) -

-
  -
- -

Set a default parser for the current thread. This parser is used -globally whenever no parser is supplied to the various parse functions of -the lxml API. If this function is called without a parser (or if it is -None), the default parser is reset to the original configuration.

-

Note that the pre-installed default parser is not thread-safe. Avoid the -default parser in multi-threaded environments. You can create a separate -parser for each thread explicitly or use a parser pool.

-
-
-
-
- -
- -
- - -
-

strip_attributes(tree_or_element, - *attribute_names) -

-
  -
- -

Delete all attributes with the provided attribute names from an -Element (or ElementTree) and its descendants.

-

Attribute names can contain wildcards as in _Element.iter.

-

Example usage:

-
-strip_attributes(root_element,
-                 'simpleattr',
-                 '{http://some/ns}attrname',
-                 '{http://other/ns}*')
-
-
-
-
-
- -
- -
- - -
-

strip_elements(tree_or_element, - with_tail=True, - *tag_names) -

-
  -
- -

Delete all elements with the provided tag names from a tree or -subtree. This will remove the elements and their entire subtree, -including all their attributes, text content and descendants. It -will also remove the tail text of the element unless you -explicitly set the with_tail keyword argument option to False.

-

Tag names can contain wildcards as in _Element.iter.

-

Note that this will not delete the element (or ElementTree root -element) that you passed even if it matches. It will only treat -its descendants. If you want to include the root element, check -its tag name directly before even calling this function.

-

Example usage:

-
-strip_elements(some_element,
-    'simpletagname',             # non-namespaced tag
-    '{http://some/ns}tagname',   # namespaced tag
-    '{http://some/other/ns}*'    # any tag from a namespace
-    lxml.etree.Comment           # comments
-    )
-
-
-
-
-
- -
- -
- - -
-

strip_tags(tree_or_element, - *tag_names) -

-
  -
- -

Delete all elements with the provided tag names from a tree or -subtree. This will remove the elements and their attributes, but -not their text/tail content or descendants. Instead, it will -merge the text content and children of the element into its -parent.

-

Tag names can contain wildcards as in _Element.iter.

-

Note that this will not delete the element (or ElementTree root -element) that you passed even if it matches. It will only treat -its descendants.

-

Example usage:

-
-strip_tags(some_element,
-    'simpletagname',             # non-namespaced tag
-    '{http://some/ns}tagname',   # namespaced tag
-    '{http://some/other/ns}*'    # any tag from a namespace
-    Comment                      # comments (including their text!)
-    )
-
-
-
-
-
- -
- -
- - -
-

tostring(element_or_tree, - encoding=None, - method="xml", - xml_declaration=None, - pretty_print=False, - with_tail=True, - standalone=None, - doctype=None, - exclusive=False, - with_comments=True, - inclusive_ns_prefixes=None) -

-
  -
- -

Serialize an element to an encoded string representation of its XML -tree.

-

Defaults to ASCII encoding without XML declaration. This -behaviour can be configured with the keyword arguments 'encoding' -(string) and 'xml_declaration' (bool). Note that changing the -encoding to a non UTF-8 compatible encoding will enable a -declaration by default.

-

You can also serialise to a Unicode string without declaration by -passing the unicode function as encoding (or str in Py3), -or the name 'unicode'. This changes the return value from a byte -string to an unencoded unicode string.

-

The keyword argument 'pretty_print' (bool) enables formatted XML.

-

The keyword argument 'method' selects the output method: 'xml', -'html', plain 'text' (text content without tags) or 'c14n'. -Default is 'xml'.

-

The exclusive and with_comments arguments are only used -with C14N output, where they request exclusive and uncommented -C14N serialisation respectively.

-

Passing a boolean value to the standalone option will output -an XML declaration with the corresponding standalone flag.

-

The doctype option allows passing in a plain string that will -be serialised before the XML tree. Note that passing in non -well-formed content here will make the XML output non well-formed. -Also, an existing doctype in the document tree will not be removed -when serialising an ElementTree instance.

-

You can prevent the tail text of the element from being serialised -by passing the boolean with_tail option. This has no impact -on the tail text of children, which will always be serialised.

-
-
-
-
- -
- -
- - -
-

tostringlist(element_or_tree, - *args, - **kwargs) -

-
  -
- -

Serialize an element to an encoded string representation of its XML -tree, stored in a list of partial strings.

-

This is purely for ElementTree 1.3 compatibility. The result is a -single string wrapped in a list.

-
-
-
-
- -
- -
- - -
-

tounicode(element_or_tree, - method="xml", - pretty_print=False, - with_tail=True, - doctype=None) -

-
  -
- -

Serialize an element to the Python unicode representation of its XML -tree.

-

Note that the result does not carry an XML encoding declaration and is -therefore not necessarily suited for serialization to byte streams without -further treatment.

-

The boolean keyword argument 'pretty_print' enables formatted XML.

-

The keyword argument 'method' selects the output method: 'xml', -'html' or plain 'text'.

-

You can prevent the tail text of the element from being serialised -by passing the boolean with_tail option. This has no impact -on the tail text of children, which will always be serialised.

-
-
-

Deprecated: - use tostring(el, encoding='unicode') instead. -

-
-
- -
- -
- - -
-

use_global_python_log(log) -

-
  -
- -

Replace the global error log by an etree.PyErrorLog that uses the -standard Python logging package.

-

Note that this disables access to the global error log from exceptions. -Parsers, XSLT etc. will continue to provide their normal local error log.

-

Note: prior to lxml 2.2, this changed the error log globally. -Since lxml 2.2, the global error log is local to a thread and this -function will only set the global error log of the current thread.

-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

__pyx_capi__

- -
-
-
-
Value:
-
-{'adoptExternalDocument': <capsule object "struct LxmlElementTree *(xm\
-lDoc *, PyObject *, int)" at 0x7f42b7808630>,
- 'appendChild': <capsule object "void (struct LxmlElement *, struct Lx\
-mlElement *)" at 0x7f42b7808e10>,
- 'appendChildToElement': <capsule object "int (struct LxmlElement *, s\
-truct LxmlElement *)" at 0x7f42b7808e40>,
- 'attributeValue': <capsule object "PyObject *(xmlNode *, xmlAttr *)" \
-at 0x7f42b7808ae0>,
-...
-
-
-
-
-
- -
- -
-

__test__

- -
-
-
-
Value:
-
-{u'FunctionNamespace (line 207)': u'''FunctionNamespace(ns_uri)
-
-    Retrieve the function namespace object associated with the given
-    URI.
-
-    Creates a new one if it does not yet exist. A function namespace
-    can only be used to register extension functions.
-
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.AncestorsIterator-class.html b/doc/html/api/lxml.etree.AncestorsIterator-class.html deleted file mode 100644 index 75c564d0..00000000 --- a/doc/html/api/lxml.etree.AncestorsIterator-class.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - lxml.etree.AncestorsIterator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class AncestorsIterator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class AncestorsIterator

-
-           object --+    
-                    |    
-_ElementMatchIterator --+
-                        |
-                       AncestorsIterator
-
- -
-AncestorsIterator(self, node, tag=None) -Iterates over the ancestors of an element (from parent to parent). - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _ElementMatchIterator: - __iter__, - __next__, - next -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.AttributeBasedElementClassLookup-class.html b/doc/html/api/lxml.etree.AttributeBasedElementClassLookup-class.html deleted file mode 100644 index dff9199b..00000000 --- a/doc/html/api/lxml.etree.AttributeBasedElementClassLookup-class.html +++ /dev/null @@ -1,316 +0,0 @@ - - - - - lxml.etree.AttributeBasedElementClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class AttributeBasedElementClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class AttributeBasedElementClassLookup

-
-            object --+        
-                     |        
-    ElementClassLookup --+    
-                         |    
-FallbackElementClassLookup --+
-                             |
-                            AttributeBasedElementClassLookup
-
- -
-

AttributeBasedElementClassLookup(self, attribute_name, class_mapping, fallback=None) -Checks an attribute of an Element and looks up the value in a -class dictionary.

-
-
Arguments:
-
    -
  • attribute name - '{ns}name' style string
  • -
  • class mapping - Python dict mapping attribute values to Element classes
  • -
  • fallback - optional fallback lookup mechanism
  • -
-
-
-

A None key in the class mapping will be checked if the attribute is -missing.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - attribute_name, - class_mapping, - fallback=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from FallbackElementClassLookup: - set_fallback -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from FallbackElementClassLookup: - fallback -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - attribute_name, - class_mapping, - fallback=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.C14NError-class.html b/doc/html/api/lxml.etree.C14NError-class.html deleted file mode 100644 index ca048399..00000000 --- a/doc/html/api/lxml.etree.C14NError-class.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - lxml.etree.C14NError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class C14NError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class C14NError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      C14NError
-
- -
-Error during C14N serialisation. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.CDATA-class.html b/doc/html/api/lxml.etree.CDATA-class.html deleted file mode 100644 index cde27a4d..00000000 --- a/doc/html/api/lxml.etree.CDATA-class.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - lxml.etree.CDATA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class CDATA - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class CDATA

-
-object --+
-         |
-        CDATA
-
- -
-

CDATA(data)

-

CDATA factory. This factory creates an opaque data object that -can be used to set Element text. The usual way to use it is:

-
->>> el = Element('content')
->>> el.text = CDATA('a string')
-
->>> print(el.text)
-a string
->>> print(tostring(el, encoding="unicode"))
-<content><![CDATA[a string]]></content>
-
- - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.CommentBase-class.html b/doc/html/api/lxml.etree.CommentBase-class.html deleted file mode 100644 index bca63d98..00000000 --- a/doc/html/api/lxml.etree.CommentBase-class.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - lxml.etree.CommentBase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class CommentBase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class CommentBase

-
-         object --+            
-                  |            
-           _Element --+        
-                      |        
-??.__ContentOnlyElement --+    
-                          |    
-                   _Comment --+
-                              |
-                             CommentBase
-
- -
Known Subclasses:
-
- -
- -
-

All custom Comment classes must inherit from this one.

-

To create an XML Comment instance, use the Comment() factory.

-

Subclasses must not override __init__ or __new__ as it is -absolutely undefined when these objects will be created or -destroyed. All persistent state of Comments must be stored in the -underlying XML. If you really need to initialize the object after -creation, you can implement an _init(self) method that will be -called after object creation.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _Comment: - __repr__ -

-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - get, - insert, - items, - keys, - set, - values -

-

Inherited from _Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from _Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _Comment: - tag -

-

Inherited from unreachable.__ContentOnlyElement: - attrib, - text -

-

Inherited from _Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.CustomElementClassLookup-class.html b/doc/html/api/lxml.etree.CustomElementClassLookup-class.html deleted file mode 100644 index 81598dd0..00000000 --- a/doc/html/api/lxml.etree.CustomElementClassLookup-class.html +++ /dev/null @@ -1,295 +0,0 @@ - - - - - lxml.etree.CustomElementClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class CustomElementClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class CustomElementClassLookup

-
-            object --+        
-                     |        
-    ElementClassLookup --+    
-                         |    
-FallbackElementClassLookup --+
-                             |
-                            CustomElementClassLookup
-
- -
Known Subclasses:
-
- -
- -
-

CustomElementClassLookup(self, fallback=None) -Element class lookup based on a subclass method.

-

You can inherit from this class and override the method:

-
-lookup(self, type, doc, namespace, name)
-
-

to lookup the element class for a node. Arguments of the method: -* type: one of 'element', 'comment', 'PI', 'entity' -* doc: document that the node is in -* namespace: namespace URI of the node (or None for comments/PIs/entities) -* name: name of the element/entity, None for comments, target for PIs

-

If you return None from this method, the fallback will be called.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
lookup(self, - type, - doc, - namespace, - name) - - -
- -
-

Inherited from FallbackElementClassLookup: - __init__, - set_fallback -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from FallbackElementClassLookup: - fallback -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.DTD-class.html b/doc/html/api/lxml.etree.DTD-class.html deleted file mode 100644 index 0e052660..00000000 --- a/doc/html/api/lxml.etree.DTD-class.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - - lxml.etree.DTD - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class DTD - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DTD

-
-object --+    
-         |    
-_Validator --+
-             |
-            DTD
-
- -
-

DTD(self, file=None, external_id=None) -A DTD validator.

-

Can load from filesystem directly given a filename or file-like object. -Alternatively, pass the keyword parameter external_id to load from a -catalog.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - etree)
- Validate doc using the DTD.
- - -
- -
-   - - - - - - -
__init__(self, - file=None, - external_id=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
elements(...) - - -
- -
-   - - - - - - -
entities(...) - - -
- -
-   - - - - - - -
iterelements(...) - - -
- -
-   - - - - - - -
iterentities(...) - - -
- -
-

Inherited from _Validator: - assertValid, - assert_, - validate -

-

Inherited from _Validator (private): - _append_log_message, - _clear_error_log -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - external_id -
-   - - name -
-   - - system_url -
-

Inherited from _Validator: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__call__(self, - etree) -
(Call operator) -

-
  -
- -

Validate doc using the DTD.

-

Returns true if the document is valid, false if not.

-
-
-
-
- -
- -
- - -
-

__init__(self, - file=None, - external_id=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.DTDError-class.html b/doc/html/api/lxml.etree.DTDError-class.html deleted file mode 100644 index 1a36b77d..00000000 --- a/doc/html/api/lxml.etree.DTDError-class.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - lxml.etree.DTDError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class DTDError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DTDError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      DTDError
-
- -
Known Subclasses:
-
- -
- -
-Base class for DTD errors. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.DTDParseError-class.html b/doc/html/api/lxml.etree.DTDParseError-class.html deleted file mode 100644 index 4b36ceb2..00000000 --- a/doc/html/api/lxml.etree.DTDParseError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.DTDParseError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class DTDParseError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DTDParseError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                                DTDError --+
-                                           |
-                                          DTDParseError
-
- -
-Error while parsing a DTD. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.DTDValidateError-class.html b/doc/html/api/lxml.etree.DTDValidateError-class.html deleted file mode 100644 index 8c5c2827..00000000 --- a/doc/html/api/lxml.etree.DTDValidateError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.DTDValidateError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class DTDValidateError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DTDValidateError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                                DTDError --+
-                                           |
-                                          DTDValidateError
-
- -
-Error while validating an XML document with a DTD. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.DocInfo-class.html b/doc/html/api/lxml.etree.DocInfo-class.html deleted file mode 100644 index dbe6482b..00000000 --- a/doc/html/api/lxml.etree.DocInfo-class.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - lxml.etree.DocInfo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class DocInfo - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DocInfo

-
-object --+
-         |
-        DocInfo
-
- -
-Document information provided by parser and DTD. - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
clear(...)
- Removes DOCTYPE and internal subset from the document.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - URL
- The source URL of the document (or None if unknown). -
-   - - doctype
- Returns a DOCTYPE declaration string for the document. -
-   - - encoding
- Returns the encoding name as declared by the document. -
-   - - externalDTD
- Returns a DTD validator based on the external subset of the document. -
-   - - internalDTD
- Returns a DTD validator based on the internal subset of the document. -
-   - - public_id
- Public ID of the DOCTYPE. -
-   - - root_name
- Returns the name of the root node as defined by the DOCTYPE. -
-   - - standalone
- Returns the standalone flag as declared by the document. The possible -values are True (standalone='yes'), False -(standalone='no' or flag not provided in the declaration), -and None (unknown or no declaration found). Note that a -normal truth test on this value will always tell if the -standalone flag was set to 'yes' or not. -
-   - - system_url
- System ID of the DOCTYPE. -
-   - - xml_version
- Returns the XML version as declared by the document. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

public_id

-

Public ID of the DOCTYPE.

-

Mutable. May be set to a valid string or None. If a DTD does not -exist, setting this variable (even to None) will create one.

-
-
-
-
- -
- -
-

system_url

-

System ID of the DOCTYPE.

-

Mutable. May be set to a valid string or None. If a DTD does not -exist, setting this variable (even to None) will create one.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.DocumentInvalid-class.html b/doc/html/api/lxml.etree.DocumentInvalid-class.html deleted file mode 100644 index ac5b96f7..00000000 --- a/doc/html/api/lxml.etree.DocumentInvalid-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.DocumentInvalid - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class DocumentInvalid - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DocumentInvalid

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      DocumentInvalid
-
- -
-

Validation error.

-

Raised by all document validators when their assertValid(tree) -method fails.

- - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ETCompatXMLParser-class.html b/doc/html/api/lxml.etree.ETCompatXMLParser-class.html deleted file mode 100644 index 2f1ddcea..00000000 --- a/doc/html/api/lxml.etree.ETCompatXMLParser-class.html +++ /dev/null @@ -1,348 +0,0 @@ - - - - - lxml.etree.ETCompatXMLParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ETCompatXMLParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETCompatXMLParser

-
-    object --+            
-             |            
-??._BaseParser --+        
-                 |        
-       _FeedParser --+    
-                     |    
-             XMLParser --+
-                         |
-                        ETCompatXMLParser
-
- -
-

ETCompatXMLParser(self, encoding=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, schema=None, huge_tree=False, remove_blank_text=False, resolve_entities=True, remove_comments=True, remove_pis=True, strip_cdata=True, target=None, compact=True)

-

An XML parser with an ElementTree compatible default setup.

-

See the XMLParser class for details.

-

This parser has remove_comments and remove_pis enabled by default -and thus ignores comments and processing instructions.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - encoding=None, - attribute_defaults=False, - dtd_validation=False, - load_dtd=False, - no_network=True, - ns_clean=False, - recover=False, - schema=None, - huge_tree=False, - remove_blank_text=False, - resolve_entities=True, - remove_comments=True, - remove_pis=True, - strip_cdata=True, - target=None, - compact=True)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _FeedParser: - close, - feed -

-

Inherited from unreachable._BaseParser: - copy, - makeelement, - setElementClassLookup, - set_element_class_lookup -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _FeedParser: - feed_error_log -

-

Inherited from unreachable._BaseParser: - error_log, - resolvers, - target, - version -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - encoding=None, - attribute_defaults=False, - dtd_validation=False, - load_dtd=False, - no_network=True, - ns_clean=False, - recover=False, - schema=None, - huge_tree=False, - remove_blank_text=False, - resolve_entities=True, - remove_comments=True, - remove_pis=True, - strip_cdata=True, - target=None, - compact=True) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ETXPath-class.html b/doc/html/api/lxml.etree.ETXPath-class.html deleted file mode 100644 index f56036d8..00000000 --- a/doc/html/api/lxml.etree.ETXPath-class.html +++ /dev/null @@ -1,316 +0,0 @@ - - - - - lxml.etree.ETXPath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ETXPath - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETXPath

-
-         object --+        
-                  |        
-_XPathEvaluatorBase --+    
-                      |    
-                  XPath --+
-                          |
-                         ETXPath
-
- -
-

ETXPath(self, path, extensions=None, regexp=True, smart_strings=True) -Special XPath class that supports the ElementTree {uri} notation for namespaces.

-

Note that this class does not accept the namespace keyword -argument. All namespaces must be passed as part of the path -string. Smart strings will be returned for string results unless -you pass smart_strings=False.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - path, - extensions=None, - regexp=True, - smart_strings=True)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from XPath: - __call__, - __repr__ -

-

Inherited from _XPathEvaluatorBase: - evaluate -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from XPath: - path -

-

Inherited from _XPathEvaluatorBase: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - path, - extensions=None, - regexp=True, - smart_strings=True) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ElementBase-class.html b/doc/html/api/lxml.etree.ElementBase-class.html deleted file mode 100644 index b202e7f5..00000000 --- a/doc/html/api/lxml.etree.ElementBase-class.html +++ /dev/null @@ -1,385 +0,0 @@ - - - - - lxml.etree.ElementBase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ElementBase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementBase

-
-object --+    
-         |    
-  _Element --+
-             |
-            ElementBase
-
- -
Known Subclasses:
-
- -
- -
-

ElementBase(*children, attrib=None, nsmap=None, **_extra)

-

The public Element class. All custom Element classes must inherit -from this one. To create an Element, use the Element() factory.

-

BIG FAT WARNING: Subclasses must not override __init__ or -__new__ as it is absolutely undefined when these objects will be -created or destroyed. All persistent state of Elements must be -stored in the underlying XML. If you really need to initialize -the object after creation, you can implement an _init(self) -method that will be called directly after object creation.

-

Subclasses of this class can be instantiated to create a new -Element. By default, the tag name will be the class name and the -namespace will be empty. You can modify this with the following -class attributes:

- -

In user code, the latter three are commonly inherited in class -hierarchies that implement a common namespace.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(attrib=None, - nsmap=None, - *children, - **_extra)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __repr__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from _Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(attrib=None, - nsmap=None, - *children, - **_extra) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ElementChildIterator-class.html b/doc/html/api/lxml.etree.ElementChildIterator-class.html deleted file mode 100644 index 1d39b9d7..00000000 --- a/doc/html/api/lxml.etree.ElementChildIterator-class.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - lxml.etree.ElementChildIterator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ElementChildIterator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementChildIterator

-
-           object --+    
-                    |    
-_ElementMatchIterator --+
-                        |
-                       ElementChildIterator
-
- -
-ElementChildIterator(self, node, tag=None, reversed=False) -Iterates over the children of an element. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _ElementMatchIterator: - __iter__, - __next__, - next -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ElementClassLookup-class.html b/doc/html/api/lxml.etree.ElementClassLookup-class.html deleted file mode 100644 index fc5d2b11..00000000 --- a/doc/html/api/lxml.etree.ElementClassLookup-class.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - lxml.etree.ElementClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ElementClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementClassLookup

-
-object --+
-         |
-        ElementClassLookup
-
- -
Known Subclasses:
-
- -
- -
-ElementClassLookup(self) -Superclass of Element class lookups. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ElementDefaultClassLookup-class.html b/doc/html/api/lxml.etree.ElementDefaultClassLookup-class.html deleted file mode 100644 index f88021b7..00000000 --- a/doc/html/api/lxml.etree.ElementDefaultClassLookup-class.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - - lxml.etree.ElementDefaultClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ElementDefaultClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementDefaultClassLookup

-
-        object --+    
-                 |    
-ElementClassLookup --+
-                     |
-                    ElementDefaultClassLookup
-
- -
-

ElementDefaultClassLookup(self, element=None, comment=None, pi=None, entity=None) -Element class lookup scheme that always returns the default Element -class.

-

The keyword arguments element, comment, pi and entity -accept the respective Element classes.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - element=None, - comment=None, - pi=None, - entity=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - comment_class -
-   - - element_class -
-   - - entity_class -
-   - - pi_class -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - element=None, - comment=None, - pi=None, - entity=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ElementDepthFirstIterator-class.html b/doc/html/api/lxml.etree.ElementDepthFirstIterator-class.html deleted file mode 100644 index 78499726..00000000 --- a/doc/html/api/lxml.etree.ElementDepthFirstIterator-class.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - lxml.etree.ElementDepthFirstIterator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ElementDepthFirstIterator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementDepthFirstIterator

-
-object --+
-         |
-        ElementDepthFirstIterator
-
- -
-

ElementDepthFirstIterator(self, node, tag=None, inclusive=True) -Iterates over an element and its sub-elements in document order (depth -first pre-order).

-

Note that this also includes comments, entities and processing -instructions. To filter them out, check if the tag property -of the returned element is a string (i.e. not None and not a -factory function), or pass the Element factory for the tag -argument to receive only Elements.

-

If the optional tag argument is not None, the iterator returns only -the elements that match the respective name and namespace.

-

The optional boolean argument 'inclusive' defaults to True and can be set -to False to exclude the start element itself.

-

Note that the behaviour of this iterator is completely undefined if the -tree it traverses is modified during iteration.

- - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__next__(...) - - -
- -
- the next value, or raise StopIteration - - - - - - -
next(x) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ElementNamespaceClassLookup-class.html b/doc/html/api/lxml.etree.ElementNamespaceClassLookup-class.html deleted file mode 100644 index b11f9d35..00000000 --- a/doc/html/api/lxml.etree.ElementNamespaceClassLookup-class.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - lxml.etree.ElementNamespaceClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ElementNamespaceClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementNamespaceClassLookup

-
-            object --+        
-                     |        
-    ElementClassLookup --+    
-                         |    
-FallbackElementClassLookup --+
-                             |
-                            ElementNamespaceClassLookup
-
- -
-

ElementNamespaceClassLookup(self, fallback=None)

-

Element class lookup scheme that searches the Element class in the -Namespace registry.

-

Usage:

-
->>> lookup = ElementNamespaceClassLookup()
->>> ns_elements = lookup.get_namespace("http://schema.org/Movie")
-
->>> @ns_elements
-... class movie(ElementBase):
-...     "Element implementation for 'movie' tag (using class name) in schema namespace."
-
->>> @ns_elements("movie")
-... class MovieElement(ElementBase):
-...     "Element implementation for 'movie' tag (explicit tag name) in schema namespace."
- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - fallback=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
get_namespace(self, - ns_uri)
- Retrieve the namespace object associated with the given URI. -Pass None for the empty namespace.
- - -
- -
-

Inherited from FallbackElementClassLookup: - set_fallback -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from FallbackElementClassLookup: - fallback -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - fallback=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

get_namespace(self, - ns_uri) -

-
  -
- -

Retrieve the namespace object associated with the given URI. -Pass None for the empty namespace.

-

Creates a new namespace object if it does not yet exist.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ElementTextIterator-class.html b/doc/html/api/lxml.etree.ElementTextIterator-class.html deleted file mode 100644 index bdd62270..00000000 --- a/doc/html/api/lxml.etree.ElementTextIterator-class.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - lxml.etree.ElementTextIterator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ElementTextIterator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementTextIterator

-
-object --+
-         |
-        ElementTextIterator
-
- -
-

ElementTextIterator(self, element, tag=None, with_tail=True) -Iterates over the text content of a subtree.

-

You can pass the tag keyword argument to restrict text content to a -specific tag name.

-

You can set the with_tail keyword argument to False to skip over -tail text (e.g. if you know that it's only whitespace from pretty-printing).

- - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__next__(...) - - -
- -
- the next value, or raise StopIteration - - - - - - -
next(x) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.EntityBase-class.html b/doc/html/api/lxml.etree.EntityBase-class.html deleted file mode 100644 index d7fd50be..00000000 --- a/doc/html/api/lxml.etree.EntityBase-class.html +++ /dev/null @@ -1,373 +0,0 @@ - - - - - lxml.etree.EntityBase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class EntityBase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class EntityBase

-
-         object --+            
-                  |            
-           _Element --+        
-                      |        
-??.__ContentOnlyElement --+    
-                          |    
-                    _Entity --+
-                              |
-                             EntityBase
-
- -
Known Subclasses:
-
- -
- -
-

All custom Entity classes must inherit from this one.

-

To create an XML Entity instance, use the Entity() factory.

-

Subclasses must not override __init__ or __new__ as it is -absolutely undefined when these objects will be created or -destroyed. All persistent state of Entities must be stored in the -underlying XML. If you really need to initialize the object after -creation, you can implement an _init(self) method that will be -called after object creation.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _Entity: - __repr__ -

-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - get, - insert, - items, - keys, - set, - values -

-

Inherited from _Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from _Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _Entity: - name, - tag, - text -

-

Inherited from unreachable.__ContentOnlyElement: - attrib -

-

Inherited from _Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.Error-class.html b/doc/html/api/lxml.etree.Error-class.html deleted file mode 100644 index db73661e..00000000 --- a/doc/html/api/lxml.etree.Error-class.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - lxml.etree.Error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class Error - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Error

-
-              object --+        
-                       |        
-exceptions.BaseException --+    
-                           |    
-        exceptions.Exception --+
-                               |
-                              Error
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from exceptions.Exception: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ErrorDomains-class.html b/doc/html/api/lxml.etree.ErrorDomains-class.html deleted file mode 100644 index cfd51347..00000000 --- a/doc/html/api/lxml.etree.ErrorDomains-class.html +++ /dev/null @@ -1,508 +0,0 @@ - - - - - lxml.etree.ErrorDomains - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ErrorDomains - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ErrorDomains

-
-object --+
-         |
-        ErrorDomains
-
- -
-Libxml2 error domains - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- D[k] if k in D, else d - - - - - - -
_getName(D, - k, - d=...)
- d defaults to None.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - BUFFER = 29 -
-   - - C14N = 21 -
-   - - CATALOG = 20 -
-   - - CHECK = 24 -
-   - - DATATYPE = 15 -
-   - - DTD = 4 -
-   - - FTP = 9 -
-   - - HTML = 5 -
-   - - HTTP = 10 -
-   - - I18N = 27 -
-   - - IO = 8 -
-   - - MEMORY = 6 -
-   - - MODULE = 26 -
-   - - NAMESPACE = 3 -
-   - - NONE = 0 -
-   - - OUTPUT = 7 -
-   - - PARSER = 1 -
-   - - REGEXP = 14 -
-   - - RELAXNGP = 18 -
-   - - RELAXNGV = 19 -
-   - - SCHEMASP = 16 -
-   - - SCHEMASV = 17 -
-   - - SCHEMATRONV = 28 -
-   - - TREE = 2 -
-   - - URI = 30 -
-   - - VALID = 23 -
-   - - WRITER = 25 -
-   - - XINCLUDE = 11 -
-   - - XPATH = 12 -
-   - - XPOINTER = 13 -
-   - - XSLT = 22 -
-   - - __qualname__ = 'ErrorDomains' -
-   - - _names = {0: 'NONE', 1: 'PARSER', 2: 'TREE', 3: 'NAMESPACE', 4... -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

_names

- -
-
-
-
Value:
-
-{0: 'NONE',
- 1: 'PARSER',
- 2: 'TREE',
- 3: 'NAMESPACE',
- 4: 'DTD',
- 5: 'HTML',
- 6: 'MEMORY',
- 7: 'OUTPUT',
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ErrorLevels-class.html b/doc/html/api/lxml.etree.ErrorLevels-class.html deleted file mode 100644 index 6871c2bb..00000000 --- a/doc/html/api/lxml.etree.ErrorLevels-class.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - - lxml.etree.ErrorLevels - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ErrorLevels - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ErrorLevels

-
-object --+
-         |
-        ErrorLevels
-
- -
-Libxml2 error levels - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- D[k] if k in D, else d - - - - - - -
_getName(D, - k, - d=...)
- d defaults to None.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - ERROR = 2 -
-   - - FATAL = 3 -
-   - - NONE = 0 -
-   - - WARNING = 1 -
-   - - __qualname__ = 'ErrorLevels' -
-   - - _names = {0: 'NONE', 1: 'WARNING', 2: 'ERROR', 3: 'FATAL'} -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ErrorTypes-class.html b/doc/html/api/lxml.etree.ErrorTypes-class.html deleted file mode 100644 index 5b2ed6a2..00000000 --- a/doc/html/api/lxml.etree.ErrorTypes-class.html +++ /dev/null @@ -1,5429 +0,0 @@ - - - - - lxml.etree.ErrorTypes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ErrorTypes - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ErrorTypes

-
-object --+
-         |
-        ErrorTypes
-
- -
-Libxml2 error types - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- D[k] if k in D, else d - - - - - - -
_getName(D, - k, - d=...)
- d defaults to None.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - BUF_OVERFLOW = 7000 -
-   - - C14N_CREATE_CTXT = 1950 -
-   - - C14N_CREATE_STACK = 1952 -
-   - - C14N_INVALID_NODE = 1953 -
-   - - C14N_RELATIVE_NAMESPACE = 1955 -
-   - - C14N_REQUIRES_UTF8 = 1951 -
-   - - C14N_UNKNOW_NODE = 1954 -
-   - - CATALOG_ENTRY_BROKEN = 1651 -
-   - - CATALOG_MISSING_ATTR = 1650 -
-   - - CATALOG_NOT_CATALOG = 1653 -
-   - - CATALOG_PREFER_VALUE = 1652 -
-   - - CATALOG_RECURSION = 1654 -
-   - - CHECK_ENTITY_TYPE = 5012 -
-   - - CHECK_FOUND_ATTRIBUTE = 5001 -
-   - - CHECK_FOUND_CDATA = 5003 -
-   - - CHECK_FOUND_COMMENT = 5007 -
-   - - CHECK_FOUND_DOCTYPE = 5008 -
-   - - CHECK_FOUND_ELEMENT = 5000 -
-   - - CHECK_FOUND_ENTITY = 5005 -
-   - - CHECK_FOUND_ENTITYREF = 5004 -
-   - - CHECK_FOUND_FRAGMENT = 5009 -
-   - - CHECK_FOUND_NOTATION = 5010 -
-   - - CHECK_FOUND_PI = 5006 -
-   - - CHECK_FOUND_TEXT = 5002 -
-   - - CHECK_NAME_NOT_NULL = 5037 -
-   - - CHECK_NOT_ATTR = 5023 -
-   - - CHECK_NOT_ATTR_DECL = 5024 -
-   - - CHECK_NOT_DTD = 5022 -
-   - - CHECK_NOT_ELEM_DECL = 5025 -
-   - - CHECK_NOT_ENTITY_DECL = 5026 -
-   - - CHECK_NOT_NCNAME = 5034 -
-   - - CHECK_NOT_NS_DECL = 5027 -
-   - - CHECK_NOT_UTF8 = 5032 -
-   - - CHECK_NO_DICT = 5033 -
-   - - CHECK_NO_DOC = 5014 -
-   - - CHECK_NO_ELEM = 5016 -
-   - - CHECK_NO_HREF = 5028 -
-   - - CHECK_NO_NAME = 5015 -
-   - - CHECK_NO_NEXT = 5020 -
-   - - CHECK_NO_PARENT = 5013 -
-   - - CHECK_NO_PREV = 5018 -
-   - - CHECK_NS_ANCESTOR = 5031 -
-   - - CHECK_NS_SCOPE = 5030 -
-   - - CHECK_OUTSIDE_DICT = 5035 -
-   - - CHECK_UNKNOWN_NODE = 5011 -
-   - - CHECK_WRONG_DOC = 5017 -
-   - - CHECK_WRONG_NAME = 5036 -
-   - - CHECK_WRONG_NEXT = 5021 -
-   - - CHECK_WRONG_PARENT = 5029 -
-   - - CHECK_WRONG_PREV = 5019 -
-   - - DTD_ATTRIBUTE_DEFAULT = 500 -
-   - - DTD_ATTRIBUTE_REDEFINED = 501 -
-   - - DTD_ATTRIBUTE_VALUE = 502 -
-   - - DTD_CONTENT_ERROR = 503 -
-   - - DTD_CONTENT_MODEL = 504 -
-   - - DTD_CONTENT_NOT_DETERMINIST = 505 -
-   - - DTD_DIFFERENT_PREFIX = 506 -
-   - - DTD_DUP_TOKEN = 541 -
-   - - DTD_ELEM_DEFAULT_NAMESPACE = 507 -
-   - - DTD_ELEM_NAMESPACE = 508 -
-   - - DTD_ELEM_REDEFINED = 509 -
-   - - DTD_EMPTY_NOTATION = 510 -
-   - - DTD_ENTITY_TYPE = 511 -
-   - - DTD_ID_FIXED = 512 -
-   - - DTD_ID_REDEFINED = 513 -
-   - - DTD_ID_SUBSET = 514 -
-   - - DTD_INVALID_CHILD = 515 -
-   - - DTD_INVALID_DEFAULT = 516 -
-   - - DTD_LOAD_ERROR = 517 -
-   - - DTD_MISSING_ATTRIBUTE = 518 -
-   - - DTD_MIXED_CORRUPT = 519 -
-   - - DTD_MULTIPLE_ID = 520 -
-   - - DTD_NOTATION_REDEFINED = 526 -
-   - - DTD_NOTATION_VALUE = 527 -
-   - - DTD_NOT_EMPTY = 528 -
-   - - DTD_NOT_PCDATA = 529 -
-   - - DTD_NOT_STANDALONE = 530 -
-   - - DTD_NO_DOC = 521 -
-   - - DTD_NO_DTD = 522 -
-   - - DTD_NO_ELEM_NAME = 523 -
-   - - DTD_NO_PREFIX = 524 -
-   - - DTD_NO_ROOT = 525 -
-   - - DTD_ROOT_NAME = 531 -
-   - - DTD_STANDALONE_DEFAULTED = 538 -
-   - - DTD_STANDALONE_WHITE_SPACE = 532 -
-   - - DTD_UNKNOWN_ATTRIBUTE = 533 -
-   - - DTD_UNKNOWN_ELEM = 534 -
-   - - DTD_UNKNOWN_ENTITY = 535 -
-   - - DTD_UNKNOWN_ID = 536 -
-   - - DTD_UNKNOWN_NOTATION = 537 -
-   - - DTD_XMLID_TYPE = 540 -
-   - - DTD_XMLID_VALUE = 539 -
-   - - ERR_ATTLIST_NOT_FINISHED = 51 -
-   - - ERR_ATTLIST_NOT_STARTED = 50 -
-   - - ERR_ATTRIBUTE_NOT_FINISHED = 40 -
-   - - ERR_ATTRIBUTE_NOT_STARTED = 39 -
-   - - ERR_ATTRIBUTE_REDEFINED = 42 -
-   - - ERR_ATTRIBUTE_WITHOUT_VALUE = 41 -
-   - - ERR_CDATA_NOT_FINISHED = 63 -
-   - - ERR_CHARREF_AT_EOF = 10 -
-   - - ERR_CHARREF_IN_DTD = 13 -
-   - - ERR_CHARREF_IN_EPILOG = 12 -
-   - - ERR_CHARREF_IN_PROLOG = 11 -
-   - - ERR_COMMENT_NOT_FINISHED = 45 -
-   - - ERR_CONDSEC_INVALID = 83 -
-   - - ERR_CONDSEC_INVALID_KEYWORD = 95 -
-   - - ERR_CONDSEC_NOT_FINISHED = 59 -
-   - - ERR_CONDSEC_NOT_STARTED = 58 -
-   - - ERR_DOCTYPE_NOT_FINISHED = 61 -
-   - - ERR_DOCUMENT_EMPTY = 4 -
-   - - ERR_DOCUMENT_END = 5 -
-   - - ERR_DOCUMENT_START = 3 -
-   - - ERR_ELEMCONTENT_NOT_FINISHED = 55 -
-   - - ERR_ELEMCONTENT_NOT_STARTED = 54 -
-   - - ERR_ENCODING_NAME = 79 -
-   - - ERR_ENTITYREF_AT_EOF = 14 -
-   - - ERR_ENTITYREF_IN_DTD = 17 -
-   - - ERR_ENTITYREF_IN_EPILOG = 16 -
-   - - ERR_ENTITYREF_IN_PROLOG = 15 -
-   - - ERR_ENTITYREF_NO_NAME = 22 -
-   - - ERR_ENTITYREF_SEMICOL_MISSING = 23 -
-   - - ERR_ENTITY_BOUNDARY = 90 -
-   - - ERR_ENTITY_CHAR_ERROR = 87 -
-   - - ERR_ENTITY_IS_EXTERNAL = 29 -
-   - - ERR_ENTITY_IS_PARAMETER = 30 -
-   - - ERR_ENTITY_LOOP = 89 -
-   - - ERR_ENTITY_NOT_FINISHED = 37 -
-   - - ERR_ENTITY_NOT_STARTED = 36 -
-   - - ERR_ENTITY_PE_INTERNAL = 88 -
-   - - ERR_ENTITY_PROCESSING = 104 -
-   - - ERR_EQUAL_REQUIRED = 75 -
-   - - ERR_EXTRA_CONTENT = 86 -
-   - - ERR_EXT_ENTITY_STANDALONE = 82 -
-   - - ERR_EXT_SUBSET_NOT_FINISHED = 60 -
-   - - ERR_GT_REQUIRED = 73 -
-   - - ERR_HYPHEN_IN_COMMENT = 80 -
-   - - ERR_INTERNAL_ERROR = 1 -
-   - - ERR_INVALID_CHAR = 9 -
-   - - ERR_INVALID_CHARREF = 8 -
-   - - ERR_INVALID_DEC_CHARREF = 7 -
-   - - ERR_INVALID_ENCODING = 81 -
-   - - ERR_INVALID_HEX_CHARREF = 6 -
-   - - ERR_INVALID_URI = 91 -
-   - - ERR_LITERAL_NOT_FINISHED = 44 -
-   - - ERR_LITERAL_NOT_STARTED = 43 -
-   - - ERR_LTSLASH_REQUIRED = 74 -
-   - - ERR_LT_IN_ATTRIBUTE = 38 -
-   - - ERR_LT_REQUIRED = 72 -
-   - - ERR_MISPLACED_CDATA_END = 62 -
-   - - ERR_MISSING_ENCODING = 101 -
-   - - ERR_MIXED_NOT_FINISHED = 53 -
-   - - ERR_MIXED_NOT_STARTED = 52 -
-   - - ERR_NAME_REQUIRED = 68 -
-   - - ERR_NAME_TOO_LONG = 110 -
-   - - ERR_NMTOKEN_REQUIRED = 67 -
-   - - ERR_NOTATION_NOT_FINISHED = 49 -
-   - - ERR_NOTATION_NOT_STARTED = 48 -
-   - - ERR_NOTATION_PROCESSING = 105 -
-   - - ERR_NOT_STANDALONE = 103 -
-   - - ERR_NOT_WELL_BALANCED = 85 -
-   - - ERR_NO_DTD = 94 -
-   - - ERR_NO_MEMORY = 2 -
-   - - ERR_NS_DECL_ERROR = 35 -
-   - - ERR_OK = 0 -
-   - - ERR_PCDATA_REQUIRED = 69 -
-   - - ERR_PEREF_AT_EOF = 18 -
-   - - ERR_PEREF_IN_EPILOG = 20 -
-   - - ERR_PEREF_IN_INT_SUBSET = 21 -
-   - - ERR_PEREF_IN_PROLOG = 19 -
-   - - ERR_PEREF_NO_NAME = 24 -
-   - - ERR_PEREF_SEMICOL_MISSING = 25 -
-   - - ERR_PI_NOT_FINISHED = 47 -
-   - - ERR_PI_NOT_STARTED = 46 -
-   - - ERR_PUBID_REQUIRED = 71 -
-   - - ERR_RESERVED_XML_NAME = 64 -
-   - - ERR_SEPARATOR_REQUIRED = 66 -
-   - - ERR_SPACE_REQUIRED = 65 -
-   - - ERR_STANDALONE_VALUE = 78 -
-   - - ERR_STRING_NOT_CLOSED = 34 -
-   - - ERR_STRING_NOT_STARTED = 33 -
-   - - ERR_TAG_NAME_MISMATCH = 76 -
-   - - ERR_TAG_NOT_FINISHED = 77 -
-   - - ERR_UNDECLARED_ENTITY = 26 -
-   - - ERR_UNKNOWN_ENCODING = 31 -
-   - - ERR_UNKNOWN_VERSION = 108 -
-   - - ERR_UNPARSED_ENTITY = 28 -
-   - - ERR_UNSUPPORTED_ENCODING = 32 -
-   - - ERR_URI_FRAGMENT = 92 -
-   - - ERR_URI_REQUIRED = 70 -
-   - - ERR_USER_STOP = 111 -
-   - - ERR_VALUE_REQUIRED = 84 -
-   - - ERR_VERSION_MISMATCH = 109 -
-   - - ERR_VERSION_MISSING = 96 -
-   - - ERR_XMLDECL_NOT_FINISHED = 57 -
-   - - ERR_XMLDECL_NOT_STARTED = 56 -
-   - - FTP_ACCNT = 2002 -
-   - - FTP_EPSV_ANSWER = 2001 -
-   - - FTP_PASV_ANSWER = 2000 -
-   - - FTP_URL_SYNTAX = 2003 -
-   - - HTML_STRUCURE_ERROR = 800 -
-   - - HTML_UNKNOWN_TAG = 801 -
-   - - HTTP_UNKNOWN_HOST = 2022 -
-   - - HTTP_URL_SYNTAX = 2020 -
-   - - HTTP_USE_IP = 2021 -
-   - - I18N_CONV_FAILED = 6003 -
-   - - I18N_EXCESS_HANDLER = 6002 -
-   - - I18N_NO_HANDLER = 6001 -
-   - - I18N_NO_NAME = 6000 -
-   - - I18N_NO_OUTPUT = 6004 -
-   - - IO_BUFFER_FULL = 1548 -
-   - - IO_EACCES = 1501 -
-   - - IO_EADDRINUSE = 1554 -
-   - - IO_EAFNOSUPPORT = 1556 -
-   - - IO_EAGAIN = 1502 -
-   - - IO_EALREADY = 1555 -
-   - - IO_EBADF = 1503 -
-   - - IO_EBADMSG = 1504 -
-   - - IO_EBUSY = 1505 -
-   - - IO_ECANCELED = 1506 -
-   - - IO_ECHILD = 1507 -
-   - - IO_ECONNREFUSED = 1552 -
-   - - IO_EDEADLK = 1508 -
-   - - IO_EDOM = 1509 -
-   - - IO_EEXIST = 1510 -
-   - - IO_EFAULT = 1511 -
-   - - IO_EFBIG = 1512 -
-   - - IO_EINPROGRESS = 1513 -
-   - - IO_EINTR = 1514 -
-   - - IO_EINVAL = 1515 -
-   - - IO_EIO = 1516 -
-   - - IO_EISCONN = 1551 -
-   - - IO_EISDIR = 1517 -
-   - - IO_EMFILE = 1518 -
-   - - IO_EMLINK = 1519 -
-   - - IO_EMSGSIZE = 1520 -
-   - - IO_ENAMETOOLONG = 1521 -
-   - - IO_ENCODER = 1544 -
-   - - IO_ENETUNREACH = 1553 -
-   - - IO_ENFILE = 1522 -
-   - - IO_ENODEV = 1523 -
-   - - IO_ENOENT = 1524 -
-   - - IO_ENOEXEC = 1525 -
-   - - IO_ENOLCK = 1526 -
-   - - IO_ENOMEM = 1527 -
-   - - IO_ENOSPC = 1528 -
-   - - IO_ENOSYS = 1529 -
-   - - IO_ENOTDIR = 1530 -
-   - - IO_ENOTEMPTY = 1531 -
-   - - IO_ENOTSOCK = 1550 -
-   - - IO_ENOTSUP = 1532 -
-   - - IO_ENOTTY = 1533 -
-   - - IO_ENXIO = 1534 -
-   - - IO_EPERM = 1535 -
-   - - IO_EPIPE = 1536 -
-   - - IO_ERANGE = 1537 -
-   - - IO_EROFS = 1538 -
-   - - IO_ESPIPE = 1539 -
-   - - IO_ESRCH = 1540 -
-   - - IO_ETIMEDOUT = 1541 -
-   - - IO_EXDEV = 1542 -
-   - - IO_FLUSH = 1545 -
-   - - IO_LOAD_ERROR = 1549 -
-   - - IO_NETWORK_ATTEMPT = 1543 -
-   - - IO_NO_INPUT = 1547 -
-   - - IO_UNKNOWN = 1500 -
-   - - IO_WRITE = 1546 -
-   - - MODULE_CLOSE = 4901 -
-   - - MODULE_OPEN = 4900 -
-   - - NS_ERR_ATTRIBUTE_REDEFINED = 203 -
-   - - NS_ERR_COLON = 205 -
-   - - NS_ERR_EMPTY = 204 -
-   - - NS_ERR_QNAME = 202 -
-   - - NS_ERR_UNDEFINED_NAMESPACE = 201 -
-   - - NS_ERR_XML_NAMESPACE = 200 -
-   - - REGEXP_COMPILE_ERROR = 1450 -
-   - - RNGP_ANYNAME_ATTR_ANCESTOR = 1000 -
-   - - RNGP_ATTRIBUTE_CHILDREN = 1002 -
-   - - RNGP_ATTRIBUTE_CONTENT = 1003 -
-   - - RNGP_ATTRIBUTE_EMPTY = 1004 -
-   - - RNGP_ATTRIBUTE_NOOP = 1005 -
-   - - RNGP_ATTR_CONFLICT = 1001 -
-   - - RNGP_CHOICE_CONTENT = 1006 -
-   - - RNGP_CHOICE_EMPTY = 1007 -
-   - - RNGP_CREATE_FAILURE = 1008 -
-   - - RNGP_DATA_CONTENT = 1009 -
-   - - RNGP_DEFINE_CREATE_FAILED = 1011 -
-   - - RNGP_DEFINE_EMPTY = 1012 -
-   - - RNGP_DEFINE_MISSING = 1013 -
-   - - RNGP_DEFINE_NAME_MISSING = 1014 -
-   - - RNGP_DEF_CHOICE_AND_INTERLEAVE = 1010 -
-   - - RNGP_ELEMENT_CONTENT = 1018 -
-   - - RNGP_ELEMENT_EMPTY = 1017 -
-   - - RNGP_ELEMENT_NAME = 1019 -
-   - - RNGP_ELEMENT_NO_CONTENT = 1020 -
-   - - RNGP_ELEM_CONTENT_EMPTY = 1015 -
-   - - RNGP_ELEM_CONTENT_ERROR = 1016 -
-   - - RNGP_ELEM_TEXT_CONFLICT = 1021 -
-   - - RNGP_EMPTY = 1022 -
-   - - RNGP_EMPTY_CONSTRUCT = 1023 -
-   - - RNGP_EMPTY_CONTENT = 1024 -
-   - - RNGP_EMPTY_NOT_EMPTY = 1025 -
-   - - RNGP_ERROR_TYPE_LIB = 1026 -
-   - - RNGP_EXCEPT_EMPTY = 1027 -
-   - - RNGP_EXCEPT_MISSING = 1028 -
-   - - RNGP_EXCEPT_MULTIPLE = 1029 -
-   - - RNGP_EXCEPT_NO_CONTENT = 1030 -
-   - - RNGP_EXTERNALREF_EMTPY = 1031 -
-   - - RNGP_EXTERNALREF_RECURSE = 1033 -
-   - - RNGP_EXTERNAL_REF_FAILURE = 1032 -
-   - - RNGP_FORBIDDEN_ATTRIBUTE = 1034 -
-   - - RNGP_FOREIGN_ELEMENT = 1035 -
-   - - RNGP_GRAMMAR_CONTENT = 1036 -
-   - - RNGP_GRAMMAR_EMPTY = 1037 -
-   - - RNGP_GRAMMAR_MISSING = 1038 -
-   - - RNGP_GRAMMAR_NO_START = 1039 -
-   - - RNGP_GROUP_ATTR_CONFLICT = 1040 -
-   - - RNGP_HREF_ERROR = 1041 -
-   - - RNGP_INCLUDE_EMPTY = 1042 -
-   - - RNGP_INCLUDE_FAILURE = 1043 -
-   - - RNGP_INCLUDE_RECURSE = 1044 -
-   - - RNGP_INTERLEAVE_ADD = 1045 -
-   - - RNGP_INTERLEAVE_CREATE_FAILED = 1046 -
-   - - RNGP_INTERLEAVE_EMPTY = 1047 -
-   - - RNGP_INTERLEAVE_NO_CONTENT = 1048 -
-   - - RNGP_INVALID_DEFINE_NAME = 1049 -
-   - - RNGP_INVALID_URI = 1050 -
-   - - RNGP_INVALID_VALUE = 1051 -
-   - - RNGP_MISSING_HREF = 1052 -
-   - - RNGP_NAME_MISSING = 1053 -
-   - - RNGP_NEED_COMBINE = 1054 -
-   - - RNGP_NOTALLOWED_NOT_EMPTY = 1055 -
-   - - RNGP_NSNAME_ATTR_ANCESTOR = 1056 -
-   - - RNGP_NSNAME_NO_NS = 1057 -
-   - - RNGP_PARAM_FORBIDDEN = 1058 -
-   - - RNGP_PARAM_NAME_MISSING = 1059 -
-   - - RNGP_PARENTREF_CREATE_FAILED = 1060 -
-   - - RNGP_PARENTREF_NAME_INVALID = 1061 -
-   - - RNGP_PARENTREF_NOT_EMPTY = 1064 -
-   - - RNGP_PARENTREF_NO_NAME = 1062 -
-   - - RNGP_PARENTREF_NO_PARENT = 1063 -
-   - - RNGP_PARSE_ERROR = 1065 -
-   - - RNGP_PAT_ANYNAME_EXCEPT_ANYNAME = 1066 -
-   - - RNGP_PAT_ATTR_ATTR = 1067 -
-   - - RNGP_PAT_ATTR_ELEM = 1068 -
-   - - RNGP_PAT_DATA_EXCEPT_ATTR = 1069 -
-   - - RNGP_PAT_DATA_EXCEPT_ELEM = 1070 -
-   - - RNGP_PAT_DATA_EXCEPT_EMPTY = 1071 -
-   - - RNGP_PAT_DATA_EXCEPT_GROUP = 1072 -
-   - - RNGP_PAT_DATA_EXCEPT_INTERLEAVE = 1073 -
-   - - RNGP_PAT_DATA_EXCEPT_LIST = 1074 -
-   - - RNGP_PAT_DATA_EXCEPT_ONEMORE = 1075 -
-   - - RNGP_PAT_DATA_EXCEPT_REF = 1076 -
-   - - RNGP_PAT_DATA_EXCEPT_TEXT = 1077 -
-   - - RNGP_PAT_LIST_ATTR = 1078 -
-   - - RNGP_PAT_LIST_ELEM = 1079 -
-   - - RNGP_PAT_LIST_INTERLEAVE = 1080 -
-   - - RNGP_PAT_LIST_LIST = 1081 -
-   - - RNGP_PAT_LIST_REF = 1082 -
-   - - RNGP_PAT_LIST_TEXT = 1083 -
-   - - RNGP_PAT_NSNAME_EXCEPT_ANYNAME = 1084 -
-   - - RNGP_PAT_NSNAME_EXCEPT_NSNAME = 1085 -
-   - - RNGP_PAT_ONEMORE_GROUP_ATTR = 1086 -
-   - - RNGP_PAT_ONEMORE_INTERLEAVE_ATTR = 1087 -
-   - - RNGP_PAT_START_ATTR = 1088 -
-   - - RNGP_PAT_START_DATA = 1089 -
-   - - RNGP_PAT_START_EMPTY = 1090 -
-   - - RNGP_PAT_START_GROUP = 1091 -
-   - - RNGP_PAT_START_INTERLEAVE = 1092 -
-   - - RNGP_PAT_START_LIST = 1093 -
-   - - RNGP_PAT_START_ONEMORE = 1094 -
-   - - RNGP_PAT_START_TEXT = 1095 -
-   - - RNGP_PAT_START_VALUE = 1096 -
-   - - RNGP_PREFIX_UNDEFINED = 1097 -
-   - - RNGP_REF_CREATE_FAILED = 1098 -
-   - - RNGP_REF_CYCLE = 1099 -
-   - - RNGP_REF_NAME_INVALID = 1100 -
-   - - RNGP_REF_NOT_EMPTY = 1103 -
-   - - RNGP_REF_NO_DEF = 1101 -
-   - - RNGP_REF_NO_NAME = 1102 -
-   - - RNGP_START_CHOICE_AND_INTERLEAVE = 1104 -
-   - - RNGP_START_CONTENT = 1105 -
-   - - RNGP_START_EMPTY = 1106 -
-   - - RNGP_START_MISSING = 1107 -
-   - - RNGP_TEXT_EXPECTED = 1108 -
-   - - RNGP_TEXT_HAS_CHILD = 1109 -
-   - - RNGP_TYPE_MISSING = 1110 -
-   - - RNGP_TYPE_NOT_FOUND = 1111 -
-   - - RNGP_TYPE_VALUE = 1112 -
-   - - RNGP_UNKNOWN_ATTRIBUTE = 1113 -
-   - - RNGP_UNKNOWN_COMBINE = 1114 -
-   - - RNGP_UNKNOWN_CONSTRUCT = 1115 -
-   - - RNGP_UNKNOWN_TYPE_LIB = 1116 -
-   - - RNGP_URI_FRAGMENT = 1117 -
-   - - RNGP_URI_NOT_ABSOLUTE = 1118 -
-   - - RNGP_VALUE_EMPTY = 1119 -
-   - - RNGP_VALUE_NO_CONTENT = 1120 -
-   - - RNGP_XMLNS_NAME = 1121 -
-   - - RNGP_XML_NS = 1122 -
-   - - SAVE_CHAR_INVALID = 1401 -
-   - - SAVE_NOT_UTF8 = 1400 -
-   - - SAVE_NO_DOCTYPE = 1402 -
-   - - SAVE_UNKNOWN_ENCODING = 1403 -
-   - - SCHEMAP_AG_PROPS_CORRECT = 3087 -
-   - - SCHEMAP_ATTRFORMDEFAULT_VALUE = 1701 -
-   - - SCHEMAP_ATTRGRP_NONAME_NOREF = 1702 -
-   - - SCHEMAP_ATTR_NONAME_NOREF = 1703 -
-   - - SCHEMAP_AU_PROPS_CORRECT = 3089 -
-   - - SCHEMAP_AU_PROPS_CORRECT_2 = 3078 -
-   - - SCHEMAP_A_PROPS_CORRECT_2 = 3079 -
-   - - SCHEMAP_A_PROPS_CORRECT_3 = 3090 -
-   - - SCHEMAP_COMPLEXTYPE_NONAME_NOREF = 1704 -
-   - - SCHEMAP_COS_ALL_LIMITED = 3091 -
-   - - SCHEMAP_COS_CT_EXTENDS_1_1 = 3063 -
-   - - SCHEMAP_COS_CT_EXTENDS_1_2 = 3088 -
-   - - SCHEMAP_COS_CT_EXTENDS_1_3 = 1800 -
-   - - SCHEMAP_COS_ST_DERIVED_OK_2_1 = 3031 -
-   - - SCHEMAP_COS_ST_DERIVED_OK_2_2 = 3032 -
-   - - SCHEMAP_COS_ST_RESTRICTS_1_1 = 3011 -
-   - - SCHEMAP_COS_ST_RESTRICTS_1_2 = 3012 -
-   - - SCHEMAP_COS_ST_RESTRICTS_1_3_1 = 3013 -
-   - - SCHEMAP_COS_ST_RESTRICTS_1_3_2 = 3014 -
-   - - SCHEMAP_COS_ST_RESTRICTS_2_1 = 3015 -
-   - - SCHEMAP_COS_ST_RESTRICTS_2_3_1_1 = 3016 -
-   - - SCHEMAP_COS_ST_RESTRICTS_2_3_1_2 = 3017 -
-   - - SCHEMAP_COS_ST_RESTRICTS_2_3_2_1 = 3018 -
-   - - SCHEMAP_COS_ST_RESTRICTS_2_3_2_2 = 3019 -
-   - - SCHEMAP_COS_ST_RESTRICTS_2_3_2_3 = 3020 -
-   - - SCHEMAP_COS_ST_RESTRICTS_2_3_2_4 = 3021 -
-   - - SCHEMAP_COS_ST_RESTRICTS_2_3_2_5 = 3022 -
-   - - SCHEMAP_COS_ST_RESTRICTS_3_1 = 3023 -
-   - - SCHEMAP_COS_ST_RESTRICTS_3_3_1 = 3024 -
-   - - SCHEMAP_COS_ST_RESTRICTS_3_3_1_2 = 3025 -
-   - - SCHEMAP_COS_ST_RESTRICTS_3_3_2_1 = 3027 -
-   - - SCHEMAP_COS_ST_RESTRICTS_3_3_2_2 = 3026 -
-   - - SCHEMAP_COS_ST_RESTRICTS_3_3_2_3 = 3028 -
-   - - SCHEMAP_COS_ST_RESTRICTS_3_3_2_4 = 3029 -
-   - - SCHEMAP_COS_ST_RESTRICTS_3_3_2_5 = 3030 -
-   - - SCHEMAP_COS_VALID_DEFAULT_1 = 3058 -
-   - - SCHEMAP_COS_VALID_DEFAULT_2_1 = 3059 -
-   - - SCHEMAP_COS_VALID_DEFAULT_2_2_1 = 3060 -
-   - - SCHEMAP_COS_VALID_DEFAULT_2_2_2 = 3061 -
-   - - SCHEMAP_CT_PROPS_CORRECT_1 = 1782 -
-   - - SCHEMAP_CT_PROPS_CORRECT_2 = 1783 -
-   - - SCHEMAP_CT_PROPS_CORRECT_3 = 1784 -
-   - - SCHEMAP_CT_PROPS_CORRECT_4 = 1785 -
-   - - SCHEMAP_CT_PROPS_CORRECT_5 = 1786 -
-   - - SCHEMAP_CVC_SIMPLE_TYPE = 3062 -
-   - - SCHEMAP_C_PROPS_CORRECT = 3080 -
-   - - SCHEMAP_DEF_AND_PREFIX = 1768 -
-   - - SCHEMAP_DERIVATION_OK_RESTRICTION_1 = 1787 -
-   - - SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1 = 1788 -
-   - - SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2 = 1789 -
-   - - SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3 = 3077 -
-   - - SCHEMAP_DERIVATION_OK_RESTRICTION_2_2 = 1790 -
-   - - SCHEMAP_DERIVATION_OK_RESTRICTION_3 = 1791 -
-   - - SCHEMAP_DERIVATION_OK_RESTRICTION_4_1 = 1797 -
-   - - SCHEMAP_DERIVATION_OK_RESTRICTION_4_2 = 1798 -
-   - - SCHEMAP_DERIVATION_OK_RESTRICTION_4_3 = 1799 -
-   - - SCHEMAP_ELEMFORMDEFAULT_VALUE = 1705 -
-   - - SCHEMAP_ELEM_DEFAULT_FIXED = 1755 -
-   - - SCHEMAP_ELEM_NONAME_NOREF = 1706 -
-   - - SCHEMAP_EXTENSION_NO_BASE = 1707 -
-   - - SCHEMAP_E_PROPS_CORRECT_2 = 3045 -
-   - - SCHEMAP_E_PROPS_CORRECT_3 = 3046 -
-   - - SCHEMAP_E_PROPS_CORRECT_4 = 3047 -
-   - - SCHEMAP_E_PROPS_CORRECT_5 = 3048 -
-   - - SCHEMAP_E_PROPS_CORRECT_6 = 3049 -
-   - - SCHEMAP_FACET_NO_VALUE = 1708 -
-   - - SCHEMAP_FAILED_BUILD_IMPORT = 1709 -
-   - - SCHEMAP_FAILED_LOAD = 1757 -
-   - - SCHEMAP_FAILED_PARSE = 1766 -
-   - - SCHEMAP_GROUP_NONAME_NOREF = 1710 -
-   - - SCHEMAP_IMPORT_NAMESPACE_NOT_URI = 1711 -
-   - - SCHEMAP_IMPORT_REDEFINE_NSNAME = 1712 -
-   - - SCHEMAP_IMPORT_SCHEMA_NOT_URI = 1713 -
-   - - SCHEMAP_INCLUDE_SCHEMA_NOT_URI = 1770 -
-   - - SCHEMAP_INCLUDE_SCHEMA_NO_URI = 1771 -
-   - - SCHEMAP_INTERNAL = 3069 -
-   - - SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE = 1793 -
-   - - SCHEMAP_INVALID_ATTR_COMBINATION = 1777 -
-   - - SCHEMAP_INVALID_ATTR_INLINE_COMBINATION = 1778 -
-   - - SCHEMAP_INVALID_ATTR_NAME = 1780 -
-   - - SCHEMAP_INVALID_ATTR_USE = 1774 -
-   - - SCHEMAP_INVALID_BOOLEAN = 1714 -
-   - - SCHEMAP_INVALID_ENUM = 1715 -
-   - - SCHEMAP_INVALID_FACET = 1716 -
-   - - SCHEMAP_INVALID_FACET_VALUE = 1717 -
-   - - SCHEMAP_INVALID_MAXOCCURS = 1718 -
-   - - SCHEMAP_INVALID_MINOCCURS = 1719 -
-   - - SCHEMAP_INVALID_REF_AND_SUBTYPE = 1720 -
-   - - SCHEMAP_INVALID_WHITE_SPACE = 1721 -
-   - - SCHEMAP_MG_PROPS_CORRECT_1 = 3074 -
-   - - SCHEMAP_MG_PROPS_CORRECT_2 = 3075 -
-   - - SCHEMAP_MISSING_SIMPLETYPE_CHILD = 1779 -
-   - - SCHEMAP_NOATTR_NOREF = 1722 -
-   - - SCHEMAP_NOROOT = 1759 -
-   - - SCHEMAP_NOTATION_NO_NAME = 1723 -
-   - - SCHEMAP_NOTHING_TO_PARSE = 1758 -
-   - - SCHEMAP_NOTYPE_NOREF = 1724 -
-   - - SCHEMAP_NOT_DETERMINISTIC = 3070 -
-   - - SCHEMAP_NOT_SCHEMA = 1772 -
-   - - SCHEMAP_NO_XMLNS = 3056 -
-   - - SCHEMAP_NO_XSI = 3057 -
-   - - SCHEMAP_PREFIX_UNDEFINED = 1700 -
-   - - SCHEMAP_P_PROPS_CORRECT_1 = 3042 -
-   - - SCHEMAP_P_PROPS_CORRECT_2_1 = 3043 -
-   - - SCHEMAP_P_PROPS_CORRECT_2_2 = 3044 -
-   - - SCHEMAP_RECURSIVE = 1775 -
-   - - SCHEMAP_REDEFINED_ATTR = 1764 -
-   - - SCHEMAP_REDEFINED_ATTRGROUP = 1763 -
-   - - SCHEMAP_REDEFINED_ELEMENT = 1762 -
-   - - SCHEMAP_REDEFINED_GROUP = 1760 -
-   - - SCHEMAP_REDEFINED_NOTATION = 1765 -
-   - - SCHEMAP_REDEFINED_TYPE = 1761 -
-   - - SCHEMAP_REF_AND_CONTENT = 1781 -
-   - - SCHEMAP_REF_AND_SUBTYPE = 1725 -
-   - - SCHEMAP_REGEXP_INVALID = 1756 -
-   - - SCHEMAP_RESTRICTION_NONAME_NOREF = 1726 -
-   - - SCHEMAP_S4S_ATTR_INVALID_VALUE = 3037 -
-   - - SCHEMAP_S4S_ATTR_MISSING = 3036 -
-   - - SCHEMAP_S4S_ATTR_NOT_ALLOWED = 3035 -
-   - - SCHEMAP_S4S_ELEM_MISSING = 3034 -
-   - - SCHEMAP_S4S_ELEM_NOT_ALLOWED = 3033 -
-   - - SCHEMAP_SIMPLETYPE_NONAME = 1727 -
-   - - SCHEMAP_SRC_ATTRIBUTE_1 = 3051 -
-   - - SCHEMAP_SRC_ATTRIBUTE_2 = 3052 -
-   - - SCHEMAP_SRC_ATTRIBUTE_3_1 = 3053 -
-   - - SCHEMAP_SRC_ATTRIBUTE_3_2 = 3054 -
-   - - SCHEMAP_SRC_ATTRIBUTE_4 = 3055 -
-   - - SCHEMAP_SRC_ATTRIBUTE_GROUP_1 = 3071 -
-   - - SCHEMAP_SRC_ATTRIBUTE_GROUP_2 = 3072 -
-   - - SCHEMAP_SRC_ATTRIBUTE_GROUP_3 = 3073 -
-   - - SCHEMAP_SRC_CT_1 = 3076 -
-   - - SCHEMAP_SRC_ELEMENT_1 = 3038 -
-   - - SCHEMAP_SRC_ELEMENT_2_1 = 3039 -
-   - - SCHEMAP_SRC_ELEMENT_2_2 = 3040 -
-   - - SCHEMAP_SRC_ELEMENT_3 = 3041 -
-   - - SCHEMAP_SRC_IMPORT = 3082 -
-   - - SCHEMAP_SRC_IMPORT_1_1 = 3064 -
-   - - SCHEMAP_SRC_IMPORT_1_2 = 3065 -
-   - - SCHEMAP_SRC_IMPORT_2 = 3066 -
-   - - SCHEMAP_SRC_IMPORT_2_1 = 3067 -
-   - - SCHEMAP_SRC_IMPORT_2_2 = 3068 -
-   - - SCHEMAP_SRC_IMPORT_3_1 = 1795 -
-   - - SCHEMAP_SRC_IMPORT_3_2 = 1796 -
-   - - SCHEMAP_SRC_INCLUDE = 3050 -
-   - - SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE = 3006 -
-   - - SCHEMAP_SRC_REDEFINE = 3081 -
-   - - SCHEMAP_SRC_RESOLVE = 3004 -
-   - - SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE = 3005 -
-   - - SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000 -
-   - - SCHEMAP_SRC_SIMPLE_TYPE_2 = 3001 -
-   - - SCHEMAP_SRC_SIMPLE_TYPE_3 = 3002 -
-   - - SCHEMAP_SRC_SIMPLE_TYPE_4 = 3003 -
-   - - SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES = 3007 -
-   - - SCHEMAP_ST_PROPS_CORRECT_1 = 3008 -
-   - - SCHEMAP_ST_PROPS_CORRECT_2 = 3009 -
-   - - SCHEMAP_ST_PROPS_CORRECT_3 = 3010 -
-   - - SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE = 1776 -
-   - - SCHEMAP_TYPE_AND_SUBTYPE = 1728 -
-   - - SCHEMAP_UNION_NOT_EXPRESSIBLE = 1794 -
-   - - SCHEMAP_UNKNOWN_ALL_CHILD = 1729 -
-   - - SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD = 1730 -
-   - - SCHEMAP_UNKNOWN_ATTRGRP_CHILD = 1732 -
-   - - SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP = 1733 -
-   - - SCHEMAP_UNKNOWN_ATTR_CHILD = 1731 -
-   - - SCHEMAP_UNKNOWN_BASE_TYPE = 1734 -
-   - - SCHEMAP_UNKNOWN_CHOICE_CHILD = 1735 -
-   - - SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD = 1736 -
-   - - SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD = 1737 -
-   - - SCHEMAP_UNKNOWN_ELEM_CHILD = 1738 -
-   - - SCHEMAP_UNKNOWN_EXTENSION_CHILD = 1739 -
-   - - SCHEMAP_UNKNOWN_FACET_CHILD = 1740 -
-   - - SCHEMAP_UNKNOWN_FACET_TYPE = 1741 -
-   - - SCHEMAP_UNKNOWN_GROUP_CHILD = 1742 -
-   - - SCHEMAP_UNKNOWN_IMPORT_CHILD = 1743 -
-   - - SCHEMAP_UNKNOWN_INCLUDE_CHILD = 1769 -
-   - - SCHEMAP_UNKNOWN_LIST_CHILD = 1744 -
-   - - SCHEMAP_UNKNOWN_MEMBER_TYPE = 1773 -
-   - - SCHEMAP_UNKNOWN_NOTATION_CHILD = 1745 -
-   - - SCHEMAP_UNKNOWN_PREFIX = 1767 -
-   - - SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD = 1746 -
-   - - SCHEMAP_UNKNOWN_REF = 1747 -
-   - - SCHEMAP_UNKNOWN_RESTRICTION_CHILD = 1748 -
-   - - SCHEMAP_UNKNOWN_SCHEMAS_CHILD = 1749 -
-   - - SCHEMAP_UNKNOWN_SEQUENCE_CHILD = 1750 -
-   - - SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD = 1751 -
-   - - SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD = 1752 -
-   - - SCHEMAP_UNKNOWN_TYPE = 1753 -
-   - - SCHEMAP_UNKNOWN_UNION_CHILD = 1754 -
-   - - SCHEMAP_WARN_ATTR_POINTLESS_PROH = 3086 -
-   - - SCHEMAP_WARN_ATTR_REDECL_PROH = 3085 -
-   - - SCHEMAP_WARN_SKIP_SCHEMA = 3083 -
-   - - SCHEMAP_WARN_UNLOCATED_SCHEMA = 3084 -
-   - - SCHEMAP_WILDCARD_INVALID_NS_MEMBER = 1792 -
-   - - SCHEMATRONV_ASSERT = 4000 -
-   - - SCHEMATRONV_REPORT = 4001 -
-   - - SCHEMAV_ATTRINVALID = 1821 -
-   - - SCHEMAV_ATTRUNKNOWN = 1820 -
-   - - SCHEMAV_CONSTRUCT = 1817 -
-   - - SCHEMAV_CVC_ATTRIBUTE_1 = 1861 -
-   - - SCHEMAV_CVC_ATTRIBUTE_2 = 1862 -
-   - - SCHEMAV_CVC_ATTRIBUTE_3 = 1863 -
-   - - SCHEMAV_CVC_ATTRIBUTE_4 = 1864 -
-   - - SCHEMAV_CVC_AU = 1874 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_1 = 1873 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_2_1 = 1841 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_2_2 = 1842 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_2_3 = 1843 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_2_4 = 1844 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_3_1 = 1865 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_3_2_1 = 1866 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_3_2_2 = 1867 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_4 = 1868 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_5_1 = 1869 -
-   - - SCHEMAV_CVC_COMPLEX_TYPE_5_2 = 1870 -
-   - - SCHEMAV_CVC_DATATYPE_VALID_1_2_1 = 1824 -
-   - - SCHEMAV_CVC_DATATYPE_VALID_1_2_2 = 1825 -
-   - - SCHEMAV_CVC_DATATYPE_VALID_1_2_3 = 1826 -
-   - - SCHEMAV_CVC_ELT_1 = 1845 -
-   - - SCHEMAV_CVC_ELT_2 = 1846 -
-   - - SCHEMAV_CVC_ELT_3_1 = 1847 -
-   - - SCHEMAV_CVC_ELT_3_2_1 = 1848 -
-   - - SCHEMAV_CVC_ELT_3_2_2 = 1849 -
-   - - SCHEMAV_CVC_ELT_4_1 = 1850 -
-   - - SCHEMAV_CVC_ELT_4_2 = 1851 -
-   - - SCHEMAV_CVC_ELT_4_3 = 1852 -
-   - - SCHEMAV_CVC_ELT_5_1_1 = 1853 -
-   - - SCHEMAV_CVC_ELT_5_1_2 = 1854 -
-   - - SCHEMAV_CVC_ELT_5_2_1 = 1855 -
-   - - SCHEMAV_CVC_ELT_5_2_2_1 = 1856 -
-   - - SCHEMAV_CVC_ELT_5_2_2_2_1 = 1857 -
-   - - SCHEMAV_CVC_ELT_5_2_2_2_2 = 1858 -
-   - - SCHEMAV_CVC_ELT_6 = 1859 -
-   - - SCHEMAV_CVC_ELT_7 = 1860 -
-   - - SCHEMAV_CVC_ENUMERATION_VALID = 1840 -
-   - - SCHEMAV_CVC_FACET_VALID = 1829 -
-   - - SCHEMAV_CVC_FRACTIONDIGITS_VALID = 1838 -
-   - - SCHEMAV_CVC_IDC = 1877 -
-   - - SCHEMAV_CVC_LENGTH_VALID = 1830 -
-   - - SCHEMAV_CVC_MAXEXCLUSIVE_VALID = 1836 -
-   - - SCHEMAV_CVC_MAXINCLUSIVE_VALID = 1834 -
-   - - SCHEMAV_CVC_MAXLENGTH_VALID = 1832 -
-   - - SCHEMAV_CVC_MINEXCLUSIVE_VALID = 1835 -
-   - - SCHEMAV_CVC_MININCLUSIVE_VALID = 1833 -
-   - - SCHEMAV_CVC_MINLENGTH_VALID = 1831 -
-   - - SCHEMAV_CVC_PATTERN_VALID = 1839 -
-   - - SCHEMAV_CVC_TOTALDIGITS_VALID = 1837 -
-   - - SCHEMAV_CVC_TYPE_1 = 1875 -
-   - - SCHEMAV_CVC_TYPE_2 = 1876 -
-   - - SCHEMAV_CVC_TYPE_3_1_1 = 1827 -
-   - - SCHEMAV_CVC_TYPE_3_1_2 = 1828 -
-   - - SCHEMAV_CVC_WILDCARD = 1878 -
-   - - SCHEMAV_DOCUMENT_ELEMENT_MISSING = 1872 -
-   - - SCHEMAV_ELEMCONT = 1810 -
-   - - SCHEMAV_ELEMENT_CONTENT = 1871 -
-   - - SCHEMAV_EXTRACONTENT = 1813 -
-   - - SCHEMAV_FACET = 1823 -
-   - - SCHEMAV_HAVEDEFAULT = 1811 -
-   - - SCHEMAV_INTERNAL = 1818 -
-   - - SCHEMAV_INVALIDATTR = 1814 -
-   - - SCHEMAV_INVALIDELEM = 1815 -
-   - - SCHEMAV_ISABSTRACT = 1808 -
-   - - SCHEMAV_MISC = 1879 -
-   - - SCHEMAV_MISSING = 1804 -
-   - - SCHEMAV_NOROLLBACK = 1807 -
-   - - SCHEMAV_NOROOT = 1801 -
-   - - SCHEMAV_NOTDETERMINIST = 1816 -
-   - - SCHEMAV_NOTEMPTY = 1809 -
-   - - SCHEMAV_NOTNILLABLE = 1812 -
-   - - SCHEMAV_NOTSIMPLE = 1819 -
-   - - SCHEMAV_NOTTOPLEVEL = 1803 -
-   - - SCHEMAV_NOTYPE = 1806 -
-   - - SCHEMAV_UNDECLAREDELEM = 1802 -
-   - - SCHEMAV_VALUE = 1822 -
-   - - SCHEMAV_WRONGELEM = 1805 -
-   - - TREE_INVALID_DEC = 1301 -
-   - - TREE_INVALID_HEX = 1300 -
-   - - TREE_NOT_UTF8 = 1303 -
-   - - TREE_UNTERMINATED_ENTITY = 1302 -
-   - - WAR_CATALOG_PI = 93 -
-   - - WAR_ENTITY_REDEFINED = 107 -
-   - - WAR_LANG_VALUE = 98 -
-   - - WAR_NS_COLUMN = 106 -
-   - - WAR_NS_URI = 99 -
-   - - WAR_NS_URI_RELATIVE = 100 -
-   - - WAR_SPACE_VALUE = 102 -
-   - - WAR_UNDECLARED_ENTITY = 27 -
-   - - WAR_UNKNOWN_VERSION = 97 -
-   - - XINCLUDE_BUILD_FAILED = 1609 -
-   - - XINCLUDE_DEPRECATED_NS = 1617 -
-   - - XINCLUDE_ENTITY_DEF_MISMATCH = 1602 -
-   - - XINCLUDE_FALLBACKS_IN_INCLUDE = 1615 -
-   - - XINCLUDE_FALLBACK_NOT_IN_INCLUDE = 1616 -
-   - - XINCLUDE_FRAGMENT_ID = 1618 -
-   - - XINCLUDE_HREF_URI = 1605 -
-   - - XINCLUDE_INCLUDE_IN_INCLUDE = 1614 -
-   - - XINCLUDE_INVALID_CHAR = 1608 -
-   - - XINCLUDE_MULTIPLE_ROOT = 1611 -
-   - - XINCLUDE_NO_FALLBACK = 1604 -
-   - - XINCLUDE_NO_HREF = 1603 -
-   - - XINCLUDE_PARSE_VALUE = 1601 -
-   - - XINCLUDE_RECURSION = 1600 -
-   - - XINCLUDE_TEXT_DOCUMENT = 1607 -
-   - - XINCLUDE_TEXT_FRAGMENT = 1606 -
-   - - XINCLUDE_UNKNOWN_ENCODING = 1610 -
-   - - XINCLUDE_XPTR_FAILED = 1612 -
-   - - XINCLUDE_XPTR_RESULT = 1613 -
-   - - XPATH_ENCODING_ERROR = 1220 -
-   - - XPATH_EXPRESSION_OK = 1200 -
-   - - XPATH_EXPR_ERROR = 1207 -
-   - - XPATH_INVALID_ARITY = 1212 -
-   - - XPATH_INVALID_CHAR_ERROR = 1221 -
-   - - XPATH_INVALID_CTXT_POSITION = 1214 -
-   - - XPATH_INVALID_CTXT_SIZE = 1213 -
-   - - XPATH_INVALID_OPERAND = 1210 -
-   - - XPATH_INVALID_PREDICATE_ERROR = 1206 -
-   - - XPATH_INVALID_TYPE = 1211 -
-   - - XPATH_MEMORY_ERROR = 1215 -
-   - - XPATH_NUMBER_ERROR = 1201 -
-   - - XPATH_START_LITERAL_ERROR = 1203 -
-   - - XPATH_UNCLOSED_ERROR = 1208 -
-   - - XPATH_UNDEF_PREFIX_ERROR = 1219 -
-   - - XPATH_UNDEF_VARIABLE_ERROR = 1205 -
-   - - XPATH_UNFINISHED_LITERAL_ERROR = 1202 -
-   - - XPATH_UNKNOWN_FUNC_ERROR = 1209 -
-   - - XPATH_VARIABLE_REF_ERROR = 1204 -
-   - - XPTR_CHILDSEQ_START = 1901 -
-   - - XPTR_EVAL_FAILED = 1902 -
-   - - XPTR_EXTRA_OBJECTS = 1903 -
-   - - XPTR_RESOURCE_ERROR = 1217 -
-   - - XPTR_SUB_RESOURCE_ERROR = 1218 -
-   - - XPTR_SYNTAX_ERROR = 1216 -
-   - - XPTR_UNKNOWN_SCHEME = 1900 -
-   - - __qualname__ = 'ErrorTypes' -
-   - - _names = {0: 'ERR_OK', 1: 'ERR_INTERNAL_ERROR', 2: 'ERR_NO_MEM... -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

_names

- -
-
-
-
Value:
-
-{0: 'ERR_OK',
- 1: 'ERR_INTERNAL_ERROR',
- 2: 'ERR_NO_MEMORY',
- 3: 'ERR_DOCUMENT_START',
- 4: 'ERR_DOCUMENT_EMPTY',
- 5: 'ERR_DOCUMENT_END',
- 6: 'ERR_INVALID_HEX_CHARREF',
- 7: 'ERR_INVALID_DEC_CHARREF',
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.FallbackElementClassLookup-class.html b/doc/html/api/lxml.etree.FallbackElementClassLookup-class.html deleted file mode 100644 index e1cd25fa..00000000 --- a/doc/html/api/lxml.etree.FallbackElementClassLookup-class.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - lxml.etree.FallbackElementClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class FallbackElementClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class FallbackElementClassLookup

-
-        object --+    
-                 |    
-ElementClassLookup --+
-                     |
-                    FallbackElementClassLookup
-
- -
Known Subclasses:
-
- -
- -
-

FallbackElementClassLookup(self, fallback=None)

-

Superclass of Element class lookups with additional fallback.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - fallback=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
set_fallback(self, - lookup)
- Sets the fallback scheme for this lookup method.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - fallback -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - fallback=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.HTMLParser-class.html b/doc/html/api/lxml.etree.HTMLParser-class.html deleted file mode 100644 index b2f55bc4..00000000 --- a/doc/html/api/lxml.etree.HTMLParser-class.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - lxml.etree.HTMLParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class HTMLParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HTMLParser

-
-    object --+        
-             |        
-??._BaseParser --+    
-                 |    
-       _FeedParser --+
-                     |
-                    HTMLParser
-
- -
Known Subclasses:
-
- -
- -
-

HTMLParser(self, encoding=None, remove_blank_text=False, remove_comments=False, remove_pis=False, strip_cdata=True, no_network=True, target=None, schema: XMLSchema =None, recover=True, compact=True, collect_ids=True, huge_tree=False)

-

The HTML parser.

-

This parser allows reading HTML into a normal XML tree. By -default, it can read broken (non well-formed) HTML, depending on -the capabilities of libxml2. Use the 'recover' option to switch -this off.

-

Available boolean keyword arguments:

- -

Other keyword arguments:

- -

Note that you should avoid sharing parsers between threads for performance -reasons.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - encoding=None, - remove_blank_text=False, - remove_comments=False, - remove_pis=False, - strip_cdata=True, - no_network=True, - target=None, - schema: XMLSchema=None, - recover=True, - compact=True, - collect_ids=True, - huge_tree=False)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _FeedParser: - close, - feed -

-

Inherited from unreachable._BaseParser: - copy, - makeelement, - setElementClassLookup, - set_element_class_lookup -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _FeedParser: - feed_error_log -

-

Inherited from unreachable._BaseParser: - error_log, - resolvers, - target, - version -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - encoding=None, - remove_blank_text=False, - remove_comments=False, - remove_pis=False, - strip_cdata=True, - no_network=True, - target=None, - schema: XMLSchema=None, - recover=True, - compact=True, - collect_ids=True, - huge_tree=False) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.HTMLPullParser-class.html b/doc/html/api/lxml.etree.HTMLPullParser-class.html deleted file mode 100644 index 698e12e1..00000000 --- a/doc/html/api/lxml.etree.HTMLPullParser-class.html +++ /dev/null @@ -1,349 +0,0 @@ - - - - - lxml.etree.HTMLPullParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class HTMLPullParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HTMLPullParser

-
-    object --+            
-             |            
-??._BaseParser --+        
-                 |        
-       _FeedParser --+    
-                     |    
-            HTMLParser --+
-                         |
-                        HTMLPullParser
-
- -
-

HTMLPullParser(self, events=None, *, tag=None, base_url=None, **kwargs)

-

HTML parser that collects parse events in an iterator.

-

The collected events are the same as for iterparse(), but the -parser itself is non-blocking in the sense that it receives -data chunks incrementally through its .feed() method, instead -of reading them directly from a file(-like) object all by itself.

-

By default, it collects Element end events. To change that, -pass any subset of the available events into the events -argument: 'start', 'end', 'start-ns', -'end-ns', 'comment', 'pi'.

-

To support loading external dependencies relative to the input -source, you can pass the base_url.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - events=None, - tag=None, - base_url=None, - *, - **kwargs)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
read_events(...) - - -
- -
-

Inherited from _FeedParser: - close, - feed -

-

Inherited from unreachable._BaseParser: - copy, - makeelement, - setElementClassLookup, - set_element_class_lookup -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _FeedParser: - feed_error_log -

-

Inherited from unreachable._BaseParser: - error_log, - resolvers, - target, - version -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - events=None, - tag=None, - base_url=None, - *, - **kwargs) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.LxmlError-class.html b/doc/html/api/lxml.etree.LxmlError-class.html deleted file mode 100644 index 1276b126..00000000 --- a/doc/html/api/lxml.etree.LxmlError-class.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - lxml.etree.LxmlError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class LxmlError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LxmlError

-
-              object --+            
-                       |            
-exceptions.BaseException --+        
-                           |        
-        exceptions.Exception --+    
-                               |    
-                           Error --+
-                                   |
-                                  LxmlError
-
- -
Known Subclasses:
-
- -
- -
-Main exception base class for lxml. All other exceptions inherit from -this one. - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.LxmlRegistryError-class.html b/doc/html/api/lxml.etree.LxmlRegistryError-class.html deleted file mode 100644 index c5b650c6..00000000 --- a/doc/html/api/lxml.etree.LxmlRegistryError-class.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - lxml.etree.LxmlRegistryError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class LxmlRegistryError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LxmlRegistryError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      LxmlRegistryError
-
- -
Known Subclasses:
-
- -
- -
-Base class of lxml registry errors. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.LxmlSyntaxError-class.html b/doc/html/api/lxml.etree.LxmlSyntaxError-class.html deleted file mode 100644 index 007a2c73..00000000 --- a/doc/html/api/lxml.etree.LxmlSyntaxError-class.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - lxml.etree.LxmlSyntaxError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class LxmlSyntaxError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LxmlSyntaxError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-              object --+               |
-                       |               |
-exceptions.BaseException --+           |
-                           |           |
-        exceptions.Exception --+       |
-                               |       |
-        exceptions.StandardError --+   |
-                                   |   |
-              exceptions.SyntaxError --+
-                                       |
-                                      LxmlSyntaxError
-
- -
Known Subclasses:
-
- -
- -
-Base class for all syntax errors. - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from LxmlError: - __init__, - __new__ -

-

Inherited from exceptions.SyntaxError: - __str__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = 'LxmlSyntaxError' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.SyntaxError: - filename, - lineno, - msg, - offset, - print_file_and_line, - text -

-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.NamespaceRegistryError-class.html b/doc/html/api/lxml.etree.NamespaceRegistryError-class.html deleted file mode 100644 index a4099b26..00000000 --- a/doc/html/api/lxml.etree.NamespaceRegistryError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.NamespaceRegistryError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class NamespaceRegistryError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class NamespaceRegistryError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                       LxmlRegistryError --+
-                                           |
-                                          NamespaceRegistryError
-
- -
-Error registering a namespace extension. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.PIBase-class.html b/doc/html/api/lxml.etree.PIBase-class.html deleted file mode 100644 index 85075ef9..00000000 --- a/doc/html/api/lxml.etree.PIBase-class.html +++ /dev/null @@ -1,374 +0,0 @@ - - - - - lxml.etree.PIBase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class PIBase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class PIBase

-
-         object --+            
-                  |            
-           _Element --+        
-                      |        
-??.__ContentOnlyElement --+    
-                          |    
-     _ProcessingInstruction --+
-                              |
-                             PIBase
-
- -
Known Subclasses:
-
- -
- -
-

All custom Processing Instruction classes must inherit from this one.

-

To create an XML ProcessingInstruction instance, use the PI() -factory.

-

Subclasses must not override __init__ or __new__ as it is -absolutely undefined when these objects will be created or -destroyed. All persistent state of PIs must be stored in the -underlying XML. If you really need to initialize the object after -creation, you can implement an _init(self) method that will be -called after object creation.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _ProcessingInstruction: - __repr__, - get -

-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - insert, - items, - keys, - set, - values -

-

Inherited from _Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from _Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _ProcessingInstruction: - attrib, - tag, - target -

-

Inherited from unreachable.__ContentOnlyElement: - text -

-

Inherited from _Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ParseError-class.html b/doc/html/api/lxml.etree.ParseError-class.html deleted file mode 100644 index 203fbf7c..00000000 --- a/doc/html/api/lxml.etree.ParseError-class.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - lxml.etree.ParseError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ParseError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ParseError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-              object --+               |    
-                       |               |    
-exceptions.BaseException --+           |    
-                           |           |    
-        exceptions.Exception --+       |    
-                               |       |    
-        exceptions.StandardError --+   |    
-                                   |   |    
-              exceptions.SyntaxError --+    
-                                       |    
-                         LxmlSyntaxError --+
-                                           |
-                                          ParseError
-
- -
Known Subclasses:
-
- -
- -
-

Syntax error while parsing an XML document.

-

For compatibility with ElementTree 1.3 and later.

- - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
-

Inherited from LxmlError: - __new__ -

-

Inherited from exceptions.SyntaxError: - __str__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = 'ParseError' -
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - position -
-

Inherited from exceptions.SyntaxError: - filename, - lineno, - msg, - offset, - print_file_and_line, - text -

-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

position

- -
-
Get Method:
-
unreachable.position(...) -
-
Set Method:
-
unreachable.position(...) -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ParserBasedElementClassLookup-class.html b/doc/html/api/lxml.etree.ParserBasedElementClassLookup-class.html deleted file mode 100644 index 52b7f763..00000000 --- a/doc/html/api/lxml.etree.ParserBasedElementClassLookup-class.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - lxml.etree.ParserBasedElementClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ParserBasedElementClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ParserBasedElementClassLookup

-
-            object --+        
-                     |        
-    ElementClassLookup --+    
-                         |    
-FallbackElementClassLookup --+
-                             |
-                            ParserBasedElementClassLookup
-
- -
-ParserBasedElementClassLookup(self, fallback=None) -Element class lookup based on the XML parser. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from FallbackElementClassLookup: - __init__, - set_fallback -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from FallbackElementClassLookup: - fallback -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.ParserError-class.html b/doc/html/api/lxml.etree.ParserError-class.html deleted file mode 100644 index a65e2965..00000000 --- a/doc/html/api/lxml.etree.ParserError-class.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - lxml.etree.ParserError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class ParserError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ParserError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      ParserError
-
- -
-Internal lxml parser error. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.PyErrorLog-class.html b/doc/html/api/lxml.etree.PyErrorLog-class.html deleted file mode 100644 index 7d3421e0..00000000 --- a/doc/html/api/lxml.etree.PyErrorLog-class.html +++ /dev/null @@ -1,456 +0,0 @@ - - - - - lxml.etree.PyErrorLog - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class PyErrorLog - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class PyErrorLog

-
-   object --+    
-            |    
-_BaseErrorLog --+
-                |
-               PyErrorLog
-
- -
-

PyErrorLog(self, logger_name=None, logger=None) -A global error log that connects to the Python stdlib logging package.

-

The constructor accepts an optional logger name or a readily -instantiated logger instance.

-

If you want to change the mapping between libxml2's ErrorLevels and Python -logging levels, you can modify the level_map dictionary from a subclass.

-

The default mapping is:

-
-ErrorLevels.WARNING = logging.WARNING
-ErrorLevels.ERROR   = logging.ERROR
-ErrorLevels.FATAL   = logging.CRITICAL
-
-

You can also override the method receive() that takes a LogEntry -object and calls self.log(log_entry, format_string, arg1, arg2, ...) -with appropriate data.

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - logger_name=None, - logger=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
copy(...)
- Dummy method that returns an empty error log.
- - -
- -
-   - - - - - - -
log(self, - log_entry, - message, - *args)
- Called by the .receive() method to log a _LogEntry instance to -the Python logging system. This handles the error level -mapping.
- - -
- -
-   - - - - - - -
receive(self, - log_entry)
- Receive a _LogEntry instance from the logging system. Calls -the .log() method with appropriate parameters:
- - -
- -
-

Inherited from _BaseErrorLog: - __repr__ -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - level_map -
-

Inherited from _BaseErrorLog: - last_error -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - logger_name=None, - logger=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

copy(...) -

-
  -
- - Dummy method that returns an empty error log. -
-
Overrides: - _BaseErrorLog.copy -
-
-
-
- -
- -
- - -
-

log(self, - log_entry, - message, - *args) -

-
  -
- -

Called by the .receive() method to log a _LogEntry instance to -the Python logging system. This handles the error level -mapping.

-

In the default implementation, the message argument -receives a complete log line, and there are no further -args. To change the message format, it is best to -override the .receive() method instead of this one.

-
-
-
-
- -
- -
- - -
-

receive(self, - log_entry) -

-
  -
- -

Receive a _LogEntry instance from the logging system. Calls -the .log() method with appropriate parameters:

-
-self.log(log_entry, repr(log_entry))
-
-

You can override this method to provide your own log output -format.

-
-
Overrides: - _BaseErrorLog.receive -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.PythonElementClassLookup-class.html b/doc/html/api/lxml.etree.PythonElementClassLookup-class.html deleted file mode 100644 index 0eab23c2..00000000 --- a/doc/html/api/lxml.etree.PythonElementClassLookup-class.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - lxml.etree.PythonElementClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class PythonElementClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class PythonElementClassLookup

-
-            object --+        
-                     |        
-    ElementClassLookup --+    
-                         |    
-FallbackElementClassLookup --+
-                             |
-                            PythonElementClassLookup
-
- -
-

PythonElementClassLookup(self, fallback=None) -Element class lookup based on a subclass method.

-

This class lookup scheme allows access to the entire XML tree in -read-only mode. To use it, re-implement the lookup(self, doc, -root) method in a subclass:

-
-from lxml import etree, pyclasslookup
-
-class MyElementClass(etree.ElementBase):
-    honkey = True
-
-class MyLookup(pyclasslookup.PythonElementClassLookup):
-    def lookup(self, doc, root):
-        if root.tag == "sometag":
-            return MyElementClass
-        else:
-            for child in root:
-                if child.tag == "someothertag":
-                    return MyElementClass
-        # delegate to default
-        return None
-
-

If you return None from this method, the fallback will be called.

-

The first argument is the opaque document instance that contains -the Element. The second argument is a lightweight Element proxy -implementation that is only valid during the lookup. Do not try -to keep a reference to it. Once the lookup is done, the proxy -will be invalid.

-

Also, you cannot wrap such a read-only Element in an ElementTree, -and you must take care not to keep a reference to them outside of -the lookup() method.

-

Note that the API of the Element objects is not complete. It is -purely read-only and does not support all features of the normal -lxml.etree API (such as XPath, extended slicing or some -iteration methods).

-

See http://codespeak.net/lxml/element_classes.html

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
lookup(self, - doc, - element)
- Override this method to implement your own lookup scheme.
- - -
- -
-

Inherited from FallbackElementClassLookup: - __init__, - set_fallback -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from FallbackElementClassLookup: - fallback -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.QName-class.html b/doc/html/api/lxml.etree.QName-class.html deleted file mode 100644 index df959452..00000000 --- a/doc/html/api/lxml.etree.QName-class.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - lxml.etree.QName - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class QName - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class QName

-
-object --+
-         |
-        QName
-
- -
-

QName(text_or_uri_or_element, tag=None)

-

QName wrapper for qualified XML names.

-

Pass a tag name by itself or a namespace URI and a tag name to -create a qualified name. Alternatively, pass an Element to -extract its tag name. None as first argument is ignored in -order to allow for generic 2-argument usage.

-

The text property holds the qualified name in -{namespace}tagname notation. The namespace and -localname properties hold the respective parts of the tag -name.

-

You can pass QName objects wherever a tag name is expected. Also, -setting Element text from a QName will resolve the namespace prefix -on assignment and set a qualified text value. This is helpful in XML -languages like SOAP or XML-Schema that use prefixed tag names in -their text content.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__eq__(x, - y)
- x==y
- - -
- -
-   - - - - - - -
__ge__(x, - y)
- x>=y
- - -
- -
-   - - - - - - -
__gt__(x, - y)
- x>y
- - -
- -
-   - - - - - - -
__hash__(x)
- hash(x)
- - -
- -
-   - - - - - - -
__init__(text_or_uri_or_element, - tag=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
-   - - - - - - -
__le__(x, - y)
- x<=y
- - -
- -
-   - - - - - - -
__lt__(x, - y)
- x<y
- - -
- -
-   - - - - - - -
__ne__(x, - y)
- x!=y
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__str__(x)
- str(x)
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - localname -
-   - - namespace -
-   - - text -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__hash__(x) -
(Hashing function) -

-
  -
- - hash(x) -
-
Overrides: - object.__hash__ -
-
-
-
- -
- -
- - -
-

__init__(text_or_uri_or_element, - tag=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__str__(x) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.RelaxNG-class.html b/doc/html/api/lxml.etree.RelaxNG-class.html deleted file mode 100644 index c5df2c4f..00000000 --- a/doc/html/api/lxml.etree.RelaxNG-class.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - - lxml.etree.RelaxNG - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class RelaxNG - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class RelaxNG

-
-object --+    
-         |    
-_Validator --+
-             |
-            RelaxNG
-
- -
-

RelaxNG(self, etree=None, file=None) -Turn a document into a Relax NG validator.

-

Either pass a schema as Element or ElementTree, or pass a file or -filename through the file keyword argument.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - etree)
- Validate doc using Relax NG.
- - -
- -
-   - - - - - - -
__init__(self, - etree=None, - file=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _Validator: - assertValid, - assert_, - validate -

-

Inherited from _Validator (private): - _append_log_message, - _clear_error_log -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-   - - - - - - -
from_rnc_string(...)
- Parse a RelaxNG schema in compact syntax from a text string
- - -
- -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _Validator: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__call__(self, - etree) -
(Call operator) -

-
  -
- -

Validate doc using Relax NG.

-

Returns true if document is valid, false if not.

-
-
-
-
- -
- -
- - -
-

__init__(self, - etree=None, - file=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

from_rnc_string(...) -
Class Method -

-
  -
- -

Parse a RelaxNG schema in compact syntax from a text string

-

Requires the rnc2rng package to be installed.

-

Passing the source URL or file path of the source as 'base_url' -will enable resolving resource references relative to the source.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.RelaxNGError-class.html b/doc/html/api/lxml.etree.RelaxNGError-class.html deleted file mode 100644 index b8275845..00000000 --- a/doc/html/api/lxml.etree.RelaxNGError-class.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - lxml.etree.RelaxNGError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class RelaxNGError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class RelaxNGError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      RelaxNGError
-
- -
Known Subclasses:
-
- -
- -
-Base class for RelaxNG errors. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.RelaxNGErrorTypes-class.html b/doc/html/api/lxml.etree.RelaxNGErrorTypes-class.html deleted file mode 100644 index ca697e46..00000000 --- a/doc/html/api/lxml.etree.RelaxNGErrorTypes-class.html +++ /dev/null @@ -1,571 +0,0 @@ - - - - - lxml.etree.RelaxNGErrorTypes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class RelaxNGErrorTypes - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class RelaxNGErrorTypes

-
-object --+
-         |
-        RelaxNGErrorTypes
-
- -
-Libxml2 RelaxNG error types - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- D[k] if k in D, else d - - - - - - -
_getName(D, - k, - d=...)
- d defaults to None.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - RELAXNG_ERR_ATTREXTRANS = 20 -
-   - - RELAXNG_ERR_ATTRNAME = 14 -
-   - - RELAXNG_ERR_ATTRNONS = 16 -
-   - - RELAXNG_ERR_ATTRVALID = 24 -
-   - - RELAXNG_ERR_ATTRWRONGNS = 18 -
-   - - RELAXNG_ERR_CONTENTVALID = 25 -
-   - - RELAXNG_ERR_DATAELEM = 28 -
-   - - RELAXNG_ERR_DATATYPE = 31 -
-   - - RELAXNG_ERR_DUPID = 4 -
-   - - RELAXNG_ERR_ELEMEXTRANS = 19 -
-   - - RELAXNG_ERR_ELEMNAME = 13 -
-   - - RELAXNG_ERR_ELEMNONS = 15 -
-   - - RELAXNG_ERR_ELEMNOTEMPTY = 21 -
-   - - RELAXNG_ERR_ELEMWRONG = 38 -
-   - - RELAXNG_ERR_ELEMWRONGNS = 17 -
-   - - RELAXNG_ERR_EXTRACONTENT = 26 -
-   - - RELAXNG_ERR_EXTRADATA = 35 -
-   - - RELAXNG_ERR_INTEREXTRA = 12 -
-   - - RELAXNG_ERR_INTERNAL = 37 -
-   - - RELAXNG_ERR_INTERNODATA = 10 -
-   - - RELAXNG_ERR_INTERSEQ = 11 -
-   - - RELAXNG_ERR_INVALIDATTR = 27 -
-   - - RELAXNG_ERR_LACKDATA = 36 -
-   - - RELAXNG_ERR_LIST = 33 -
-   - - RELAXNG_ERR_LISTELEM = 30 -
-   - - RELAXNG_ERR_LISTEMPTY = 9 -
-   - - RELAXNG_ERR_LISTEXTRA = 8 -
-   - - RELAXNG_ERR_MEMORY = 1 -
-   - - RELAXNG_ERR_NODEFINE = 7 -
-   - - RELAXNG_ERR_NOELEM = 22 -
-   - - RELAXNG_ERR_NOGRAMMAR = 34 -
-   - - RELAXNG_ERR_NOSTATE = 6 -
-   - - RELAXNG_ERR_NOTELEM = 23 -
-   - - RELAXNG_ERR_TEXTWRONG = 39 -
-   - - RELAXNG_ERR_TYPE = 2 -
-   - - RELAXNG_ERR_TYPECMP = 5 -
-   - - RELAXNG_ERR_TYPEVAL = 3 -
-   - - RELAXNG_ERR_VALELEM = 29 -
-   - - RELAXNG_ERR_VALUE = 32 -
-   - - RELAXNG_OK = 0 -
-   - - __qualname__ = 'RelaxNGErrorTypes' -
-   - - _names = {0: 'RELAXNG_OK', 1: 'RELAXNG_ERR_MEMORY', 2: 'RELAXN... -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

_names

- -
-
-
-
Value:
-
-{0: 'RELAXNG_OK',
- 1: 'RELAXNG_ERR_MEMORY',
- 2: 'RELAXNG_ERR_TYPE',
- 3: 'RELAXNG_ERR_TYPEVAL',
- 4: 'RELAXNG_ERR_DUPID',
- 5: 'RELAXNG_ERR_TYPECMP',
- 6: 'RELAXNG_ERR_NOSTATE',
- 7: 'RELAXNG_ERR_NODEFINE',
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.RelaxNGParseError-class.html b/doc/html/api/lxml.etree.RelaxNGParseError-class.html deleted file mode 100644 index 8c32a390..00000000 --- a/doc/html/api/lxml.etree.RelaxNGParseError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.RelaxNGParseError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class RelaxNGParseError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class RelaxNGParseError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                            RelaxNGError --+
-                                           |
-                                          RelaxNGParseError
-
- -
-Error while parsing an XML document as RelaxNG. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.RelaxNGValidateError-class.html b/doc/html/api/lxml.etree.RelaxNGValidateError-class.html deleted file mode 100644 index 394bcd19..00000000 --- a/doc/html/api/lxml.etree.RelaxNGValidateError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.RelaxNGValidateError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class RelaxNGValidateError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class RelaxNGValidateError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                            RelaxNGError --+
-                                           |
-                                          RelaxNGValidateError
-
- -
-Error while validating an XML document with a RelaxNG schema. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.Resolver-class.html b/doc/html/api/lxml.etree.Resolver-class.html deleted file mode 100644 index 7db4a775..00000000 --- a/doc/html/api/lxml.etree.Resolver-class.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - - lxml.etree.Resolver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class Resolver - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Resolver

-
-object --+
-         |
-        Resolver
-
- -
Known Subclasses:
-
- -
- -
-This is the base class of all resolvers. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
resolve(self, - system_url, - public_id, - context)
- Override this method to resolve an external source by -system_url and public_id. The third argument is an -opaque context object.
- - -
- -
-   - - - - - - -
resolve_empty(self, - context)
- Return an empty input document.
- - -
- -
-   - - - - - - -
resolve_file(self, - f, - context, - base_url=None, - close=True)
- Return an open file-like object as input document.
- - -
- -
-   - - - - - - -
resolve_filename(self, - filename, - context)
- Return the name of a parsable file as input document.
- - -
- -
-   - - - - - - -
resolve_string(self, - string, - context, - base_url=None)
- Return a parsable string as input document.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

resolve(self, - system_url, - public_id, - context) -

-
  -
- -

Override this method to resolve an external source by -system_url and public_id. The third argument is an -opaque context object.

-

Return the result of one of the resolve_*() methods.

-
-
-
-
- -
- -
- - -
-

resolve_empty(self, - context) -

-
  -
- -

Return an empty input document.

-

Pass context as parameter.

-
-
-
-
- -
- -
- - -
-

resolve_file(self, - f, - context, - base_url=None, - close=True) -

-
  -
- -

Return an open file-like object as input document.

-

Pass open file and context as parameters. You can pass the -base URL or filename of the file through the base_url -keyword argument. If the close flag is True (the -default), the file will be closed after reading.

-

Note that using .resolve_filename() is more efficient, -especially in threaded environments.

-
-
-
-
- -
- -
- - -
-

resolve_filename(self, - filename, - context) -

-
  -
- -

Return the name of a parsable file as input document.

-

Pass filename and context as parameters. You can also pass a -URL with an HTTP, FTP or file target.

-
-
-
-
- -
- -
- - -
-

resolve_string(self, - string, - context, - base_url=None) -

-
  -
- -

Return a parsable string as input document.

-

Pass data string and context as parameters. You can pass the -source URL or filename through the base_url keyword -argument.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.Schematron-class.html b/doc/html/api/lxml.etree.Schematron-class.html deleted file mode 100644 index 3b8085e2..00000000 --- a/doc/html/api/lxml.etree.Schematron-class.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - lxml.etree.Schematron - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class Schematron - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Schematron

-
-object --+    
-         |    
-_Validator --+
-             |
-            Schematron
-
- -
-

Schematron(self, etree=None, file=None) -A Schematron validator.

-

Pass a root Element or an ElementTree to turn it into a validator. -Alternatively, pass a filename as keyword argument 'file' to parse from -the file system.

-

Schematron is a less well known, but very powerful schema language. The main -idea is to use the capabilities of XPath to put restrictions on the structure -and the content of XML documents. Here is a simple example:

-
->>> schematron = Schematron(XML('''
-... <schema xmlns="http://www.ascc.net/xml/schematron" >
-...   <pattern name="id is the only permited attribute name">
-...     <rule context="*">
-...       <report test="@*[not(name()='id')]">Attribute
-...         <name path="@*[not(name()='id')]"/> is forbidden<name/>
-...       </report>
-...     </rule>
-...   </pattern>
-... </schema>
-... '''))
-
->>> xml = XML('''
-... <AAA name="aaa">
-...   <BBB id="bbb"/>
-...   <CCC color="ccc"/>
-... </AAA>
-... ''')
-
->>> schematron.validate(xml)
-0
-
->>> xml = XML('''
-... <AAA id="aaa">
-...   <BBB id="bbb"/>
-...   <CCC/>
-... </AAA>
-... ''')
-
->>> schematron.validate(xml)
-1
-
-

Schematron was added to libxml2 in version 2.6.21. Before version 2.6.32, -however, Schematron lacked support for error reporting other than to stderr. -This version is therefore required to retrieve validation warnings and -errors in lxml.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - etree)
- Validate doc using Schematron.
- - -
- -
-   - - - - - - -
__init__(self, - etree=None, - file=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _Validator: - assertValid, - assert_, - validate -

-

Inherited from _Validator (private): - _append_log_message, - _clear_error_log -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _Validator: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__call__(self, - etree) -
(Call operator) -

-
  -
- -

Validate doc using Schematron.

-

Returns true if document is valid, false if not.

-
-
-
-
- -
- -
- - -
-

__init__(self, - etree=None, - file=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.SchematronError-class.html b/doc/html/api/lxml.etree.SchematronError-class.html deleted file mode 100644 index 2c0526b8..00000000 --- a/doc/html/api/lxml.etree.SchematronError-class.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - lxml.etree.SchematronError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class SchematronError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SchematronError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      SchematronError
-
- -
Known Subclasses:
-
- -
- -
-Base class of all Schematron errors. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.SchematronParseError-class.html b/doc/html/api/lxml.etree.SchematronParseError-class.html deleted file mode 100644 index 354f53b2..00000000 --- a/doc/html/api/lxml.etree.SchematronParseError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.SchematronParseError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class SchematronParseError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SchematronParseError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                         SchematronError --+
-                                           |
-                                          SchematronParseError
-
- -
-Error while parsing an XML document as Schematron schema. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.SchematronValidateError-class.html b/doc/html/api/lxml.etree.SchematronValidateError-class.html deleted file mode 100644 index 58235271..00000000 --- a/doc/html/api/lxml.etree.SchematronValidateError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.SchematronValidateError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class SchematronValidateError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SchematronValidateError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                         SchematronError --+
-                                           |
-                                          SchematronValidateError
-
- -
-Error while validating an XML document with a Schematron schema. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.SerialisationError-class.html b/doc/html/api/lxml.etree.SerialisationError-class.html deleted file mode 100644 index 982bf778..00000000 --- a/doc/html/api/lxml.etree.SerialisationError-class.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - lxml.etree.SerialisationError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class SerialisationError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SerialisationError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      SerialisationError
-
- -
Known Subclasses:
-
- -
- -
-A libxml2 error that occurred during serialisation. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.SiblingsIterator-class.html b/doc/html/api/lxml.etree.SiblingsIterator-class.html deleted file mode 100644 index 4145b704..00000000 --- a/doc/html/api/lxml.etree.SiblingsIterator-class.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - - lxml.etree.SiblingsIterator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class SiblingsIterator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SiblingsIterator

-
-           object --+    
-                    |    
-_ElementMatchIterator --+
-                        |
-                       SiblingsIterator
-
- -
-

SiblingsIterator(self, node, tag=None, preceding=False) -Iterates over the siblings of an element.

-

You can pass the boolean keyword preceding to specify the direction.

- - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _ElementMatchIterator: - __iter__, - __next__, - next -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.TreeBuilder-class.html b/doc/html/api/lxml.etree.TreeBuilder-class.html deleted file mode 100644 index 2541685d..00000000 --- a/doc/html/api/lxml.etree.TreeBuilder-class.html +++ /dev/null @@ -1,405 +0,0 @@ - - - - - lxml.etree.TreeBuilder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class TreeBuilder - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class TreeBuilder

-
-      object --+    
-               |    
-_SaxParserTarget --+
-                   |
-                  TreeBuilder
-
- -
-

TreeBuilder(self, element_factory=None, parser=None) -Parser target that builds a tree.

-

The final tree is returned by the close() method.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - element_factory=None, - parser=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
close(self)
- Flushes the builder buffers, and returns the toplevel document -element.
- - -
- -
-   - - - - - - -
comment(self, - comment) - - -
- -
-   - - - - - - -
data(self, - data)
- Adds text to the current element. The value should be either an -8-bit string containing ASCII text, or a Unicode string.
- - -
- -
-   - - - - - - -
end(self, - tag)
- Closes the current element.
- - -
- -
-   - - - - - - -
pi(self, - target, - data) - - -
- -
-   - - - - - - -
start(self, - tag, - attrs, - nsmap=None)
- Opens a new element.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - element_factory=None, - parser=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XInclude-class.html b/doc/html/api/lxml.etree.XInclude-class.html deleted file mode 100644 index 1c11dce3..00000000 --- a/doc/html/api/lxml.etree.XInclude-class.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - - lxml.etree.XInclude - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XInclude - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XInclude

-
-object --+
-         |
-        XInclude
-
- -
-

XInclude(self) -XInclude processor.

-

Create an instance and call it on an Element to run XInclude -processing.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - node) - - -
- -
-   - - - - - - -
__init__(self)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - error_log -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XIncludeError-class.html b/doc/html/api/lxml.etree.XIncludeError-class.html deleted file mode 100644 index 45eca3ff..00000000 --- a/doc/html/api/lxml.etree.XIncludeError-class.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - lxml.etree.XIncludeError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XIncludeError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XIncludeError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      XIncludeError
-
- -
-Error during XInclude processing. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XMLParser-class.html b/doc/html/api/lxml.etree.XMLParser-class.html deleted file mode 100644 index ee791e21..00000000 --- a/doc/html/api/lxml.etree.XMLParser-class.html +++ /dev/null @@ -1,405 +0,0 @@ - - - - - lxml.etree.XMLParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XMLParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XMLParser

-
-    object --+        
-             |        
-??._BaseParser --+    
-                 |    
-       _FeedParser --+
-                     |
-                    XMLParser
-
- -
Known Subclasses:
-
- -
- -
-

XMLParser(self, encoding=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, schema: XMLSchema =None, huge_tree=False, remove_blank_text=False, resolve_entities=True, remove_comments=False, remove_pis=False, strip_cdata=True, collect_ids=True, target=None, compact=True)

-

The XML parser.

-

Parsers can be supplied as additional argument to various parse -functions of the lxml API. A default parser is always available -and can be replaced by a call to the global function -'set_default_parser'. New parsers can be created at any time -without a major run-time overhead.

-

The keyword arguments in the constructor are mainly based on the -libxml2 parser configuration. A DTD will also be loaded if DTD -validation or attribute default values are requested (unless you -additionally provide an XMLSchema from which the default -attributes can be read).

-

Available boolean keyword arguments:

- -

Other keyword arguments:

- -

Note that you should avoid sharing parsers between threads. While this is -not harmful, it is more efficient to use separate parsers. This does not -apply to the default parser.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - encoding=None, - attribute_defaults=False, - dtd_validation=False, - load_dtd=False, - no_network=True, - ns_clean=False, - recover=False, - schema: XMLSchema=None, - huge_tree=False, - remove_blank_text=False, - resolve_entities=True, - remove_comments=False, - remove_pis=False, - strip_cdata=True, - collect_ids=True, - target=None, - compact=True)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _FeedParser: - close, - feed -

-

Inherited from unreachable._BaseParser: - copy, - makeelement, - setElementClassLookup, - set_element_class_lookup -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _FeedParser: - feed_error_log -

-

Inherited from unreachable._BaseParser: - error_log, - resolvers, - target, - version -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - encoding=None, - attribute_defaults=False, - dtd_validation=False, - load_dtd=False, - no_network=True, - ns_clean=False, - recover=False, - schema: XMLSchema=None, - huge_tree=False, - remove_blank_text=False, - resolve_entities=True, - remove_comments=False, - remove_pis=False, - strip_cdata=True, - collect_ids=True, - target=None, - compact=True) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XMLPullParser-class.html b/doc/html/api/lxml.etree.XMLPullParser-class.html deleted file mode 100644 index 6b81fb20..00000000 --- a/doc/html/api/lxml.etree.XMLPullParser-class.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - lxml.etree.XMLPullParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XMLPullParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XMLPullParser

-
-    object --+            
-             |            
-??._BaseParser --+        
-                 |        
-       _FeedParser --+    
-                     |    
-             XMLParser --+
-                         |
-                        XMLPullParser
-
- -
-

XMLPullParser(self, events=None, *, tag=None, **kwargs)

-

XML parser that collects parse events in an iterator.

-

The collected events are the same as for iterparse(), but the -parser itself is non-blocking in the sense that it receives -data chunks incrementally through its .feed() method, instead -of reading them directly from a file(-like) object all by itself.

-

By default, it collects Element end events. To change that, -pass any subset of the available events into the events -argument: 'start', 'end', 'start-ns', -'end-ns', 'comment', 'pi'.

-

To support loading external dependencies relative to the input -source, you can pass the base_url.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - events=None, - tag=None, - *, - **kwargs)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
read_events(...) - - -
- -
-

Inherited from _FeedParser: - close, - feed -

-

Inherited from unreachable._BaseParser: - copy, - makeelement, - setElementClassLookup, - set_element_class_lookup -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _FeedParser: - feed_error_log -

-

Inherited from unreachable._BaseParser: - error_log, - resolvers, - target, - version -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - events=None, - tag=None, - *, - **kwargs) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XMLSchema-class.html b/doc/html/api/lxml.etree.XMLSchema-class.html deleted file mode 100644 index d6eb84f4..00000000 --- a/doc/html/api/lxml.etree.XMLSchema-class.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - lxml.etree.XMLSchema - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XMLSchema - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XMLSchema

-
-object --+    
-         |    
-_Validator --+
-             |
-            XMLSchema
-
- -
-

XMLSchema(self, etree=None, file=None) -Turn a document into an XML Schema validator.

-

Either pass a schema as Element or ElementTree, or pass a file or -filename through the file keyword argument.

-

Passing the attribute_defaults boolean option will make the -schema insert default/fixed attributes into validated documents.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - etree)
- Validate doc using XML Schema.
- - -
- -
-   - - - - - - -
__init__(self, - etree=None, - file=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from _Validator: - assertValid, - assert_, - validate -

-

Inherited from _Validator (private): - _append_log_message, - _clear_error_log -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _Validator: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__call__(self, - etree) -
(Call operator) -

-
  -
- -

Validate doc using XML Schema.

-

Returns true if document is valid, false if not.

-
-
-
-
- -
- -
- - -
-

__init__(self, - etree=None, - file=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XMLSchemaError-class.html b/doc/html/api/lxml.etree.XMLSchemaError-class.html deleted file mode 100644 index b1d94e0e..00000000 --- a/doc/html/api/lxml.etree.XMLSchemaError-class.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - lxml.etree.XMLSchemaError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XMLSchemaError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XMLSchemaError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      XMLSchemaError
-
- -
Known Subclasses:
-
- -
- -
-Base class of all XML Schema errors - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XMLSchemaParseError-class.html b/doc/html/api/lxml.etree.XMLSchemaParseError-class.html deleted file mode 100644 index 7d1efbd4..00000000 --- a/doc/html/api/lxml.etree.XMLSchemaParseError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.XMLSchemaParseError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XMLSchemaParseError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XMLSchemaParseError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                          XMLSchemaError --+
-                                           |
-                                          XMLSchemaParseError
-
- -
-Error while parsing an XML document as XML Schema. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XMLSchemaValidateError-class.html b/doc/html/api/lxml.etree.XMLSchemaValidateError-class.html deleted file mode 100644 index 4fa08873..00000000 --- a/doc/html/api/lxml.etree.XMLSchemaValidateError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.XMLSchemaValidateError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XMLSchemaValidateError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XMLSchemaValidateError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                          XMLSchemaError --+
-                                           |
-                                          XMLSchemaValidateError
-
- -
-Error while validating an XML document with an XML Schema. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XMLSyntaxError-class.html b/doc/html/api/lxml.etree.XMLSyntaxError-class.html deleted file mode 100644 index 844bb0ea..00000000 --- a/doc/html/api/lxml.etree.XMLSyntaxError-class.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - lxml.etree.XMLSyntaxError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XMLSyntaxError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XMLSyntaxError

-
-              object --+                        
-                       |                        
-exceptions.BaseException --+                    
-                           |                    
-        exceptions.Exception --+                
-                               |                
-                           Error --+            
-                                   |            
-                           LxmlError --+        
-                                       |        
-              object --+               |        
-                       |               |        
-exceptions.BaseException --+           |        
-                           |           |        
-        exceptions.Exception --+       |        
-                               |       |        
-        exceptions.StandardError --+   |        
-                                   |   |        
-              exceptions.SyntaxError --+        
-                                       |        
-                         LxmlSyntaxError --+    
-                                           |    
-                                  ParseError --+
-                                               |
-                                              XMLSyntaxError
-
- -
-Syntax error while parsing an XML document. - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from ParseError: - __init__ -

-

Inherited from LxmlError: - __new__ -

-

Inherited from exceptions.SyntaxError: - __str__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = 'XMLSyntaxError' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from ParseError: - position -

-

Inherited from exceptions.SyntaxError: - filename, - lineno, - msg, - offset, - print_file_and_line, - text -

-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XPath-class.html b/doc/html/api/lxml.etree.XPath-class.html deleted file mode 100644 index d0a1d2f1..00000000 --- a/doc/html/api/lxml.etree.XPath-class.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - lxml.etree.XPath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XPath - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XPath

-
-         object --+    
-                  |    
-_XPathEvaluatorBase --+
-                      |
-                     XPath
-
- -
Known Subclasses:
-
- -
- -
-

XPath(self, path, namespaces=None, extensions=None, regexp=True, smart_strings=True) -A compiled XPath expression that can be called on Elements and ElementTrees.

-

Besides the XPath expression, you can pass prefix-namespace -mappings and extension functions to the constructor through the -keyword arguments namespaces and extensions. EXSLT -regular expression support can be disabled with the 'regexp' -boolean keyword (defaults to True). Smart strings will be -returned for string results unless you pass -smart_strings=False.

- - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - _etree_or_element, - **_variables) - - -
- -
-   - - - - - - -
__init__(self, - path, - namespaces=None, - extensions=None, - regexp=True, - smart_strings=True)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-

Inherited from _XPathEvaluatorBase: - evaluate -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - path
- The literal XPath expression. -
-

Inherited from _XPathEvaluatorBase: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - path, - namespaces=None, - extensions=None, - regexp=True, - smart_strings=True) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XPathDocumentEvaluator-class.html b/doc/html/api/lxml.etree.XPathDocumentEvaluator-class.html deleted file mode 100644 index 618c763e..00000000 --- a/doc/html/api/lxml.etree.XPathDocumentEvaluator-class.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - lxml.etree.XPathDocumentEvaluator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XPathDocumentEvaluator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XPathDocumentEvaluator

-
-         object --+        
-                  |        
-_XPathEvaluatorBase --+    
-                      |    
-  XPathElementEvaluator --+
-                          |
-                         XPathDocumentEvaluator
-
- -
-

XPathDocumentEvaluator(self, etree, namespaces=None, extensions=None, regexp=True, smart_strings=True) -Create an XPath evaluator for an ElementTree.

-

Additional namespace declarations can be passed with the -'namespace' keyword argument. EXSLT regular expression support -can be disabled with the 'regexp' boolean keyword (defaults to -True). Smart strings will be returned for string results unless -you pass smart_strings=False.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - _path, - **_variables)
- Evaluate an XPath expression on the document.
- - -
- -
-   - - - - - - -
__init__(self, - etree, - namespaces=None, - extensions=None, - regexp=True, - smart_strings=True)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from XPathElementEvaluator: - register_namespace, - register_namespaces -

-

Inherited from _XPathEvaluatorBase: - evaluate -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _XPathEvaluatorBase: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__call__(self, - _path, - **_variables) -
(Call operator) -

-
  -
- -

Evaluate an XPath expression on the document.

-

Variables may be provided as keyword arguments. Note that namespaces -are currently not supported for variables.

-
-
Overrides: - XPathElementEvaluator.__call__ -
-
-
-
- -
- -
- - -
-

__init__(self, - etree, - namespaces=None, - extensions=None, - regexp=True, - smart_strings=True) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XPathElementEvaluator-class.html b/doc/html/api/lxml.etree.XPathElementEvaluator-class.html deleted file mode 100644 index 9aec9e67..00000000 --- a/doc/html/api/lxml.etree.XPathElementEvaluator-class.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - - lxml.etree.XPathElementEvaluator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XPathElementEvaluator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XPathElementEvaluator

-
-         object --+    
-                  |    
-_XPathEvaluatorBase --+
-                      |
-                     XPathElementEvaluator
-
- -
Known Subclasses:
-
- -
- -
-

XPathElementEvaluator(self, element, namespaces=None, extensions=None, regexp=True, smart_strings=True) -Create an XPath evaluator for an element.

-

Absolute XPath expressions (starting with '/') will be evaluated against -the ElementTree as returned by getroottree().

-

Additional namespace declarations can be passed with the -'namespace' keyword argument. EXSLT regular expression support -can be disabled with the 'regexp' boolean keyword (defaults to -True). Smart strings will be returned for string results unless -you pass smart_strings=False.

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - _path, - **_variables)
- Evaluate an XPath expression on the document.
- - -
- -
-   - - - - - - -
__init__(self, - element, - namespaces=None, - extensions=None, - regexp=True, - smart_strings=True)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
register_namespace(...)
- Register a namespace with the XPath context.
- - -
- -
-   - - - - - - -
register_namespaces(...)
- Register a prefix -> uri dict.
- - -
- -
-

Inherited from _XPathEvaluatorBase: - evaluate -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _XPathEvaluatorBase: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__call__(self, - _path, - **_variables) -
(Call operator) -

-
  -
- -

Evaluate an XPath expression on the document.

-

Variables may be provided as keyword arguments. Note that namespaces -are currently not supported for variables.

-

Absolute XPath expressions (starting with '/') will be evaluated -against the ElementTree as returned by getroottree().

-
-
-
-
- -
- -
- - -
-

__init__(self, - element, - namespaces=None, - extensions=None, - regexp=True, - smart_strings=True) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XPathError-class.html b/doc/html/api/lxml.etree.XPathError-class.html deleted file mode 100644 index abca0f19..00000000 --- a/doc/html/api/lxml.etree.XPathError-class.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - lxml.etree.XPathError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XPathError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XPathError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      XPathError
-
- -
Known Subclasses:
-
- -
- -
-Base class of all XPath errors. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XPathEvalError-class.html b/doc/html/api/lxml.etree.XPathEvalError-class.html deleted file mode 100644 index 9692817b..00000000 --- a/doc/html/api/lxml.etree.XPathEvalError-class.html +++ /dev/null @@ -1,276 +0,0 @@ - - - - - lxml.etree.XPathEvalError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XPathEvalError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XPathEvalError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                              XPathError --+
-                                           |
-                                          XPathEvalError
-
- -
Known Subclasses:
-
- -
- -
-Error during XPath evaluation. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XPathFunctionError-class.html b/doc/html/api/lxml.etree.XPathFunctionError-class.html deleted file mode 100644 index 24e9792d..00000000 --- a/doc/html/api/lxml.etree.XPathFunctionError-class.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - lxml.etree.XPathFunctionError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XPathFunctionError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XPathFunctionError

-
-              object --+                        
-                       |                        
-exceptions.BaseException --+                    
-                           |                    
-        exceptions.Exception --+                
-                               |                
-                           Error --+            
-                                   |            
-                           LxmlError --+        
-                                       |        
-                              XPathError --+    
-                                           |    
-                              XPathEvalError --+
-                                               |
-                                              XPathFunctionError
-
- -
-Internal error looking up an XPath extension function. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XPathResultError-class.html b/doc/html/api/lxml.etree.XPathResultError-class.html deleted file mode 100644 index 76a66f52..00000000 --- a/doc/html/api/lxml.etree.XPathResultError-class.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - lxml.etree.XPathResultError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XPathResultError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XPathResultError

-
-              object --+                        
-                       |                        
-exceptions.BaseException --+                    
-                           |                    
-        exceptions.Exception --+                
-                               |                
-                           Error --+            
-                                   |            
-                           LxmlError --+        
-                                       |        
-                              XPathError --+    
-                                           |    
-                              XPathEvalError --+
-                                               |
-                                              XPathResultError
-
- -
-Error handling an XPath result. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XPathSyntaxError-class.html b/doc/html/api/lxml.etree.XPathSyntaxError-class.html deleted file mode 100644 index 4cf6bf77..00000000 --- a/doc/html/api/lxml.etree.XPathSyntaxError-class.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - - lxml.etree.XPathSyntaxError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XPathSyntaxError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XPathSyntaxError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-              object --+               |    
-                       |               |    
-exceptions.BaseException --+           |    
-                           |           |    
-        exceptions.Exception --+       |    
-                               |       |    
-        exceptions.StandardError --+   |    
-                                   |   |    
-              exceptions.SyntaxError --+    
-                                       |    
-                         LxmlSyntaxError --+
-                                           |
-              object --+                   |
-                       |                   |
-exceptions.BaseException --+               |
-                           |               |
-        exceptions.Exception --+           |
-                               |           |
-                           Error --+       |
-                                   |       |
-                           LxmlError --+   |
-                                       |   |
-                              XPathError --+
-                                           |
-                                          XPathSyntaxError
-
- -
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from XPathError: - __new__ -

-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.SyntaxError: - __str__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = 'XPathSyntaxError' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.SyntaxError: - filename, - lineno, - msg, - offset, - print_file_and_line, - text -

-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XSLT-class.html b/doc/html/api/lxml.etree.XSLT-class.html deleted file mode 100644 index dc8c04ad..00000000 --- a/doc/html/api/lxml.etree.XSLT-class.html +++ /dev/null @@ -1,598 +0,0 @@ - - - - - lxml.etree.XSLT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XSLT - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XSLT

-
-object --+
-         |
-        XSLT
-
- -
-

XSLT(self, xslt_input, extensions=None, regexp=True, access_control=None)

-

Turn an XSL document into an XSLT object.

-

Calling this object on a tree or Element will execute the XSLT:

-
-transform = etree.XSLT(xsl_tree)
-result = transform(xml_tree)
-
-

Keyword arguments of the constructor:

- -

Keyword arguments of the XSLT call:

- -

Other keyword arguments of the call are passed to the stylesheet -as parameters.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - _input, - profile_run=False, - **kw)
- Execute the XSL transformation on a tree or Element.
- - -
- -
-   - - - - - - -
__copy__(...) - - -
- -
-   - - - - - - -
__deepcopy__(...) - - -
- -
-   - - - - - - -
__init__(self, - xslt_input, - extensions=None, - regexp=True, - access_control=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
apply(self, - _input, - profile_run=False, - **kw) - - -
- -
-   - - - - - - -
tostring(self, - result_tree)
- Save result doc to string based on stylesheet output method.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Static Methods[hide private]
-
-   - - - - - - -
set_global_max_depth(max_depth)
- The maximum traversal depth that the stylesheet engine will allow. -This does not only count the template recursion depth but also takes -the number of variables/parameters into account. The required setting -for a run depends on both the stylesheet and the input data.
- - -
- -
-   - - - - - - -
strparam(strval)
- Mark an XSLT string parameter that requires quote escaping -before passing it into the transformation. Use it like this:
- - -
- -
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - error_log
- The log of errors and warnings of an XSLT execution. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__call__(self, - _input, - profile_run=False, - **kw) -
(Call operator) -

-
  -
- -

Execute the XSL transformation on a tree or Element.

-

Pass the profile_run option to get profile information -about the XSLT. The result of the XSLT will have a property -xslt_profile that holds an XML tree with profiling data.

-
-
-
-
- -
- -
- - -
-

__init__(self, - xslt_input, - extensions=None, - regexp=True, - access_control=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

apply(self, - _input, - profile_run=False, - **kw) -

-
  -
- - -
-
-

Deprecated: - call the object, not this method. -

-
-
- -
- -
- - -
-

set_global_max_depth(max_depth) -
Static Method -

-
  -
- -

The maximum traversal depth that the stylesheet engine will allow. -This does not only count the template recursion depth but also takes -the number of variables/parameters into account. The required setting -for a run depends on both the stylesheet and the input data.

-

Example:

-
-XSLT.set_global_max_depth(5000)
-
-

Note that this is currently a global, module-wide setting because -libxslt does not support it at a per-stylesheet level.

-
-
-
-
- -
- -
- - -
-

strparam(strval) -
Static Method -

-
  -
- -

Mark an XSLT string parameter that requires quote escaping -before passing it into the transformation. Use it like this:

-
-result = transform(doc, some_strval = XSLT.strparam(
-    '''it's "Monty Python's" ...'''))
-
-

Escaped string parameters can be reused without restriction.

-
-
-
-
- -
- -
- - -
-

tostring(self, - result_tree) -

-
  -
- - Save result doc to string based on stylesheet output method. -
-
-

Deprecated: - use str(result_tree) instead. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XSLTAccessControl-class.html b/doc/html/api/lxml.etree.XSLTAccessControl-class.html deleted file mode 100644 index 89860250..00000000 --- a/doc/html/api/lxml.etree.XSLTAccessControl-class.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - - lxml.etree.XSLTAccessControl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XSLTAccessControl - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XSLTAccessControl

-
-object --+
-         |
-        XSLTAccessControl
-
- -
-

XSLTAccessControl(self, read_file=True, write_file=True, create_dir=True, read_network=True, write_network=True)

-

Access control for XSLT: reading/writing files, directories and -network I/O. Access to a type of resource is granted or denied by -passing any of the following boolean keyword arguments. All of -them default to True to allow access.

- -

For convenience, there is also a class member DENY_ALL that -provides an XSLTAccessControl instance that is readily configured -to deny everything, and a DENY_WRITE member that denies all -write access but allows read access.

-

See XSLT.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - read_file=True, - write_file=True, - create_dir=True, - read_network=True, - write_network=True)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - DENY_ALL = XSLTAccessControl(create_dir=False, read_file=False... -
-   - - DENY_WRITE = XSLTAccessControl(create_dir=False, read_file=Tru... -
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - options
- The access control configuration as a map of options. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - read_file=True, - write_file=True, - create_dir=True, - read_network=True, - write_network=True) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

DENY_ALL

- -
-
-
-
Value:
-
-XSLTAccessControl(create_dir=False, read_file=False, read_network=Fals\
-e, write_file=False, write_network=False)
-
-
-
-
-
- -
- -
-

DENY_WRITE

- -
-
-
-
Value:
-
-XSLTAccessControl(create_dir=False, read_file=True, read_network=True,\
- write_file=False, write_network=False)
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XSLTApplyError-class.html b/doc/html/api/lxml.etree.XSLTApplyError-class.html deleted file mode 100644 index 4a58dcf9..00000000 --- a/doc/html/api/lxml.etree.XSLTApplyError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.XSLTApplyError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XSLTApplyError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XSLTApplyError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                               XSLTError --+
-                                           |
-                                          XSLTApplyError
-
- -
-Error running an XSL transformation. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XSLTError-class.html b/doc/html/api/lxml.etree.XSLTError-class.html deleted file mode 100644 index 40a9c445..00000000 --- a/doc/html/api/lxml.etree.XSLTError-class.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - lxml.etree.XSLTError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XSLTError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XSLTError

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                           Error --+    
-                                   |    
-                           LxmlError --+
-                                       |
-                                      XSLTError
-
- -
Known Subclasses:
-
- -
- -
-Base class of all XSLT errors. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XSLTExtension-class.html b/doc/html/api/lxml.etree.XSLTExtension-class.html deleted file mode 100644 index 2e9dd6a1..00000000 --- a/doc/html/api/lxml.etree.XSLTExtension-class.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - lxml.etree.XSLTExtension - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XSLTExtension - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XSLTExtension

-
-object --+
-         |
-        XSLTExtension
-
- -
-Base class of an XSLT extension element. - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
apply_templates(self, - context, - node, - output_parent=None, - elements_only=False, - remove_blank_text=False)
- Call this method to retrieve the result of applying templates -to an element.
- - -
- -
-   - - - - - - -
execute(self, - context, - self_node, - input_node, - output_parent)
- Execute this extension element.
- - -
- -
-   - - - - - - -
process_children(self, - context, - output_parent=None, - elements_only=False, - remove_blank_text=False)
- Call this method to process the XSLT content of the extension -element itself.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

apply_templates(self, - context, - node, - output_parent=None, - elements_only=False, - remove_blank_text=False) -

-
  -
- -

Call this method to retrieve the result of applying templates -to an element.

-

The return value is a list of elements or text strings that -were generated by the XSLT processor. If you pass -elements_only=True, strings will be discarded from the result -list. The option remove_blank_text=True will only discard -strings that consist entirely of whitespace (e.g. formatting). -These options do not apply to Elements, only to bare string results.

-

If you pass an Element as output_parent parameter, the result -will instead be appended to the element (including attributes -etc.) and the return value will be None. This is a safe way -to generate content into the output document directly, without -having to take care of special values like text or attributes. -Note that the string discarding options will be ignored in this -case.

-
-
-
-
- -
- -
- - -
-

execute(self, - context, - self_node, - input_node, - output_parent) -

-
  -
- -

Execute this extension element.

-

Subclasses must override this method. They may append -elements to the output_parent element here, or set its text -content. To this end, the input_node provides read-only -access to the current node in the input document, and the -self_node points to the extension element in the stylesheet.

-

Note that the output_parent parameter may be None if there -is no parent element in the current context (e.g. no content -was added to the output tree yet).

-
-
-
-
- -
- -
- - -
-

process_children(self, - context, - output_parent=None, - elements_only=False, - remove_blank_text=False) -

-
  -
- -

Call this method to process the XSLT content of the extension -element itself.

-

The return value is a list of elements or text strings that -were generated by the XSLT processor. If you pass -elements_only=True, strings will be discarded from the result -list. The option remove_blank_text=True will only discard -strings that consist entirely of whitespace (e.g. formatting). -These options do not apply to Elements, only to bare string results.

-

If you pass an Element as output_parent parameter, the result -will instead be appended to the element (including attributes -etc.) and the return value will be None. This is a safe way -to generate content into the output document directly, without -having to take care of special values like text or attributes. -Note that the string discarding options will be ignored in this -case.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XSLTExtensionError-class.html b/doc/html/api/lxml.etree.XSLTExtensionError-class.html deleted file mode 100644 index f855dbaa..00000000 --- a/doc/html/api/lxml.etree.XSLTExtensionError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.XSLTExtensionError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XSLTExtensionError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XSLTExtensionError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                               XSLTError --+
-                                           |
-                                          XSLTExtensionError
-
- -
-Error registering an XSLT extension. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XSLTParseError-class.html b/doc/html/api/lxml.etree.XSLTParseError-class.html deleted file mode 100644 index 4a3e2009..00000000 --- a/doc/html/api/lxml.etree.XSLTParseError-class.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - lxml.etree.XSLTParseError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XSLTParseError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XSLTParseError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                               XSLTError --+
-                                           |
-                                          XSLTParseError
-
- -
-Error parsing a stylesheet document. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.XSLTSaveError-class.html b/doc/html/api/lxml.etree.XSLTSaveError-class.html deleted file mode 100644 index f25d2ef4..00000000 --- a/doc/html/api/lxml.etree.XSLTSaveError-class.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - - lxml.etree.XSLTSaveError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class XSLTSaveError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XSLTSaveError

-
-              object --+                    
-                       |                    
-exceptions.BaseException --+                
-                           |                
-        exceptions.Exception --+            
-                               |            
-                           Error --+        
-                                   |        
-                           LxmlError --+    
-                                       |    
-                               XSLTError --+
-                                           |
-              object --+                   |
-                       |                   |
-exceptions.BaseException --+               |
-                           |               |
-        exceptions.Exception --+           |
-                               |           |
-                           Error --+       |
-                                   |       |
-                           LxmlError --+   |
-                                       |   |
-                      SerialisationError --+
-                                           |
-                                          XSLTSaveError
-
- -
-Error serialising an XSLT result. - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from XSLTError: - __new__ -

-

Inherited from LxmlError: - __init__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = 'XSLTSaveError' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._Attrib-class.html b/doc/html/api/lxml.etree._Attrib-class.html deleted file mode 100644 index dea5be18..00000000 --- a/doc/html/api/lxml.etree._Attrib-class.html +++ /dev/null @@ -1,727 +0,0 @@ - - - - - lxml.etree._Attrib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _Attrib - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _Attrib

-
-object --+
-         |
-        _Attrib
-
- -
-A dict-like proxy for the Element.attrib property. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__contains__(x, - y)
- y in x
- - -
- -
-   - - - - - - -
__copy__(...) - - -
- -
-   - - - - - - -
__deepcopy__(...) - - -
- -
-   - - - - - - -
__delitem__(x, - y)
- del x[y]
- - -
- -
-   - - - - - - -
__eq__(x, - y)
- x==y
- - -
- -
-   - - - - - - -
__ge__(x, - y)
- x>=y
- - -
- -
-   - - - - - - -
__getitem__(x, - y)
- x[y]
- - -
- -
-   - - - - - - -
__gt__(x, - y)
- x>y
- - -
- -
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
-   - - - - - - -
__le__(x, - y)
- x<=y
- - -
- -
-   - - - - - - -
__len__(x)
- len(x)
- - -
- -
-   - - - - - - -
__lt__(x, - y)
- x<y
- - -
- -
-   - - - - - - -
__ne__(x, - y)
- x!=y
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__nonzero__(x)
- x != 0
- - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
__setitem__(x, - i, - y)
- x[i]=y
- - -
- -
-   - - - - - - -
clear(...) - - -
- -
-   - - - - - - -
get(...) - - -
- -
-   - - - - - - -
has_key(...) - - -
- -
-   - - - - - - -
items(...) - - -
- -
-   - - - - - - -
iteritems(...) - - -
- -
-   - - - - - - -
iterkeys(...) - - -
- -
-   - - - - - - -
itervalues(...) - - -
- -
-   - - - - - - -
keys(...) - - -
- -
-   - - - - - - -
pop(...) - - -
- -
-   - - - - - - -
update(...) - - -
- -
-   - - - - - - -
values(...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._BaseErrorLog-class.html b/doc/html/api/lxml.etree._BaseErrorLog-class.html deleted file mode 100644 index 8107f556..00000000 --- a/doc/html/api/lxml.etree._BaseErrorLog-class.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - lxml.etree._BaseErrorLog - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _BaseErrorLog - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _BaseErrorLog

-
-object --+
-         |
-        _BaseErrorLog
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
copy(...) - - -
- -
-   - - - - - - -
receive(...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - last_error -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._Comment-class.html b/doc/html/api/lxml.etree._Comment-class.html deleted file mode 100644 index 3a0a5cd7..00000000 --- a/doc/html/api/lxml.etree._Comment-class.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - lxml.etree._Comment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _Comment - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _Comment

-
-         object --+        
-                  |        
-           _Element --+    
-                      |    
-??.__ContentOnlyElement --+
-                          |
-                         _Comment
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - get, - insert, - items, - keys, - set, - values -

-

Inherited from _Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from _Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - tag
- Element tag -
-

Inherited from unreachable.__ContentOnlyElement: - attrib, - text -

-

Inherited from _Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._Document-class.html b/doc/html/api/lxml.etree._Document-class.html deleted file mode 100644 index 0ee8c3ca..00000000 --- a/doc/html/api/lxml.etree._Document-class.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - lxml.etree._Document - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _Document - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _Document

-
-object --+
-         |
-        _Document
-
- -
-

Internal base class to reference a libxml document.

-

When instances of this class are garbage collected, the libxml -document is cleaned up.

- - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._DomainErrorLog-class.html b/doc/html/api/lxml.etree._DomainErrorLog-class.html deleted file mode 100644 index e63b6db3..00000000 --- a/doc/html/api/lxml.etree._DomainErrorLog-class.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - lxml.etree._DomainErrorLog - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _DomainErrorLog - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _DomainErrorLog

-
-   object --+            
-            |            
-_BaseErrorLog --+        
-                |        
-    _ListErrorLog --+    
-                    |    
-            _ErrorLog --+
-                        |
-                       _DomainErrorLog
-
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
receive(...) - - -
- -
-

Inherited from _ErrorLog: - __exit__, - __iter__, - clear, - copy -

-

Inherited from _ListErrorLog: - __contains__, - __getitem__, - __len__, - __nonzero__, - __repr__, - filter_domains, - filter_from_errors, - filter_from_fatals, - filter_from_level, - filter_from_warnings, - filter_levels, - filter_types -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _BaseErrorLog: - last_error -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

receive(...) -

-
  -
- - -
-
Overrides: - _BaseErrorLog.receive -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._Element-class.html b/doc/html/api/lxml.etree._Element-class.html deleted file mode 100644 index 59575382..00000000 --- a/doc/html/api/lxml.etree._Element-class.html +++ /dev/null @@ -1,1665 +0,0 @@ - - - - - lxml.etree._Element - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _Element - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _Element

-
-object --+
-         |
-        _Element
-
- -
Known Subclasses:
-
- -
- -
-

Element class.

-

References a document object and a libxml node.

-

By pointing to a Document instance, a reference is kept to -_Document as long as there is some pointer to a node in it.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__contains__(self, - element) - - -
- -
-   - - - - - - -
__copy__(self) - - -
- -
-   - - - - - - -
__deepcopy__(self, - memo) - - -
- -
-   - - - - - - -
__delitem__(self, - x)
- Deletes the given subelement or a slice.
- - -
- -
-   - - - - - - -
__getitem__(...)
- Returns the subelement at the given position or the requested -slice.
- - -
- -
-   - - - - - - -
__iter__(self) - - -
- -
-   - - - - - - -
__len__(self)
- Returns the number of subelements.
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__nonzero__(x)
- x != 0
- - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- - -
- -
-   - - - - - - -
__reversed__(self) - - -
- -
-   - - - - - - -
__setitem__(self, - x, - value)
- Replaces the given subelement index or slice.
- - -
- -
-   - - - - - - -
_init(self)
- Called after object initialisation. Custom subclasses may override -this if they recursively call _init() in the superclasses.
- - -
- -
-   - - - - - - -
addnext(self, - element)
- Adds the element as a following sibling directly after this -element.
- - -
- -
-   - - - - - - -
addprevious(self, - element)
- Adds the element as a preceding sibling directly before this -element.
- - -
- -
-   - - - - - - -
append(self, - element)
- Adds a subelement to the end of this element.
- - -
- -
-   - - - - - - -
clear(self)
- Resets an element. This function removes all subelements, clears -all attributes and sets the text and tail properties to None.
- - -
- -
-   - - - - - - -
cssselect(...)
- Run the CSS expression on this element and its children, -returning a list of the results.
- - -
- -
-   - - - - - - -
extend(self, - elements)
- Extends the current children by the elements in the iterable.
- - -
- -
-   - - - - - - -
find(self, - path, - namespaces=None)
- Finds the first matching subelement, by tag name or path.
- - -
- -
-   - - - - - - -
findall(self, - path, - namespaces=None)
- Finds all matching subelements, by tag name or path.
- - -
- -
-   - - - - - - -
findtext(self, - path, - default=None, - namespaces=None)
- Finds text for the first matching subelement, by tag name or path.
- - -
- -
-   - - - - - - -
get(self, - key, - default=None)
- Gets an element attribute.
- - -
- -
-   - - - - - - -
getchildren(self)
- Returns all direct children. The elements are returned in document -order.
- - -
- -
-   - - - - - - -
getiterator(self, - tag=None, - *tags)
- Returns a sequence or iterator of all elements in the subtree in -document order (depth first pre-order), starting with this -element.
- - -
- -
-   - - - - - - -
getnext(self)
- Returns the following sibling of this element or None.
- - -
- -
-   - - - - - - -
getparent(self)
- Returns the parent of this element or None for the root element.
- - -
- -
-   - - - - - - -
getprevious(self)
- Returns the preceding sibling of this element or None.
- - -
- -
-   - - - - - - -
getroottree(self)
- Return an ElementTree for the root node of the document that -contains this element.
- - -
- -
-   - - - - - - -
index(self, - child, - start=None, - stop=None)
- Find the position of the child within the parent.
- - -
- -
-   - - - - - - -
insert(self, - index, - element)
- Inserts a subelement at the given position in this element
- - -
- -
-   - - - - - - -
items(self)
- Gets element attributes, as a sequence. The attributes are returned in -an arbitrary order.
- - -
- -
-   - - - - - - -
iter(self, - tag=None, - *tags)
- Iterate over all elements in the subtree in document order (depth -first pre-order), starting with this element.
- - -
- -
-   - - - - - - -
iterancestors(self, - tag=None, - *tags)
- Iterate over the ancestors of this element (from parent to parent).
- - -
- -
-   - - - - - - -
iterchildren(self, - tag=None, - reversed=False, - *tags)
- Iterate over the children of this element.
- - -
- -
-   - - - - - - -
iterdescendants(self, - tag=None, - *tags)
- Iterate over the descendants of this element in document order.
- - -
- -
-   - - - - - - -
iterfind(self, - path, - namespaces=None)
- Iterates over all matching subelements, by tag name or path.
- - -
- -
-   - - - - - - -
itersiblings(self, - tag=None, - preceding=False, - *tags)
- Iterate over the following or preceding siblings of this element.
- - -
- -
-   - - - - - - -
itertext(self, - tag=None, - with_tail=True, - *tags)
- Iterates over the text content of a subtree.
- - -
- -
-   - - - - - - -
keys(self)
- Gets a list of attribute names. The names are returned in an -arbitrary order (just like for an ordinary Python dictionary).
- - -
- -
-   - - - - - - -
makeelement(self, - _tag, - attrib=None, - nsmap=None, - **_extra)
- Creates a new element associated with the same document.
- - -
- -
-   - - - - - - -
remove(self, - element)
- Removes a matching subelement. Unlike the find methods, this -method compares elements based on identity, not on tag value -or contents.
- - -
- -
-   - - - - - - -
replace(self, - old_element, - new_element)
- Replaces a subelement with the element passed as second argument.
- - -
- -
-   - - - - - - -
set(self, - key, - value)
- Sets an element attribute.
- - -
- -
-   - - - - - - -
values(self)
- Gets element attribute values as a sequence of strings. The -attributes are returned in an arbitrary order.
- - -
- -
-   - - - - - - -
xpath(self, - _path, - namespaces=None, - extensions=None, - smart_strings=True, - **_variables)
- Evaluate an xpath expression using the element as context node.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - attrib
- Element attribute dictionary. Where possible, use get(), set(), -keys(), values() and items() to access element attributes. -
-   - - base
- The base URI of the Element (xml:base or HTML base URL). -None if the base URI is unknown. -
-   - - nsmap
- Namespace prefix->URI mapping known in the context of this -Element. This includes all namespace declarations of the -parents. -
-   - - prefix
- Namespace prefix or None. -
-   - - sourceline
- Original line number as found by the parser or None if unknown. -
-   - - tag
- Element tag -
-   - - tail
- Text after this element's end tag, but before the next sibling -element's start tag. This is either a string or the value None, if -there was no text. -
-   - - text
- Text before the first subelement. This is either a string or -the value None, if there was no text. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
- -
- -
- - -
-

addnext(self, - element) -

-
  -
- -

Adds the element as a following sibling directly after this -element.

-

This is normally used to set a processing instruction or comment after -the root node of a document. Note that tail text is automatically -discarded when adding at the root level.

-
-
-
-
- -
- -
- - -
-

addprevious(self, - element) -

-
  -
- -

Adds the element as a preceding sibling directly before this -element.

-

This is normally used to set a processing instruction or comment -before the root node of a document. Note that tail text is -automatically discarded when adding at the root level.

-
-
-
-
- -
- -
- - -
-

cssselect(...) -

-
  -
- -

Run the CSS expression on this element and its children, -returning a list of the results.

-

Equivalent to lxml.cssselect.CSSSelect(expr)(self) -- note -that pre-compiling the expression can provide a substantial -speedup.

-
-
-
-
- -
- -
- - -
-

find(self, - path, - namespaces=None) -

-
  -
- -

Finds the first matching subelement, by tag name or path.

-

The optional namespaces argument accepts a -prefix-to-namespace mapping that allows the usage of XPath -prefixes in the path expression.

-
-
-
-
- -
- -
- - -
-

findall(self, - path, - namespaces=None) -

-
  -
- -

Finds all matching subelements, by tag name or path.

-

The optional namespaces argument accepts a -prefix-to-namespace mapping that allows the usage of XPath -prefixes in the path expression.

-
-
-
-
- -
- -
- - -
-

findtext(self, - path, - default=None, - namespaces=None) -

-
  -
- -

Finds text for the first matching subelement, by tag name or path.

-

The optional namespaces argument accepts a -prefix-to-namespace mapping that allows the usage of XPath -prefixes in the path expression.

-
-
-
-
- -
- -
- - -
-

getchildren(self) -

-
  -
- - Returns all direct children. The elements are returned in document -order. -
-
-

Deprecated: - Note that this method has been deprecated as of -ElementTree 1.3 and lxml 2.0. New code should use -list(element) or simply iterate over elements. -

-
-
- -
- -
- - -
-

getiterator(self, - tag=None, - *tags) -

-
  -
- -

Returns a sequence or iterator of all elements in the subtree in -document order (depth first pre-order), starting with this -element.

-

Can be restricted to find only elements with specific tags, -see iter.

-
-
-

Deprecated: - Note that this method is deprecated as of -ElementTree 1.3 and lxml 2.0. It returns an iterator in -lxml, which diverges from the original ElementTree -behaviour. If you want an efficient iterator, use the -element.iter() method instead. You should only use this -method in new code if you require backwards compatibility -with older versions of lxml or ElementTree. -

-
-
- -
- -
- - -
-

getroottree(self) -

-
  -
- -

Return an ElementTree for the root node of the document that -contains this element.

-

This is the same as following element.getparent() up the tree until it -returns None (for the root element) and then build an ElementTree for -the last parent that was returned.

-
-
-
-
- -
- -
- - -
-

index(self, - child, - start=None, - stop=None) -

-
  -
- -

Find the position of the child within the parent.

-

This method is not part of the original ElementTree API.

-
-
-
-
- -
- -
- - -
-

iter(self, - tag=None, - *tags) -

-
  -
- -

Iterate over all elements in the subtree in document order (depth -first pre-order), starting with this element.

-

Can be restricted to find only elements with specific tags: -pass "{ns}localname" as tag. Either or both of ns and -localname can be * for a wildcard; ns can be empty -for no namespace. "localname" is equivalent to "{}localname" -(i.e. no namespace) but "*" is "{*}*" (any or no namespace), -not "{}*".

-

You can also pass the Element, Comment, ProcessingInstruction and -Entity factory functions to look only for the specific element type.

-

Passing multiple tags (or a sequence of tags) instead of a single tag -will let the iterator return all elements matching any of these tags, -in document order.

-
-
-
-
- -
- -
- - -
-

iterancestors(self, - tag=None, - *tags) -

-
  -
- -

Iterate over the ancestors of this element (from parent to parent).

-

Can be restricted to find only elements with specific tags, -see iter.

-
-
-
-
- -
- -
- - -
-

iterchildren(self, - tag=None, - reversed=False, - *tags) -

-
  -
- -

Iterate over the children of this element.

-

As opposed to using normal iteration on this element, the returned -elements can be reversed with the 'reversed' keyword and restricted -to find only elements with specific tags, see iter.

-
-
-
-
- -
- -
- - -
-

iterdescendants(self, - tag=None, - *tags) -

-
  -
- -

Iterate over the descendants of this element in document order.

-

As opposed to el.iter(), this iterator does not yield the element -itself. The returned elements can be restricted to find only elements -with specific tags, see iter.

-
-
-
-
- -
- -
- - -
-

iterfind(self, - path, - namespaces=None) -

-
  -
- -

Iterates over all matching subelements, by tag name or path.

-

The optional namespaces argument accepts a -prefix-to-namespace mapping that allows the usage of XPath -prefixes in the path expression.

-
-
-
-
- -
- -
- - -
-

itersiblings(self, - tag=None, - preceding=False, - *tags) -

-
  -
- -

Iterate over the following or preceding siblings of this element.

-

The direction is determined by the 'preceding' keyword which -defaults to False, i.e. forward iteration over the following -siblings. When True, the iterator yields the preceding -siblings in reverse document order, i.e. starting right before -the current element and going backwards.

-

Can be restricted to find only elements with specific tags, -see iter.

-
-
-
-
- -
- -
- - -
-

itertext(self, - tag=None, - with_tail=True, - *tags) -

-
  -
- -

Iterates over the text content of a subtree.

-

You can pass tag names to restrict text content to specific elements, -see iter.

-

You can set the with_tail keyword argument to False to skip -over tail text.

-
-
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

base

-

The base URI of the Element (xml:base or HTML base URL). -None if the base URI is unknown.

-

Note that the value depends on the URL of the document that -holds the Element if there is no xml:base attribute on the -Element or its ancestors.

-

Setting this property will set an xml:base attribute on the -Element, regardless of the document type (XML or HTML).

-
-
-
-
- -
- -
-

nsmap

-

Namespace prefix->URI mapping known in the context of this -Element. This includes all namespace declarations of the -parents.

-

Note that changing the returned dict has no effect on the Element.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._ElementIterator-class.html b/doc/html/api/lxml.etree._ElementIterator-class.html deleted file mode 100644 index 7d705940..00000000 --- a/doc/html/api/lxml.etree._ElementIterator-class.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - lxml.etree._ElementIterator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _ElementIterator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ElementIterator

-
-        object --+    
-                 |    
-_ElementTagMatcher --+
-                     |
-                    _ElementIterator
-
- -
-Dead but public. :) - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__next__(...) - - -
- -
- the next value, or raise StopIteration - - - - - - -
next(x) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._ElementMatchIterator-class.html b/doc/html/api/lxml.etree._ElementMatchIterator-class.html deleted file mode 100644 index c838d95c..00000000 --- a/doc/html/api/lxml.etree._ElementMatchIterator-class.html +++ /dev/null @@ -1,301 +0,0 @@ - - - - - lxml.etree._ElementMatchIterator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _ElementMatchIterator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ElementMatchIterator

-
-object --+
-         |
-        _ElementMatchIterator
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__next__(...) - - -
- -
- the next value, or raise StopIteration - - - - - - -
next(x) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._ElementStringResult-class.html b/doc/html/api/lxml.etree._ElementStringResult-class.html deleted file mode 100644 index 91f398f7..00000000 --- a/doc/html/api/lxml.etree._ElementStringResult-class.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - lxml.etree._ElementStringResult - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _ElementStringResult - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ElementStringResult

-
-object --+        
-         |        
-basestring --+    
-             |    
-           str --+
-                 |
-                _ElementStringResult
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
getparent(...) - - -
- -
-

Inherited from str: - __add__, - __contains__, - __eq__, - __format__, - __ge__, - __getattribute__, - __getitem__, - __getnewargs__, - __getslice__, - __gt__, - __hash__, - __le__, - __len__, - __lt__, - __mod__, - __mul__, - __ne__, - __new__, - __repr__, - __rmod__, - __rmul__, - __sizeof__, - __str__, - capitalize, - center, - count, - decode, - encode, - endswith, - expandtabs, - find, - format, - index, - isalnum, - isalpha, - isdigit, - islower, - isspace, - istitle, - isupper, - join, - ljust, - lower, - lstrip, - partition, - replace, - rfind, - rindex, - rjust, - rpartition, - rsplit, - rstrip, - split, - splitlines, - startswith, - strip, - swapcase, - title, - translate, - upper, - zfill -

-

Inherited from str (private): - _formatter_field_name_split, - _formatter_parser -

-

Inherited from object: - __delattr__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = '_ElementStringResult' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._ElementTagMatcher-class.html b/doc/html/api/lxml.etree._ElementTagMatcher-class.html deleted file mode 100644 index b7a19168..00000000 --- a/doc/html/api/lxml.etree._ElementTagMatcher-class.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - lxml.etree._ElementTagMatcher - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _ElementTagMatcher - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ElementTagMatcher

-
-object --+
-         |
-        _ElementTagMatcher
-
- -
Known Subclasses:
-
- -
- -
-Dead but public. :) - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._ElementTree-class.html b/doc/html/api/lxml.etree._ElementTree-class.html deleted file mode 100644 index a91e5dc9..00000000 --- a/doc/html/api/lxml.etree._ElementTree-class.html +++ /dev/null @@ -1,1101 +0,0 @@ - - - - - lxml.etree._ElementTree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _ElementTree - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ElementTree

-
-object --+
-         |
-        _ElementTree
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__copy__(...) - - -
- -
-   - - - - - - -
__deepcopy__(...) - - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
_setroot(self, - root)
- Relocate the ElementTree to a new root node.
- - -
- -
-   - - - - - - -
find(self, - path, - namespaces=None)
- Finds the first toplevel element with given tag. Same as -tree.getroot().find(path).
- - -
- -
-   - - - - - - -
findall(self, - path, - namespaces=None)
- Finds all elements matching the ElementPath expression. Same as -getroot().findall(path).
- - -
- -
-   - - - - - - -
findtext(self, - path, - default=None, - namespaces=None)
- Finds the text for the first element matching the ElementPath -expression. Same as getroot().findtext(path)
- - -
- -
-   - - - - - - -
getelementpath(self, - element)
- Returns a structural, absolute ElementPath expression to find the -element. This path can be used in the .find() method to look up -the element, provided that the elements along the path and their -list of immediate children were not modified in between.
- - -
- -
-   - - - - - - -
getiterator(self, - tag=None, - *tags)
- Returns a sequence or iterator of all elements in document order -(depth first pre-order), starting with the root element.
- - -
- -
-   - - - - - - -
getpath(self, - element)
- Returns a structural, absolute XPath expression to find the element.
- - -
- -
-   - - - - - - -
getroot(self)
- Gets the root element for this tree.
- - -
- -
-   - - - - - - -
iter(self, - tag=None, - *tags)
- Creates an iterator for the root element. The iterator loops over -all elements in this tree, in document order. Note that siblings -of the root element (comments or processing instructions) are not -returned by the iterator.
- - -
- -
-   - - - - - - -
iterfind(self, - path, - namespaces=None)
- Iterates over all elements matching the ElementPath expression. -Same as getroot().iterfind(path).
- - -
- -
-   - - - - - - -
parse(self, - source, - parser=None, - base_url=None)
- Updates self with the content of source and returns its root
- - -
- -
-   - - - - - - -
relaxng(self, - relaxng)
- Validate this document using other document.
- - -
- -
-   - - - - - - -
write(self, - file, - encoding=None, - method="xml", - pretty_print=False, - xml_declaration=None, - with_tail=True, - standalone=None, - doctype=None, - compression=0, - exclusive=False, - with_comments=True, - inclusive_ns_prefixes=None)
- Write the tree to a filename, file or file-like object.
- - -
- -
-   - - - - - - -
write_c14n(self, - file, - exclusive=False, - with_comments=True, - compression=0, - inclusive_ns_prefixes=None)
- C14N write of document. Always writes UTF-8.
- - -
- -
-   - - - - - - -
xinclude(self)
- Process the XInclude nodes in this document and include the -referenced XML fragments.
- - -
- -
-   - - - - - - -
xmlschema(self, - xmlschema)
- Validate this document using other document.
- - -
- -
-   - - - - - - -
xpath(self, - _path, - namespaces=None, - extensions=None, - smart_strings=True, - **_variables)
- XPath evaluate in context of document.
- - -
- -
-   - - - - - - -
xslt(self, - _xslt, - extensions=None, - access_control=None, - **_kw)
- Transform this document using other document.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - docinfo
- Information about the document provided by parser and DTD. -
-   - - parser
- The parser that was used to parse the document in this ElementTree. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

find(self, - path, - namespaces=None) -

-
  -
- -

Finds the first toplevel element with given tag. Same as -tree.getroot().find(path).

-

The optional namespaces argument accepts a -prefix-to-namespace mapping that allows the usage of XPath -prefixes in the path expression.

-
-
-
-
- -
- -
- - -
-

findall(self, - path, - namespaces=None) -

-
  -
- -

Finds all elements matching the ElementPath expression. Same as -getroot().findall(path).

-

The optional namespaces argument accepts a -prefix-to-namespace mapping that allows the usage of XPath -prefixes in the path expression.

-
-
-
-
- -
- -
- - -
-

findtext(self, - path, - default=None, - namespaces=None) -

-
  -
- -

Finds the text for the first element matching the ElementPath -expression. Same as getroot().findtext(path)

-

The optional namespaces argument accepts a -prefix-to-namespace mapping that allows the usage of XPath -prefixes in the path expression.

-
-
-
-
- -
- -
- - -
-

getelementpath(self, - element) -

-
  -
- -

Returns a structural, absolute ElementPath expression to find the -element. This path can be used in the .find() method to look up -the element, provided that the elements along the path and their -list of immediate children were not modified in between.

-

ElementPath has the advantage over an XPath expression (as returned -by the .getpath() method) that it does not require additional prefix -declarations. It is always self-contained.

-
-
-
-
- -
- -
- - -
-

getiterator(self, - tag=None, - *tags) -

-
  -
- -

Returns a sequence or iterator of all elements in document order -(depth first pre-order), starting with the root element.

-

Can be restricted to find only elements with specific tags, -see _Element.iter.

-
-
-

Deprecated: - Note that this method is deprecated as of -ElementTree 1.3 and lxml 2.0. It returns an iterator in -lxml, which diverges from the original ElementTree -behaviour. If you want an efficient iterator, use the -tree.iter() method instead. You should only use this -method in new code if you require backwards compatibility -with older versions of lxml or ElementTree. -

-
-
- -
- -
- - -
-

getpath(self, - element) -

-
  -
- -

Returns a structural, absolute XPath expression to find the element.

-

For namespaced elements, the expression uses prefixes from the -document, which therefore need to be provided in order to make any -use of the expression in XPath.

-

Also see the method getelementpath(self, element), which returns a -self-contained ElementPath expression.

-
-
-
-
- -
- -
- - -
-

iter(self, - tag=None, - *tags) -

-
  -
- -

Creates an iterator for the root element. The iterator loops over -all elements in this tree, in document order. Note that siblings -of the root element (comments or processing instructions) are not -returned by the iterator.

-

Can be restricted to find only elements with specific tags, -see _Element.iter.

-
-
-
-
- -
- -
- - -
-

iterfind(self, - path, - namespaces=None) -

-
  -
- -

Iterates over all elements matching the ElementPath expression. -Same as getroot().iterfind(path).

-

The optional namespaces argument accepts a -prefix-to-namespace mapping that allows the usage of XPath -prefixes in the path expression.

-
-
-
-
- -
- -
- - -
-

relaxng(self, - relaxng) -

-
  -
- -

Validate this document using other document.

-

The relaxng argument is a tree that should contain a Relax NG schema.

-

Returns True or False, depending on whether validation -succeeded.

-

Note: if you are going to apply the same Relax NG schema against -multiple documents, it is more efficient to use the RelaxNG -class directly.

-
-
-
-
- -
- -
- - -
-

write(self, - file, - encoding=None, - method="xml", - pretty_print=False, - xml_declaration=None, - with_tail=True, - standalone=None, - doctype=None, - compression=0, - exclusive=False, - with_comments=True, - inclusive_ns_prefixes=None) -

-
  -
- -

Write the tree to a filename, file or file-like object.

-

Defaults to ASCII encoding and writing a declaration as needed.

-

The keyword argument 'method' selects the output method: -'xml', 'html', 'text' or 'c14n'. Default is 'xml'.

-

The exclusive and with_comments arguments are only -used with C14N output, where they request exclusive and -uncommented C14N serialisation respectively.

-

Passing a boolean value to the standalone option will -output an XML declaration with the corresponding -standalone flag.

-

The doctype option allows passing in a plain string that will -be serialised before the XML tree. Note that passing in non -well-formed content here will make the XML output non well-formed. -Also, an existing doctype in the document tree will not be removed -when serialising an ElementTree instance.

-

The compression option enables GZip compression level 1-9.

-

The inclusive_ns_prefixes should be a list of namespace strings -(i.e. ['xs', 'xsi']) that will be promoted to the top-level element -during exclusive C14N serialisation. This parameter is ignored if -exclusive mode=False.

-

If exclusive=True and no list is provided, a namespace will only be -rendered if it is used by the immediate parent or one of its attributes -and its prefix and values have not already been rendered by an ancestor -of the namespace node's parent element.

-
-
-
-
- -
- -
- - -
-

write_c14n(self, - file, - exclusive=False, - with_comments=True, - compression=0, - inclusive_ns_prefixes=None) -

-
  -
- -

C14N write of document. Always writes UTF-8.

-

The compression option enables GZip compression level 1-9.

-

The inclusive_ns_prefixes should be a list of namespace strings -(i.e. ['xs', 'xsi']) that will be promoted to the top-level element -during exclusive C14N serialisation. This parameter is ignored if -exclusive mode=False.

-

If exclusive=True and no list is provided, a namespace will only be -rendered if it is used by the immediate parent or one of its attributes -and its prefix and values have not already been rendered by an ancestor -of the namespace node's parent element.

-
-
-
-
- -
- -
- - -
-

xinclude(self) -

-
  -
- -

Process the XInclude nodes in this document and include the -referenced XML fragments.

-

There is support for loading files through the file system, HTTP and -FTP.

-

Note that XInclude does not support custom resolvers in Python space -due to restrictions of libxml2 <= 2.6.29.

-
-
-
-
- -
- -
- - -
-

xmlschema(self, - xmlschema) -

-
  -
- -

Validate this document using other document.

-

The xmlschema argument is a tree that should contain an XML Schema.

-

Returns True or False, depending on whether validation -succeeded.

-

Note: If you are going to apply the same XML Schema against -multiple documents, it is more efficient to use the XMLSchema -class directly.

-
-
-
-
- -
- -
- - -
-

xpath(self, - _path, - namespaces=None, - extensions=None, - smart_strings=True, - **_variables) -

-
  -
- -

XPath evaluate in context of document.

-

namespaces is an optional dictionary with prefix to namespace URI -mappings, used by XPath. extensions defines additional extension -functions.

-

Returns a list (nodeset), or bool, float or string.

-

In case of a list result, return Element for element nodes, -string for text and attribute values.

-

Note: if you are going to apply multiple XPath expressions -against the same document, it is more efficient to use -XPathEvaluator directly.

-
-
-
-
- -
- -
- - -
-

xslt(self, - _xslt, - extensions=None, - access_control=None, - **_kw) -

-
  -
- -

Transform this document using other document.

-

xslt is a tree that should be XSLT -keyword parameters are XSLT transformation parameters.

-

Returns the transformed tree.

-

Note: if you are going to apply the same XSLT stylesheet against -multiple documents, it is more efficient to use the XSLT -class directly.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._ElementUnicodeResult-class.html b/doc/html/api/lxml.etree._ElementUnicodeResult-class.html deleted file mode 100644 index 29e4548a..00000000 --- a/doc/html/api/lxml.etree._ElementUnicodeResult-class.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - lxml.etree._ElementUnicodeResult - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _ElementUnicodeResult - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ElementUnicodeResult

-
-object --+        
-         |        
-basestring --+    
-             |    
-       unicode --+
-                 |
-                _ElementUnicodeResult
-
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
getparent(...) - - -
- -
-

Inherited from unicode: - __add__, - __contains__, - __eq__, - __format__, - __ge__, - __getattribute__, - __getitem__, - __getnewargs__, - __getslice__, - __gt__, - __hash__, - __le__, - __len__, - __lt__, - __mod__, - __mul__, - __ne__, - __repr__, - __rmod__, - __rmul__, - __sizeof__, - __str__, - capitalize, - center, - count, - decode, - encode, - endswith, - expandtabs, - find, - format, - index, - isalnum, - isalpha, - isdecimal, - isdigit, - islower, - isnumeric, - isspace, - istitle, - isupper, - join, - ljust, - lower, - lstrip, - partition, - replace, - rfind, - rindex, - rjust, - rpartition, - rsplit, - rstrip, - split, - splitlines, - startswith, - strip, - swapcase, - title, - translate, - upper, - zfill -

-

Inherited from unicode (private): - _formatter_field_name_split, - _formatter_parser -

-

Inherited from object: - __delattr__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - attrname -
-   - - is_attribute -
-   - - is_tail -
-   - - is_text -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._Entity-class.html b/doc/html/api/lxml.etree._Entity-class.html deleted file mode 100644 index 43da874c..00000000 --- a/doc/html/api/lxml.etree._Entity-class.html +++ /dev/null @@ -1,379 +0,0 @@ - - - - - lxml.etree._Entity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _Entity - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _Entity

-
-         object --+        
-                  |        
-           _Element --+    
-                      |    
-??.__ContentOnlyElement --+
-                          |
-                         _Entity
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - get, - insert, - items, - keys, - set, - values -

-

Inherited from _Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from _Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - name -
-   - - tag
- Element tag -
-   - - text
- Text before the first subelement. This is either a string or -the value None, if there was no text. -
-

Inherited from unreachable.__ContentOnlyElement: - attrib -

-

Inherited from _Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._ErrorLog-class.html b/doc/html/api/lxml.etree._ErrorLog-class.html deleted file mode 100644 index 4690641c..00000000 --- a/doc/html/api/lxml.etree._ErrorLog-class.html +++ /dev/null @@ -1,459 +0,0 @@ - - - - - lxml.etree._ErrorLog - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _ErrorLog - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ErrorLog

-
-   object --+        
-            |        
-_BaseErrorLog --+    
-                |    
-    _ListErrorLog --+
-                    |
-                   _ErrorLog
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__exit__(...) - - -
- -
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
clear(...) - - -
- -
-   - - - - - - -
copy(...)
- Creates a shallow copy of this error log and the list of entries.
- - -
- -
-   - - - - - - -
receive(...) - - -
- -
-

Inherited from _ListErrorLog: - __contains__, - __getitem__, - __len__, - __nonzero__, - __repr__, - filter_domains, - filter_from_errors, - filter_from_fatals, - filter_from_level, - filter_from_warnings, - filter_levels, - filter_types -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _BaseErrorLog: - last_error -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__iter__(x) -

-
  -
- - iter(x) -
-
Overrides: - _ListErrorLog.__iter__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

copy(...) -

-
  -
- - Creates a shallow copy of this error log and the list of entries. -
-
Overrides: - _BaseErrorLog.copy -
-
-
-
- -
- -
- - -
-

receive(...) -

-
  -
- - -
-
Overrides: - _BaseErrorLog.receive -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._FeedParser-class.html b/doc/html/api/lxml.etree._FeedParser-class.html deleted file mode 100644 index 0b98cb88..00000000 --- a/doc/html/api/lxml.etree._FeedParser-class.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - - lxml.etree._FeedParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _FeedParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _FeedParser

-
-    object --+    
-             |    
-??._BaseParser --+
-                 |
-                _FeedParser
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
close(self)
- Terminates feeding data to this parser. This tells the parser to -process any remaining data in the feed buffer, and then returns the -root Element of the tree that was parsed.
- - -
- -
-   - - - - - - -
feed(self, - data)
- Feeds data to the parser. The argument should be an 8-bit string -buffer containing encoded data, although Unicode is supported as long -as both string types are not mixed.
- - -
- -
-

Inherited from unreachable._BaseParser: - __init__, - copy, - makeelement, - setElementClassLookup, - set_element_class_lookup -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - feed_error_log
- The error log of the last (or current) run of the feed parser. -
-

Inherited from unreachable._BaseParser: - error_log, - resolvers, - target, - version -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

close(self) -

-
  -
- -

Terminates feeding data to this parser. This tells the parser to -process any remaining data in the feed buffer, and then returns the -root Element of the tree that was parsed.

-

This method must be called after passing the last chunk of data into -the feed() method. It should only be called when using the feed -parser interface, all other usage is undefined.

-
-
-
-
- -
- -
- - -
-

feed(self, - data) -

-
  -
- -

Feeds data to the parser. The argument should be an 8-bit string -buffer containing encoded data, although Unicode is supported as long -as both string types are not mixed.

-

This is the main entry point to the consumer interface of a -parser. The parser will parse as much of the XML stream as it -can on each call. To finish parsing or to reset the parser, -call the close() method. Both methods may raise -ParseError if errors occur in the input data. If an error is -raised, there is no longer a need to call close().

-

The feed parser interface is independent of the normal parser -usage. You can use the same parser as a feed parser and in -the parse() function concurrently.

-
-
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

feed_error_log

-

The error log of the last (or current) run of the feed parser.

-

Note that this is local to the feed parser and thus is -different from what the error_log property returns.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._IDDict-class.html b/doc/html/api/lxml.etree._IDDict-class.html deleted file mode 100644 index 2ab8dd49..00000000 --- a/doc/html/api/lxml.etree._IDDict-class.html +++ /dev/null @@ -1,505 +0,0 @@ - - - - - lxml.etree._IDDict - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _IDDict - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _IDDict

-
-object --+
-         |
-        _IDDict
-
- -
-

IDDict(self, etree) -A dictionary-like proxy class that mapps ID attributes to elements.

-

The dictionary must be instantiated with the root element of a parsed XML -document, otherwise the behaviour is undefined. Elements and XML trees -that were created or modified 'by hand' are not supported.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__contains__(x, - y)
- y in x
- - -
- -
-   - - - - - - -
__getitem__(x, - y)
- x[y]
- - -
- -
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
-   - - - - - - -
__len__(x)
- len(x)
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
copy(...) - - -
- -
-   - - - - - - -
get(...) - - -
- -
-   - - - - - - -
has_key(...) - - -
- -
-   - - - - - - -
items(...) - - -
- -
-   - - - - - - -
iteritems(...) - - -
- -
-   - - - - - - -
iterkeys(...) - - -
- -
-   - - - - - - -
itervalues(...) - - -
- -
-   - - - - - - -
keys(...) - - -
- -
-   - - - - - - -
values(...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._ListErrorLog-class.html b/doc/html/api/lxml.etree._ListErrorLog-class.html deleted file mode 100644 index 957b57b6..00000000 --- a/doc/html/api/lxml.etree._ListErrorLog-class.html +++ /dev/null @@ -1,593 +0,0 @@ - - - - - lxml.etree._ListErrorLog - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _ListErrorLog - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ListErrorLog

-
-   object --+    
-            |    
-_BaseErrorLog --+
-                |
-               _ListErrorLog
-
- -
Known Subclasses:
-
- -
- -
-Immutable base version of a list based error log. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__contains__(x, - y)
- y in x
- - -
- -
-   - - - - - - -
__getitem__(x, - y)
- x[y]
- - -
- -
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
-   - - - - - - -
__len__(x)
- len(x)
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__nonzero__(x)
- x != 0
- - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
copy(...)
- Creates a shallow copy of this error log. Reuses the list of -entries.
- - -
- -
-   - - - - - - -
filter_domains(...)
- Filter the errors by the given domains and return a new error log -containing the matches.
- - -
- -
-   - - - - - - -
filter_from_errors(self)
- Convenience method to get all error messages or worse.
- - -
- -
-   - - - - - - -
filter_from_fatals(self)
- Convenience method to get all fatal error messages.
- - -
- -
-   - - - - - - -
filter_from_level(self, - level)
- Return a log with all messages of the requested level of worse.
- - -
- -
-   - - - - - - -
filter_from_warnings(self)
- Convenience method to get all warnings or worse.
- - -
- -
-   - - - - - - -
filter_levels(self, - levels)
- Filter the errors by the given error levels and return a new -error log containing the matches.
- - -
- -
-   - - - - - - -
filter_types(self, - types)
- Filter the errors by the given types and return a new error -log containing the matches.
- - -
- -
-

Inherited from _BaseErrorLog: - receive -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _BaseErrorLog: - last_error -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
- -
- -
- - -
-

copy(...) -

-
  -
- - Creates a shallow copy of this error log. Reuses the list of -entries. -
-
Overrides: - _BaseErrorLog.copy -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._LogEntry-class.html b/doc/html/api/lxml.etree._LogEntry-class.html deleted file mode 100644 index 4bd69cff..00000000 --- a/doc/html/api/lxml.etree._LogEntry-class.html +++ /dev/null @@ -1,379 +0,0 @@ - - - - - lxml.etree._LogEntry - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _LogEntry - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _LogEntry

-
-object --+
-         |
-        _LogEntry
-
- -
-

A log message entry from an error log.

-

Attributes:

- - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - column -
-   - - domain -
-   - - domain_name
- The name of the error domain. See lxml.etree.ErrorDomains -
-   - - filename -
-   - - level -
-   - - level_name
- The name of the error level. See lxml.etree.ErrorLevels -
-   - - line -
-   - - message -
-   - - path
- The XPath for the node where the error was detected. -
-   - - type -
-   - - type_name
- The name of the error type. See lxml.etree.ErrorTypes -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._ProcessingInstruction-class.html b/doc/html/api/lxml.etree._ProcessingInstruction-class.html deleted file mode 100644 index 568b4a14..00000000 --- a/doc/html/api/lxml.etree._ProcessingInstruction-class.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - - lxml.etree._ProcessingInstruction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _ProcessingInstruction - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ProcessingInstruction

-
-         object --+        
-                  |        
-           _Element --+    
-                      |    
-??.__ContentOnlyElement --+
-                          |
-                         _ProcessingInstruction
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
get(self, - key, - default=None)
- Try to parse pseudo-attributes from the text content of the -processing instruction, search for one with the given key as -name and return its associated value.
- - -
- -
-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - insert, - items, - keys, - set, - values -

-

Inherited from _Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from _Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - attrib
- Returns a dict containing all pseudo-attributes that can be -parsed from the text content of this processing instruction. -Note that modifying the dict currently has no effect on the -XML node, although this is not guaranteed to stay this way. -
-   - - tag
- Element tag -
-   - - target -
-

Inherited from unreachable.__ContentOnlyElement: - text -

-

Inherited from _Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
- -
- -
- - -
-

get(self, - key, - default=None) -

-
  -
- -

Try to parse pseudo-attributes from the text content of the -processing instruction, search for one with the given key as -name and return its associated value.

-

Note that this is only a convenience method for the most -common case that all text content is structured in -attribute-like name-value pairs with properly quoted values. -It is not guaranteed to work for all possible text content.

-
-
Overrides: - _Element.get -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._RotatingErrorLog-class.html b/doc/html/api/lxml.etree._RotatingErrorLog-class.html deleted file mode 100644 index 21ea4d12..00000000 --- a/doc/html/api/lxml.etree._RotatingErrorLog-class.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - lxml.etree._RotatingErrorLog - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _RotatingErrorLog - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _RotatingErrorLog

-
-   object --+            
-            |            
-_BaseErrorLog --+        
-                |        
-    _ListErrorLog --+    
-                    |    
-            _ErrorLog --+
-                        |
-                       _RotatingErrorLog
-
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
receive(...) - - -
- -
-

Inherited from _ErrorLog: - __exit__, - __iter__, - clear, - copy -

-

Inherited from _ListErrorLog: - __contains__, - __getitem__, - __len__, - __nonzero__, - __repr__, - filter_domains, - filter_from_errors, - filter_from_fatals, - filter_from_level, - filter_from_warnings, - filter_levels, - filter_types -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _BaseErrorLog: - last_error -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

receive(...) -

-
  -
- - -
-
Overrides: - _BaseErrorLog.receive -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._SaxParserTarget-class.html b/doc/html/api/lxml.etree._SaxParserTarget-class.html deleted file mode 100644 index 45ad47b4..00000000 --- a/doc/html/api/lxml.etree._SaxParserTarget-class.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - lxml.etree._SaxParserTarget - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _SaxParserTarget - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _SaxParserTarget

-
-object --+
-         |
-        _SaxParserTarget
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._TargetParserResult-class.html b/doc/html/api/lxml.etree._TargetParserResult-class.html deleted file mode 100644 index 652408ff..00000000 --- a/doc/html/api/lxml.etree._TargetParserResult-class.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - lxml.etree._TargetParserResult - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _TargetParserResult - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _TargetParserResult

-
-              object --+        
-                       |        
-exceptions.BaseException --+    
-                           |    
-        exceptions.Exception --+
-                               |
-                              _TargetParserResult
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
-

Inherited from exceptions.Exception: - __new__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = '_TargetParserResult' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._Validator-class.html b/doc/html/api/lxml.etree._Validator-class.html deleted file mode 100644 index e74b0ba3..00000000 --- a/doc/html/api/lxml.etree._Validator-class.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - lxml.etree._Validator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _Validator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _Validator

-
-object --+
-         |
-        _Validator
-
- -
Known Subclasses:
-
- -
- -
-Base class for XML validators. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
_append_log_message(...) - - -
- -
-   - - - - - - -
_clear_error_log(...) - - -
- -
-   - - - - - - -
assertValid(self, - etree)
- Raises DocumentInvalid if the document does not comply with the schema.
- - -
- -
-   - - - - - - -
assert_(self, - etree)
- Raises AssertionError if the document does not comply with the schema.
- - -
- -
-   - - - - - - -
validate(self, - etree)
- Validate the document using this schema.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - error_log
- The log of validation errors and warnings. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

validate(self, - etree) -

-
  -
- -

Validate the document using this schema.

-

Returns true if document is valid, false if not.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._XPathEvaluatorBase-class.html b/doc/html/api/lxml.etree._XPathEvaluatorBase-class.html deleted file mode 100644 index b1455bb9..00000000 --- a/doc/html/api/lxml.etree._XPathEvaluatorBase-class.html +++ /dev/null @@ -1,345 +0,0 @@ - - - - - lxml.etree._XPathEvaluatorBase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _XPathEvaluatorBase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _XPathEvaluatorBase

-
-object --+
-         |
-        _XPathEvaluatorBase
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
evaluate(self, - _eval_arg, - **_variables)
- Evaluate an XPath expression.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - error_log -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(...) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

evaluate(self, - _eval_arg, - **_variables) -

-
  -
- -

Evaluate an XPath expression.

-

Instead of calling this method, you can also call the evaluator object -itself.

-

Variables may be provided as keyword arguments. Note that namespaces -are currently not supported for variables.

-
-
-

Deprecated: - call the object, not its method. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._XSLTProcessingInstruction-class.html b/doc/html/api/lxml.etree._XSLTProcessingInstruction-class.html deleted file mode 100644 index 1e13fef0..00000000 --- a/doc/html/api/lxml.etree._XSLTProcessingInstruction-class.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - lxml.etree._XSLTProcessingInstruction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _XSLTProcessingInstruction - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _XSLTProcessingInstruction

-
-         object --+                
-                  |                
-           _Element --+            
-                      |            
-??.__ContentOnlyElement --+        
-                          |        
-     _ProcessingInstruction --+    
-                              |    
-                         PIBase --+
-                                  |
-                                 _XSLTProcessingInstruction
-
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
parseXSL(self, - parser=None)
- Try to parse the stylesheet referenced by this PI and return -an ElementTree for it. If the stylesheet is embedded in the -same document (referenced via xml:id), find and return an -ElementTree for the stylesheet Element.
- - -
- -
-   - - - - - - -
set(self, - key, - value)
- Supports setting the 'href' pseudo-attribute in the text of -the processing instruction.
- - -
- -
-

Inherited from PIBase: - __init__ -

-

Inherited from _ProcessingInstruction: - __repr__, - get -

-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - insert, - items, - keys, - values -

-

Inherited from _Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from _Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from _ProcessingInstruction: - attrib, - tag, - target -

-

Inherited from unreachable.__ContentOnlyElement: - text -

-

Inherited from _Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

parseXSL(self, - parser=None) -

-
  -
- -

Try to parse the stylesheet referenced by this PI and return -an ElementTree for it. If the stylesheet is embedded in the -same document (referenced via xml:id), find and return an -ElementTree for the stylesheet Element.

-

The optional parser keyword argument can be passed to specify the -parser used to read from external stylesheet URLs.

-
-
-
-
- -
- -
- - -
-

set(self, - key, - value) -

-
  -
- - Supports setting the 'href' pseudo-attribute in the text of -the processing instruction. -
-
Overrides: - _Element.set -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree._XSLTResultTree-class.html b/doc/html/api/lxml.etree._XSLTResultTree-class.html deleted file mode 100644 index 2c9d5c20..00000000 --- a/doc/html/api/lxml.etree._XSLTResultTree-class.html +++ /dev/null @@ -1,382 +0,0 @@ - - - - - lxml.etree._XSLTResultTree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class _XSLTResultTree - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _XSLTResultTree

-
-  object --+    
-           |    
-_ElementTree --+
-               |
-              _XSLTResultTree
-
- -
-

The result of an XSLT evaluation.

-

Use str() or bytes() (or unicode() in Python 2.x) to serialise to a string, -and the .write_output() method to write serialise to a file.

- - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__str__(x)
- str(x)
- - -
- -
-   - - - - - - -
__unicode__(...) - - -
- -
-   - - - - - - -
write_output(...)
- write_output(self, file, *, compression=0)
- - -
- -
-

Inherited from _ElementTree: - __copy__, - __deepcopy__, - find, - findall, - findtext, - getelementpath, - getiterator, - getpath, - getroot, - iter, - iterfind, - parse, - relaxng, - write, - write_c14n, - xinclude, - xmlschema, - xpath, - xslt -

-

Inherited from _ElementTree (private): - _setroot -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - xslt_profile
- Return an ElementTree with profiling data for the stylesheet run. -
-

Inherited from _ElementTree: - docinfo, - parser -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__str__(x) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
-
-
-
- -
- -
- - -
-

write_output(...) -

-
  -
- -

write_output(self, file, *, compression=0)

-

Serialise the XSLT output to a file or file-like object.

-

As opposed to the generic .write() method, .write_output() serialises -the result as defined by the <xsl:output> tag.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.htmlfile-class.html b/doc/html/api/lxml.etree.htmlfile-class.html deleted file mode 100644 index 78a19d71..00000000 --- a/doc/html/api/lxml.etree.htmlfile-class.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - lxml.etree.htmlfile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class htmlfile - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class htmlfile

-
-object --+    
-         |    
-   xmlfile --+
-             |
-            htmlfile
-
- -
-

htmlfile(self, output_file, encoding=None, compression=None, close=False, buffered=True)

-

A simple mechanism for incremental HTML serialisation. Works the same as -xmlfile.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - output_file, - encoding=None, - compression=None, - close=False, - buffered=True)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from xmlfile: - __aenter__, - __aexit__, - __enter__, - __exit__ -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - output_file, - encoding=None, - compression=None, - close=False, - buffered=True) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.iterparse-class.html b/doc/html/api/lxml.etree.iterparse-class.html deleted file mode 100644 index b601419b..00000000 --- a/doc/html/api/lxml.etree.iterparse-class.html +++ /dev/null @@ -1,524 +0,0 @@ - - - - - lxml.etree.iterparse - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class iterparse - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class iterparse

-
-object --+
-         |
-        iterparse
-
- -
-

iterparse(self, source, events=("end",), tag=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, remove_blank_text=False, remove_comments=False, remove_pis=False, encoding=None, html=False, recover=None, huge_tree=False, schema=None)

-

Incremental parser.

-

Parses XML into a tree and generates tuples (event, element) in a -SAX-like fashion. event is any of 'start', 'end', 'start-ns', -'end-ns'.

-

For 'start' and 'end', element is the Element that the parser just -found opening or closing. For 'start-ns', it is a tuple (prefix, URI) of -a new namespace declaration. For 'end-ns', it is simply None. Note that -all start and end events are guaranteed to be properly nested.

-

The keyword argument events specifies a sequence of event type names -that should be generated. By default, only 'end' events will be -generated.

-

The additional tag argument restricts the 'start' and 'end' events to -those elements that match the given tag. The tag argument can also be -a sequence of tags to allow matching more than one tag. By default, -events are generated for all elements. Note that the 'start-ns' and -'end-ns' events are not impacted by this restriction.

-

The other keyword arguments in the constructor are mainly based on the -libxml2 parser configuration. A DTD will also be loaded if validation or -attribute default values are requested.

-
-
Available boolean keyword arguments:
-
    -
  • attribute_defaults: read default attributes from DTD

    -
  • -
  • dtd_validation: validate (if DTD is available)

    -
  • -
  • load_dtd: use DTD for parsing

    -
  • -
  • no_network: prevent network access for related files

    -
  • -
  • remove_blank_text: discard blank text nodes

    -
  • -
  • remove_comments: discard comments

    -
  • -
  • remove_pis: discard processing instructions

    -
  • -
  • strip_cdata: replace CDATA sections by normal text content (default: True)

    -
  • -
  • compact: safe memory for short text content (default: True)

    -
  • -
  • resolve_entities: replace entities by their text value (default: True)

    -
  • -
  • -
    huge_tree: disable security restrictions and support very deep trees
    -

    and very long text content (only affects libxml2 2.7+)

    -
    -
    -
  • -
  • html: parse input as HTML (default: XML)

    -
  • -
  • -
    recover: try hard to parse through broken input (default: True for HTML,
    -

    False otherwise)

    -
    -
    -
  • -
-
-
Other keyword arguments:
-
    -
  • encoding: override the document encoding
  • -
  • schema: an XMLSchema to validate against
  • -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - source, - events=("end", - ), - tag=None, - attribute_defaults=False, - dtd_validation=False, - load_dtd=False, - no_network=True, - remove_blank_text=False, - remove_comments=False, - remove_pis=False, - encoding=None, - html=False, - recover=None, - huge_tree=False, - schema=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__next__(...) - - -
- -
-   - - - - - - -
makeelement(self, - _tag, - attrib=None, - nsmap=None, - **_extra)
- Creates a new element associated with this parser.
- - -
- -
- the next value, or raise StopIteration - - - - - - -
next(x) - - -
- -
-   - - - - - - -
set_element_class_lookup(self, - lookup= None)
- Set a lookup scheme for element classes generated from this parser.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - error_log
- The error log of the last (or current) parser run. -
-   - - resolvers
- The custom resolver registry of the last (or current) parser run. -
-   - - root -
-   - - version
- The version of the underlying XML parser. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - source, - events=("end", - ), - tag=None, - attribute_defaults=False, - dtd_validation=False, - load_dtd=False, - no_network=True, - remove_blank_text=False, - remove_comments=False, - remove_pis=False, - encoding=None, - html=False, - recover=None, - huge_tree=False, - schema=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

set_element_class_lookup(self, - lookup= None) -

-
  -
- -

Set a lookup scheme for element classes generated from this parser.

-

Reset it by passing None or nothing.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.iterwalk-class.html b/doc/html/api/lxml.etree.iterwalk-class.html deleted file mode 100644 index 46882aa6..00000000 --- a/doc/html/api/lxml.etree.iterwalk-class.html +++ /dev/null @@ -1,392 +0,0 @@ - - - - - lxml.etree.iterwalk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class iterwalk - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class iterwalk

-
-object --+
-         |
-        iterwalk
-
- -
-

iterwalk(self, element_or_tree, events=("end",), tag=None)

-

A tree walker that generates events from an existing tree as if it -was parsing XML data with iterparse().

-

Just as for iterparse(), the tag argument can be a single tag or a -sequence of tags.

-

After receiving a 'start' or 'start-ns' event, the children and -descendants of the current element can be excluded from iteration -by calling the skip_subtree() method.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - element_or_tree, - events=("end", - ), - tag=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
-   - - - - - - -
__iter__(x)
- iter(x)
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__next__(...) - - -
- -
- the next value, or raise StopIteration - - - - - - -
next(x) - - -
- -
-   - - - - - - -
skip_subtree(...)
- Prevent descending into the current subtree. -Instead, the next returned event will be the 'end' event of the current element -(if included), ignoring any children or descendants.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - element_or_tree, - events=("end", - ), - tag=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

skip_subtree(...) -

-
  -
- -

Prevent descending into the current subtree. -Instead, the next returned event will be the 'end' event of the current element -(if included), ignoring any children or descendants.

-

This has no effect right after an 'end' or 'end-ns' event.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.etree.xmlfile-class.html b/doc/html/api/lxml.etree.xmlfile-class.html deleted file mode 100644 index be00b37c..00000000 --- a/doc/html/api/lxml.etree.xmlfile-class.html +++ /dev/null @@ -1,397 +0,0 @@ - - - - - lxml.etree.xmlfile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module etree :: - Class xmlfile - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class xmlfile

-
-object --+
-         |
-        xmlfile
-
- -
Known Subclasses:
-
- -
- -
-

xmlfile(self, output_file, encoding=None, compression=None, close=False, buffered=True)

-

A simple mechanism for incremental XML serialisation.

-

Usage example:

-
-with xmlfile("somefile.xml", encoding='utf-8') as xf:
-    xf.write_declaration(standalone=True)
-    xf.write_doctype('<!DOCTYPE root SYSTEM "some.dtd">')
-
-    # generate an element (the root element)
-    with xf.element('root'):
-         # write a complete Element into the open root element
-         xf.write(etree.Element('test'))
-
-         # generate and write more Elements, e.g. through iterparse
-         for element in generate_some_elements():
-             # serialise generated elements into the XML file
-             xf.write(element)
-
-         # or write multiple Elements or strings at once
-         xf.write(etree.Element('start'), "text", etree.Element('end'))
-
-

If 'output_file' is a file(-like) object, passing close=True will -close it when exiting the context manager. By default, it is left -to the owner to do that. When a file path is used, lxml will take care -of opening and closing the file itself. Also, when a compression level -is set, lxml will deliberately close the file to make sure all data gets -compressed and written.

-

Setting buffered=False will flush the output after each operation, -such as opening or closing an xf.element() block or calling -xf.write(). Alternatively, calling xf.flush() can be used to -explicitly flush any pending output when buffering is enabled.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__aenter__(...) - - -
- -
-   - - - - - - -
__aexit__(...) - - -
- -
-   - - - - - - -
__enter__(...) - - -
- -
-   - - - - - - -
__exit__(...) - - -
- -
-   - - - - - - -
__init__(self, - output_file, - encoding=None, - compression=None, - close=False, - buffered=True)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - output_file, - encoding=None, - compression=None, - close=False, - buffered=True) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html-module.html b/doc/html/api/lxml.html-module.html deleted file mode 100644 index df97fd8b..00000000 --- a/doc/html/api/lxml.html-module.html +++ /dev/null @@ -1,1344 +0,0 @@ - - - - - lxml.html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Package html

source code

-The lxml.html tool set for HTML handling. - - - - - - - - -
- - - - - -
Submodules[hide private]
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - CheckboxGroup
- Represents a group of checkboxes (<input type=checkbox>) that -have the same name. -
-   - - CheckboxValues
- Represents the values of the checked checkboxes in a group of -checkboxes with the same name. -
-   - - Classes
- Provides access to an element's class attribute as a set-like collection. -Usage: -
-   - - FieldsDict -
-   - - FormElement
- Represents a <form> element. -
-   - - HTMLParser
- An HTML parser that is configured to return lxml.html Element -objects. -
-   - - HtmlComment -
-   - - HtmlElement -
-   - - HtmlElementClassLookup
- A lookup scheme for HTML Element classes. -
-   - - HtmlEntity -
-   - - HtmlMixin -
-   - - HtmlProcessingInstruction -
-   - - InputElement
- Represents an <input> element. -
-   - - InputGetter
- An accessor that represents all the input fields in a form. -
-   - - InputMixin
- Mix-in for all input elements (input, select, and textarea) -
-   - - LabelElement
- Represents a <label> element. -
-   - - MultipleSelectOptions
- Represents all the selected options in a <select multiple> element. -
-   - - RadioGroup
- This object represents several <input type=radio> elements -that have the same name. -
-   - - SelectElement
- <select> element. You can get the name with .name. -
-   - - TextareaElement
- <textarea> element. You can get the name with .name and -get/set the value with .value -
-   - - XHTMLParser
- An XML parser that is configured to return lxml.html Element -objects. -
-   - - _MethodFunc
- An object that represents a method on an element as a function; -the function takes either an element or an HTML string. It -returns whatever the function normally returns, or if the function -works in-place (and so returns None) it returns a serialized form -of the resulting document. -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
Element(*args, - **kw)
- Create a new HTML Element.
- source code - -
- -
-   - - - - - - -
__bytes_replace_meta_content_type(...)
- sub(repl, string[, count = 0]) --> newstring -Return the string obtained by replacing the leftmost non-overlapping -occurrences of pattern in string by the replacement repl.
- source code - -
- -
-   - - - - - - -
__fix_docstring(s) - source code - -
- -
-   - - - - - - -
__str_replace_meta_content_type(...)
- sub(repl, string[, count = 0]) --> newstring -Return the string obtained by replacing the leftmost non-overlapping -occurrences of pattern in string by the replacement repl.
- source code - -
- -
-   - - - - - - -
_contains_block_level_tag(el) - source code - -
- -
-   - - - - - - -
_element_name(el) - source code - -
- -
-   - - - - - - -
_iter_css_imports(...)
- finditer(string[, pos[, endpos]]) --> iterator. -Return an iterator over all non-overlapping matches for the -RE pattern in string. For each match, the iterator returns a -match object.
- source code - -
- -
-   - - - - - - -
_iter_css_urls(...)
- finditer(string[, pos[, endpos]]) --> iterator. -Return an iterator over all non-overlapping matches for the -RE pattern in string. For each match, the iterator returns a -match object.
- source code - -
- -
-   - - - - - - -
_looks_like_full_html_bytes(...)
- match(string[, pos[, endpos]]) --> match object or None. -Matches zero or more characters at the beginning of the string
- source code - -
- -
-   - - - - - - -
_looks_like_full_html_unicode(...)
- match(string[, pos[, endpos]]) --> match object or None. -Matches zero or more characters at the beginning of the string
- source code - -
- -
-   - - - - - - -
_nons(tag) - source code - -
- -
-   - - - - - - -
_parse_meta_refresh_url(...)
- search(string[, pos[, endpos]]) --> match object or None. -Scan through string looking for a match, and return a corresponding -match object instance. Return None if no position in the string matches.
- source code - -
- -
-   - - - - - - -
_transform_result(typ, - result)
- Convert the result back into the input type.
- source code - -
- -
-   - - - - - - -
_unquote_match(s, - pos) - source code - -
- -
-   - - - - - - -
document_fromstring(html, - parser=None, - ensure_head_body=False, - **kw) - source code - -
- -
-   - - - - - - -
fragment_fromstring(html, - create_parent=False, - base_url=None, - parser=None, - **kw)
- Parses a single HTML element; it is an error if there is more than -one element, or if anything but whitespace precedes or follows the -element.
- source code - -
- -
-   - - - - - - -
fragments_fromstring(html, - no_leading_text=False, - base_url=None, - parser=None, - **kw)
- Parses several HTML elements, returning a list of elements.
- source code - -
- -
-   - - - - - - -
fromstring(html, - base_url=None, - parser=None, - **kw)
- Parse the html, returning a single element/document.
- source code - -
- -
-   - - - - - - -
html_to_xhtml(html)
- Convert all tags in an HTML tree to XHTML by moving them to the -XHTML namespace.
- source code - -
- -
-   - - - - - - -
open_http_urllib(method, - url, - values) - source code - -
- -
-   - - - - - - -
open_in_browser(doc, - encoding=None)
- Open the HTML document in a web browser, saving it to a temporary -file to open it. Note that this does not delete the file after -use. This is mainly meant for debugging.
- source code - -
- -
-   - - - - - - -
parse(filename_or_url, - parser=None, - base_url=None, - **kw)
- Parse a filename, URL, or file-like object into an HTML document -tree. Note: this returns a tree, not an element. Use -parse(...).getroot() to get the document root.
- source code - -
- -
-   - - - - - - -
submit_form(form, - extra_values=None, - open_http=None)
- Helper function to submit a form. Returns a file-like object, as from -urllib.urlopen(). This object also has a .geturl() function, -which shows the URL if there were any redirects.
- source code - -
- -
-   - - - - - - -
tostring(doc, - pretty_print=False, - include_meta_content_type=False, - encoding=None, - method='html', - with_tail=True, - doctype=None)
- Return an HTML string representation of the document.
- source code - -
- -
-   - - - - - - -
xhtml_to_html(xhtml)
- Convert all tags in an XHTML tree to HTML by removing their -XHTML namespace.
- source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml' -
-   - - __package__ = 'lxml.html' -
-   - - _archive_re = re.compile(r'[^ ]+') -
-   - - _class_xpath = descendant-or-self::*[@class and contains(conca... -
-   - - _collect_string_content = string() -
-   - - _forms_xpath = descendant-or-self::form|descendant-or-self::x:... -
-   - - _id_xpath = descendant-or-self::*[@id=$id] -
-   - - _label_xpath = //label[@for=$id]|//x:label[@for=$id] -
-   - - _options_xpath = descendant-or-self::option|descendant-or-self... -
-   - - _rel_links_xpath = descendant-or-self::a[@rel]|descendant-or-s... -
-   - - find_class = <lxml.html._MethodFunc object> -
-   - - find_rel_links = <lxml.html._MethodFunc object> -
-   - - html_parser = <lxml.html.HTMLParser object> -
-   - - iterlinks = <lxml.html._MethodFunc object> -
-   - - make_links_absolute = <lxml.html._MethodFunc object> -
-   - - resolve_base_href = <lxml.html._MethodFunc object> -
-   - - rewrite_links = <lxml.html._MethodFunc object> -
-   - - xhtml_parser = <lxml.html.XHTMLParser object> -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

Element(*args, - **kw) -

-
source code  -
- -

Create a new HTML Element.

-

This can also be used for XHTML documents.

-
-
-
-
- -
- -
- - -
-

fragment_fromstring(html, - create_parent=False, - base_url=None, - parser=None, - **kw) -

-
source code  -
- -

Parses a single HTML element; it is an error if there is more than -one element, or if anything but whitespace precedes or follows the -element.

-

If create_parent is true (or is a tag name) then a parent node -will be created to encapsulate the HTML in a single element. In this -case, leading or trailing text is also allowed, as are multiple elements -as result of the parsing.

-

Passing a base_url will set the document's base_url attribute -(and the tree's docinfo.URL).

-
-
-
-
- -
- -
- - -
-

fragments_fromstring(html, - no_leading_text=False, - base_url=None, - parser=None, - **kw) -

-
source code  -
- -

Parses several HTML elements, returning a list of elements.

-

The first item in the list may be a string. -If no_leading_text is true, then it will be an error if there is -leading text, and it will always be a list of only elements.

-

base_url will set the document's base_url attribute -(and the tree's docinfo.URL).

-
-
-
-
- -
- -
- - -
-

fromstring(html, - base_url=None, - parser=None, - **kw) -

-
source code  -
- -

Parse the html, returning a single element/document.

-

This tries to minimally parse the chunk of text, without knowing if it -is a fragment or a document.

-

base_url will set the document's base_url attribute (and the tree's docinfo.URL)

-
-
-
-
- -
- -
- - -
-

parse(filename_or_url, - parser=None, - base_url=None, - **kw) -

-
source code  -
- -

Parse a filename, URL, or file-like object into an HTML document -tree. Note: this returns a tree, not an element. Use -parse(...).getroot() to get the document root.

-

You can override the base URL with the base_url keyword. This -is most useful when parsing from a file-like object.

-
-
-
-
- -
- -
- - -
-

submit_form(form, - extra_values=None, - open_http=None) -

-
source code  -
- -

Helper function to submit a form. Returns a file-like object, as from -urllib.urlopen(). This object also has a .geturl() function, -which shows the URL if there were any redirects.

-

You can use this like:

-
-form = doc.forms[0]
-form.inputs['foo'].value = 'bar' # etc
-response = form.submit()
-doc = parse(response)
-doc.make_links_absolute(response.geturl())
-
-

To change the HTTP requester, pass a function as open_http keyword -argument that opens the URL for you. The function must have the following -signature:

-
-open_http(method, URL, values)
-
-

The action is one of 'GET' or 'POST', the URL is the target URL as a -string, and the values are a sequence of (name, value) tuples with the -form data.

-
-
-
-
- -
- -
- - -
-

tostring(doc, - pretty_print=False, - include_meta_content_type=False, - encoding=None, - method='html', - with_tail=True, - doctype=None) -

-
source code  -
- -

Return an HTML string representation of the document.

-

Note: if include_meta_content_type is true this will create a -<meta http-equiv="Content-Type" ...> tag in the head; -regardless of the value of include_meta_content_type any existing -<meta http-equiv="Content-Type" ...> tag will be removed

-

The encoding argument controls the output encoding (defauts to -ASCII, with &#...; character references for any characters outside -of ASCII). Note that you can pass the name 'unicode' as -encoding argument to serialise to a Unicode string.

-

The method argument defines the output method. It defaults to -'html', but can also be 'xml' for xhtml output, or 'text' to -serialise to plain text without markup.

-

To leave out the tail text of the top-level element that is being -serialised, pass with_tail=False.

-

The doctype option allows passing in a plain string that will -be serialised before the XML tree. Note that passing in non -well-formed content here will make the XML output non well-formed. -Also, an existing doctype in the document tree will not be removed -when serialising an ElementTree instance.

-

Example:

-
->>> from lxml import html
->>> root = html.fragment_fromstring('<p>Hello<br>world!</p>')
-
->>> html.tostring(root)
-'<p>Hello<br>world!</p>'
->>> html.tostring(root, method='html')
-'<p>Hello<br>world!</p>'
-
->>> html.tostring(root, method='xml')
-'<p>Hello<br/>world!</p>'
-
->>> html.tostring(root, method='text')
-'Helloworld!'
-
->>> html.tostring(root, method='text', encoding='unicode')
-u'Helloworld!'
-
->>> root = html.fragment_fromstring('<div><p>Hello<br>world!</p>TAIL</div>')
->>> html.tostring(root[0], method='text', encoding='unicode')
-u'Helloworld!TAIL'
-
->>> html.tostring(root[0], method='text', encoding='unicode', with_tail=False)
-u'Helloworld!'
-
->>> doc = html.document_fromstring('<p>Hello<br>world!</p>')
->>> html.tostring(doc, method='html', encoding='unicode')
-u'<html><body><p>Hello<br>world!</p></body></html>'
-
->>> print(html.tostring(doc, method='html', encoding='unicode',
-...          doctype='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"'
-...                  ' "http://www.w3.org/TR/html4/strict.dtd">'))
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html><body><p>Hello<br>world!</p></body></html>
-
-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

_class_xpath

- -
-
-
-
Value:
-
-descendant-or-self::*[@class and contains(concat(' ', normalize-space(\
-@class), ' '), concat(' ', $class_name, ' '))]
-
-
-
-
-
- -
- -
-

_forms_xpath

- -
-
-
-
Value:
-
-descendant-or-self::form|descendant-or-self::x:form
-
-
-
-
-
- -
- -
-

_options_xpath

- -
-
-
-
Value:
-
-descendant-or-self::option|descendant-or-self::x:option
-
-
-
-
-
- -
- -
-

_rel_links_xpath

- -
-
-
-
Value:
-
-descendant-or-self::a[@rel]|descendant-or-self::x:a[@rel]
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html-pysrc.html b/doc/html/api/lxml.html-pysrc.html deleted file mode 100644 index ca767dce..00000000 --- a/doc/html/api/lxml.html-pysrc.html +++ /dev/null @@ -1,4077 +0,0 @@ - - - - - lxml.html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Package lxml.html

-
-   1  # Copyright (c) 2004 Ian Bicking. All rights reserved. 
-   2  # 
-   3  # Redistribution and use in source and binary forms, with or without 
-   4  # modification, are permitted provided that the following conditions are 
-   5  # met: 
-   6  # 
-   7  # 1. Redistributions of source code must retain the above copyright 
-   8  # notice, this list of conditions and the following disclaimer. 
-   9  # 
-  10  # 2. Redistributions in binary form must reproduce the above copyright 
-  11  # notice, this list of conditions and the following disclaimer in 
-  12  # the documentation and/or other materials provided with the 
-  13  # distribution. 
-  14  # 
-  15  # 3. Neither the name of Ian Bicking nor the names of its contributors may 
-  16  # be used to endorse or promote products derived from this software 
-  17  # without specific prior written permission. 
-  18  # 
-  19  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-  20  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-  21  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
-  22  # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IAN BICKING OR 
-  23  # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
-  24  # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
-  25  # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
-  26  # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
-  27  # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
-  28  # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
-  29  # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
-  30   
-  31  """The ``lxml.html`` tool set for HTML handling. 
-  32  """ 
-  33   
-  34  from __future__ import absolute_import 
-  35   
-  36  __all__ = [ 
-  37      'document_fromstring', 'fragment_fromstring', 'fragments_fromstring', 'fromstring', 
-  38      'tostring', 'Element', 'defs', 'open_in_browser', 'submit_form', 
-  39      'find_rel_links', 'find_class', 'make_links_absolute', 
-  40      'resolve_base_href', 'iterlinks', 'rewrite_links', 'open_in_browser', 'parse'] 
-  41   
-  42   
-  43  import copy 
-  44  import sys 
-  45  import re 
-  46  from functools import partial 
-  47   
-  48  try: 
-  49      # while unnecessary, importing from 'collections.abc' is the right way to do it 
-  50      from collections.abc import MutableMapping, MutableSet 
-  51  except ImportError: 
-  52      from collections import MutableMapping, MutableSet 
-  53   
-  54  from .. import etree 
-  55  from . import defs 
-  56  from ._setmixin import SetMixin 
-  57   
-  58  try: 
-  59      from urlparse import urljoin 
-  60  except ImportError: 
-  61      # Python 3 
-  62      from urllib.parse import urljoin 
-  63   
-  64  try: 
-  65      unicode 
-  66  except NameError: 
-  67      # Python 3 
-  68      unicode = str 
-  69  try: 
-  70      basestring 
-  71  except NameError: 
-  72      # Python 3 
-  73      basestring = (str, bytes) 
-
74 - 75 - 76 -def __fix_docstring(s): -
77 if not s: - 78 return s - 79 if sys.version_info[0] >= 3: - 80 sub = re.compile(r"^(\s*)u'", re.M).sub - 81 else: - 82 sub = re.compile(r"^(\s*)b'", re.M).sub - 83 return sub(r"\1'", s) -
84 - 85 - 86 XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml" - 87 - 88 _rel_links_xpath = etree.XPath("descendant-or-self::a[@rel]|descendant-or-self::x:a[@rel]", - 89 namespaces={'x':XHTML_NAMESPACE}) - 90 _options_xpath = etree.XPath("descendant-or-self::option|descendant-or-self::x:option", - 91 namespaces={'x':XHTML_NAMESPACE}) - 92 _forms_xpath = etree.XPath("descendant-or-self::form|descendant-or-self::x:form", - 93 namespaces={'x':XHTML_NAMESPACE}) - 94 #_class_xpath = etree.XPath(r"descendant-or-self::*[regexp:match(@class, concat('\b', $class_name, '\b'))]", {'regexp': 'http://exslt.org/regular-expressions'}) - 95 _class_xpath = etree.XPath("descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), concat(' ', $class_name, ' '))]") - 96 _id_xpath = etree.XPath("descendant-or-self::*[@id=$id]") - 97 _collect_string_content = etree.XPath("string()") - 98 _iter_css_urls = re.compile(r'url\(('+'["][^"]*["]|'+"['][^']*[']|"+r'[^)]*)\)', re.I).finditer - 99 _iter_css_imports = re.compile(r'@import "(.*?)"').finditer - 100 _label_xpath = etree.XPath("//label[@for=$id]|//x:label[@for=$id]", - 101 namespaces={'x':XHTML_NAMESPACE}) - 102 _archive_re = re.compile(r'[^ ]+') - 103 _parse_meta_refresh_url = re.compile( - 104 r'[^;=]*;\s*(?:url\s*=\s*)?(?P<url>.*)$', re.I).search -
105 - 106 - 107 -def _unquote_match(s, pos): -
108 if s[:1] == '"' and s[-1:] == '"' or s[:1] == "'" and s[-1:] == "'": - 109 return s[1:-1], pos+1 - 110 else: - 111 return s,pos -
112 -
113 - 114 -def _transform_result(typ, result): -
115 """Convert the result back into the input type. - 116 """ - 117 if issubclass(typ, bytes): - 118 return tostring(result, encoding='utf-8') - 119 elif issubclass(typ, unicode): - 120 return tostring(result, encoding='unicode') - 121 else: - 122 return result -
123 -
124 - 125 -def _nons(tag): -
126 if isinstance(tag, basestring): - 127 if tag[0] == '{' and tag[1:len(XHTML_NAMESPACE)+1] == XHTML_NAMESPACE: - 128 return tag.split('}')[-1] - 129 return tag -
130 -
131 - 132 -class Classes(MutableSet): -
133 """Provides access to an element's class attribute as a set-like collection. - 134 Usage:: - 135 - 136 >>> el = fromstring('<p class="hidden large">Text</p>') - 137 >>> classes = el.classes # or: classes = Classes(el.attrib) - 138 >>> classes |= ['block', 'paragraph'] - 139 >>> el.get('class') - 140 'hidden large block paragraph' - 141 >>> classes.toggle('hidden') - 142 False - 143 >>> el.get('class') - 144 'large block paragraph' - 145 >>> classes -= ('some', 'classes', 'block') - 146 >>> el.get('class') - 147 'large paragraph' - 148 """ -
149 - def __init__(self, attributes): -
150 self._attributes = attributes - 151 self._get_class_value = partial(attributes.get, 'class', '') -
152 -
153 - def add(self, value): -
154 """ - 155 Add a class. - 156 - 157 This has no effect if the class is already present. - 158 """ - 159 if not value or re.search(r'\s', value): - 160 raise ValueError("Invalid class name: %r" % value) - 161 classes = self._get_class_value().split() - 162 if value in classes: - 163 return - 164 classes.append(value) - 165 self._attributes['class'] = ' '.join(classes) -
166 -
167 - def discard(self, value): -
168 """ - 169 Remove a class if it is currently present. - 170 - 171 If the class is not present, do nothing. - 172 """ - 173 if not value or re.search(r'\s', value): - 174 raise ValueError("Invalid class name: %r" % value) - 175 classes = [name for name in self._get_class_value().split() - 176 if name != value] - 177 if classes: - 178 self._attributes['class'] = ' '.join(classes) - 179 elif 'class' in self._attributes: - 180 del self._attributes['class'] -
181 -
182 - def remove(self, value): -
183 """ - 184 Remove a class; it must currently be present. - 185 - 186 If the class is not present, raise a KeyError. - 187 """ - 188 if not value or re.search(r'\s', value): - 189 raise ValueError("Invalid class name: %r" % value) - 190 super(Classes, self).remove(value) -
191 -
192 - def __contains__(self, name): -
193 classes = self._get_class_value() - 194 return name in classes and name in classes.split() -
195 -
196 - def __iter__(self): -
197 return iter(self._get_class_value().split()) -
198 -
199 - def __len__(self): -
200 return len(self._get_class_value().split()) -
201 - 202 # non-standard methods - 203 -
204 - def update(self, values): -
205 """ - 206 Add all names from 'values'. - 207 """ - 208 classes = self._get_class_value().split() - 209 extended = False - 210 for value in values: - 211 if value not in classes: - 212 classes.append(value) - 213 extended = True - 214 if extended: - 215 self._attributes['class'] = ' '.join(classes) -
216 -
217 - def toggle(self, value): -
218 """ - 219 Add a class name if it isn't there yet, or remove it if it exists. - 220 - 221 Returns true if the class was added (and is now enabled) and - 222 false if it was removed (and is now disabled). - 223 """ - 224 if not value or re.search(r'\s', value): - 225 raise ValueError("Invalid class name: %r" % value) - 226 classes = self._get_class_value().split() - 227 try: - 228 classes.remove(value) - 229 enabled = False - 230 except ValueError: - 231 classes.append(value) - 232 enabled = True - 233 if classes: - 234 self._attributes['class'] = ' '.join(classes) - 235 else: - 236 del self._attributes['class'] - 237 return enabled -
238 -
239 - 240 -class HtmlMixin(object): -
241 -
242 - def set(self, key, value=None): -
243 """set(self, key, value=None) - 244 - 245 Sets an element attribute. If no value is provided, or if the value is None, - 246 creates a 'boolean' attribute without value, e.g. "<form novalidate></form>" - 247 for ``form.set('novalidate')``. - 248 """ - 249 super(HtmlElement, self).set(key, value) -
250 - 251 @property -
252 - def classes(self): -
253 """ - 254 A set-like wrapper around the 'class' attribute. - 255 """ - 256 return Classes(self.attrib) -
257 - 258 @classes.setter -
259 - def classes(self, classes): -
260 assert isinstance(classes, Classes) # only allow "el.classes |= ..." etc. - 261 value = classes._get_class_value() - 262 if value: - 263 self.set('class', value) - 264 elif self.get('class') is not None: - 265 del self.attrib['class'] -
266 - 267 @property -
268 - def base_url(self): -
269 """ - 270 Returns the base URL, given when the page was parsed. - 271 - 272 Use with ``urlparse.urljoin(el.base_url, href)`` to get - 273 absolute URLs. - 274 """ - 275 return self.getroottree().docinfo.URL -
276 - 277 @property -
278 - def forms(self): -
279 """ - 280 Return a list of all the forms - 281 """ - 282 return _forms_xpath(self) -
283 - 284 @property -
285 - def body(self): -
286 """ - 287 Return the <body> element. Can be called from a child element - 288 to get the document's head. - 289 """ - 290 return self.xpath('//body|//x:body', namespaces={'x':XHTML_NAMESPACE})[0] -
291 - 292 @property -
293 - def head(self): -
294 """ - 295 Returns the <head> element. Can be called from a child - 296 element to get the document's head. - 297 """ - 298 return self.xpath('//head|//x:head', namespaces={'x':XHTML_NAMESPACE})[0] -
299 - 300 @property -
301 - def label(self): -
302 """ - 303 Get or set any <label> element associated with this element. - 304 """ - 305 id = self.get('id') - 306 if not id: - 307 return None - 308 result = _label_xpath(self, id=id) - 309 if not result: - 310 return None - 311 else: - 312 return result[0] -
313 - 314 @label.setter -
315 - def label(self, label): -
316 id = self.get('id') - 317 if not id: - 318 raise TypeError( - 319 "You cannot set a label for an element (%r) that has no id" - 320 % self) - 321 if _nons(label.tag) != 'label': - 322 raise TypeError( - 323 "You can only assign label to a label element (not %r)" - 324 % label) - 325 label.set('for', id) -
326 - 327 @label.deleter -
328 - def label(self): -
329 label = self.label - 330 if label is not None: - 331 del label.attrib['for'] -
332 -
333 - def drop_tree(self): -
334 """ - 335 Removes this element from the tree, including its children and - 336 text. The tail text is joined to the previous element or - 337 parent. - 338 """ - 339 parent = self.getparent() - 340 assert parent is not None - 341 if self.tail: - 342 previous = self.getprevious() - 343 if previous is None: - 344 parent.text = (parent.text or '') + self.tail - 345 else: - 346 previous.tail = (previous.tail or '') + self.tail - 347 parent.remove(self) -
348 -
349 - def drop_tag(self): -
350 """ - 351 Remove the tag, but not its children or text. The children and text - 352 are merged into the parent. - 353 - 354 Example:: - 355 - 356 >>> h = fragment_fromstring('<div>Hello <b>World!</b></div>') - 357 >>> h.find('.//b').drop_tag() - 358 >>> print(tostring(h, encoding='unicode')) - 359 <div>Hello World!</div> - 360 """ - 361 parent = self.getparent() - 362 assert parent is not None - 363 previous = self.getprevious() - 364 if self.text and isinstance(self.tag, basestring): - 365 # not a Comment, etc. - 366 if previous is None: - 367 parent.text = (parent.text or '') + self.text - 368 else: - 369 previous.tail = (previous.tail or '') + self.text - 370 if self.tail: - 371 if len(self): - 372 last = self[-1] - 373 last.tail = (last.tail or '') + self.tail - 374 elif previous is None: - 375 parent.text = (parent.text or '') + self.tail - 376 else: - 377 previous.tail = (previous.tail or '') + self.tail - 378 index = parent.index(self) - 379 parent[index:index+1] = self[:] -
380 - 388 -
389 - def find_class(self, class_name): -
390 """ - 391 Find any elements with the given class name. - 392 """ - 393 return _class_xpath(self, class_name=class_name) -
394 -
395 - def get_element_by_id(self, id, *default): -
396 """ - 397 Get the first element in a document with the given id. If none is - 398 found, return the default argument if provided or raise KeyError - 399 otherwise. - 400 - 401 Note that there can be more than one element with the same id, - 402 and this isn't uncommon in HTML documents found in the wild. - 403 Browsers return only the first match, and this function does - 404 the same. - 405 """ - 406 try: - 407 # FIXME: should this check for multiple matches? - 408 # browsers just return the first one - 409 return _id_xpath(self, id=id)[0] - 410 except IndexError: - 411 if default: - 412 return default[0] - 413 else: - 414 raise KeyError(id) -
415 -
416 - def text_content(self): -
417 """ - 418 Return the text content of the tag (and the text in any children). - 419 """ - 420 return _collect_string_content(self) -
421 -
422 - def cssselect(self, expr, translator='html'): -
423 """ - 424 Run the CSS expression on this element and its children, - 425 returning a list of the results. - 426 - 427 Equivalent to lxml.cssselect.CSSSelect(expr, translator='html')(self) - 428 -- note that pre-compiling the expression can provide a substantial - 429 speedup. - 430 """ - 431 # Do the import here to make the dependency optional. - 432 from lxml.cssselect import CSSSelector - 433 return CSSSelector(expr, translator=translator)(self) -
434 - 435 ######################################## - 436 ## Link functions - 437 ######################################## - 438 - 469 elif handle_failures == 'discard': - 470 def link_repl(href): - 471 try: - 472 return urljoin(base_url, href) - 473 except ValueError: - 474 return None -
475 elif handle_failures is None: - 476 def link_repl(href): - 477 return urljoin(base_url, href) - 478 else: - 479 raise ValueError( - 480 "unexpected value for handle_failures: %r" % handle_failures) - 481 - 482 self.rewrite_links(link_repl) - 483 -
484 - def resolve_base_href(self, handle_failures=None): -
485 """ - 486 Find any ``<base href>`` tag in the document, and apply its - 487 values to all links found in the document. Also remove the - 488 tag once it has been applied. - 489 - 490 If ``handle_failures`` is None (default), a failure to process - 491 a URL will abort the processing. If set to 'ignore', errors - 492 are ignored. If set to 'discard', failing URLs will be removed. - 493 """ - 494 base_href = None - 495 basetags = self.xpath('//base[@href]|//x:base[@href]', - 496 namespaces={'x': XHTML_NAMESPACE}) - 497 for b in basetags: - 498 base_href = b.get('href') - 499 b.drop_tree() - 500 if not base_href: - 501 return - 502 self.make_links_absolute(base_href, resolve_base_href=False, - 503 handle_failures=handle_failures) -
504 - 594 - 643 -
644 - 645 -class _MethodFunc(object): -
646 """ - 647 An object that represents a method on an element as a function; - 648 the function takes either an element or an HTML string. It - 649 returns whatever the function normally returns, or if the function - 650 works in-place (and so returns None) it returns a serialized form - 651 of the resulting document. - 652 """ -
653 - def __init__(self, name, copy=False, source_class=HtmlMixin): -
654 self.name = name - 655 self.copy = copy - 656 self.__doc__ = getattr(source_class, self.name).__doc__ -
657 - def __call__(self, doc, *args, **kw): -
658 result_type = type(doc) - 659 if isinstance(doc, basestring): - 660 if 'copy' in kw: - 661 raise TypeError( - 662 "The keyword 'copy' can only be used with element inputs to %s, not a string input" % self.name) - 663 doc = fromstring(doc, **kw) - 664 else: - 665 if 'copy' in kw: - 666 make_a_copy = kw.pop('copy') - 667 else: - 668 make_a_copy = self.copy - 669 if make_a_copy: - 670 doc = copy.deepcopy(doc) - 671 meth = getattr(doc, self.name) - 672 result = meth(*args, **kw) - 673 # FIXME: this None test is a bit sloppy - 674 if result is None: - 675 # Then return what we got in - 676 return _transform_result(result_type, doc) - 677 else: - 678 return result -
679 - 680 - 681 find_rel_links = _MethodFunc('find_rel_links', copy=False) - 682 find_class = _MethodFunc('find_class', copy=False) - 683 make_links_absolute = _MethodFunc('make_links_absolute', copy=True) - 684 resolve_base_href = _MethodFunc('resolve_base_href', copy=True) - 685 iterlinks = _MethodFunc('iterlinks', copy=False) - 686 rewrite_links = _MethodFunc('rewrite_links', copy=True) -
687 - 688 - 689 -class HtmlComment(etree.CommentBase, HtmlMixin): -
690 pass -
691 -
692 - 693 -class HtmlElement(etree.ElementBase, HtmlMixin): -
694 # Override etree.ElementBase.cssselect() and set(), despite the MRO (FIXME: change base order?) - 695 cssselect = HtmlMixin.cssselect - 696 set = HtmlMixin.set -
697 -
698 - 699 -class HtmlProcessingInstruction(etree.PIBase, HtmlMixin): -
700 pass -
701 -
702 - 703 -class HtmlEntity(etree.EntityBase, HtmlMixin): -
704 pass -
705 -
706 - 707 -class HtmlElementClassLookup(etree.CustomElementClassLookup): -
708 """A lookup scheme for HTML Element classes. - 709 - 710 To create a lookup instance with different Element classes, pass a tag - 711 name mapping of Element classes in the ``classes`` keyword argument and/or - 712 a tag name mapping of Mixin classes in the ``mixins`` keyword argument. - 713 The special key '*' denotes a Mixin class that should be mixed into all - 714 Element classes. - 715 """ - 716 _default_element_classes = {} - 717 -
718 - def __init__(self, classes=None, mixins=None): -
719 etree.CustomElementClassLookup.__init__(self) - 720 if classes is None: - 721 classes = self._default_element_classes.copy() - 722 if mixins: - 723 mixers = {} - 724 for name, value in mixins: - 725 if name == '*': - 726 for n in classes.keys(): - 727 mixers.setdefault(n, []).append(value) - 728 else: - 729 mixers.setdefault(name, []).append(value) - 730 for name, mix_bases in mixers.items(): - 731 cur = classes.get(name, HtmlElement) - 732 bases = tuple(mix_bases + [cur]) - 733 classes[name] = type(cur.__name__, bases, {}) - 734 self._element_classes = classes -
735 -
736 - def lookup(self, node_type, document, namespace, name): -
737 if node_type == 'element': - 738 return self._element_classes.get(name.lower(), HtmlElement) - 739 elif node_type == 'comment': - 740 return HtmlComment - 741 elif node_type == 'PI': - 742 return HtmlProcessingInstruction - 743 elif node_type == 'entity': - 744 return HtmlEntity - 745 # Otherwise normal lookup - 746 return None -
747 - 748 - 749 ################################################################################ - 750 # parsing - 751 ################################################################################ - 752 - 753 _looks_like_full_html_unicode = re.compile( - 754 unicode(r'^\s*<(?:html|!doctype)'), re.I).match - 755 _looks_like_full_html_bytes = re.compile( - 756 r'^\s*<(?:html|!doctype)'.encode('ascii'), re.I).match -
757 - 758 - 759 -def document_fromstring(html, parser=None, ensure_head_body=False, **kw): -
760 if parser is None: - 761 parser = html_parser - 762 value = etree.fromstring(html, parser, **kw) - 763 if value is None: - 764 raise etree.ParserError( - 765 "Document is empty") - 766 if ensure_head_body and value.find('head') is None: - 767 value.insert(0, Element('head')) - 768 if ensure_head_body and value.find('body') is None: - 769 value.append(Element('body')) - 770 return value -
771 -
772 - 773 -def fragments_fromstring(html, no_leading_text=False, base_url=None, - 774 parser=None, **kw): -
775 """Parses several HTML elements, returning a list of elements. - 776 - 777 The first item in the list may be a string. - 778 If no_leading_text is true, then it will be an error if there is - 779 leading text, and it will always be a list of only elements. - 780 - 781 base_url will set the document's base_url attribute - 782 (and the tree's docinfo.URL). - 783 """ - 784 if parser is None: - 785 parser = html_parser - 786 # FIXME: check what happens when you give html with a body, head, etc. - 787 if isinstance(html, bytes): - 788 if not _looks_like_full_html_bytes(html): - 789 # can't use %-formatting in early Py3 versions - 790 html = ('<html><body>'.encode('ascii') + html + - 791 '</body></html>'.encode('ascii')) - 792 else: - 793 if not _looks_like_full_html_unicode(html): - 794 html = '<html><body>%s</body></html>' % html - 795 doc = document_fromstring(html, parser=parser, base_url=base_url, **kw) - 796 assert _nons(doc.tag) == 'html' - 797 bodies = [e for e in doc if _nons(e.tag) == 'body'] - 798 assert len(bodies) == 1, ("too many bodies: %r in %r" % (bodies, html)) - 799 body = bodies[0] - 800 elements = [] - 801 if no_leading_text and body.text and body.text.strip(): - 802 raise etree.ParserError( - 803 "There is leading text: %r" % body.text) - 804 if body.text and body.text.strip(): - 805 elements.append(body.text) - 806 elements.extend(body) - 807 # FIXME: removing the reference to the parent artificial document - 808 # would be nice - 809 return elements -
810 -
811 - 812 -def fragment_fromstring(html, create_parent=False, base_url=None, - 813 parser=None, **kw): -
814 """ - 815 Parses a single HTML element; it is an error if there is more than - 816 one element, or if anything but whitespace precedes or follows the - 817 element. - 818 - 819 If ``create_parent`` is true (or is a tag name) then a parent node - 820 will be created to encapsulate the HTML in a single element. In this - 821 case, leading or trailing text is also allowed, as are multiple elements - 822 as result of the parsing. - 823 - 824 Passing a ``base_url`` will set the document's ``base_url`` attribute - 825 (and the tree's docinfo.URL). - 826 """ - 827 if parser is None: - 828 parser = html_parser - 829 - 830 accept_leading_text = bool(create_parent) - 831 - 832 elements = fragments_fromstring( - 833 html, parser=parser, no_leading_text=not accept_leading_text, - 834 base_url=base_url, **kw) - 835 - 836 if create_parent: - 837 if not isinstance(create_parent, basestring): - 838 create_parent = 'div' - 839 new_root = Element(create_parent) - 840 if elements: - 841 if isinstance(elements[0], basestring): - 842 new_root.text = elements[0] - 843 del elements[0] - 844 new_root.extend(elements) - 845 return new_root - 846 - 847 if not elements: - 848 raise etree.ParserError('No elements found') - 849 if len(elements) > 1: - 850 raise etree.ParserError( - 851 "Multiple elements found (%s)" - 852 % ', '.join([_element_name(e) for e in elements])) - 853 el = elements[0] - 854 if el.tail and el.tail.strip(): - 855 raise etree.ParserError( - 856 "Element followed by text: %r" % el.tail) - 857 el.tail = None - 858 return el -
859 -
860 - 861 -def fromstring(html, base_url=None, parser=None, **kw): -
862 """ - 863 Parse the html, returning a single element/document. - 864 - 865 This tries to minimally parse the chunk of text, without knowing if it - 866 is a fragment or a document. - 867 - 868 base_url will set the document's base_url attribute (and the tree's docinfo.URL) - 869 """ - 870 if parser is None: - 871 parser = html_parser - 872 if isinstance(html, bytes): - 873 is_full_html = _looks_like_full_html_bytes(html) - 874 else: - 875 is_full_html = _looks_like_full_html_unicode(html) - 876 doc = document_fromstring(html, parser=parser, base_url=base_url, **kw) - 877 if is_full_html: - 878 return doc - 879 # otherwise, lets parse it out... - 880 bodies = doc.findall('body') - 881 if not bodies: - 882 bodies = doc.findall('{%s}body' % XHTML_NAMESPACE) - 883 if bodies: - 884 body = bodies[0] - 885 if len(bodies) > 1: - 886 # Somehow there are multiple bodies, which is bad, but just - 887 # smash them into one body - 888 for other_body in bodies[1:]: - 889 if other_body.text: - 890 if len(body): - 891 body[-1].tail = (body[-1].tail or '') + other_body.text - 892 else: - 893 body.text = (body.text or '') + other_body.text - 894 body.extend(other_body) - 895 # We'll ignore tail - 896 # I guess we are ignoring attributes too - 897 other_body.drop_tree() - 898 else: - 899 body = None - 900 heads = doc.findall('head') - 901 if not heads: - 902 heads = doc.findall('{%s}head' % XHTML_NAMESPACE) - 903 if heads: - 904 # Well, we have some sort of structure, so lets keep it all - 905 head = heads[0] - 906 if len(heads) > 1: - 907 for other_head in heads[1:]: - 908 head.extend(other_head) - 909 # We don't care about text or tail in a head - 910 other_head.drop_tree() - 911 return doc - 912 if body is None: - 913 return doc - 914 if (len(body) == 1 and (not body.text or not body.text.strip()) - 915 and (not body[-1].tail or not body[-1].tail.strip())): - 916 # The body has just one element, so it was probably a single - 917 # element passed in - 918 return body[0] - 919 # Now we have a body which represents a bunch of tags which have the - 920 # content that was passed in. We will create a fake container, which - 921 # is the body tag, except <body> implies too much structure. - 922 if _contains_block_level_tag(body): - 923 body.tag = 'div' - 924 else: - 925 body.tag = 'span' - 926 return body -
927 -
928 - 929 -def parse(filename_or_url, parser=None, base_url=None, **kw): -
930 """ - 931 Parse a filename, URL, or file-like object into an HTML document - 932 tree. Note: this returns a tree, not an element. Use - 933 ``parse(...).getroot()`` to get the document root. - 934 - 935 You can override the base URL with the ``base_url`` keyword. This - 936 is most useful when parsing from a file-like object. - 937 """ - 938 if parser is None: - 939 parser = html_parser - 940 return etree.parse(filename_or_url, parser, base_url=base_url, **kw) -
941 -
942 - 943 -def _contains_block_level_tag(el): -
944 # FIXME: I could do this with XPath, but would that just be - 945 # unnecessarily slow? - 946 for el in el.iter(etree.Element): - 947 if _nons(el.tag) in defs.block_tags: - 948 return True - 949 return False -
950 -
951 - 952 -def _element_name(el): -
953 if isinstance(el, etree.CommentBase): - 954 return 'comment' - 955 elif isinstance(el, basestring): - 956 return 'string' - 957 else: - 958 return _nons(el.tag) -
959 -
960 - 961 ################################################################################ - 962 # form handling - 963 ################################################################################ - 964 - 965 -class FormElement(HtmlElement): -
966 """ - 967 Represents a <form> element. - 968 """ - 969 - 970 @property -
971 - def inputs(self): -
972 """ - 973 Returns an accessor for all the input elements in the form. - 974 - 975 See `InputGetter` for more information about the object. - 976 """ - 977 return InputGetter(self) -
978 - 979 @property -
980 - def fields(self): -
981 """ - 982 Dictionary-like object that represents all the fields in this - 983 form. You can set values in this dictionary to effect the - 984 form. - 985 """ - 986 return FieldsDict(self.inputs) -
987 - 988 @fields.setter -
989 - def fields(self, value): -
990 fields = self.fields - 991 prev_keys = fields.keys() - 992 for key, value in value.items(): - 993 if key in prev_keys: - 994 prev_keys.remove(key) - 995 fields[key] = value - 996 for key in prev_keys: - 997 if key is None: - 998 # Case of an unnamed input; these aren't really - 999 # expressed in form_values() anyway. -1000 continue -1001 fields[key] = None -
1002 -
1003 - def _name(self): -
1004 if self.get('name'): -1005 return self.get('name') -1006 elif self.get('id'): -1007 return '#' + self.get('id') -1008 iter_tags = self.body.iter -1009 forms = list(iter_tags('form')) -1010 if not forms: -1011 forms = list(iter_tags('{%s}form' % XHTML_NAMESPACE)) -1012 return str(forms.index(self)) -
1013 -
1014 - def form_values(self): -
1015 """ -1016 Return a list of tuples of the field values for the form. -1017 This is suitable to be passed to ``urllib.urlencode()``. -1018 """ -1019 results = [] -1020 for el in self.inputs: -1021 name = el.name -1022 if not name or 'disabled' in el.attrib: -1023 continue -1024 tag = _nons(el.tag) -1025 if tag == 'textarea': -1026 results.append((name, el.value)) -1027 elif tag == 'select': -1028 value = el.value -1029 if el.multiple: -1030 for v in value: -1031 results.append((name, v)) -1032 elif value is not None: -1033 results.append((name, el.value)) -1034 else: -1035 assert tag == 'input', ( -1036 "Unexpected tag: %r" % el) -1037 if el.checkable and not el.checked: -1038 continue -1039 if el.type in ('submit', 'image', 'reset', 'file'): -1040 continue -1041 value = el.value -1042 if value is not None: -1043 results.append((name, el.value)) -1044 return results -
1045 -1046 @property -
1047 - def action(self): -
1048 """ -1049 Get/set the form's ``action`` attribute. -1050 """ -1051 base_url = self.base_url -1052 action = self.get('action') -1053 if base_url and action is not None: -1054 return urljoin(base_url, action) -1055 else: -1056 return action -
1057 -1058 @action.setter -
1059 - def action(self, value): -
1060 self.set('action', value) -
1061 -1062 @action.deleter -
1063 - def action(self): -
1064 attrib = self.attrib -1065 if 'action' in attrib: -1066 del attrib['action'] -
1067 -1068 @property -
1069 - def method(self): -
1070 """ -1071 Get/set the form's method. Always returns a capitalized -1072 string, and defaults to ``'GET'`` -1073 """ -1074 return self.get('method', 'GET').upper() -
1075 -1076 @method.setter -
1077 - def method(self, value): -
1078 self.set('method', value.upper()) -
1079 -1080 -1081 HtmlElementClassLookup._default_element_classes['form'] = FormElement -
1082 -1083 -1084 -def submit_form(form, extra_values=None, open_http=None): -
1085 """ -1086 Helper function to submit a form. Returns a file-like object, as from -1087 ``urllib.urlopen()``. This object also has a ``.geturl()`` function, -1088 which shows the URL if there were any redirects. -1089 -1090 You can use this like:: -1091 -1092 form = doc.forms[0] -1093 form.inputs['foo'].value = 'bar' # etc -1094 response = form.submit() -1095 doc = parse(response) -1096 doc.make_links_absolute(response.geturl()) -1097 -1098 To change the HTTP requester, pass a function as ``open_http`` keyword -1099 argument that opens the URL for you. The function must have the following -1100 signature:: -1101 -1102 open_http(method, URL, values) -1103 -1104 The action is one of 'GET' or 'POST', the URL is the target URL as a -1105 string, and the values are a sequence of ``(name, value)`` tuples with the -1106 form data. -1107 """ -1108 values = form.form_values() -1109 if extra_values: -1110 if hasattr(extra_values, 'items'): -1111 extra_values = extra_values.items() -1112 values.extend(extra_values) -1113 if open_http is None: -1114 open_http = open_http_urllib -1115 if form.action: -1116 url = form.action -1117 else: -1118 url = form.base_url -1119 return open_http(form.method, url, values) -
1120 -
1121 -1122 -def open_http_urllib(method, url, values): -
1123 if not url: -1124 raise ValueError("cannot submit, no URL provided") -1125 ## FIXME: should test that it's not a relative URL or something -1126 try: -1127 from urllib import urlencode, urlopen -1128 except ImportError: # Python 3 -1129 from urllib.request import urlopen -1130 from urllib.parse import urlencode -1131 if method == 'GET': -1132 if '?' in url: -1133 url += '&' -1134 else: -1135 url += '?' -1136 url += urlencode(values) -1137 data = None -1138 else: -1139 data = urlencode(values) -1140 if not isinstance(data, bytes): -1141 data = data.encode('ASCII') -1142 return urlopen(url, data) -
1143 -
1144 -1145 -class FieldsDict(MutableMapping): -
1146 -
1147 - def __init__(self, inputs): -
1148 self.inputs = inputs -
1149 - def __getitem__(self, item): -
1150 return self.inputs[item].value -
1151 - def __setitem__(self, item, value): -
1152 self.inputs[item].value = value -
1153 - def __delitem__(self, item): -
1154 raise KeyError( -1155 "You cannot remove keys from ElementDict") -
1156 - def keys(self): -
1157 return self.inputs.keys() -
1158 - def __contains__(self, item): -
1159 return item in self.inputs -
1160 - def __iter__(self): -
1161 return iter(self.inputs.keys()) -
1162 - def __len__(self): -
1163 return len(self.inputs) -
1164 -
1165 - def __repr__(self): -
1166 return '<%s for form %s>' % ( -1167 self.__class__.__name__, -1168 self.inputs.form._name()) -
1169 -
1170 -1171 -class InputGetter(object): -
1172 -1173 """ -1174 An accessor that represents all the input fields in a form. -1175 -1176 You can get fields by name from this, with -1177 ``form.inputs['field_name']``. If there are a set of checkboxes -1178 with the same name, they are returned as a list (a `CheckboxGroup` -1179 which also allows value setting). Radio inputs are handled -1180 similarly. -1181 -1182 You can also iterate over this to get all input elements. This -1183 won't return the same thing as if you get all the names, as -1184 checkboxes and radio elements are returned individually. -1185 """ -1186 -1187 _name_xpath = etree.XPath(".//*[@name = $name and (local-name(.) = 'select' or local-name(.) = 'input' or local-name(.) = 'textarea')]") -1188 _all_xpath = etree.XPath(".//*[local-name() = 'select' or local-name() = 'input' or local-name() = 'textarea']") -1189 -
1190 - def __init__(self, form): -
1191 self.form = form -
1192 -
1193 - def __repr__(self): -
1194 return '<%s for form %s>' % ( -1195 self.__class__.__name__, -1196 self.form._name()) -
1197 -1198 ## FIXME: there should be more methods, and it's unclear if this is -1199 ## a dictionary-like object or list-like object -1200 -
1201 - def __getitem__(self, name): -
1202 results = self._name_xpath(self.form, name=name) -1203 if results: -1204 type = results[0].get('type') -1205 if type == 'radio' and len(results) > 1: -1206 group = RadioGroup(results) -1207 group.name = name -1208 return group -1209 elif type == 'checkbox' and len(results) > 1: -1210 group = CheckboxGroup(results) -1211 group.name = name -1212 return group -1213 else: -1214 # I don't like throwing away elements like this -1215 return results[0] -1216 else: -1217 raise KeyError( -1218 "No input element with the name %r" % name) -
1219 -
1220 - def __contains__(self, name): -
1221 results = self._name_xpath(self.form, name=name) -1222 return bool(results) -
1223 -
1224 - def keys(self): -
1225 names = set() -1226 for el in self: -1227 names.add(el.name) -1228 if None in names: -1229 names.remove(None) -1230 return list(names) -
1231 -
1232 - def __iter__(self): -
1233 ## FIXME: kind of dumb to turn a list into an iterator, only -1234 ## to have it likely turned back into a list again :( -1235 return iter(self._all_xpath(self.form)) -
1236 -
1237 -1238 -class InputMixin(object): -
1239 """ -1240 Mix-in for all input elements (input, select, and textarea) -1241 """ -1242 @property -
1243 - def name(self): -
1244 """ -1245 Get/set the name of the element -1246 """ -1247 return self.get('name') -
1248 -1249 @name.setter -
1250 - def name(self, value): -
1251 self.set('name', value) -
1252 -1253 @name.deleter -
1254 - def name(self): -
1255 attrib = self.attrib -1256 if 'name' in attrib: -1257 del attrib['name'] -
1258 -
1259 - def __repr__(self): -
1260 type_name = getattr(self, 'type', None) -1261 if type_name: -1262 type_name = ' type=%r' % type_name -1263 else: -1264 type_name = '' -1265 return '<%s %x name=%r%s>' % ( -1266 self.__class__.__name__, id(self), self.name, type_name) -
1267 -
1268 -1269 -class TextareaElement(InputMixin, HtmlElement): -
1270 """ -1271 ``<textarea>`` element. You can get the name with ``.name`` and -1272 get/set the value with ``.value`` -1273 """ -1274 @property -
1275 - def value(self): -
1276 """ -1277 Get/set the value (which is the contents of this element) -1278 """ -1279 content = self.text or '' -1280 if self.tag.startswith("{%s}" % XHTML_NAMESPACE): -1281 serialisation_method = 'xml' -1282 else: -1283 serialisation_method = 'html' -1284 for el in self: -1285 # it's rare that we actually get here, so let's not use ''.join() -1286 content += etree.tostring( -1287 el, method=serialisation_method, encoding='unicode') -1288 return content -
1289 -1290 @value.setter -
1291 - def value(self, value): -
1292 del self[:] -1293 self.text = value -
1294 -1295 @value.deleter -
1296 - def value(self): -
1297 self.text = '' -1298 del self[:] -
1299 -1300 -1301 HtmlElementClassLookup._default_element_classes['textarea'] = TextareaElement -
1302 -1303 -1304 -class SelectElement(InputMixin, HtmlElement): -
1305 """ -1306 ``<select>`` element. You can get the name with ``.name``. -1307 -1308 ``.value`` will be the value of the selected option, unless this -1309 is a multi-select element (``<select multiple>``), in which case -1310 it will be a set-like object. In either case ``.value_options`` -1311 gives the possible values. -1312 -1313 The boolean attribute ``.multiple`` shows if this is a -1314 multi-select. -1315 """ -1316 @property -
1317 - def value(self): -
1318 """ -1319 Get/set the value of this select (the selected option). -1320 -1321 If this is a multi-select, this is a set-like object that -1322 represents all the selected options. -1323 """ -1324 if self.multiple: -1325 return MultipleSelectOptions(self) -1326 options = _options_xpath(self) -1327 -1328 try: -1329 selected_option = next(el for el in reversed(options) if el.get('selected') is not None) -1330 except StopIteration: -1331 try: -1332 selected_option = next(el for el in options if el.get('disabled') is None) -1333 except StopIteration: -1334 return None -1335 value = selected_option.get('value') -1336 if value is None: -1337 value = (selected_option.text or '').strip() -1338 return value -
1339 -1340 @value.setter -
1341 - def value(self, value): -
1342 if self.multiple: -1343 if isinstance(value, basestring): -1344 raise TypeError("You must pass in a sequence") -1345 values = self.value -1346 values.clear() -1347 values.update(value) -1348 return -1349 checked_option = None -1350 if value is not None: -1351 for el in _options_xpath(self): -1352 opt_value = el.get('value') -1353 if opt_value is None: -1354 opt_value = (el.text or '').strip() -1355 if opt_value == value: -1356 checked_option = el -1357 break -1358 else: -1359 raise ValueError( -1360 "There is no option with the value of %r" % value) -1361 for el in _options_xpath(self): -1362 if 'selected' in el.attrib: -1363 del el.attrib['selected'] -1364 if checked_option is not None: -1365 checked_option.set('selected', '') -
1366 -1367 @value.deleter -
1368 - def value(self): -
1369 # FIXME: should del be allowed at all? -1370 if self.multiple: -1371 self.value.clear() -1372 else: -1373 self.value = None -
1374 -1375 @property -
1376 - def value_options(self): -
1377 """ -1378 All the possible values this select can have (the ``value`` -1379 attribute of all the ``<option>`` elements. -1380 """ -1381 options = [] -1382 for el in _options_xpath(self): -1383 value = el.get('value') -1384 if value is None: -1385 value = (el.text or '').strip() -1386 options.append(value) -1387 return options -
1388 -1389 @property -
1390 - def multiple(self): -
1391 """ -1392 Boolean attribute: is there a ``multiple`` attribute on this element. -1393 """ -1394 return 'multiple' in self.attrib -
1395 -1396 @multiple.setter -
1397 - def multiple(self, value): -
1398 if value: -1399 self.set('multiple', '') -1400 elif 'multiple' in self.attrib: -1401 del self.attrib['multiple'] -
1402 -1403 -1404 HtmlElementClassLookup._default_element_classes['select'] = SelectElement -
1405 -1406 -1407 -class MultipleSelectOptions(SetMixin): -
1408 """ -1409 Represents all the selected options in a ``<select multiple>`` element. -1410 -1411 You can add to this set-like option to select an option, or remove -1412 to unselect the option. -1413 """ -1414 -
1415 - def __init__(self, select): -
1416 self.select = select -
1417 -1418 @property -
1419 - def options(self): -
1420 """ -1421 Iterator of all the ``<option>`` elements. -1422 """ -1423 return iter(_options_xpath(self.select)) -
1424 -
1425 - def __iter__(self): -
1426 for option in self.options: -1427 if 'selected' in option.attrib: -1428 opt_value = option.get('value') -1429 if opt_value is None: -1430 opt_value = (option.text or '').strip() -1431 yield opt_value -
1432 -
1433 - def add(self, item): -
1434 for option in self.options: -1435 opt_value = option.get('value') -1436 if opt_value is None: -1437 opt_value = (option.text or '').strip() -1438 if opt_value == item: -1439 option.set('selected', '') -1440 break -1441 else: -1442 raise ValueError( -1443 "There is no option with the value %r" % item) -
1444 -
1445 - def remove(self, item): -
1446 for option in self.options: -1447 opt_value = option.get('value') -1448 if opt_value is None: -1449 opt_value = (option.text or '').strip() -1450 if opt_value == item: -1451 if 'selected' in option.attrib: -1452 del option.attrib['selected'] -1453 else: -1454 raise ValueError( -1455 "The option %r is not currently selected" % item) -1456 break -1457 else: -1458 raise ValueError( -1459 "There is not option with the value %r" % item) -
1460 -
1461 - def __repr__(self): -
1462 return '<%s {%s} for select name=%r>' % ( -1463 self.__class__.__name__, -1464 ', '.join([repr(v) for v in self]), -1465 self.select.name) -
1466 -
1467 -1468 -class RadioGroup(list): -
1469 """ -1470 This object represents several ``<input type=radio>`` elements -1471 that have the same name. -1472 -1473 You can use this like a list, but also use the property -1474 ``.value`` to check/uncheck inputs. Also you can use -1475 ``.value_options`` to get the possible values. -1476 """ -1477 @property -
1478 - def value(self): -
1479 """ -1480 Get/set the value, which checks the radio with that value (and -1481 unchecks any other value). -1482 """ -1483 for el in self: -1484 if 'checked' in el.attrib: -1485 return el.get('value') -1486 return None -
1487 -1488 @value.setter -
1489 - def value(self, value): -
1490 checked_option = None -1491 if value is not None: -1492 for el in self: -1493 if el.get('value') == value: -1494 checked_option = el -1495 break -1496 else: -1497 raise ValueError("There is no radio input with the value %r" % value) -1498 for el in self: -1499 if 'checked' in el.attrib: -1500 del el.attrib['checked'] -1501 if checked_option is not None: -1502 checked_option.set('checked', '') -
1503 -1504 @value.deleter -
1505 - def value(self): -
1506 self.value = None -
1507 -1508 @property -
1509 - def value_options(self): -
1510 """ -1511 Returns a list of all the possible values. -1512 """ -1513 return [el.get('value') for el in self] -
1514 -
1515 - def __repr__(self): -
1516 return '%s(%s)' % ( -1517 self.__class__.__name__, -1518 list.__repr__(self)) -
1519 -
1520 -1521 -class CheckboxGroup(list): -
1522 """ -1523 Represents a group of checkboxes (``<input type=checkbox>``) that -1524 have the same name. -1525 -1526 In addition to using this like a list, the ``.value`` attribute -1527 returns a set-like object that you can add to or remove from to -1528 check and uncheck checkboxes. You can also use ``.value_options`` -1529 to get the possible values. -1530 """ -1531 @property -
1532 - def value(self): -
1533 """ -1534 Return a set-like object that can be modified to check or -1535 uncheck individual checkboxes according to their value. -1536 """ -1537 return CheckboxValues(self) -
1538 -1539 @value.setter -
1540 - def value(self, value): -
1541 values = self.value -1542 values.clear() -1543 if not hasattr(value, '__iter__'): -1544 raise ValueError( -1545 "A CheckboxGroup (name=%r) must be set to a sequence (not %r)" -1546 % (self[0].name, value)) -1547 values.update(value) -
1548 -1549 @value.deleter -
1550 - def value(self): -
1551 self.value.clear() -
1552 -1553 @property -
1554 - def value_options(self): -
1555 """ -1556 Returns a list of all the possible values. -1557 """ -1558 return [el.get('value') for el in self] -
1559 -
1560 - def __repr__(self): -
1561 return '%s(%s)' % ( -1562 self.__class__.__name__, list.__repr__(self)) -
1563 -
1564 -1565 -class CheckboxValues(SetMixin): -
1566 """ -1567 Represents the values of the checked checkboxes in a group of -1568 checkboxes with the same name. -1569 """ -1570 -
1571 - def __init__(self, group): -
1572 self.group = group -
1573 -
1574 - def __iter__(self): -
1575 return iter([ -1576 el.get('value') -1577 for el in self.group -1578 if 'checked' in el.attrib]) -
1579 -
1580 - def add(self, value): -
1581 for el in self.group: -1582 if el.get('value') == value: -1583 el.set('checked', '') -1584 break -1585 else: -1586 raise KeyError("No checkbox with value %r" % value) -
1587 -
1588 - def remove(self, value): -
1589 for el in self.group: -1590 if el.get('value') == value: -1591 if 'checked' in el.attrib: -1592 del el.attrib['checked'] -1593 else: -1594 raise KeyError( -1595 "The checkbox with value %r was already unchecked" % value) -1596 break -1597 else: -1598 raise KeyError( -1599 "No checkbox with value %r" % value) -
1600 -
1601 - def __repr__(self): -
1602 return '<%s {%s} for checkboxes name=%r>' % ( -1603 self.__class__.__name__, -1604 ', '.join([repr(v) for v in self]), -1605 self.group.name) -
1606 -
1607 -1608 -class InputElement(InputMixin, HtmlElement): -
1609 """ -1610 Represents an ``<input>`` element. -1611 -1612 You can get the type with ``.type`` (which is lower-cased and -1613 defaults to ``'text'``). -1614 -1615 Also you can get and set the value with ``.value`` -1616 -1617 Checkboxes and radios have the attribute ``input.checkable == -1618 True`` (for all others it is false) and a boolean attribute -1619 ``.checked``. -1620 -1621 """ -1622 -1623 ## FIXME: I'm a little uncomfortable with the use of .checked -1624 @property -
1625 - def value(self): -
1626 """ -1627 Get/set the value of this element, using the ``value`` attribute. -1628 -1629 Also, if this is a checkbox and it has no value, this defaults -1630 to ``'on'``. If it is a checkbox or radio that is not -1631 checked, this returns None. -1632 """ -1633 if self.checkable: -1634 if self.checked: -1635 return self.get('value') or 'on' -1636 else: -1637 return None -1638 return self.get('value') -
1639 -1640 @value.setter -
1641 - def value(self, value): -
1642 if self.checkable: -1643 if not value: -1644 self.checked = False -1645 else: -1646 self.checked = True -1647 if isinstance(value, basestring): -1648 self.set('value', value) -1649 else: -1650 self.set('value', value) -
1651 -1652 @value.deleter -
1653 - def value(self): -
1654 if self.checkable: -1655 self.checked = False -1656 else: -1657 if 'value' in self.attrib: -1658 del self.attrib['value'] -
1659 -1660 @property -
1661 - def type(self): -
1662 """ -1663 Return the type of this element (using the type attribute). -1664 """ -1665 return self.get('type', 'text').lower() -
1666 -1667 @type.setter -
1668 - def type(self, value): -
1669 self.set('type', value) -
1670 -1671 @property -
1672 - def checkable(self): -
1673 """ -1674 Boolean: can this element be checked? -1675 """ -1676 return self.type in ('checkbox', 'radio') -
1677 -1678 @property -
1679 - def checked(self): -
1680 """ -1681 Boolean attribute to get/set the presence of the ``checked`` -1682 attribute. -1683 -1684 You can only use this on checkable input types. -1685 """ -1686 if not self.checkable: -1687 raise AttributeError('Not a checkable input type') -1688 return 'checked' in self.attrib -
1689 -1690 @checked.setter -
1691 - def checked(self, value): -
1692 if not self.checkable: -1693 raise AttributeError('Not a checkable input type') -1694 if value: -1695 self.set('checked', '') -1696 else: -1697 attrib = self.attrib -1698 if 'checked' in attrib: -1699 del attrib['checked'] -
1700 -1701 -1702 HtmlElementClassLookup._default_element_classes['input'] = InputElement -
1703 -1704 -1705 -class LabelElement(HtmlElement): -
1706 """ -1707 Represents a ``<label>`` element. -1708 -1709 Label elements are linked to other elements with their ``for`` -1710 attribute. You can access this element with ``label.for_element``. -1711 """ -1712 @property -
1713 - def for_element(self): -
1714 """ -1715 Get/set the element this label points to. Return None if it -1716 can't be found. -1717 """ -1718 id = self.get('for') -1719 if not id: -1720 return None -1721 return self.body.get_element_by_id(id) -
1722 -1723 @for_element.setter -
1724 - def for_element(self, other): -
1725 id = other.get('id') -1726 if not id: -1727 raise TypeError( -1728 "Element %r has no id attribute" % other) -1729 self.set('for', id) -
1730 -1731 @for_element.deleter -
1732 - def for_element(self): -
1733 attrib = self.attrib -1734 if 'id' in attrib: -1735 del attrib['id'] -
1736 -1737 -1738 HtmlElementClassLookup._default_element_classes['label'] = LabelElement -
1739 -1740 -1741 ############################################################ -1742 ## Serialization -1743 ############################################################ -1744 -1745 -def html_to_xhtml(html): -
1746 """Convert all tags in an HTML tree to XHTML by moving them to the -1747 XHTML namespace. -1748 """ -1749 try: -1750 html = html.getroot() -1751 except AttributeError: -1752 pass -1753 prefix = "{%s}" % XHTML_NAMESPACE -1754 for el in html.iter(etree.Element): -1755 tag = el.tag -1756 if tag[0] != '{': -1757 el.tag = prefix + tag -
1758 -
1759 -1760 -def xhtml_to_html(xhtml): -
1761 """Convert all tags in an XHTML tree to HTML by removing their -1762 XHTML namespace. -1763 """ -1764 try: -1765 xhtml = xhtml.getroot() -1766 except AttributeError: -1767 pass -1768 prefix = "{%s}" % XHTML_NAMESPACE -1769 prefix_len = len(prefix) -1770 for el in xhtml.iter(prefix + "*"): -1771 el.tag = el.tag[prefix_len:] -
1772 -1773 -1774 # This isn't a general match, but it's a match for what libxml2 -1775 # specifically serialises: -1776 __str_replace_meta_content_type = re.compile( -1777 r'<meta http-equiv="Content-Type"[^>]*>').sub -1778 __bytes_replace_meta_content_type = re.compile( -1779 r'<meta http-equiv="Content-Type"[^>]*>'.encode('ASCII')).sub -
1780 -1781 -1782 -def tostring(doc, pretty_print=False, include_meta_content_type=False, -1783 encoding=None, method="html", with_tail=True, doctype=None): -
1784 """Return an HTML string representation of the document. -1785 -1786 Note: if include_meta_content_type is true this will create a -1787 ``<meta http-equiv="Content-Type" ...>`` tag in the head; -1788 regardless of the value of include_meta_content_type any existing -1789 ``<meta http-equiv="Content-Type" ...>`` tag will be removed -1790 -1791 The ``encoding`` argument controls the output encoding (defauts to -1792 ASCII, with &#...; character references for any characters outside -1793 of ASCII). Note that you can pass the name ``'unicode'`` as -1794 ``encoding`` argument to serialise to a Unicode string. -1795 -1796 The ``method`` argument defines the output method. It defaults to -1797 'html', but can also be 'xml' for xhtml output, or 'text' to -1798 serialise to plain text without markup. -1799 -1800 To leave out the tail text of the top-level element that is being -1801 serialised, pass ``with_tail=False``. -1802 -1803 The ``doctype`` option allows passing in a plain string that will -1804 be serialised before the XML tree. Note that passing in non -1805 well-formed content here will make the XML output non well-formed. -1806 Also, an existing doctype in the document tree will not be removed -1807 when serialising an ElementTree instance. -1808 -1809 Example:: -1810 -1811 >>> from lxml import html -1812 >>> root = html.fragment_fromstring('<p>Hello<br>world!</p>') -1813 -1814 >>> html.tostring(root) -1815 b'<p>Hello<br>world!</p>' -1816 >>> html.tostring(root, method='html') -1817 b'<p>Hello<br>world!</p>' -1818 -1819 >>> html.tostring(root, method='xml') -1820 b'<p>Hello<br/>world!</p>' -1821 -1822 >>> html.tostring(root, method='text') -1823 b'Helloworld!' -1824 -1825 >>> html.tostring(root, method='text', encoding='unicode') -1826 u'Helloworld!' -1827 -1828 >>> root = html.fragment_fromstring('<div><p>Hello<br>world!</p>TAIL</div>') -1829 >>> html.tostring(root[0], method='text', encoding='unicode') -1830 u'Helloworld!TAIL' -1831 -1832 >>> html.tostring(root[0], method='text', encoding='unicode', with_tail=False) -1833 u'Helloworld!' -1834 -1835 >>> doc = html.document_fromstring('<p>Hello<br>world!</p>') -1836 >>> html.tostring(doc, method='html', encoding='unicode') -1837 u'<html><body><p>Hello<br>world!</p></body></html>' -1838 -1839 >>> print(html.tostring(doc, method='html', encoding='unicode', -1840 ... doctype='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"' -1841 ... ' "http://www.w3.org/TR/html4/strict.dtd">')) -1842 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -1843 <html><body><p>Hello<br>world!</p></body></html> -1844 """ -1845 html = etree.tostring(doc, method=method, pretty_print=pretty_print, -1846 encoding=encoding, with_tail=with_tail, -1847 doctype=doctype) -1848 if method == 'html' and not include_meta_content_type: -1849 if isinstance(html, str): -1850 html = __str_replace_meta_content_type('', html) -1851 else: -1852 html = __bytes_replace_meta_content_type(bytes(), html) -1853 return html -
1854 -1855 -1856 tostring.__doc__ = __fix_docstring(tostring.__doc__) -
1857 -1858 -1859 -def open_in_browser(doc, encoding=None): -
1860 """ -1861 Open the HTML document in a web browser, saving it to a temporary -1862 file to open it. Note that this does not delete the file after -1863 use. This is mainly meant for debugging. -1864 """ -1865 import os -1866 import webbrowser -1867 import tempfile -1868 if not isinstance(doc, etree._ElementTree): -1869 doc = etree.ElementTree(doc) -1870 handle, fn = tempfile.mkstemp(suffix='.html') -1871 f = os.fdopen(handle, 'wb') -1872 try: -1873 doc.write(f, method="html", encoding=encoding or doc.docinfo.encoding or "UTF-8") -1874 finally: -1875 # we leak the file itself here, but we should at least close it -1876 f.close() -1877 url = 'file://' + fn.replace(os.path.sep, '/') -1878 print(url) -1879 webbrowser.open(url) -
1880 -
1881 -1882 ################################################################################ -1883 # configure Element class lookup -1884 ################################################################################ -1885 -1886 -class HTMLParser(etree.HTMLParser): -
1887 """An HTML parser that is configured to return lxml.html Element -1888 objects. -1889 """ -
1890 - def __init__(self, **kwargs): -
1891 super(HTMLParser, self).__init__(**kwargs) -1892 self.set_element_class_lookup(HtmlElementClassLookup()) -
1893 -
1894 -1895 -class XHTMLParser(etree.XMLParser): -
1896 """An XML parser that is configured to return lxml.html Element -1897 objects. -1898 -1899 Note that this parser is not really XHTML aware unless you let it -1900 load a DTD that declares the HTML entities. To do this, make sure -1901 you have the XHTML DTDs installed in your catalogs, and create the -1902 parser like this:: -1903 -1904 >>> parser = XHTMLParser(load_dtd=True) -1905 -1906 If you additionally want to validate the document, use this:: -1907 -1908 >>> parser = XHTMLParser(dtd_validation=True) -1909 -1910 For catalog support, see http://www.xmlsoft.org/catalog.html. -1911 """ -
1912 - def __init__(self, **kwargs): -
1913 super(XHTMLParser, self).__init__(**kwargs) -1914 self.set_element_class_lookup(HtmlElementClassLookup()) -
1915 -
1916 -1917 -def Element(*args, **kw): -
1918 """Create a new HTML Element. -1919 -1920 This can also be used for XHTML documents. -1921 """ -1922 v = html_parser.makeelement(*args, **kw) -1923 return v -
1924 -1925 -1926 html_parser = HTMLParser() -1927 xhtml_parser = XHTMLParser() -1928 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.CheckboxGroup-class.html b/doc/html/api/lxml.html.CheckboxGroup-class.html deleted file mode 100644 index 6512988d..00000000 --- a/doc/html/api/lxml.html.CheckboxGroup-class.html +++ /dev/null @@ -1,385 +0,0 @@ - - - - - lxml.html.CheckboxGroup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - CheckboxGroup :: - Class CheckboxGroup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class CheckboxGroup

source code

-
-object --+    
-         |    
-      list --+
-             |
-            CheckboxGroup
-
- -
-

Represents a group of checkboxes (<input type=checkbox>) that -have the same name.

-

In addition to using this like a list, the .value attribute -returns a set-like object that you can add to or remove from to -check and uncheck checkboxes. You can also use .value_options -to get the possible values.

- - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-

Inherited from list: - __add__, - __contains__, - __delitem__, - __delslice__, - __eq__, - __ge__, - __getattribute__, - __getitem__, - __getslice__, - __gt__, - __iadd__, - __imul__, - __init__, - __iter__, - __le__, - __len__, - __lt__, - __mul__, - __ne__, - __new__, - __reversed__, - __rmul__, - __setitem__, - __setslice__, - __sizeof__, - append, - count, - extend, - index, - insert, - pop, - remove, - reverse, - sort -

-

Inherited from object: - __delattr__, - __format__, - __reduce__, - __reduce_ex__, - __setattr__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from list: - __hash__ -

-
- - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - value
- Return a set-like object that can be modified to check or -uncheck individual checkboxes according to their value. -
-   - - value_options
- Returns a list of all the possible values. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

value

- Return a set-like object that can be modified to check or -uncheck individual checkboxes according to their value. -
-
Get Method:
-
unreachable.value(self) - - Return a set-like object that can be modified to check or -uncheck individual checkboxes according to their value. -
-
Set Method:
-
unreachable.value(self, - value) -
-
Delete Method:
-
unreachable.value(self) -
-
-
-
- -
- -
-

value_options

- Returns a list of all the possible values. -
-
Get Method:
-
unreachable.value_options(self) - - Returns a list of all the possible values. -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.CheckboxValues-class.html b/doc/html/api/lxml.html.CheckboxValues-class.html deleted file mode 100644 index 19988764..00000000 --- a/doc/html/api/lxml.html.CheckboxValues-class.html +++ /dev/null @@ -1,563 +0,0 @@ - - - - - lxml.html.CheckboxValues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - CheckboxValues :: - Class CheckboxValues - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class CheckboxValues

source code

-
-       object --+                
-                |                
-    _abcoll.Sized --+            
-                    |            
-       object --+   |            
-                |   |            
- _abcoll.Iterable --+            
-                    |            
-       object --+   |            
-                |   |            
-_abcoll.Container --+            
-                    |            
-          _abcoll.Set --+        
-                        |        
-       _abcoll.MutableSet --+    
-                            |    
-           _setmixin.SetMixin --+
-                                |
-                               CheckboxValues
-
- -
-Represents the values of the checked checkboxes in a group of -checkboxes with the same name. - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from _abcoll.Sized: - __metaclass__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - group)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__iter__(self) - source code - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-   - - - - - - -
add(self, - value)
- Add an element.
- source code - -
- -
-   - - - - - - -
remove(self, - value)
- Remove an element. If not a member, raise a KeyError.
- source code - -
- -
-

Inherited from _setmixin.SetMixin: - __contains__, - __len__, - copy, - difference, - difference_update, - discard, - intersection, - intersection_update, - issubset, - issuperset, - symmetric_difference, - symmetric_difference_update, - union, - update -

-

Inherited from _abcoll.MutableSet: - __iand__, - __ior__, - __isub__, - __ixor__, - clear, - pop -

-

Inherited from _abcoll.Set: - __and__, - __eq__, - __ge__, - __gt__, - __le__, - __lt__, - __ne__, - __or__, - __rand__, - __ror__, - __rsub__, - __rxor__, - __sub__, - __xor__, - isdisjoint -

-

Inherited from _abcoll.Set (private): - _hash -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from _setmixin.SetMixin (private): - _from_iterable -

-

Inherited from _abcoll.Sized: - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __abstractmethods__ = frozenset([]) -
-

Inherited from _setmixin.SetMixin (private): - _abc_negative_cache, - _abc_negative_cache_version, - _abc_registry -

-

Inherited from _abcoll.Set: - __hash__ -

-

Inherited from _abcoll.Sized (private): - _abc_cache -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - group) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__iter__(self) -

-
source code  -
- - -
-
Overrides: - _abcoll.Iterable.__iter__ -
-
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

add(self, - value) -

-
source code  -
- - Add an element. -
-
Overrides: - _abcoll.MutableSet.add -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

remove(self, - value) -

-
source code  -
- - Remove an element. If not a member, raise a KeyError. -
-
Overrides: - _abcoll.MutableSet.remove -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.Classes-class.html b/doc/html/api/lxml.html.Classes-class.html deleted file mode 100644 index 342ee776..00000000 --- a/doc/html/api/lxml.html.Classes-class.html +++ /dev/null @@ -1,715 +0,0 @@ - - - - - lxml.html.Classes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - Classes :: - Class Classes - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Classes

source code

-
-       object --+            
-                |            
-    _abcoll.Sized --+        
-                    |        
-       object --+   |        
-                |   |        
- _abcoll.Iterable --+        
-                    |        
-       object --+   |        
-                |   |        
-_abcoll.Container --+        
-                    |        
-          _abcoll.Set --+    
-                        |    
-       _abcoll.MutableSet --+
-                            |
-                           Classes
-
- -
-

Provides access to an element's class attribute as a set-like collection. -Usage:

-
->>> el = fromstring('<p class="hidden large">Text</p>')
->>> classes = el.classes  # or: classes = Classes(el.attrib)
->>> classes |= ['block', 'paragraph']
->>> el.get('class')
-'hidden large block paragraph'
->>> classes.toggle('hidden')
-False
->>> el.get('class')
-'large block paragraph'
->>> classes -= ('some', 'classes', 'block')
->>> el.get('class')
-'large paragraph'
-
- - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from _abcoll.Sized: - __metaclass__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__contains__(self, - name) - source code - -
- -
-   - - - - - - -
__init__(self, - attributes)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__iter__(self) - source code - -
- -
-   - - - - - - -
__len__(self) - source code - -
- -
-   - - - - - - -
add(self, - value)
- Add a class.
- source code - -
- -
-   - - - - - - -
discard(self, - value)
- Remove a class if it is currently present.
- source code - -
- -
-   - - - - - - -
remove(self, - value)
- Remove a class; it must currently be present.
- source code - -
- -
-   - - - - - - -
toggle(self, - value)
- Add a class name if it isn't there yet, or remove it if it exists.
- source code - -
- -
-   - - - - - - -
update(self, - values)
- Add all names from 'values'.
- source code - -
- -
-

Inherited from _abcoll.MutableSet: - __iand__, - __ior__, - __isub__, - __ixor__, - clear, - pop -

-

Inherited from _abcoll.Set: - __and__, - __eq__, - __ge__, - __gt__, - __le__, - __lt__, - __ne__, - __or__, - __rand__, - __ror__, - __rsub__, - __rxor__, - __sub__, - __xor__, - isdisjoint -

-

Inherited from _abcoll.Set (private): - _hash -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from _abcoll.Set (private): - _from_iterable -

-

Inherited from _abcoll.Sized: - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __abstractmethods__ = frozenset([]) -
-   - - _abc_negative_cache = <_weakrefset.WeakSet object> -
-   - - _abc_negative_cache_version = 22 -
-   - - _abc_registry = <_weakrefset.WeakSet object> -
-

Inherited from _abcoll.Set: - __hash__ -

-

Inherited from _abcoll.Sized (private): - _abc_cache -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__contains__(self, - name) -
(In operator) -

-
source code  -
- - -
-
Overrides: - _abcoll.Container.__contains__ -
-
-
-
- -
- -
- - -
-

__init__(self, - attributes) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__iter__(self) -

-
source code  -
- - -
-
Overrides: - _abcoll.Iterable.__iter__ -
-
-
-
- -
- -
- - -
-

__len__(self) -
(Length operator) -

-
source code  -
- - -
-
Overrides: - _abcoll.Sized.__len__ -
-
-
-
- -
- -
- - -
-

add(self, - value) -

-
source code  -
- -

Add a class.

-

This has no effect if the class is already present.

-
-
Overrides: - _abcoll.MutableSet.add -
-
-
-
- -
- -
- - -
-

discard(self, - value) -

-
source code  -
- -

Remove a class if it is currently present.

-

If the class is not present, do nothing.

-
-
Overrides: - _abcoll.MutableSet.discard -
-
-
-
- -
- -
- - -
-

remove(self, - value) -

-
source code  -
- -

Remove a class; it must currently be present.

-

If the class is not present, raise a KeyError.

-
-
Overrides: - _abcoll.MutableSet.remove -
-
-
-
- -
- -
- - -
-

toggle(self, - value) -

-
source code  -
- -

Add a class name if it isn't there yet, or remove it if it exists.

-

Returns true if the class was added (and is now enabled) and -false if it was removed (and is now disabled).

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.ElementSoup-module.html b/doc/html/api/lxml.html.ElementSoup-module.html deleted file mode 100644 index bc9cf06f..00000000 --- a/doc/html/api/lxml.html.ElementSoup-module.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - lxml.html.ElementSoup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module ElementSoup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module ElementSoup

source code

-Legacy interface to the BeautifulSoup HTML parser. - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
convert_tree(beautiful_soup_tree, - makeelement=None)
- Convert a BeautifulSoup tree to a list of Element trees.
- source code - -
- -
-   - - - - - - -
parse(file, - beautifulsoup=None, - makeelement=None) - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __doc__ = """Legacy interface to the BeautifulSoup HTML pars... -
-   - - __package__ = 'lxml.html' -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

convert_tree(beautiful_soup_tree, - makeelement=None) -

-
source code  -
- -

Convert a BeautifulSoup tree to a list of Element trees.

-

Returns a list instead of a single root Element to support -HTML-like soup with more than one root element.

-

You can pass a different Element factory through the makeelement -keyword.

-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

__doc__

- -
-
-
-
Value:
-
-"""Legacy interface to the BeautifulSoup HTML parser.
-"""
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.ElementSoup-pysrc.html b/doc/html/api/lxml.html.ElementSoup-pysrc.html deleted file mode 100644 index 47a6aad3..00000000 --- a/doc/html/api/lxml.html.ElementSoup-pysrc.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - lxml.html.ElementSoup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module ElementSoup - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.html.ElementSoup

-
- 1  __doc__ = """Legacy interface to the BeautifulSoup HTML parser. 
- 2  """ 
- 3   
- 4  __all__ = ["parse", "convert_tree"] 
- 5   
- 6  from soupparser import convert_tree, parse as _parse 
- 7   
-
8 -def parse(file, beautifulsoup=None, makeelement=None): -
9 root = _parse(file, beautifulsoup=beautifulsoup, makeelement=makeelement) -10 return root.getroot() -
11 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.FieldsDict-class.html b/doc/html/api/lxml.html.FieldsDict-class.html deleted file mode 100644 index 78c6a14f..00000000 --- a/doc/html/api/lxml.html.FieldsDict-class.html +++ /dev/null @@ -1,705 +0,0 @@ - - - - - lxml.html.FieldsDict - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - FieldsDict :: - Class FieldsDict - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class FieldsDict

source code

-
-       object --+            
-                |            
-    _abcoll.Sized --+        
-                    |        
-       object --+   |        
-                |   |        
- _abcoll.Iterable --+        
-                    |        
-       object --+   |        
-                |   |        
-_abcoll.Container --+        
-                    |        
-      _abcoll.Mapping --+    
-                        |    
-   _abcoll.MutableMapping --+
-                            |
-                           FieldsDict
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from _abcoll.Sized: - __metaclass__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__contains__(self, - item) - source code - -
- -
-   - - - - - - -
__delitem__(self, - item) - source code - -
- -
-   - - - - - - -
__getitem__(self, - item) - source code - -
- -
-   - - - - - - -
__init__(self, - inputs)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__iter__(self) - source code - -
- -
-   - - - - - - -
__len__(self) - source code - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-   - - - - - - -
__setitem__(self, - item, - value) - source code - -
- -
- list of D's keys - - - - - - -
keys(self) - source code - -
- -
-

Inherited from _abcoll.MutableMapping: - clear, - pop, - popitem, - setdefault, - update -

-

Inherited from _abcoll.Mapping: - __eq__, - __ne__, - get, - items, - iteritems, - iterkeys, - itervalues, - values -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from _abcoll.Sized: - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __abstractmethods__ = frozenset([]) -
-   - - _abc_negative_cache = <_weakrefset.WeakSet object> -
-   - - _abc_negative_cache_version = 22 -
-   - - _abc_registry = <_weakrefset.WeakSet object> -
-

Inherited from _abcoll.Mapping: - __hash__ -

-

Inherited from _abcoll.Sized (private): - _abc_cache -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__contains__(self, - item) -
(In operator) -

-
source code  -
- - -
-
Overrides: - _abcoll.Container.__contains__ -
-
-
-
- -
- -
- - -
-

__delitem__(self, - item) -
(Index deletion operator) -

-
source code  -
- - -
-
Overrides: - _abcoll.MutableMapping.__delitem__ -
-
-
-
- -
- -
- - -
-

__getitem__(self, - item) -
(Indexing operator) -

-
source code  -
- - -
-
Overrides: - _abcoll.Mapping.__getitem__ -
-
-
-
- -
- -
- - -
-

__init__(self, - inputs) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__iter__(self) -

-
source code  -
- - -
-
Overrides: - _abcoll.Iterable.__iter__ -
-
-
-
- -
- -
- - -
-

__len__(self) -
(Length operator) -

-
source code  -
- - -
-
Overrides: - _abcoll.Sized.__len__ -
-
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__setitem__(self, - item, - value) -
(Index assignment operator) -

-
source code  -
- - -
-
Overrides: - _abcoll.MutableMapping.__setitem__ -
-
-
-
- -
- -
- - -
-

keys(self) -

-
source code  -
- - -
-
Returns: list of D's keys
-
Overrides: - _abcoll.Mapping.keys -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.FormElement-class.html b/doc/html/api/lxml.html.FormElement-class.html deleted file mode 100644 index 2c3ea0f3..00000000 --- a/doc/html/api/lxml.html.FormElement-class.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - - lxml.html.FormElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - FormElement :: - Class FormElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class FormElement

source code

-
-    object --+            
-             |            
-etree._Element --+        
-                 |        
- etree.ElementBase --+    
-                     |    
-        object --+   |    
-                 |   |    
-         HtmlMixin --+    
-                     |    
-           HtmlElement --+
-                         |
-                        FormElement
-
- -
-Represents a <form> element. - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
_name(self) - source code - -
- -
-   - - - - - - -
form_values(self)
- Return a list of tuples of the field values for the form. -This is suitable to be passed to urllib.urlencode().
- source code - -
- -
-

Inherited from HtmlElement: - cssselect, - set -

-

Inherited from etree.ElementBase: - __init__, - __new__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __repr__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from HtmlMixin: - drop_tag, - drop_tree, - find_class, - find_rel_links, - get_element_by_id, - iterlinks, - make_links_absolute, - resolve_base_href, - rewrite_links, - text_content -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - action
- Get/set the form's action attribute. -
-   - - fields
- Dictionary-like object that represents all the fields in this -form. You can set values in this dictionary to effect the -form. -
-   - - inputs
- Returns an accessor for all the input elements in the form. -
-   - - method
- Get/set the form's method. Always returns a capitalized -string, and defaults to 'GET' -
-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from HtmlMixin: - base_url, - body, - classes, - forms, - head, - label -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

action

- Get/set the form's action attribute. -
-
Get Method:
-
unreachable.action(self) - - Get/set the form's action attribute. -
-
Set Method:
-
unreachable.action(self, - value) -
-
Delete Method:
-
unreachable.action(self) -
-
-
-
- -
- -
-

fields

- Dictionary-like object that represents all the fields in this -form. You can set values in this dictionary to effect the -form. -
-
Get Method:
-
unreachable.fields(self) - - Dictionary-like object that represents all the fields in this -form. You can set values in this dictionary to effect the -form. -
-
Set Method:
-
unreachable.fields(self, - value) -
-
-
-
- -
- -
-

inputs

-

Returns an accessor for all the input elements in the form.

-

See InputGetter for more information about the object.

-
-
Get Method:
-
unreachable.inputs(self) - - Returns an accessor for all the input elements in the form. -
-
-
-
- -
- -
-

method

- Get/set the form's method. Always returns a capitalized -string, and defaults to 'GET' -
-
Get Method:
-
unreachable.method(self) - - Get/set the form's method. Always returns a capitalized -string, and defaults to 'GET' -
-
Set Method:
-
unreachable.method(self, - value) -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.HTMLParser-class.html b/doc/html/api/lxml.html.HTMLParser-class.html deleted file mode 100644 index cf4010dc..00000000 --- a/doc/html/api/lxml.html.HTMLParser-class.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - lxml.html.HTMLParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - HTMLParser :: - Class HTMLParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HTMLParser

source code

-
-    object --+            
-             |            
-??._BaseParser --+        
-                 |        
- etree._FeedParser --+    
-                     |    
-      etree.HTMLParser --+
-                         |
-                        HTMLParser
-
- -
-An HTML parser that is configured to return lxml.html Element -objects. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - **kwargs)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-

Inherited from etree.HTMLParser: - __new__ -

-

Inherited from etree._FeedParser: - close, - feed -

-

Inherited from unreachable._BaseParser: - copy, - makeelement, - setElementClassLookup, - set_element_class_lookup -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree._FeedParser: - feed_error_log -

-

Inherited from unreachable._BaseParser: - error_log, - resolvers, - target, - version -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - **kwargs) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.HtmlComment-class.html b/doc/html/api/lxml.html.HtmlComment-class.html deleted file mode 100644 index 12577d24..00000000 --- a/doc/html/api/lxml.html.HtmlComment-class.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - lxml.html.HtmlComment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - HtmlComment :: - Class HtmlComment - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HtmlComment

source code

-
-         object --+                
-                  |                
-     etree._Element --+            
-                      |            
-??.__ContentOnlyElement --+        
-                          |        
-             etree._Comment --+    
-                              |    
-              etree.CommentBase --+
-                                  |
-                     object --+   |
-                              |   |
-                      HtmlMixin --+
-                                  |
-                                 HtmlComment
-
- -
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from etree.CommentBase: - __init__, - __new__ -

-

Inherited from etree._Comment: - __repr__ -

-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - get, - insert, - items, - keys, - set, - values -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from HtmlMixin: - drop_tag, - drop_tree, - find_class, - find_rel_links, - get_element_by_id, - iterlinks, - make_links_absolute, - resolve_base_href, - rewrite_links, - text_content -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree._Comment: - tag -

-

Inherited from unreachable.__ContentOnlyElement: - attrib, - text -

-

Inherited from etree._Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from HtmlMixin: - base_url, - body, - classes, - forms, - head, - label -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.HtmlElement-class.html b/doc/html/api/lxml.html.HtmlElement-class.html deleted file mode 100644 index 7df5717c..00000000 --- a/doc/html/api/lxml.html.HtmlElement-class.html +++ /dev/null @@ -1,392 +0,0 @@ - - - - - lxml.html.HtmlElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - HtmlElement :: - Class HtmlElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HtmlElement

source code

-
-    object --+        
-             |        
-etree._Element --+    
-                 |    
- etree.ElementBase --+
-                     |
-        object --+   |
-                 |   |
-         HtmlMixin --+
-                     |
-                    HtmlElement
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
cssselect(self, - expr, - translator='html')
- Run the CSS expression on this element and its children, -returning a list of the results.
- source code - -
- -
-   - - - - - - -
set(self, - key, - value=None)
- Sets an element attribute. If no value is provided, or if the value is None, -creates a 'boolean' attribute without value, e.g. "<form novalidate></form>" -for form.set('novalidate').
- source code - -
- -
-

Inherited from etree.ElementBase: - __init__, - __new__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __repr__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from HtmlMixin: - drop_tag, - drop_tree, - find_class, - find_rel_links, - get_element_by_id, - iterlinks, - make_links_absolute, - resolve_base_href, - rewrite_links, - text_content -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from HtmlMixin: - base_url, - body, - classes, - forms, - head, - label -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

cssselect(self, - expr, - translator='html') -

-
source code  -
- -

Run the CSS expression on this element and its children, -returning a list of the results.

-

Equivalent to lxml.cssselect.CSSSelect(expr, translator='html')(self) --- note that pre-compiling the expression can provide a substantial -speedup.

-
-
Overrides: - HtmlMixin.cssselect -
-
-
-
- -
- -
- - -
-

set(self, - key, - value=None) -

-
source code  -
- - Sets an element attribute. If no value is provided, or if the value is None, -creates a 'boolean' attribute without value, e.g. "<form novalidate></form>" -for form.set('novalidate'). -
-
Overrides: - HtmlMixin.set -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.HtmlElementClassLookup-class.html b/doc/html/api/lxml.html.HtmlElementClassLookup-class.html deleted file mode 100644 index 90e32e5a..00000000 --- a/doc/html/api/lxml.html.HtmlElementClassLookup-class.html +++ /dev/null @@ -1,387 +0,0 @@ - - - - - lxml.html.HtmlElementClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - HtmlElementClassLookup :: - Class HtmlElementClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HtmlElementClassLookup

source code

-
-                  object --+            
-                           |            
-    etree.ElementClassLookup --+        
-                               |        
-etree.FallbackElementClassLookup --+    
-                                   |    
-      etree.CustomElementClassLookup --+
-                                       |
-                                      HtmlElementClassLookup
-
- -
-

A lookup scheme for HTML Element classes.

-

To create a lookup instance with different Element classes, pass a tag -name mapping of Element classes in the classes keyword argument and/or -a tag name mapping of Mixin classes in the mixins keyword argument. -The special key '*' denotes a Mixin class that should be mixed into all -Element classes.

- - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - classes=None, - mixins=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
lookup(self, - node_type, - document, - namespace, - name) - source code - -
- -
-

Inherited from etree.CustomElementClassLookup: - __new__ -

-

Inherited from etree.FallbackElementClassLookup: - set_fallback -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - _default_element_classes = {'form': <class 'lxml.html.FormElem... -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree.FallbackElementClassLookup: - fallback -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - classes=None, - mixins=None) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

lookup(self, - node_type, - document, - namespace, - name) -

-
source code  -
- - -
-
Overrides: - etree.CustomElementClassLookup.lookup -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

_default_element_classes

- -
-
-
-
Value:
-
-{'form': <class 'lxml.html.FormElement'>,
- 'input': <class 'lxml.html.InputElement'>,
- 'label': <class 'lxml.html.LabelElement'>,
- 'select': <class 'lxml.html.SelectElement'>,
- 'textarea': <class 'lxml.html.TextareaElement'>}
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.HtmlEntity-class.html b/doc/html/api/lxml.html.HtmlEntity-class.html deleted file mode 100644 index 8f34924a..00000000 --- a/doc/html/api/lxml.html.HtmlEntity-class.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - lxml.html.HtmlEntity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - HtmlEntity :: - Class HtmlEntity - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HtmlEntity

source code

-
-         object --+                
-                  |                
-     etree._Element --+            
-                      |            
-??.__ContentOnlyElement --+        
-                          |        
-              etree._Entity --+    
-                              |    
-               etree.EntityBase --+
-                                  |
-                     object --+   |
-                              |   |
-                      HtmlMixin --+
-                                  |
-                                 HtmlEntity
-
- -
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from etree.EntityBase: - __init__, - __new__ -

-

Inherited from etree._Entity: - __repr__ -

-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - get, - insert, - items, - keys, - set, - values -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from HtmlMixin: - drop_tag, - drop_tree, - find_class, - find_rel_links, - get_element_by_id, - iterlinks, - make_links_absolute, - resolve_base_href, - rewrite_links, - text_content -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree._Entity: - name, - tag, - text -

-

Inherited from unreachable.__ContentOnlyElement: - attrib -

-

Inherited from etree._Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from HtmlMixin: - base_url, - body, - classes, - forms, - head, - label -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.HtmlMixin-class.html b/doc/html/api/lxml.html.HtmlMixin-class.html deleted file mode 100644 index 5a7374a0..00000000 --- a/doc/html/api/lxml.html.HtmlMixin-class.html +++ /dev/null @@ -1,821 +0,0 @@ - - - - - lxml.html.HtmlMixin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - HtmlMixin :: - Class HtmlMixin - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HtmlMixin

source code

-
-object --+
-         |
-        HtmlMixin
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
cssselect(self, - expr, - translator='html')
- Run the CSS expression on this element and its children, -returning a list of the results.
- source code - -
- -
-   - - - - - - -
drop_tag(self)
- Remove the tag, but not its children or text. The children and text -are merged into the parent.
- source code - -
- -
-   - - - - - - -
drop_tree(self)
- Removes this element from the tree, including its children and -text. The tail text is joined to the previous element or -parent.
- source code - -
- -
-   - - - - - - -
find_class(self, - class_name)
- Find any elements with the given class name.
- source code - -
- -
-   - - - - - - -
find_rel_links(self, - rel)
- Find any links like <a rel="{rel}">...</a>; returns a list of elements.
- source code - -
- -
-   - - - - - - -
get_element_by_id(self, - id, - *default)
- Get the first element in a document with the given id. If none is -found, return the default argument if provided or raise KeyError -otherwise.
- source code - -
- -
-   - - - - - - -
iterlinks(self)
- Yield (element, attribute, link, pos), where attribute may be None -(indicating the link is in the text). pos is the position -where the link occurs; often 0, but sometimes something else in -the case of links in stylesheets or style tags.
- source code - -
- -
-   - - - - - - -
make_links_absolute(self, - base_url=None, - resolve_base_href=True, - handle_failures=None)
- Make all links in the document absolute, given the -base_url for the document (the full URL where the document -came from), or if no base_url is given, then the .base_url -of the document.
- source code - -
- -
-   - - - - - - -
resolve_base_href(self, - handle_failures=None)
- Find any <base href> tag in the document, and apply its -values to all links found in the document. Also remove the -tag once it has been applied.
- source code - -
- -
-   - - - - - - -
rewrite_links(self, - link_repl_func, - resolve_base_href=True, - base_href=None)
- Rewrite all the links in the document. For each link -link_repl_func(link) will be called, and the return value -will replace the old link.
- source code - -
- -
-   - - - - - - -
set(self, - key, - value=None)
- Sets an element attribute. If no value is provided, or if the value is None, -creates a 'boolean' attribute without value, e.g. "<form novalidate></form>" -for form.set('novalidate').
- source code - -
- -
-   - - - - - - -
text_content(self)
- Return the text content of the tag (and the text in any children).
- source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - base_url
- Returns the base URL, given when the page was parsed. -
-   - - body
- Return the <body> element. Can be called from a child element -to get the document's head. -
-   - - classes
- A set-like wrapper around the 'class' attribute. -
-   - - forms
- Return a list of all the forms -
-   - - head
- Returns the <head> element. Can be called from a child -element to get the document's head. -
-   - - label
- Get or set any <label> element associated with this element. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

cssselect(self, - expr, - translator='html') -

-
source code  -
- -

Run the CSS expression on this element and its children, -returning a list of the results.

-

Equivalent to lxml.cssselect.CSSSelect(expr, translator='html')(self) --- note that pre-compiling the expression can provide a substantial -speedup.

-
-
-
-
- -
- -
- - -
-

drop_tag(self) -

-
source code  -
- -

Remove the tag, but not its children or text. The children and text -are merged into the parent.

-

Example:

-
->>> h = fragment_fromstring('<div>Hello <b>World!</b></div>')
->>> h.find('.//b').drop_tag()
->>> print(tostring(h, encoding='unicode'))
-<div>Hello World!</div>
-
-
-
-
-
- -
- -
- - -
-

get_element_by_id(self, - id, - *default) -

-
source code  -
- -

Get the first element in a document with the given id. If none is -found, return the default argument if provided or raise KeyError -otherwise.

-

Note that there can be more than one element with the same id, -and this isn't uncommon in HTML documents found in the wild. -Browsers return only the first match, and this function does -the same.

-
-
-
-
- -
- -
- - -
-

iterlinks(self) -

-
source code  -
- -

Yield (element, attribute, link, pos), where attribute may be None -(indicating the link is in the text). pos is the position -where the link occurs; often 0, but sometimes something else in -the case of links in stylesheets or style tags.

-

Note: <base href> is not taken into account in any way. The -link you get is exactly the link in the document.

-

Note: multiple links inside of a single text string or -attribute value are returned in reversed order. This makes it -possible to replace or delete them from the text string value -based on their reported text positions. Otherwise, a -modification at one text position can change the positions of -links reported later on.

-
-
-
-
- -
- -
- - -
-

make_links_absolute(self, - base_url=None, - resolve_base_href=True, - handle_failures=None) -

-
source code  -
- -

Make all links in the document absolute, given the -base_url for the document (the full URL where the document -came from), or if no base_url is given, then the .base_url -of the document.

-

If resolve_base_href is true, then any <base href> -tags in the document are used and removed from the document. -If it is false then any such tag is ignored.

-

If handle_failures is None (default), a failure to process -a URL will abort the processing. If set to 'ignore', errors -are ignored. If set to 'discard', failing URLs will be removed.

-
-
-
-
- -
- -
- - -
-

resolve_base_href(self, - handle_failures=None) -

-
source code  -
- -

Find any <base href> tag in the document, and apply its -values to all links found in the document. Also remove the -tag once it has been applied.

-

If handle_failures is None (default), a failure to process -a URL will abort the processing. If set to 'ignore', errors -are ignored. If set to 'discard', failing URLs will be removed.

-
-
-
-
- -
- -
- - -
-

rewrite_links(self, - link_repl_func, - resolve_base_href=True, - base_href=None) -

-
source code  -
- -

Rewrite all the links in the document. For each link -link_repl_func(link) will be called, and the return value -will replace the old link.

-

Note that links may not be absolute (unless you first called -make_links_absolute()), and may be internal (e.g., -'#anchor'). They can also be values like -'mailto:email' or 'javascript:expr'.

-

If you give base_href then all links passed to -link_repl_func() will take that into account.

-

If the link_repl_func returns None, the attribute or -tag text will be removed completely.

-
-
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

base_url

-

Returns the base URL, given when the page was parsed.

-

Use with urlparse.urljoin(el.base_url, href) to get -absolute URLs.

-
-
Get Method:
-
unreachable.base_url(self) - - Returns the base URL, given when the page was parsed. -
-
-
-
- -
- -
-

body

- Return the <body> element. Can be called from a child element -to get the document's head. -
-
Get Method:
-
unreachable.body(self) - - Return the <body> element. Can be called from a child element -to get the document's head. -
-
-
-
- -
- -
-

classes

- A set-like wrapper around the 'class' attribute. -
-
Get Method:
-
unreachable.classes(self) - - A set-like wrapper around the 'class' attribute. -
-
Set Method:
-
unreachable.classes(self, - classes) -
-
-
-
- -
- -
-

forms

- Return a list of all the forms -
-
Get Method:
-
unreachable.forms(self) - - Return a list of all the forms -
-
-
-
- -
- -
-

head

- Returns the <head> element. Can be called from a child -element to get the document's head. -
-
Get Method:
-
unreachable.head(self) - - Returns the <head> element. Can be called from a child -element to get the document's head. -
-
-
-
- -
- -
-

label

- Get or set any <label> element associated with this element. -
-
Get Method:
-
unreachable.label(self) - - Get or set any <label> element associated with this element. -
-
Set Method:
-
unreachable.label(self, - label) -
-
Delete Method:
-
unreachable.label(self) -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.HtmlProcessingInstruction-class.html b/doc/html/api/lxml.html.HtmlProcessingInstruction-class.html deleted file mode 100644 index 8af9dc8e..00000000 --- a/doc/html/api/lxml.html.HtmlProcessingInstruction-class.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - lxml.html.HtmlProcessingInstruction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - HtmlProcessingInstruction :: - Class HtmlProcessingInstruction - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HtmlProcessingInstruction

source code

-
-          object --+                
-                   |                
-      etree._Element --+            
-                       |            
- ??.__ContentOnlyElement --+        
-                           |        
-etree._ProcessingInstruction --+    
-                               |    
-                    etree.PIBase --+
-                                   |
-                      object --+   |
-                               |   |
-                       HtmlMixin --+
-                                   |
-                                  HtmlProcessingInstruction
-
- -
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from etree.PIBase: - __init__, - __new__ -

-

Inherited from etree._ProcessingInstruction: - __repr__, - get -

-

Inherited from unreachable.__ContentOnlyElement: - __delitem__, - __getitem__, - __len__, - __setitem__, - append, - insert, - items, - keys, - set, - values -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __iter__, - __nonzero__, - __reversed__, - addnext, - addprevious, - clear, - cssselect, - extend, - find, - findall, - findtext, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - makeelement, - remove, - replace, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from HtmlMixin: - drop_tag, - drop_tree, - find_class, - find_rel_links, - get_element_by_id, - iterlinks, - make_links_absolute, - resolve_base_href, - rewrite_links, - text_content -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree._ProcessingInstruction: - attrib, - tag, - target -

-

Inherited from unreachable.__ContentOnlyElement: - text -

-

Inherited from etree._Element: - base, - nsmap, - prefix, - sourceline, - tail -

-

Inherited from HtmlMixin: - base_url, - body, - classes, - forms, - head, - label -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.InputElement-class.html b/doc/html/api/lxml.html.InputElement-class.html deleted file mode 100644 index 33b21e11..00000000 --- a/doc/html/api/lxml.html.InputElement-class.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - lxml.html.InputElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - InputElement :: - Class InputElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class InputElement

source code

-
-            object --+    
-                     |    
-            InputMixin --+
-                         |
-    object --+           |
-             |           |
-etree._Element --+       |
-                 |       |
- etree.ElementBase --+   |
-                     |   |
-        object --+   |   |
-                 |   |   |
-         HtmlMixin --+   |
-                     |   |
-           HtmlElement --+
-                         |
-                        InputElement
-
- -
-

Represents an <input> element.

-

You can get the type with .type (which is lower-cased and -defaults to 'text').

-

Also you can get and set the value with .value

-

Checkboxes and radios have the attribute input.checkable == -True (for all others it is false) and a boolean attribute -.checked.

- - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from InputMixin: - __repr__ -

-

Inherited from HtmlElement: - cssselect, - set -

-

Inherited from etree.ElementBase: - __init__, - __new__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from HtmlMixin: - drop_tag, - drop_tree, - find_class, - find_rel_links, - get_element_by_id, - iterlinks, - make_links_absolute, - resolve_base_href, - rewrite_links, - text_content -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - checkable
- Boolean: can this element be checked? -
-   - - checked
- Boolean attribute to get/set the presence of the checked -attribute. -
-   - - type
- Return the type of this element (using the type attribute). -
-   - - value
- Get/set the value of this element, using the value attribute. -
-

Inherited from InputMixin: - name -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from HtmlMixin: - base_url, - body, - classes, - forms, - head, - label -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

checkable

- Boolean: can this element be checked? -
-
Get Method:
-
unreachable.checkable(self) - - Boolean: can this element be checked? -
-
-
-
- -
- -
-

checked

-

Boolean attribute to get/set the presence of the checked -attribute.

-

You can only use this on checkable input types.

-
-
Get Method:
-
unreachable.checked(self) - - Boolean attribute to get/set the presence of the checked -attribute. -
-
Set Method:
-
unreachable.checked(self, - value) -
-
-
-
- -
- -
-

type

- Return the type of this element (using the type attribute). -
-
Get Method:
-
unreachable.type(self) - - Return the type of this element (using the type attribute). -
-
Set Method:
-
unreachable.type(self, - value) -
-
-
-
- -
- -
-

value

-

Get/set the value of this element, using the value attribute.

-

Also, if this is a checkbox and it has no value, this defaults -to 'on'. If it is a checkbox or radio that is not -checked, this returns None.

-
-
Get Method:
-
unreachable.value(self) - - Get/set the value of this element, using the value attribute. -
-
Set Method:
-
unreachable.value(self, - value) -
-
Delete Method:
-
unreachable.value(self) -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.InputGetter-class.html b/doc/html/api/lxml.html.InputGetter-class.html deleted file mode 100644 index c1a0731c..00000000 --- a/doc/html/api/lxml.html.InputGetter-class.html +++ /dev/null @@ -1,454 +0,0 @@ - - - - - lxml.html.InputGetter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - InputGetter :: - Class InputGetter - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class InputGetter

source code

-
-object --+
-         |
-        InputGetter
-
- -
-

An accessor that represents all the input fields in a form.

-

You can get fields by name from this, with -form.inputs['field_name']. If there are a set of checkboxes -with the same name, they are returned as a list (a CheckboxGroup -which also allows value setting). Radio inputs are handled -similarly.

-

You can also iterate over this to get all input elements. This -won't return the same thing as if you get all the names, as -checkboxes and radio elements are returned individually.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__contains__(self, - name) - source code - -
- -
-   - - - - - - -
__getitem__(self, - name) - source code - -
- -
-   - - - - - - -
__init__(self, - form)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__iter__(self) - source code - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-   - - - - - - -
keys(self) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - _all_xpath = .//*[local-name() = 'select' or local-name() = 'i... -
-   - - _name_xpath = .//*[@name = $name and (local-name(.) = 'select'... -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - form) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

_all_xpath

- -
-
-
-
Value:
-
-.//*[local-name() = 'select' or local-name() = 'input' or local-name()\
- = 'textarea']
-
-
-
-
-
- -
- -
-

_name_xpath

- -
-
-
-
Value:
-
-.//*[@name = $name and (local-name(.) = 'select' or local-name(.) = 'i\
-nput' or local-name(.) = 'textarea')]
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.InputMixin-class.html b/doc/html/api/lxml.html.InputMixin-class.html deleted file mode 100644 index 1e8336a8..00000000 --- a/doc/html/api/lxml.html.InputMixin-class.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - lxml.html.InputMixin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - InputMixin :: - Class InputMixin - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class InputMixin

source code

-
-object --+
-         |
-        InputMixin
-
- -
Known Subclasses:
-
- -
- -
-Mix-in for all input elements (input, select, and textarea) - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - name
- Get/set the name of the element -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

name

- Get/set the name of the element -
-
Get Method:
-
unreachable.name(self) - - Get/set the name of the element -
-
Set Method:
-
unreachable.name(self, - value) -
-
Delete Method:
-
unreachable.name(self) -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.LabelElement-class.html b/doc/html/api/lxml.html.LabelElement-class.html deleted file mode 100644 index 929c04fc..00000000 --- a/doc/html/api/lxml.html.LabelElement-class.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - lxml.html.LabelElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - LabelElement :: - Class LabelElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LabelElement

source code

-
-    object --+            
-             |            
-etree._Element --+        
-                 |        
- etree.ElementBase --+    
-                     |    
-        object --+   |    
-                 |   |    
-         HtmlMixin --+    
-                     |    
-           HtmlElement --+
-                         |
-                        LabelElement
-
- -
-

Represents a <label> element.

-

Label elements are linked to other elements with their for -attribute. You can access this element with label.for_element.

- - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from HtmlElement: - cssselect, - set -

-

Inherited from etree.ElementBase: - __init__, - __new__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __repr__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from HtmlMixin: - drop_tag, - drop_tree, - find_class, - find_rel_links, - get_element_by_id, - iterlinks, - make_links_absolute, - resolve_base_href, - rewrite_links, - text_content -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - for_element
- Get/set the element this label points to. Return None if it -can't be found. -
-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from HtmlMixin: - base_url, - body, - classes, - forms, - head, - label -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

for_element

- Get/set the element this label points to. Return None if it -can't be found. -
-
Get Method:
-
unreachable.for_element(self) - - Get/set the element this label points to. Return None if it -can't be found. -
-
Set Method:
-
unreachable.for_element(self, - other) -
-
Delete Method:
-
unreachable.for_element(self) -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.MultipleSelectOptions-class.html b/doc/html/api/lxml.html.MultipleSelectOptions-class.html deleted file mode 100644 index dcb4ba20..00000000 --- a/doc/html/api/lxml.html.MultipleSelectOptions-class.html +++ /dev/null @@ -1,606 +0,0 @@ - - - - - lxml.html.MultipleSelectOptions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - MultipleSelectOptions :: - Class MultipleSelectOptions - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class MultipleSelectOptions

source code

-
-       object --+                
-                |                
-    _abcoll.Sized --+            
-                    |            
-       object --+   |            
-                |   |            
- _abcoll.Iterable --+            
-                    |            
-       object --+   |            
-                |   |            
-_abcoll.Container --+            
-                    |            
-          _abcoll.Set --+        
-                        |        
-       _abcoll.MutableSet --+    
-                            |    
-           _setmixin.SetMixin --+
-                                |
-                               MultipleSelectOptions
-
- -
-

Represents all the selected options in a <select multiple> element.

-

You can add to this set-like option to select an option, or remove -to unselect the option.

- - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from _abcoll.Sized: - __metaclass__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - select)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__iter__(self) - source code - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-   - - - - - - -
add(self, - item)
- Add an element.
- source code - -
- -
-   - - - - - - -
remove(self, - item)
- Remove an element. If not a member, raise a KeyError.
- source code - -
- -
-

Inherited from _setmixin.SetMixin: - __contains__, - __len__, - copy, - difference, - difference_update, - discard, - intersection, - intersection_update, - issubset, - issuperset, - symmetric_difference, - symmetric_difference_update, - union, - update -

-

Inherited from _abcoll.MutableSet: - __iand__, - __ior__, - __isub__, - __ixor__, - clear, - pop -

-

Inherited from _abcoll.Set: - __and__, - __eq__, - __ge__, - __gt__, - __le__, - __lt__, - __ne__, - __or__, - __rand__, - __ror__, - __rsub__, - __rxor__, - __sub__, - __xor__, - isdisjoint -

-

Inherited from _abcoll.Set (private): - _hash -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from _setmixin.SetMixin (private): - _from_iterable -

-

Inherited from _abcoll.Sized: - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __abstractmethods__ = frozenset([]) -
-

Inherited from _setmixin.SetMixin (private): - _abc_negative_cache, - _abc_negative_cache_version, - _abc_registry -

-

Inherited from _abcoll.Set: - __hash__ -

-

Inherited from _abcoll.Sized (private): - _abc_cache -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - options
- Iterator of all the <option> elements. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - select) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__iter__(self) -

-
source code  -
- - -
-
Overrides: - _abcoll.Iterable.__iter__ -
-
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

add(self, - item) -

-
source code  -
- - Add an element. -
-
Overrides: - _abcoll.MutableSet.add -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

remove(self, - item) -

-
source code  -
- - Remove an element. If not a member, raise a KeyError. -
-
Overrides: - _abcoll.MutableSet.remove -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

options

- Iterator of all the <option> elements. -
-
Get Method:
-
unreachable.options(self) - - Iterator of all the <option> elements. -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.RadioGroup-class.html b/doc/html/api/lxml.html.RadioGroup-class.html deleted file mode 100644 index 573761a2..00000000 --- a/doc/html/api/lxml.html.RadioGroup-class.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - lxml.html.RadioGroup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - RadioGroup :: - Class RadioGroup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class RadioGroup

source code

-
-object --+    
-         |    
-      list --+
-             |
-            RadioGroup
-
- -
-

This object represents several <input type=radio> elements -that have the same name.

-

You can use this like a list, but also use the property -.value to check/uncheck inputs. Also you can use -.value_options to get the possible values.

- - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-

Inherited from list: - __add__, - __contains__, - __delitem__, - __delslice__, - __eq__, - __ge__, - __getattribute__, - __getitem__, - __getslice__, - __gt__, - __iadd__, - __imul__, - __init__, - __iter__, - __le__, - __len__, - __lt__, - __mul__, - __ne__, - __new__, - __reversed__, - __rmul__, - __setitem__, - __setslice__, - __sizeof__, - append, - count, - extend, - index, - insert, - pop, - remove, - reverse, - sort -

-

Inherited from object: - __delattr__, - __format__, - __reduce__, - __reduce_ex__, - __setattr__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from list: - __hash__ -

-
- - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - value
- Get/set the value, which checks the radio with that value (and -unchecks any other value). -
-   - - value_options
- Returns a list of all the possible values. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

value

- Get/set the value, which checks the radio with that value (and -unchecks any other value). -
-
Get Method:
-
unreachable.value(self) - - Get/set the value, which checks the radio with that value (and -unchecks any other value). -
-
Set Method:
-
unreachable.value(self, - value) -
-
Delete Method:
-
unreachable.value(self) -
-
-
-
- -
- -
-

value_options

- Returns a list of all the possible values. -
-
Get Method:
-
unreachable.value_options(self) - - Returns a list of all the possible values. -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.SelectElement-class.html b/doc/html/api/lxml.html.SelectElement-class.html deleted file mode 100644 index 7a19f01d..00000000 --- a/doc/html/api/lxml.html.SelectElement-class.html +++ /dev/null @@ -1,399 +0,0 @@ - - - - - lxml.html.SelectElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - SelectElement :: - Class SelectElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SelectElement

source code

-
-            object --+    
-                     |    
-            InputMixin --+
-                         |
-    object --+           |
-             |           |
-etree._Element --+       |
-                 |       |
- etree.ElementBase --+   |
-                     |   |
-        object --+   |   |
-                 |   |   |
-         HtmlMixin --+   |
-                     |   |
-           HtmlElement --+
-                         |
-                        SelectElement
-
- -
-

<select> element. You can get the name with .name.

-

.value will be the value of the selected option, unless this -is a multi-select element (<select multiple>), in which case -it will be a set-like object. In either case .value_options -gives the possible values.

-

The boolean attribute .multiple shows if this is a -multi-select.

- - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from InputMixin: - __repr__ -

-

Inherited from HtmlElement: - cssselect, - set -

-

Inherited from etree.ElementBase: - __init__, - __new__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from HtmlMixin: - drop_tag, - drop_tree, - find_class, - find_rel_links, - get_element_by_id, - iterlinks, - make_links_absolute, - resolve_base_href, - rewrite_links, - text_content -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - multiple
- Boolean attribute: is there a multiple attribute on this element. -
-   - - value
- Get/set the value of this select (the selected option). -
-   - - value_options
- All the possible values this select can have (the value -attribute of all the <option> elements. -
-

Inherited from InputMixin: - name -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from HtmlMixin: - base_url, - body, - classes, - forms, - head, - label -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

multiple

- Boolean attribute: is there a multiple attribute on this element. -
-
Get Method:
-
unreachable.multiple(self) - - Boolean attribute: is there a multiple attribute on this element. -
-
Set Method:
-
unreachable.multiple(self, - value) -
-
-
-
- -
- -
-

value

-

Get/set the value of this select (the selected option).

-

If this is a multi-select, this is a set-like object that -represents all the selected options.

-
-
Get Method:
-
unreachable.value(self) - - Get/set the value of this select (the selected option). -
-
Set Method:
-
unreachable.value(self, - value) -
-
Delete Method:
-
unreachable.value(self) -
-
-
-
- -
- -
-

value_options

- All the possible values this select can have (the value -attribute of all the <option> elements. -
-
Get Method:
-
unreachable.value_options(self) - - All the possible values this select can have (the value -attribute of all the <option> elements. -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.TextareaElement-class.html b/doc/html/api/lxml.html.TextareaElement-class.html deleted file mode 100644 index 74b171eb..00000000 --- a/doc/html/api/lxml.html.TextareaElement-class.html +++ /dev/null @@ -1,339 +0,0 @@ - - - - - lxml.html.TextareaElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - TextareaElement :: - Class TextareaElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class TextareaElement

source code

-
-            object --+    
-                     |    
-            InputMixin --+
-                         |
-    object --+           |
-             |           |
-etree._Element --+       |
-                 |       |
- etree.ElementBase --+   |
-                     |   |
-        object --+   |   |
-                 |   |   |
-         HtmlMixin --+   |
-                     |   |
-           HtmlElement --+
-                         |
-                        TextareaElement
-
- -
-<textarea> element. You can get the name with .name and -get/set the value with .value - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from InputMixin: - __repr__ -

-

Inherited from HtmlElement: - cssselect, - set -

-

Inherited from etree.ElementBase: - __init__, - __new__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from HtmlMixin: - drop_tag, - drop_tree, - find_class, - find_rel_links, - get_element_by_id, - iterlinks, - make_links_absolute, - resolve_base_href, - rewrite_links, - text_content -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - value
- Get/set the value (which is the contents of this element) -
-

Inherited from InputMixin: - name -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from HtmlMixin: - base_url, - body, - classes, - forms, - head, - label -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

value

- Get/set the value (which is the contents of this element) -
-
Get Method:
-
unreachable.value(self) - - Get/set the value (which is the contents of this element) -
-
Set Method:
-
unreachable.value(self, - value) -
-
Delete Method:
-
unreachable.value(self) -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.XHTMLParser-class.html b/doc/html/api/lxml.html.XHTMLParser-class.html deleted file mode 100644 index 0a100530..00000000 --- a/doc/html/api/lxml.html.XHTMLParser-class.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - lxml.html.XHTMLParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - XHTMLParser :: - Class XHTMLParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XHTMLParser

source code

-
-    object --+            
-             |            
-??._BaseParser --+        
-                 |        
- etree._FeedParser --+    
-                     |    
-       etree.XMLParser --+
-                         |
-                        XHTMLParser
-
- -
-

An XML parser that is configured to return lxml.html Element -objects.

-

Note that this parser is not really XHTML aware unless you let it -load a DTD that declares the HTML entities. To do this, make sure -you have the XHTML DTDs installed in your catalogs, and create the -parser like this:

-
->>> parser = XHTMLParser(load_dtd=True)
-
-

If you additionally want to validate the document, use this:

-
->>> parser = XHTMLParser(dtd_validation=True)
-
-

For catalog support, see http://www.xmlsoft.org/catalog.html.

- - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - **kwargs)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-

Inherited from etree.XMLParser: - __new__ -

-

Inherited from etree._FeedParser: - close, - feed -

-

Inherited from unreachable._BaseParser: - copy, - makeelement, - setElementClassLookup, - set_element_class_lookup -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree._FeedParser: - feed_error_log -

-

Inherited from unreachable._BaseParser: - error_log, - resolvers, - target, - version -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - **kwargs) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html._MethodFunc-class.html b/doc/html/api/lxml.html._MethodFunc-class.html deleted file mode 100644 index 3535a3e0..00000000 --- a/doc/html/api/lxml.html._MethodFunc-class.html +++ /dev/null @@ -1,276 +0,0 @@ - - - - - lxml.html._MethodFunc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - lxml :: - html :: - _MethodFunc :: - Class _MethodFunc - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _MethodFunc

source code

-
-object --+
-         |
-        _MethodFunc
-
- -
-An object that represents a method on an element as a function; -the function takes either an element or an HTML string. It -returns whatever the function normally returns, or if the function -works in-place (and so returns None) it returns a serialized form -of the resulting document. - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - doc, - *args, - **kw) - source code - -
- -
-   - - - - - - -
__init__(self, - name, - copy=False, - source_class=<class 'lxml.html.HtmlMixin'>)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - name, - copy=False, - source_class=<class 'lxml.html.HtmlMixin'>) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.builder-module.html b/doc/html/api/lxml.html.builder-module.html deleted file mode 100644 index e1bb9b0d..00000000 --- a/doc/html/api/lxml.html.builder-module.html +++ /dev/null @@ -1,858 +0,0 @@ - - - - - lxml.html.builder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module builder - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module builder

source code

-

A set of HTML generator tags for building HTML documents.

-

Usage:

-
->>> from lxml.html.builder import *
->>> html = HTML(
-...            HEAD( TITLE("Hello World") ),
-...            BODY( CLASS("main"),
-...                  H1("Hello World !")
-...            )
-...        )
-
->>> import lxml.etree
->>> print lxml.etree.tostring(html, pretty_print=True)
-<html>
-  <head>
-    <title>Hello World</title>
-  </head>
-  <body class="main">
-    <h1>Hello World !</h1>
-  </body>
-</html>
-
- - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
CLASS(v) - source code - -
- -
-   - - - - - - -
FOR(v) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - E = <lxml.builder.ElementMaker object> -
-   - - A = <functools.partial object> -
-   - - ABBR = <functools.partial object> -
-   - - ACRONYM = <functools.partial object> -
-   - - ADDRESS = <functools.partial object> -
-   - - APPLET = <functools.partial object> -
-   - - AREA = <functools.partial object> -
-   - - B = <functools.partial object> -
-   - - BASE = <functools.partial object> -
-   - - BASEFONT = <functools.partial object> -
-   - - BDO = <functools.partial object> -
-   - - BIG = <functools.partial object> -
-   - - BLOCKQUOTE = <functools.partial object> -
-   - - BODY = <functools.partial object> -
-   - - BR = <functools.partial object> -
-   - - BUTTON = <functools.partial object> -
-   - - CAPTION = <functools.partial object> -
-   - - CENTER = <functools.partial object> -
-   - - CITE = <functools.partial object> -
-   - - CODE = <functools.partial object> -
-   - - COL = <functools.partial object> -
-   - - COLGROUP = <functools.partial object> -
-   - - DD = <functools.partial object> -
-   - - DEL = <functools.partial object> -
-   - - DFN = <functools.partial object> -
-   - - DIR = <functools.partial object> -
-   - - DIV = <functools.partial object> -
-   - - DL = <functools.partial object> -
-   - - DT = <functools.partial object> -
-   - - EM = <functools.partial object> -
-   - - FIELDSET = <functools.partial object> -
-   - - FONT = <functools.partial object> -
-   - - FORM = <functools.partial object> -
-   - - FRAME = <functools.partial object> -
-   - - FRAMESET = <functools.partial object> -
-   - - H1 = <functools.partial object> -
-   - - H2 = <functools.partial object> -
-   - - H3 = <functools.partial object> -
-   - - H4 = <functools.partial object> -
-   - - H5 = <functools.partial object> -
-   - - H6 = <functools.partial object> -
-   - - HEAD = <functools.partial object> -
-   - - HR = <functools.partial object> -
-   - - HTML = <functools.partial object> -
-   - - I = <functools.partial object> -
-   - - IFRAME = <functools.partial object> -
-   - - IMG = <functools.partial object> -
-   - - INPUT = <functools.partial object> -
-   - - INS = <functools.partial object> -
-   - - ISINDEX = <functools.partial object> -
-   - - KBD = <functools.partial object> -
-   - - LABEL = <functools.partial object> -
-   - - LEGEND = <functools.partial object> -
-   - - LI = <functools.partial object> -
-   - - LINK = <functools.partial object> -
-   - - MAP = <functools.partial object> -
-   - - MENU = <functools.partial object> -
-   - - META = <functools.partial object> -
-   - - NOFRAMES = <functools.partial object> -
-   - - NOSCRIPT = <functools.partial object> -
-   - - OBJECT = <functools.partial object> -
-   - - OL = <functools.partial object> -
-   - - OPTGROUP = <functools.partial object> -
-   - - OPTION = <functools.partial object> -
-   - - P = <functools.partial object> -
-   - - PARAM = <functools.partial object> -
-   - - PRE = <functools.partial object> -
-   - - Q = <functools.partial object> -
-   - - S = <functools.partial object> -
-   - - SAMP = <functools.partial object> -
-   - - SCRIPT = <functools.partial object> -
-   - - SELECT = <functools.partial object> -
-   - - SMALL = <functools.partial object> -
-   - - SPAN = <functools.partial object> -
-   - - STRIKE = <functools.partial object> -
-   - - STRONG = <functools.partial object> -
-   - - STYLE = <functools.partial object> -
-   - - SUB = <functools.partial object> -
-   - - SUP = <functools.partial object> -
-   - - TABLE = <functools.partial object> -
-   - - TBODY = <functools.partial object> -
-   - - TD = <functools.partial object> -
-   - - TEXTAREA = <functools.partial object> -
-   - - TFOOT = <functools.partial object> -
-   - - TH = <functools.partial object> -
-   - - THEAD = <functools.partial object> -
-   - - TITLE = <functools.partial object> -
-   - - TR = <functools.partial object> -
-   - - TT = <functools.partial object> -
-   - - U = <functools.partial object> -
-   - - UL = <functools.partial object> -
-   - - VAR = <functools.partial object> -
-   - - __package__ = 'lxml.html' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.builder-pysrc.html b/doc/html/api/lxml.html.builder-pysrc.html deleted file mode 100644 index 88ddfc85..00000000 --- a/doc/html/api/lxml.html.builder-pysrc.html +++ /dev/null @@ -1,458 +0,0 @@ - - - - - lxml.html.builder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module builder - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.html.builder

-
-  1  # -------------------------------------------------------------------- 
-  2  # The ElementTree toolkit is 
-  3  # Copyright (c) 1999-2004 by Fredrik Lundh 
-  4  # -------------------------------------------------------------------- 
-  5   
-  6  """ 
-  7  A set of HTML generator tags for building HTML documents. 
-  8   
-  9  Usage:: 
- 10   
- 11      >>> from lxml.html.builder import * 
- 12      >>> html = HTML( 
- 13      ...            HEAD( TITLE("Hello World") ), 
- 14      ...            BODY( CLASS("main"), 
- 15      ...                  H1("Hello World !") 
- 16      ...            ) 
- 17      ...        ) 
- 18   
- 19      >>> import lxml.etree 
- 20      >>> print lxml.etree.tostring(html, pretty_print=True) 
- 21      <html> 
- 22        <head> 
- 23          <title>Hello World</title> 
- 24        </head> 
- 25        <body class="main"> 
- 26          <h1>Hello World !</h1> 
- 27        </body> 
- 28      </html> 
- 29   
- 30  """ 
- 31   
- 32  from lxml.builder import ElementMaker 
- 33  from lxml.html import html_parser 
- 34   
- 35  E = ElementMaker(makeelement=html_parser.makeelement) 
- 36   
- 37  # elements 
- 38  A = E.a # anchor 
- 39  ABBR = E.abbr # abbreviated form (e.g., WWW, HTTP, etc.) 
- 40  ACRONYM = E.acronym #  
- 41  ADDRESS = E.address # information on author 
- 42  APPLET = E.applet # Java applet (DEPRECATED) 
- 43  AREA = E.area # client-side image map area 
- 44  B = E.b # bold text style 
- 45  BASE = E.base # document base URI 
- 46  BASEFONT = E.basefont # base font size (DEPRECATED) 
- 47  BDO = E.bdo # I18N BiDi over-ride 
- 48  BIG = E.big # large text style 
- 49  BLOCKQUOTE = E.blockquote # long quotation 
- 50  BODY = E.body # document body 
- 51  BR = E.br # forced line break 
- 52  BUTTON = E.button # push button 
- 53  CAPTION = E.caption # table caption 
- 54  CENTER = E.center # shorthand for DIV align=center (DEPRECATED) 
- 55  CITE = E.cite # citation 
- 56  CODE = E.code # computer code fragment 
- 57  COL = E.col # table column 
- 58  COLGROUP = E.colgroup # table column group 
- 59  DD = E.dd # definition description 
- 60  DEL = getattr(E, 'del') # deleted text 
- 61  DFN = E.dfn # instance definition 
- 62  DIR = E.dir # directory list (DEPRECATED) 
- 63  DIV = E.div # generic language/style container 
- 64  DL = E.dl # definition list 
- 65  DT = E.dt # definition term 
- 66  EM = E.em # emphasis 
- 67  FIELDSET = E.fieldset # form control group 
- 68  FONT = E.font # local change to font (DEPRECATED) 
- 69  FORM = E.form # interactive form 
- 70  FRAME = E.frame # subwindow 
- 71  FRAMESET = E.frameset # window subdivision 
- 72  H1 = E.h1 # heading 
- 73  H2 = E.h2 # heading 
- 74  H3 = E.h3 # heading 
- 75  H4 = E.h4 # heading 
- 76  H5 = E.h5 # heading 
- 77  H6 = E.h6 # heading 
- 78  HEAD = E.head # document head 
- 79  HR = E.hr # horizontal rule 
- 80  HTML = E.html # document root element 
- 81  I = E.i # italic text style 
- 82  IFRAME = E.iframe # inline subwindow 
- 83  IMG = E.img # Embedded image 
- 84  INPUT = E.input # form control 
- 85  INS = E.ins # inserted text 
- 86  ISINDEX = E.isindex # single line prompt (DEPRECATED) 
- 87  KBD = E.kbd # text to be entered by the user 
- 88  LABEL = E.label # form field label text 
- 89  LEGEND = E.legend # fieldset legend 
- 90  LI = E.li # list item 
- 91  LINK = E.link # a media-independent link 
- 92  MAP = E.map # client-side image map 
- 93  MENU = E.menu # menu list (DEPRECATED) 
- 94  META = E.meta # generic metainformation 
- 95  NOFRAMES = E.noframes # alternate content container for non frame-based rendering 
- 96  NOSCRIPT = E.noscript # alternate content container for non script-based rendering 
- 97  OBJECT = E.object # generic embedded object 
- 98  OL = E.ol # ordered list 
- 99  OPTGROUP = E.optgroup # option group 
-100  OPTION = E.option # selectable choice 
-101  P = E.p # paragraph 
-102  PARAM = E.param # named property value 
-103  PRE = E.pre # preformatted text 
-104  Q = E.q # short inline quotation 
-105  S = E.s # strike-through text style (DEPRECATED) 
-106  SAMP = E.samp # sample program output, scripts, etc. 
-107  SCRIPT = E.script # script statements 
-108  SELECT = E.select # option selector 
-109  SMALL = E.small # small text style 
-110  SPAN = E.span # generic language/style container 
-111  STRIKE = E.strike # strike-through text (DEPRECATED) 
-112  STRONG = E.strong # strong emphasis 
-113  STYLE = E.style # style info 
-114  SUB = E.sub # subscript 
-115  SUP = E.sup # superscript 
-116  TABLE = E.table #  
-117  TBODY = E.tbody # table body 
-118  TD = E.td # table data cell 
-119  TEXTAREA = E.textarea # multi-line text field 
-120  TFOOT = E.tfoot # table footer 
-121  TH = E.th # table header cell 
-122  THEAD = E.thead # table header 
-123  TITLE = E.title # document title 
-124  TR = E.tr # table row 
-125  TT = E.tt # teletype or monospaced text style 
-126  U = E.u # underlined text style (DEPRECATED) 
-127  UL = E.ul # unordered list 
-128  VAR = E.var # instance of a variable or program argument 
-129   
-130  # attributes (only reserved words are included here) 
-131  ATTR = dict 
-
132 -def CLASS(v): return {'class': v} -
133 -def FOR(v): return {'for': v} -
134 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.clean-module.html b/doc/html/api/lxml.html.clean-module.html deleted file mode 100644 index 540aa015..00000000 --- a/doc/html/api/lxml.html.clean-module.html +++ /dev/null @@ -1,778 +0,0 @@ - - - - - lxml.html.clean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module clean - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module clean

source code

-

A cleanup tool for HTML.

-

Removes unwanted tags and content. See the Cleaner class for -details.

- - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - unicode
- str(object='') -> string -
-   - - bytes
- str(object='') -> string -
-   - - Cleaner
- Instances cleans the document of each of the possible offending -elements. The cleaning is controlled by attributes; you can -override attributes in a subclass, or set them in the constructor. -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
- character - - - - - - -
unichr(i)
- Return a string of one character with ordinal i; 0 <= i < 256.
- - -
- -
-   - - - - - - -
_is_image_dataurl(...)
- search(string[, pos[, endpos]]) --> match object or None. -Scan through string looking for a match, and return a corresponding -match object instance. Return None if no position in the string matches.
- source code - -
- -
-   - - - - - - -
_is_possibly_malicious_scheme(...)
- search(string[, pos[, endpos]]) --> match object or None. -Scan through string looking for a match, and return a corresponding -match object instance. Return None if no position in the string matches.
- source code - -
- -
-   - - - - - - -
_is_javascript_scheme(s) - source code - -
- -
-   - - - - - - -
_substitute_whitespace(...)
- sub(repl, string[, count = 0]) --> newstring -Return the string obtained by replacing the leftmost non-overlapping -occurrences of pattern in string by the replacement repl.
- source code - -
- -
-   - - - - - - -
clean_html(...) - source code - -
- -
-   - - - - - - -
autolink(el, - link_regexes=_link_regexes, - avoid_elements=_avoid_elements, - avoid_hosts=_avoid_hosts, - avoid_classes=_avoid_classes)
- Turn any URLs into links.
- source code - -
- -
-   - - - - - - -
_link_text(text, - link_regexes, - avoid_hosts, - factory) - source code - -
- -
-   - - - - - - -
autolink_html(html)
- Turn any URLs into links.
- source code - -
- -
-   - - - - - - -
word_break(el, - max_width=40, - avoid_elements=_avoid_word_break_elements, - avoid_classes=_avoid_word_break_classes, - break_character=unichr(0x200b))
- Breaks any long words found in the body of the text (not attributes).
- source code - -
- -
-   - - - - - - -
word_break_html(html) - source code - -
- -
-   - - - - - - -
_break_text(text, - max_width, - break_character) - source code - -
- -
-   - - - - - - -
_insert_break(word, - width, - break_character) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - basestring = str, bytes -
-   - - _css_javascript_re = re.compile(r'(?is)expression\s*\(.*?\)') -
-   - - _css_import_re = re.compile(r'(?i)@\s*import') -
-   - - _conditional_comment_re = re.compile(r'(?is)\[if[\s\n\r]+.*?\]... -
-   - - _find_styled_elements = descendant-or-self::*[@style] -
-   - - _find_external_links = descendant-or-self::a [normalize-space... -
-   - - clean = <lxml.html.clean.Cleaner object> -
-   - - _link_regexes = [re.compile(r'(?i)(?P<body>https?://(?P<host>[... -
-   - - _avoid_elements = ['textarea', 'pre', 'code', 'head', 'select'... -
-   - - _avoid_hosts = [re.compile(r'(?i)^localhost'), re.compile(r'(?... -
-   - - _avoid_classes = ['nolink'] -
-   - - _avoid_word_break_elements = ['pre', 'textarea', 'code'] -
-   - - _avoid_word_break_classes = ['nobreak'] -
-   - - _break_prefer_re = re.compile(r'(?i)[^a-z]') -
-   - - __package__ = 'lxml.html' -
-   - - __test__ = {} -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

autolink(el, - link_regexes=_link_regexes, - avoid_elements=_avoid_elements, - avoid_hosts=_avoid_hosts, - avoid_classes=_avoid_classes) -

-
source code  -
- -

Turn any URLs into links.

-

It will search for links identified by the given regular -expressions (by default mailto and http(s) links).

-

It won't link text in an element in avoid_elements, or an element -with a class in avoid_classes. It won't link to anything with a -host that matches one of the regular expressions in avoid_hosts -(default localhost and 127.0.0.1).

-

If you pass in an element, the element's tail will not be -substituted, only the contents of the element.

-
-
-
-
- -
- -
- - -
-

autolink_html(html) -

-
source code  -
- -

Turn any URLs into links.

-

It will search for links identified by the given regular -expressions (by default mailto and http(s) links).

-

It won't link text in an element in avoid_elements, or an element -with a class in avoid_classes. It won't link to anything with a -host that matches one of the regular expressions in avoid_hosts -(default localhost and 127.0.0.1).

-

If you pass in an element, the element's tail will not be -substituted, only the contents of the element.

-
-
-
-
- -
- -
- - -
-

word_break(el, - max_width=40, - avoid_elements=_avoid_word_break_elements, - avoid_classes=_avoid_word_break_classes, - break_character=unichr(0x200b)) -

-
source code  -
- -

Breaks any long words found in the body of the text (not attributes).

-

Doesn't effect any of the tags in avoid_elements, by default -<textarea> and <pre>

-

Breaks words by inserting &#8203;, which is a unicode character -for Zero Width Space character. This generally takes up no space -in rendering, but does copy as a space, and in monospace contexts -usually takes up space.

-

See http://www.cs.tut.fi/~jkorpela/html/nobr.html for a discussion

-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

_conditional_comment_re

- -
-
-
-
Value:
-
-re.compile(r'(?is)\[if[\s\n\r]+.*?\][\s\n\r]*>')
-
-
-
-
-
- -
- -
-

_find_external_links

- -
-
-
-
Value:
-
-descendant-or-self::a  [normalize-space(@href) and substring(normalize\
--space(@href),1,1) != '#'] |descendant-or-self::x:a[normalize-space(@h\
-ref) and substring(normalize-space(@href),1,1) != '#']
-
-
-
-
-
- -
- -
-

_link_regexes

- -
-
-
-
Value:
-
-[re.compile(r'(?i)(?P<body>https?://(?P<host>[a-z0-9\._-]+)(?:/[/-_\.,\
-a-z0-9%&\?;=~]*)?(?:\([/-_\.,a-z0-9%&\?;=~]*\))?)'),
- re.compile(r'(?i)mailto:(?P<body>[a-z0-9\._-]+@(?P<host>[a-z0-9_\.-]+\
-[a-z]))')]
-
-
-
-
-
- -
- -
-

_avoid_elements

- -
-
-
-
Value:
-
-['textarea', 'pre', 'code', 'head', 'select', 'a']
-
-
-
-
-
- -
- -
-

_avoid_hosts

- -
-
-
-
Value:
-
-[re.compile(r'(?i)^localhost'),
- re.compile(r'(?i)\bexample\.(?:com|org|net)$'),
- re.compile(r'^127\.0\.0\.1$')]
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.clean-pysrc.html b/doc/html/api/lxml.html.clean-pysrc.html deleted file mode 100644 index 3c1351e4..00000000 --- a/doc/html/api/lxml.html.clean-pysrc.html +++ /dev/null @@ -1,1349 +0,0 @@ - - - - - lxml.html.clean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module clean - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.html.clean

-
-  1  """A cleanup tool for HTML. 
-  2   
-  3  Removes unwanted tags and content.  See the `Cleaner` class for 
-  4  details. 
-  5  """ 
-  6   
-  7  import re 
-  8  import copy 
-  9  try: 
- 10      from urlparse import urlsplit 
- 11  except ImportError: 
- 12      # Python 3 
- 13      from urllib.parse import urlsplit 
- 14  from lxml import etree 
- 15  from lxml.html import defs 
- 16  from lxml.html import fromstring, XHTML_NAMESPACE 
- 17  from lxml.html import xhtml_to_html, _transform_result 
- 18   
- 19  try: 
- 20      unichr 
- 21  except NameError: 
- 22      # Python 3 
- 23      unichr = chr 
- 24  try: 
- 25      unicode 
- 26  except NameError: 
- 27      # Python 3 
- 28      unicode = str 
- 29  try: 
- 30      bytes 
- 31  except NameError: 
- 32      # Python < 2.6 
- 33      bytes = str 
- 34  try: 
- 35      basestring 
- 36  except NameError: 
- 37      basestring = (str, bytes) 
- 38   
- 39   
- 40  __all__ = ['clean_html', 'clean', 'Cleaner', 'autolink', 'autolink_html', 
- 41             'word_break', 'word_break_html'] 
- 42   
- 43  # Look at http://code.sixapart.com/trac/livejournal/browser/trunk/cgi-bin/cleanhtml.pl 
- 44  #   Particularly the CSS cleaning; most of the tag cleaning is integrated now 
- 45  # I have multiple kinds of schemes searched; but should schemes be 
- 46  #   whitelisted instead? 
- 47  # max height? 
- 48  # remove images?  Also in CSS?  background attribute? 
- 49  # Some way to whitelist object, iframe, etc (e.g., if you want to 
- 50  #   allow *just* embedded YouTube movies) 
- 51  # Log what was deleted and why? 
- 52  # style="behavior: ..." might be bad in IE? 
- 53  # Should we have something for just <meta http-equiv>?  That's the worst of the 
- 54  #   metas. 
- 55  # UTF-7 detections?  Example: 
- 56  #     <HEAD><META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-7"> </HEAD>+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4- 
- 57  #   you don't always have to have the charset set, if the page has no charset 
- 58  #   and there's UTF7-like code in it. 
- 59  # Look at these tests: http://htmlpurifier.org/live/smoketests/xssAttacks.php 
- 60   
- 61   
- 62  # This is an IE-specific construct you can have in a stylesheet to 
- 63  # run some Javascript: 
- 64  _css_javascript_re = re.compile( 
- 65      r'expression\s*\(.*?\)', re.S|re.I) 
- 66   
- 67  # Do I have to worry about @\nimport? 
- 68  _css_import_re = re.compile( 
- 69      r'@\s*import', re.I) 
- 70   
- 71  # All kinds of schemes besides just javascript: that can cause 
- 72  # execution: 
- 73  _is_image_dataurl = re.compile( 
- 74      r'^data:image/.+;base64', re.I).search 
- 75  _is_possibly_malicious_scheme = re.compile( 
- 76      r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):', 
- 77      re.I).search 
-
79 if _is_image_dataurl(s): - 80 return None - 81 return _is_possibly_malicious_scheme(s) -
82 - 83 _substitute_whitespace = re.compile(r'[\s\x00-\x08\x0B\x0C\x0E-\x19]+').sub - 84 # FIXME: should data: be blocked? - 85 - 86 # FIXME: check against: http://msdn2.microsoft.com/en-us/library/ms537512.aspx - 87 _conditional_comment_re = re.compile( - 88 r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S) - 89 - 90 _find_styled_elements = etree.XPath( - 91 "descendant-or-self::*[@style]") - 92 - 93 _find_external_links = etree.XPath( - 94 ("descendant-or-self::a [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |" - 95 "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"), - 96 namespaces={'x':XHTML_NAMESPACE}) - 97 - 98 -
99 -class Cleaner(object): -
100 """ -101 Instances cleans the document of each of the possible offending -102 elements. The cleaning is controlled by attributes; you can -103 override attributes in a subclass, or set them in the constructor. -104 -105 ``scripts``: -106 Removes any ``<script>`` tags. -107 -108 ``javascript``: -109 Removes any Javascript, like an ``onclick`` attribute. Also removes stylesheets -110 as they could contain Javascript. -111 -112 ``comments``: -113 Removes any comments. -114 -115 ``style``: -116 Removes any style tags. -117 -118 ``inline_style`` -119 Removes any style attributes. Defaults to the value of the ``style`` option. -120 -121 ``links``: -122 Removes any ``<link>`` tags -123 -124 ``meta``: -125 Removes any ``<meta>`` tags -126 -127 ``page_structure``: -128 Structural parts of a page: ``<head>``, ``<html>``, ``<title>``. -129 -130 ``processing_instructions``: -131 Removes any processing instructions. -132 -133 ``embedded``: -134 Removes any embedded objects (flash, iframes) -135 -136 ``frames``: -137 Removes any frame-related tags -138 -139 ``forms``: -140 Removes any form tags -141 -142 ``annoying_tags``: -143 Tags that aren't *wrong*, but are annoying. ``<blink>`` and ``<marquee>`` -144 -145 ``remove_tags``: -146 A list of tags to remove. Only the tags will be removed, -147 their content will get pulled up into the parent tag. -148 -149 ``kill_tags``: -150 A list of tags to kill. Killing also removes the tag's content, -151 i.e. the whole subtree, not just the tag itself. -152 -153 ``allow_tags``: -154 A list of tags to include (default include all). -155 -156 ``remove_unknown_tags``: -157 Remove any tags that aren't standard parts of HTML. -158 -159 ``safe_attrs_only``: -160 If true, only include 'safe' attributes (specifically the list -161 from the feedparser HTML sanitisation web site). -162 -163 ``safe_attrs``: -164 A set of attribute names to override the default list of attributes -165 considered 'safe' (when safe_attrs_only=True). -166 -167 ``add_nofollow``: -168 If true, then any <a> tags will have ``rel="nofollow"`` added to them. -169 -170 ``host_whitelist``: -171 A list or set of hosts that you can use for embedded content -172 (for content like ``<object>``, ``<link rel="stylesheet">``, etc). -173 You can also implement/override the method -174 ``allow_embedded_url(el, url)`` or ``allow_element(el)`` to -175 implement more complex rules for what can be embedded. -176 Anything that passes this test will be shown, regardless of -177 the value of (for instance) ``embedded``. -178 -179 Note that this parameter might not work as intended if you do not -180 make the links absolute before doing the cleaning. -181 -182 Note that you may also need to set ``whitelist_tags``. -183 -184 ``whitelist_tags``: -185 A set of tags that can be included with ``host_whitelist``. -186 The default is ``iframe`` and ``embed``; you may wish to -187 include other tags like ``script``, or you may want to -188 implement ``allow_embedded_url`` for more control. Set to None to -189 include all tags. -190 -191 This modifies the document *in place*. -192 """ -193 -194 scripts = True -195 javascript = True -196 comments = True -197 style = False -198 inline_style = None -199 links = True -200 meta = True -201 page_structure = True -202 processing_instructions = True -203 embedded = True -204 frames = True -205 forms = True -206 annoying_tags = True -207 remove_tags = None -208 allow_tags = None -209 kill_tags = None -210 remove_unknown_tags = True -211 safe_attrs_only = True -212 safe_attrs = defs.safe_attrs -213 add_nofollow = False -214 host_whitelist = () -215 whitelist_tags = set(['iframe', 'embed']) -216 -
217 - def __init__(self, **kw): -
218 for name, value in kw.items(): -219 if not hasattr(self, name): -220 raise TypeError( -221 "Unknown parameter: %s=%r" % (name, value)) -222 setattr(self, name, value) -223 if self.inline_style is None and 'inline_style' not in kw: -224 self.inline_style = self.style -
225 -226 # Used to lookup the primary URL for a given tag that is up for -227 # removal: -228 _tag_link_attrs = dict( -229 script='src', -230 link='href', -231 # From: http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html -232 # From what I can tell, both attributes can contain a link: -233 applet=['code', 'object'], -234 iframe='src', -235 embed='src', -236 layer='src', -237 # FIXME: there doesn't really seem like a general way to figure out what -238 # links an <object> tag uses; links often go in <param> tags with values -239 # that we don't really know. You'd have to have knowledge about specific -240 # kinds of plugins (probably keyed off classid), and match against those. -241 ##object=?, -242 # FIXME: not looking at the action currently, because it is more complex -243 # than than -- if you keep the form, you should keep the form controls. -244 ##form='action', -245 a='href', -246 ) -247 -
248 - def __call__(self, doc): -
249 """ -250 Cleans the document. -251 """ -252 if hasattr(doc, 'getroot'): -253 # ElementTree instance, instead of an element -254 doc = doc.getroot() -255 # convert XHTML to HTML -256 xhtml_to_html(doc) -257 # Normalize a case that IE treats <image> like <img>, and that -258 # can confuse either this step or later steps. -259 for el in doc.iter('image'): -260 el.tag = 'img' -261 if not self.comments: -262 # Of course, if we were going to kill comments anyway, we don't -263 # need to worry about this -264 self.kill_conditional_comments(doc) -265 -266 kill_tags = set(self.kill_tags or ()) -267 remove_tags = set(self.remove_tags or ()) -268 allow_tags = set(self.allow_tags or ()) -269 -270 if self.scripts: -271 kill_tags.add('script') -272 if self.safe_attrs_only: -273 safe_attrs = set(self.safe_attrs) -274 for el in doc.iter(etree.Element): -275 attrib = el.attrib -276 for aname in attrib.keys(): -277 if aname not in safe_attrs: -278 del attrib[aname] -279 if self.javascript: -280 if not (self.safe_attrs_only and -281 self.safe_attrs == defs.safe_attrs): -282 # safe_attrs handles events attributes itself -283 for el in doc.iter(etree.Element): -284 attrib = el.attrib -285 for aname in attrib.keys(): -286 if aname.startswith('on'): -287 del attrib[aname] -288 doc.rewrite_links(self._remove_javascript_link, -289 resolve_base_href=False) -290 # If we're deleting style then we don't have to remove JS links -291 # from styles, otherwise... -292 if not self.inline_style: -293 for el in _find_styled_elements(doc): -294 old = el.get('style') -295 new = _css_javascript_re.sub('', old) -296 new = _css_import_re.sub('', new) -297 if self._has_sneaky_javascript(new): -298 # Something tricky is going on... -299 del el.attrib['style'] -300 elif new != old: -301 el.set('style', new) -302 if not self.style: -303 for el in list(doc.iter('style')): -304 if el.get('type', '').lower().strip() == 'text/javascript': -305 el.drop_tree() -306 continue -307 old = el.text or '' -308 new = _css_javascript_re.sub('', old) -309 # The imported CSS can do anything; we just can't allow: -310 new = _css_import_re.sub('', old) -311 if self._has_sneaky_javascript(new): -312 # Something tricky is going on... -313 el.text = '/* deleted */' -314 elif new != old: -315 el.text = new -316 if self.comments or self.processing_instructions: -317 # FIXME: why either? I feel like there's some obscure reason -318 # because you can put PIs in comments...? But I've already -319 # forgotten it -320 kill_tags.add(etree.Comment) -321 if self.processing_instructions: -322 kill_tags.add(etree.ProcessingInstruction) -323 if self.style: -324 kill_tags.add('style') -325 if self.inline_style: -326 etree.strip_attributes(doc, 'style') -327 if self.links: -328 kill_tags.add('link') -329 elif self.style or self.javascript: -330 # We must get rid of included stylesheets if Javascript is not -331 # allowed, as you can put Javascript in them -332 for el in list(doc.iter('link')): -333 if 'stylesheet' in el.get('rel', '').lower(): -334 # Note this kills alternate stylesheets as well -335 if not self.allow_element(el): -336 el.drop_tree() -337 if self.meta: -338 kill_tags.add('meta') -339 if self.page_structure: -340 remove_tags.update(('head', 'html', 'title')) -341 if self.embedded: -342 # FIXME: is <layer> really embedded? -343 # We should get rid of any <param> tags not inside <applet>; -344 # These are not really valid anyway. -345 for el in list(doc.iter('param')): -346 found_parent = False -347 parent = el.getparent() -348 while parent is not None and parent.tag not in ('applet', 'object'): -349 parent = parent.getparent() -350 if parent is None: -351 el.drop_tree() -352 kill_tags.update(('applet',)) -353 # The alternate contents that are in an iframe are a good fallback: -354 remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param')) -355 if self.frames: -356 # FIXME: ideally we should look at the frame links, but -357 # generally frames don't mix properly with an HTML -358 # fragment anyway. -359 kill_tags.update(defs.frame_tags) -360 if self.forms: -361 remove_tags.add('form') -362 kill_tags.update(('button', 'input', 'select', 'textarea')) -363 if self.annoying_tags: -364 remove_tags.update(('blink', 'marquee')) -365 -366 _remove = [] -367 _kill = [] -368 for el in doc.iter(): -369 if el.tag in kill_tags: -370 if self.allow_element(el): -371 continue -372 _kill.append(el) -373 elif el.tag in remove_tags: -374 if self.allow_element(el): -375 continue -376 _remove.append(el) -377 -378 if _remove and _remove[0] == doc: -379 # We have to drop the parent-most tag, which we can't -380 # do. Instead we'll rewrite it: -381 el = _remove.pop(0) -382 el.tag = 'div' -383 el.attrib.clear() -384 elif _kill and _kill[0] == doc: -385 # We have to drop the parent-most element, which we can't -386 # do. Instead we'll clear it: -387 el = _kill.pop(0) -388 if el.tag != 'html': -389 el.tag = 'div' -390 el.clear() -391 -392 _kill.reverse() # start with innermost tags -393 for el in _kill: -394 el.drop_tree() -395 for el in _remove: -396 el.drop_tag() -397 -398 if self.remove_unknown_tags: -399 if allow_tags: -400 raise ValueError( -401 "It does not make sense to pass in both allow_tags and remove_unknown_tags") -402 allow_tags = set(defs.tags) -403 if allow_tags: -404 bad = [] -405 for el in doc.iter(): -406 if el.tag not in allow_tags: -407 bad.append(el) -408 if bad: -409 if bad[0] is doc: -410 el = bad.pop(0) -411 el.tag = 'div' -412 el.attrib.clear() -413 for el in bad: -414 el.drop_tag() -415 if self.add_nofollow: -416 for el in _find_external_links(doc): -417 if not self.allow_follow(el): -418 rel = el.get('rel') -419 if rel: -420 if ('nofollow' in rel -421 and ' nofollow ' in (' %s ' % rel)): -422 continue -423 rel = '%s nofollow' % rel -424 else: -425 rel = 'nofollow' -426 el.set('rel', rel) -
427 -
428 - def allow_follow(self, anchor): -
429 """ -430 Override to suppress rel="nofollow" on some anchors. -431 """ -432 return False -
433 -
434 - def allow_element(self, el): -
435 if el.tag not in self._tag_link_attrs: -436 return False -437 attr = self._tag_link_attrs[el.tag] -438 if isinstance(attr, (list, tuple)): -439 for one_attr in attr: -440 url = el.get(one_attr) -441 if not url: -442 return False -443 if not self.allow_embedded_url(el, url): -444 return False -445 return True -446 else: -447 url = el.get(attr) -448 if not url: -449 return False -450 return self.allow_embedded_url(el, url) -
451 -
452 - def allow_embedded_url(self, el, url): -
453 if (self.whitelist_tags is not None -454 and el.tag not in self.whitelist_tags): -455 return False -456 scheme, netloc, path, query, fragment = urlsplit(url) -457 netloc = netloc.lower().split(':', 1)[0] -458 if scheme not in ('http', 'https'): -459 return False -460 if netloc in self.host_whitelist: -461 return True -462 return False -
463 -
464 - def kill_conditional_comments(self, doc): -
465 """ -466 IE conditional comments basically embed HTML that the parser -467 doesn't normally see. We can't allow anything like that, so -468 we'll kill any comments that could be conditional. -469 """ -470 bad = [] -471 self._kill_elements( -472 doc, lambda el: _conditional_comment_re.search(el.text), -473 etree.Comment) -
474 -
475 - def _kill_elements(self, doc, condition, iterate=None): -
476 bad = [] -477 for el in doc.iter(iterate): -478 if condition(el): -479 bad.append(el) -480 for el in bad: -481 el.drop_tree() -
482 -490 -491 _substitute_comments = re.compile(r'/\*.*?\*/', re.S).sub -492 -
493 - def _has_sneaky_javascript(self, style): -
494 """ -495 Depending on the browser, stuff like ``e x p r e s s i o n(...)`` -496 can get interpreted, or ``expre/* stuff */ssion(...)``. This -497 checks for attempt to do stuff like this. -498 -499 Typically the response will be to kill the entire style; if you -500 have just a bit of Javascript in the style another rule will catch -501 that and remove only the Javascript from the style; this catches -502 more sneaky attempts. -503 """ -504 style = self._substitute_comments('', style) -505 style = style.replace('\\', '') -506 style = _substitute_whitespace('', style) -507 style = style.lower() -508 if 'javascript:' in style: -509 return True -510 if 'expression(' in style: -511 return True -512 return False -
513 -
514 - def clean_html(self, html): -
515 result_type = type(html) -516 if isinstance(html, basestring): -517 doc = fromstring(html) -518 else: -519 doc = copy.deepcopy(html) -520 self(doc) -521 return _transform_result(result_type, doc) -
522 -523 clean = Cleaner() -524 clean_html = clean.clean_html -525 -526 ############################################################ -527 ## Autolinking -528 ############################################################ -529 -530 _link_regexes = [ -531 re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I), -532 # This is conservative, but autolinking can be a bit conservative: -533 re.compile(r'mailto:(?P<body>[a-z0-9._-]+@(?P<host>[a-z0-9_.-]+[a-z]))', re.I), -534 ] -535 -536 _avoid_elements = ['textarea', 'pre', 'code', 'head', 'select', 'a'] -537 -538 _avoid_hosts = [ -539 re.compile(r'^localhost', re.I), -540 re.compile(r'\bexample\.(?:com|org|net)$', re.I), -541 re.compile(r'^127\.0\.0\.1$'), -542 ] -543 -544 _avoid_classes = ['nolink'] -545 -590 -648 -657 -658 autolink_html.__doc__ = autolink.__doc__ -659 -660 ############################################################ -661 ## Word wrapping -662 ############################################################ -663 -664 _avoid_word_break_elements = ['pre', 'textarea', 'code'] -665 _avoid_word_break_classes = ['nobreak'] -666 -
667 -def word_break(el, max_width=40, -668 avoid_elements=_avoid_word_break_elements, -669 avoid_classes=_avoid_word_break_classes, -670 break_character=unichr(0x200b)): -
671 """ -672 Breaks any long words found in the body of the text (not attributes). -673 -674 Doesn't effect any of the tags in avoid_elements, by default -675 ``<textarea>`` and ``<pre>`` -676 -677 Breaks words by inserting &#8203;, which is a unicode character -678 for Zero Width Space character. This generally takes up no space -679 in rendering, but does copy as a space, and in monospace contexts -680 usually takes up space. -681 -682 See http://www.cs.tut.fi/~jkorpela/html/nobr.html for a discussion -683 """ -684 # Character suggestion of &#8203 comes from: -685 # http://www.cs.tut.fi/~jkorpela/html/nobr.html -686 if el.tag in _avoid_word_break_elements: -687 return -688 class_name = el.get('class') -689 if class_name: -690 dont_break = False -691 class_name = class_name.split() -692 for avoid in avoid_classes: -693 if avoid in class_name: -694 dont_break = True -695 break -696 if dont_break: -697 return -698 if el.text: -699 el.text = _break_text(el.text, max_width, break_character) -700 for child in el: -701 word_break(child, max_width=max_width, -702 avoid_elements=avoid_elements, -703 avoid_classes=avoid_classes, -704 break_character=break_character) -705 if child.tail: -706 child.tail = _break_text(child.tail, max_width, break_character) -
707 -
708 -def word_break_html(html, *args, **kw): -
709 result_type = type(html) -710 doc = fromstring(html) -711 word_break(doc, *args, **kw) -712 return _transform_result(result_type, doc) -
713 -
714 -def _break_text(text, max_width, break_character): -
715 words = text.split() -716 for word in words: -717 if len(word) > max_width: -718 replacement = _insert_break(word, max_width, break_character) -719 text = text.replace(word, replacement) -720 return text -
721 -722 _break_prefer_re = re.compile(r'[^a-z]', re.I) -723 -
724 -def _insert_break(word, width, break_character): -
725 orig_word = word -726 result = '' -727 while len(word) > width: -728 start = word[:width] -729 breaks = list(_break_prefer_re.finditer(start)) -730 if breaks: -731 last_break = breaks[-1] -732 # Only walk back up to 10 characters to find a nice break: -733 if last_break.end() > width-10: -734 # FIXME: should the break character be at the end of the -735 # chunk, or the beginning of the next chunk? -736 start = word[:last_break.end()] -737 result += start + break_character -738 word = word[len(start):] -739 result += word -740 return result -
741 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.clean.Cleaner-class.html b/doc/html/api/lxml.html.clean.Cleaner-class.html deleted file mode 100644 index 9d7451de..00000000 --- a/doc/html/api/lxml.html.clean.Cleaner-class.html +++ /dev/null @@ -1,797 +0,0 @@ - - - - - lxml.html.clean.Cleaner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module clean :: - Class Cleaner - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Cleaner

source code

-
-object --+
-         |
-        Cleaner
-
- -
-

Instances cleans the document of each of the possible offending -elements. The cleaning is controlled by attributes; you can -override attributes in a subclass, or set them in the constructor.

-
-
scripts:
-
Removes any <script> tags.
-
javascript:
-
Removes any Javascript, like an onclick attribute. Also removes stylesheets -as they could contain Javascript.
-
comments:
-
Removes any comments.
-
style:
-
Removes any style tags.
-
inline_style
-
Removes any style attributes. Defaults to the value of the style option.
-
links:
-
Removes any <link> tags
-
meta:
-
Removes any <meta> tags
-
page_structure:
-
Structural parts of a page: <head>, <html>, <title>.
-
processing_instructions:
-
Removes any processing instructions.
-
embedded:
-
Removes any embedded objects (flash, iframes)
-
frames:
-
Removes any frame-related tags
-
forms:
-
Removes any form tags
-
annoying_tags:
-
Tags that aren't wrong, but are annoying. <blink> and <marquee>
-
remove_tags:
-
A list of tags to remove. Only the tags will be removed, -their content will get pulled up into the parent tag.
-
kill_tags:
-
A list of tags to kill. Killing also removes the tag's content, -i.e. the whole subtree, not just the tag itself.
-
allow_tags:
-
A list of tags to include (default include all).
-
remove_unknown_tags:
-
Remove any tags that aren't standard parts of HTML.
-
safe_attrs_only:
-
If true, only include 'safe' attributes (specifically the list -from the feedparser HTML sanitisation web site).
-
safe_attrs:
-
A set of attribute names to override the default list of attributes -considered 'safe' (when safe_attrs_only=True).
-
add_nofollow:
-
If true, then any <a> tags will have rel="nofollow" added to them.
-
host_whitelist:
-

A list or set of hosts that you can use for embedded content -(for content like <object>, <link rel="stylesheet">, etc). -You can also implement/override the method -allow_embedded_url(el, url) or allow_element(el) to -implement more complex rules for what can be embedded. -Anything that passes this test will be shown, regardless of -the value of (for instance) embedded.

-

Note that this parameter might not work as intended if you do not -make the links absolute before doing the cleaning.

-

Note that you may also need to set whitelist_tags.

-
-
whitelist_tags:
-
A set of tags that can be included with host_whitelist. -The default is iframe and embed; you may wish to -include other tags like script, or you may want to -implement allow_embedded_url for more control. Set to None to -include all tags.
-
-

This modifies the document in place.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__call__(self, - doc)
- Cleans the document.
- source code - -
- -
-   - - - - - - -
allow_follow(self, - anchor)
- Override to suppress rel="nofollow" on some anchors.
- source code - -
- -
-   - - - - - - -
allow_element(self, - el) - source code - -
- -
-   - - - - - - -
allow_embedded_url(self, - el, - url) - source code - -
- -
-   - - - - - - -
kill_conditional_comments(self, - doc)
- IE conditional comments basically embed HTML that the parser -doesn't normally see. We can't allow anything like that, so -we'll kill any comments that could be conditional.
- source code - -
- -
-   - - - - - - -
_kill_elements(self, - doc, - condition, - iterate=None) - source code - -
- -
-   - - - - - - -
_remove_javascript_link(self, - link) - source code - -
- -
-   - - - - - - -
_substitute_comments(...)
- sub(repl, string[, count = 0]) --> newstring -Return the string obtained by replacing the leftmost non-overlapping -occurrences of pattern in string by the replacement repl.
- source code - -
- -
-   - - - - - - -
_has_sneaky_javascript(self, - style)
- Depending on the browser, stuff like e x p r e s s i o n(...) -can get interpreted, or expre/* stuff */ssion(...). This -checks for attempt to do stuff like this.
- source code - -
- -
-   - - - - - - -
clean_html(self, - html) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - scripts = True -
-   - - javascript = True -
-   - - comments = True -
-   - - style = False -
-   - - inline_style = None
- hash(x) -
-   - - links = True -
-   - - meta = True -
-   - - page_structure = True -
-   - - processing_instructions = True -
-   - - embedded = True -
-   - - frames = True -
-   - - forms = True -
-   - - annoying_tags = True -
-   - - remove_tags = None
- hash(x) -
-   - - allow_tags = None
- hash(x) -
-   - - kill_tags = None
- hash(x) -
-   - - remove_unknown_tags = True -
-   - - safe_attrs_only = True -
-   - - safe_attrs = frozenset(['abbr', 'accept', 'accept-charset', 'a... -
-   - - add_nofollow = False -
-   - - host_whitelist = () -
-   - - whitelist_tags = set(['embed', 'iframe']) -
-   - - _tag_link_attrs = {'a': 'href', 'applet': ['code', 'object'], ... -
-   - - __qualname__ = 'Cleaner' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

_has_sneaky_javascript(self, - style) -

-
source code  -
- -

Depending on the browser, stuff like e x p r e s s i o n(...) -can get interpreted, or expre/* stuff */ssion(...). This -checks for attempt to do stuff like this.

-

Typically the response will be to kill the entire style; if you -have just a bit of Javascript in the style another rule will catch -that and remove only the Javascript from the style; this catches -more sneaky attempts.

-
-
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

safe_attrs

- -
-
-
-
Value:
-
-frozenset(['abbr',
-           'accept',
-           'accept-charset',
-           'accesskey',
-           'action',
-           'align',
-           'alt',
-           'axis',
-...
-
-
-
-
-
- -
- -
-

_tag_link_attrs

- -
-
-
-
Value:
-
-{'a': 'href',
- 'applet': ['code', 'object'],
- 'embed': 'src',
- 'iframe': 'src',
- 'layer': 'src',
- 'link': 'href',
- 'script': 'src'}
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.defs-module.html b/doc/html/api/lxml.html.defs-module.html deleted file mode 100644 index 727955a6..00000000 --- a/doc/html/api/lxml.html.defs-module.html +++ /dev/null @@ -1,802 +0,0 @@ - - - - - lxml.html.defs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module defs - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module defs

source code

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - empty_tags = frozenset(['area', 'base', 'basefont', 'br', 'col... -
-   - - deprecated_tags = frozenset(['applet', 'basefont', 'center', '... -
-   - - link_attrs = frozenset(['action', 'archive', 'background', 'ci... -
-   - - event_attrs = frozenset(['onblur', 'onchange', 'onclick', 'ond... -
-   - - safe_attrs = frozenset(['abbr', 'accept', 'accept-charset', 'a... -
-   - - top_level_tags = frozenset(['body', 'frameset', 'head', 'html']) -
-   - - head_tags = frozenset(['base', 'isindex', 'link', 'meta', 'scr... -
-   - - general_block_tags = frozenset(['address', 'blockquote', 'cent... -
-   - - list_tags = frozenset(['dd', 'dir', 'dl', 'dt', 'li', 'menu', ... -
-   - - table_tags = frozenset(['caption', 'col', 'colgroup', 'table',... -
-   - - block_tags = frozenset(['address', 'blockquote', 'caption', 'c... -
-   - - form_tags = frozenset(['button', 'fieldset', 'form', 'input', ... -
-   - - special_inline_tags = frozenset(['a', 'applet', 'area', 'basef... -
-   - - phrase_tags = frozenset(['abbr', 'acronym', 'cite', 'code', 'd... -
-   - - font_style_tags = frozenset(['b', 'big', 'i', 's', 'small', 's... -
-   - - frame_tags = frozenset(['frame', 'frameset', 'noframes']) -
-   - - html5_tags = frozenset(['article', 'aside', 'audio', 'canvas',... -
-   - - nonstandard_tags = frozenset(['blink', 'marquee']) -
-   - - tags = frozenset(['a', 'abbr', 'acronym', 'address', 'applet',... -
-   - - __package__ = None
- hash(x) -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

empty_tags

- -
-
-
-
Value:
-
-frozenset(['area',
-           'base',
-           'basefont',
-           'br',
-           'col',
-           'frame',
-           'hr',
-           'img',
-...
-
-
-
-
-
- -
- -
-

deprecated_tags

- -
-
-
-
Value:
-
-frozenset(['applet',
-           'basefont',
-           'center',
-           'dir',
-           'font',
-           'isindex',
-           'menu',
-           's',
-...
-
-
-
-
-
- -
- -
-

link_attrs

- -
-
-
-
Value:
-
-frozenset(['action',
-           'archive',
-           'background',
-           'cite',
-           'classid',
-           'codebase',
-           'data',
-           'dynsrc',
-...
-
-
-
-
-
- -
- -
-

event_attrs

- -
-
-
-
Value:
-
-frozenset(['onblur',
-           'onchange',
-           'onclick',
-           'ondblclick',
-           'onerror',
-           'onfocus',
-           'onkeydown',
-           'onkeypress',
-...
-
-
-
-
-
- -
- -
-

safe_attrs

- -
-
-
-
Value:
-
-frozenset(['abbr',
-           'accept',
-           'accept-charset',
-           'accesskey',
-           'action',
-           'align',
-           'alt',
-           'axis',
-...
-
-
-
-
-
- -
- -
-

head_tags

- -
-
-
-
Value:
-
-frozenset(['base',
-           'isindex',
-           'link',
-           'meta',
-           'script',
-           'style',
-           'title'])
-
-
-
-
-
- -
- -
-

general_block_tags

- -
-
-
-
Value:
-
-frozenset(['address',
-           'blockquote',
-           'center',
-           'del',
-           'div',
-           'h1',
-           'h2',
-           'h3',
-...
-
-
-
-
-
- -
- -
-

list_tags

- -
-
-
-
Value:
-
-frozenset(['dd', 'dir', 'dl', 'dt', 'li', 'menu', 'ol', 'ul'])
-
-
-
-
-
- -
- -
-

table_tags

- -
-
-
-
Value:
-
-frozenset(['caption',
-           'col',
-           'colgroup',
-           'table',
-           'tbody',
-           'td',
-           'tfoot',
-           'th',
-...
-
-
-
-
-
- -
- -
-

block_tags

- -
-
-
-
Value:
-
-frozenset(['address',
-           'blockquote',
-           'caption',
-           'center',
-           'col',
-           'colgroup',
-           'dd',
-           'del',
-...
-
-
-
-
-
- -
- -
-

form_tags

- -
-
-
-
Value:
-
-frozenset(['button',
-           'fieldset',
-           'form',
-           'input',
-           'label',
-           'legend',
-           'optgroup',
-           'option',
-...
-
-
-
-
-
- -
- -
-

special_inline_tags

- -
-
-
-
Value:
-
-frozenset(['a',
-           'applet',
-           'area',
-           'basefont',
-           'bdo',
-           'br',
-           'embed',
-           'font',
-...
-
-
-
-
-
- -
- -
-

phrase_tags

- -
-
-
-
Value:
-
-frozenset(['abbr',
-           'acronym',
-           'cite',
-           'code',
-           'del',
-           'dfn',
-           'em',
-           'ins',
-...
-
-
-
-
-
- -
- -
-

font_style_tags

- -
-
-
-
Value:
-
-frozenset(['b', 'big', 'i', 's', 'small', 'strike', 'tt', 'u'])
-
-
-
-
-
- -
- -
-

html5_tags

- -
-
-
-
Value:
-
-frozenset(['article',
-           'aside',
-           'audio',
-           'canvas',
-           'command',
-           'datalist',
-           'details',
-           'embed',
-...
-
-
-
-
-
- -
- -
-

tags

- -
-
-
-
Value:
-
-frozenset(['a',
-           'abbr',
-           'acronym',
-           'address',
-           'applet',
-           'area',
-           'article',
-           'aside',
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.defs-pysrc.html b/doc/html/api/lxml.html.defs-pysrc.html deleted file mode 100644 index 736d37bd..00000000 --- a/doc/html/api/lxml.html.defs-pysrc.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - - lxml.html.defs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module defs - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.html.defs

-
-  1  # FIXME: this should all be confirmed against what a DTD says 
-  2  # (probably in a test; this may not match the DTD exactly, but we 
-  3  # should document just how it differs). 
-  4   
-  5  # Data taken from http://www.w3.org/TR/html401/index/elements.html 
-  6  # and http://www.w3.org/community/webed/wiki/HTML/New_HTML5_Elements 
-  7  # for html5_tags. 
-  8   
-  9  empty_tags = frozenset([ 
- 10      'area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 
- 11      'img', 'input', 'isindex', 'link', 'meta', 'param']) 
- 12   
- 13  deprecated_tags = frozenset([ 
- 14      'applet', 'basefont', 'center', 'dir', 'font', 'isindex', 
- 15      'menu', 's', 'strike', 'u']) 
- 16   
- 17  # archive actually takes a space-separated list of URIs 
- 18  link_attrs = frozenset([ 
- 19      'action', 'archive', 'background', 'cite', 'classid', 
- 20      'codebase', 'data', 'href', 'longdesc', 'profile', 'src', 
- 21      'usemap', 
- 22      # Not standard: 
- 23      'dynsrc', 'lowsrc', 
- 24      ]) 
- 25   
- 26  # Not in the HTML 4 spec: 
- 27  # onerror, onresize 
- 28  event_attrs = frozenset([ 
- 29      'onblur', 'onchange', 'onclick', 'ondblclick', 'onerror', 
- 30      'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 
- 31      'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 
- 32      'onmouseup', 'onreset', 'onresize', 'onselect', 'onsubmit', 
- 33      'onunload', 
- 34      ]) 
- 35   
- 36  safe_attrs = frozenset([ 
- 37      'abbr', 'accept', 'accept-charset', 'accesskey', 'action', 'align', 
- 38      'alt', 'axis', 'border', 'cellpadding', 'cellspacing', 'char', 'charoff', 
- 39      'charset', 'checked', 'cite', 'class', 'clear', 'cols', 'colspan', 
- 40      'color', 'compact', 'coords', 'datetime', 'dir', 'disabled', 'enctype', 
- 41      'for', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 
- 42      'ismap', 'label', 'lang', 'longdesc', 'maxlength', 'media', 'method', 
- 43      'multiple', 'name', 'nohref', 'noshade', 'nowrap', 'prompt', 'readonly', 
- 44      'rel', 'rev', 'rows', 'rowspan', 'rules', 'scope', 'selected', 'shape', 
- 45      'size', 'span', 'src', 'start', 'summary', 'tabindex', 'target', 'title', 
- 46      'type', 'usemap', 'valign', 'value', 'vspace', 'width']) 
- 47   
- 48  # From http://htmlhelp.com/reference/html40/olist.html 
- 49  top_level_tags = frozenset([ 
- 50      'html', 'head', 'body', 'frameset', 
- 51      ]) 
- 52   
- 53  head_tags = frozenset([ 
- 54      'base', 'isindex', 'link', 'meta', 'script', 'style', 'title', 
- 55      ]) 
- 56   
- 57  general_block_tags = frozenset([ 
- 58      'address', 
- 59      'blockquote', 
- 60      'center', 
- 61      'del', 
- 62      'div', 
- 63      'h1', 
- 64      'h2', 
- 65      'h3', 
- 66      'h4', 
- 67      'h5', 
- 68      'h6', 
- 69      'hr', 
- 70      'ins', 
- 71      'isindex', 
- 72      'noscript', 
- 73      'p', 
- 74      'pre', 
- 75      ]) 
- 76   
- 77  list_tags = frozenset([ 
- 78      'dir', 'dl', 'dt', 'dd', 'li', 'menu', 'ol', 'ul', 
- 79      ]) 
- 80   
- 81  table_tags = frozenset([ 
- 82      'table', 'caption', 'colgroup', 'col', 
- 83      'thead', 'tfoot', 'tbody', 'tr', 'td', 'th', 
- 84      ]) 
- 85   
- 86  # just this one from 
- 87  # http://www.georgehernandez.com/h/XComputers/HTML/2BlockLevel.htm 
- 88  block_tags = general_block_tags | list_tags | table_tags | frozenset([ 
- 89      # Partial form tags 
- 90      'fieldset', 'form', 'legend', 'optgroup', 'option', 
- 91      ]) 
- 92   
- 93  form_tags = frozenset([ 
- 94      'form', 'button', 'fieldset', 'legend', 'input', 'label', 
- 95      'select', 'optgroup', 'option', 'textarea', 
- 96      ]) 
- 97   
- 98  special_inline_tags = frozenset([ 
- 99      'a', 'applet', 'basefont', 'bdo', 'br', 'embed', 'font', 'iframe', 
-100      'img', 'map', 'area', 'object', 'param', 'q', 'script', 
-101      'span', 'sub', 'sup', 
-102      ]) 
-103   
-104  phrase_tags = frozenset([ 
-105      'abbr', 'acronym', 'cite', 'code', 'del', 'dfn', 'em', 
-106      'ins', 'kbd', 'samp', 'strong', 'var', 
-107      ]) 
-108   
-109  font_style_tags = frozenset([ 
-110      'b', 'big', 'i', 's', 'small', 'strike', 'tt', 'u', 
-111      ]) 
-112   
-113  frame_tags = frozenset([ 
-114      'frameset', 'frame', 'noframes', 
-115      ]) 
-116       
-117  html5_tags = frozenset([ 
-118      'article', 'aside', 'audio', 'canvas', 'command', 'datalist', 
-119      'details', 'embed', 'figcaption', 'figure', 'footer', 'header', 
-120      'hgroup', 'keygen', 'mark', 'math', 'meter', 'nav', 'output', 
-121      'progress', 'rp', 'rt', 'ruby', 'section', 'source', 'summary', 
-122      'svg', 'time', 'track', 'video', 'wbr' 
-123      ]) 
-124   
-125  # These tags aren't standard 
-126  nonstandard_tags = frozenset(['blink', 'marquee']) 
-127   
-128   
-129  tags = (top_level_tags | head_tags | general_block_tags | list_tags 
-130          | table_tags | form_tags | special_inline_tags | phrase_tags 
-131          | font_style_tags | nonstandard_tags | html5_tags) 
-132   
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.diff-module.html b/doc/html/api/lxml.html.diff-module.html deleted file mode 100644 index 49edb6ad..00000000 --- a/doc/html/api/lxml.html.diff-module.html +++ /dev/null @@ -1,1434 +0,0 @@ - - - - - lxml.html.diff - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module diff - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module diff

source code

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - basestring
- str(object='') -> string -
-   - - DEL_START -
-   - - DEL_END -
-   - - NoDeletes
- Raised when the document no longer contains any pending deletes -(DEL_START/DEL_END) -
-   - - token
- Represents a diffable token, generally a word that is displayed to -the user. Opening tags are attached to this token when they are -adjacent (pre_tags) and closing tags that follow the word -(post_tags). Some exceptions occur when there are empty tags -adjacent to a word, so there may be close tags in pre_tags, or -open tags in post_tags. -
-   - - tag_token
- Represents a token that is actually a tag. Currently this is just -the <img> tag, which takes up visible space just like a word but -is only represented in a document by a tag. -
-   - - href_token
- Represents the href in an anchor tag. Unlike other words, we only -show the href when it changes. -
-   - - InsensitiveSequenceMatcher
- Acts like SequenceMatcher, but tries not to find very small equal -blocks amidst large spans of changes -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
default_markup(text, - version) - source code - -
- -
-   - - - - - - -
html_annotate(doclist, - markup=default_markup)
- doclist should be ordered from oldest to newest, like:
- source code - -
- -
-   - - - - - - -
tokenize_annotated(doc, - annotation)
- Tokenize a document and add an annotation attribute to each token
- source code - -
- -
-   - - - - - - -
html_annotate_merge_annotations(tokens_old, - tokens_new)
- Merge the annotations from tokens_old into tokens_new, when the -tokens in the new document already existed in the old document.
- source code - -
- -
-   - - - - - - -
copy_annotations(src, - dest)
- Copy annotations from the tokens listed in src to the tokens in dest
- source code - -
- -
-   - - - - - - -
compress_tokens(tokens)
- Combine adjacent tokens when there is no HTML between the tokens, -and they share an annotation
- source code - -
- -
-   - - - - - - -
compress_merge_back(tokens, - tok)
- Merge tok into the last element of tokens (modifying the list of -tokens in-place).
- source code - -
- -
-   - - - - - - -
markup_serialize_tokens(tokens, - markup_func)
- Serialize the list of tokens into a list of text chunks, calling -markup_func around text to add annotations.
- source code - -
- -
-   - - - - - - -
htmldiff(old_html, - new_html)
- Do a diff of the old and new document. The documents are HTML -fragments (str/UTF8 or unicode), they are not complete documents -(i.e., no <html> tag).
- source code - -
- -
-   - - - - - - -
htmldiff_tokens(html1_tokens, - html2_tokens)
- Does a diff on the tokens themselves, returning a list of text -chunks (not tokens).
- source code - -
- -
-   - - - - - - -
expand_tokens(tokens, - equal=False)
- Given a list of tokens, return a generator of the chunks of -text for the data in the tokens.
- source code - -
- -
-   - - - - - - -
merge_insert(ins_chunks, - doc)
- doc is the already-handled document (as a list of text chunks); -here we add <ins>ins_chunks</ins> to the end of that.
- source code - -
- -
-   - - - - - - -
merge_delete(del_chunks, - doc)
- Adds the text chunks in del_chunks to the document doc (another -list of text chunks) with marker to show it is a delete. -cleanup_delete later resolves these markers into <del> tags.
- source code - -
- -
-   - - - - - - -
cleanup_delete(chunks)
- Cleans up any DEL_START/DEL_END markers in the document, replacing -them with <del></del>. To do this while keeping the document -valid, it may need to drop some tags (either start or end tags).
- source code - -
- -
-   - - - - - - -
split_unbalanced(chunks)
- Return (unbalanced_start, balanced, unbalanced_end), where each is -a list of text and tag chunks.
- source code - -
- -
-   - - - - - - -
split_delete(chunks)
- Returns (stuff_before_DEL_START, stuff_inside_DEL_START_END, -stuff_after_DEL_END). Returns the first case found (there may be -more DEL_STARTs in stuff_after_DEL_END). Raises NoDeletes if -there's no DEL_START found.
- source code - -
- -
-   - - - - - - -
locate_unbalanced_start(unbalanced_start, - pre_delete, - post_delete)
- pre_delete and post_delete implicitly point to a place in the -document (where the two were split). This moves that point (by -popping items from one and pushing them onto the other). It moves -the point to try to find a place where unbalanced_start applies.
- source code - -
- -
-   - - - - - - -
locate_unbalanced_end(unbalanced_end, - pre_delete, - post_delete)
- like locate_unbalanced_start, except handling end tags and -possibly moving the point earlier in the document.
- source code - -
- -
-   - - - - - - -
tokenize(html, - include_hrefs=True)
- Parse the given HTML and returns token objects (words with attached tags).
- source code - -
- -
-   - - - - - - -
parse_html(html, - cleanup=True)
- Parses an HTML fragment, returning an lxml element. Note that the HTML will be -wrapped in a <div> tag that was not in the original document.
- source code - -
- -
-   - - - - - - -
cleanup_html(html)
- This 'cleans' the HTML, meaning that any page structure is removed -(only the contents of <body> are used, if there is any <body). -Also <ins> and <del> tags are removed.
- source code - -
- -
-   - - - - - - -
split_trailing_whitespace(word)
- This function takes a word, such as 'test
- source code - -
- -
-   - - - - - - -
fixup_chunks(chunks)
- This function takes a list of chunks and produces a list of tokens.
- source code - -
- -
-   - - - - - - -
flatten_el(el, - include_hrefs, - skip_tag=False)
- Takes an lxml element el, and generates all the text chunks for -that tag. Each start tag is a chunk, each word is a chunk, and each -end tag is a chunk.
- source code - -
- -
-   - - - - - - -
split_words(text)
- Splits some text into words. Includes trailing whitespace -on each word when appropriate.
- source code - -
- -
-   - - - - - - -
start_tag(el)
- The text representation of the start tag for a tag.
- source code - -
- -
-   - - - - - - -
end_tag(el)
- The text representation of an end tag for a tag. Includes -trailing whitespace when appropriate.
- source code - -
- -
-   - - - - - - -
is_word(tok) - source code - -
- -
-   - - - - - - -
is_end_tag(tok) - source code - -
- -
-   - - - - - - -
is_start_tag(tok) - source code - -
- -
-   - - - - - - -
fixup_ins_del_tags(html)
- Given an html string, move any <ins> or <del> tags inside of any -block-level elements, e.g. transform <ins><p>word</p></ins> to -<p><ins>word</ins></p>
- source code - -
- -
-   - - - - - - -
serialize_html_fragment(el, - skip_outer=False)
- Serialize a single lxml element as HTML. The serialized form -includes the elements tail.
- source code - -
- -
-   - - - - - - -
_fixup_ins_del_tags(doc)
- fixup_ins_del_tags that works on an lxml document in-place
- source code - -
- -
-   - - - - - - -
_contains_block_level_tag(el)
- True if the element contains any block-level elements, like <p>, <td>, etc.
- source code - -
- -
-   - - - - - - -
_move_el_inside_block(el, - tag)
- helper for _fixup_ins_del_tags; actually takes the <ins> etc tags -and moves them inside any block-level tags.
- source code - -
- -
-   - - - - - - -
_merge_element_contents(el)
- Removes an element, but merges its contents into its place, e.g., -given <p>Hi <i>there!</i></p>, if you remove the <i> element you get -<p>Hi there!</p>
- source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - _body_re = re.compile(r'(?is)<body.*?>') -
-   - - _end_body_re = re.compile(r'(?is)</body.*?>') -
-   - - _ins_del_re = re.compile(r'(?is)</?(ins|del).*?>') -
-   - - end_whitespace_re = re.compile(r'[ \t\n\r]$') -
-   - - empty_tags = ('param', 'img', 'area', 'br', 'basefont', 'input... -
-   - - block_level_tags = ('address', 'blockquote', 'center', 'dir', ... -
-   - - block_level_container_tags = ('dd', 'dt', 'frameset', 'li', 't... -
-   - - split_words_re = re.compile(r'(?u)\S+(?:\s+|$)') -
-   - - start_whitespace_re = re.compile(r'^[ \t\n\r]') -
-   - - __package__ = 'lxml.html' -
-   - - __test__ = {u'html_annotate (line 31)':... -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

html_annotate(doclist, - markup=default_markup) -

-
source code  -
- -

doclist should be ordered from oldest to newest, like:

-
->>> version1 = 'Hello World'
->>> version2 = 'Goodbye World'
->>> print(html_annotate([(version1, 'version 1'),
-...                      (version2, 'version 2')]))
-<span title="version 2">Goodbye</span> <span title="version 1">World</span>
-
-

The documents must be fragments (str/UTF8 or unicode), not -complete documents

-

The markup argument is a function to markup the spans of words. -This function is called like markup('Hello', 'version 2'), and -returns HTML. The first argument is text and never includes any -markup. The default uses a span with a title:

-
-
->>> print(default_markup('Some Text', 'by Joe'))
-<span title="by Joe">Some Text</span>
-
-
-
-
-
- -
- -
- - -
-

htmldiff(old_html, - new_html) -

-
source code  -
- -

Do a diff of the old and new document. The documents are HTML -fragments (str/UTF8 or unicode), they are not complete documents -(i.e., no <html> tag).

-

Returns HTML with <ins> and <del> tags added around the -appropriate text.

-

Markup is generally ignored, with the markup from new_html -preserved, and possibly some markup from old_html (though it is -considered acceptable to lose some of the old markup). Only the -words in the HTML are diffed. The exception is <img> tags, which -are treated like words, and the href attribute of <a> tags, which -are noted inside the tag itself when there are changes.

-
-
-
-
- -
- -
- - -
-

cleanup_delete(chunks) -

-
source code  -
- -

Cleans up any DEL_START/DEL_END markers in the document, replacing -them with <del></del>. To do this while keeping the document -valid, it may need to drop some tags (either start or end tags).

-

It may also move the del into adjacent tags to try to move it to a -similar location where it was originally located (e.g., moving a -delete into preceding <div> tag, if the del looks like (DEL_START, -'Text</div>', DEL_END)

-
-
-
-
- -
- -
- - -
-

split_unbalanced(chunks) -

-
source code  -
- -

Return (unbalanced_start, balanced, unbalanced_end), where each is -a list of text and tag chunks.

-

unbalanced_start is a list of all the tags that are opened, but -not closed in this span. Similarly, unbalanced_end is a list of -tags that are closed but were not opened. Extracting these might -mean some reordering of the chunks.

-
-
-
-
- -
- -
- - -
-

locate_unbalanced_start(unbalanced_start, - pre_delete, - post_delete) -

-
source code  -
- -

pre_delete and post_delete implicitly point to a place in the -document (where the two were split). This moves that point (by -popping items from one and pushing them onto the other). It moves -the point to try to find a place where unbalanced_start applies.

-

As an example:

-
->>> unbalanced_start = ['<div>']
->>> doc = ['<p>', 'Text', '</p>', '<div>', 'More Text', '</div>']
->>> pre, post = doc[:3], doc[3:]
->>> pre, post
-(['<p>', 'Text', '</p>'], ['<div>', 'More Text', '</div>'])
->>> locate_unbalanced_start(unbalanced_start, pre, post)
->>> pre, post
-(['<p>', 'Text', '</p>', '<div>'], ['More Text', '</div>'])
-
-

As you can see, we moved the point so that the dangling <div> that -we found will be effectively replaced by the div in the original -document. If this doesn't work out, we just throw away -unbalanced_start without doing anything.

-
-
-
-
- -
- -
- - -
-

tokenize(html, - include_hrefs=True) -

-
source code  -
- -

Parse the given HTML and returns token objects (words with attached tags).

-

This parses only the content of a page; anything in the head is -ignored, and the <head> and <body> elements are themselves -optional. The content is then parsed by lxml, which ensures the -validity of the resulting parsed document (though lxml may make -incorrect guesses when the markup is particular bad).

-

<ins> and <del> tags are also eliminated from the document, as -that gets confusing.

-

If include_hrefs is true, then the href attribute of <a> tags is -included as a special kind of diffable token.

-
-
-
-
- -
- -
- - -
-

parse_html(html, - cleanup=True) -

-
source code  -
- -

Parses an HTML fragment, returning an lxml element. Note that the HTML will be -wrapped in a <div> tag that was not in the original document.

-

If cleanup is true, make sure there's no <head> or <body>, and get -rid of any <ins> and <del> tags.

-
-
-
-
- -
- -
- - -
-

split_trailing_whitespace(word) -

-
source code  -
- -
-This function takes a word, such as 'test
-

' and returns ('test','

-

')

-
-
-
-
- -
- -
- - -
-

flatten_el(el, - include_hrefs, - skip_tag=False) -

-
source code  -
- -

Takes an lxml element el, and generates all the text chunks for -that tag. Each start tag is a chunk, each word is a chunk, and each -end tag is a chunk.

-

If skip_tag is true, then the outermost container tag is -not returned (just its contents).

-
-
-
-
- -
- -
- - -
-

serialize_html_fragment(el, - skip_outer=False) -

-
source code  -
- -

Serialize a single lxml element as HTML. The serialized form -includes the elements tail.

-

If skip_outer is true, then don't serialize the outermost tag

-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

empty_tags

- -
-
-
-
Value:
-
-('param',
- 'img',
- 'area',
- 'br',
- 'basefont',
- 'input',
- 'base',
- 'meta',
-...
-
-
-
-
-
- -
- -
-

block_level_tags

- -
-
-
-
Value:
-
-('address',
- 'blockquote',
- 'center',
- 'dir',
- 'div',
- 'dl',
- 'fieldset',
- 'form',
-...
-
-
-
-
-
- -
- -
-

block_level_container_tags

- -
-
-
-
Value:
-
-('dd',
- 'dt',
- 'frameset',
- 'li',
- 'tbody',
- 'td',
- 'tfoot',
- 'th',
-...
-
-
-
-
-
- -
- -
-

__test__

- -
-
-
-
Value:
-
-{u'html_annotate (line 31)': u'''
-    doclist should be ordered from oldest to newest, like::
-
-        >>> version1 = 'Hello World'
-        >>> version2 = 'Goodbye World'
-        >>> print(html_annotate([(version1, 'version 1'),
-        ...                      (version2, 'version 2')]))
-        <span title="version 2">Goodbye</span> <span title="version 1"\
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.diff-pysrc.html b/doc/html/api/lxml.html.diff-pysrc.html deleted file mode 100644 index 61d295cc..00000000 --- a/doc/html/api/lxml.html.diff-pysrc.html +++ /dev/null @@ -1,1824 +0,0 @@ - - - - - lxml.html.diff - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module diff - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.html.diff

-
-  1  import difflib 
-  2  from lxml import etree 
-  3  from lxml.html import fragment_fromstring 
-  4  import re 
-  5   
-  6  __all__ = ['html_annotate', 'htmldiff'] 
-  7   
-  8  try: 
-  9      from html import escape as html_escape 
- 10  except ImportError: 
- 11      from cgi import escape as html_escape 
- 12  try: 
- 13      _unicode = unicode 
- 14  except NameError: 
- 15      # Python 3 
- 16      _unicode = str 
- 17  try: 
- 18      basestring 
- 19  except NameError: 
- 20      # Python 3 
- 21      basestring = str 
- 22   
- 23  ############################################################ 
- 24  ## Annotation 
- 25  ############################################################ 
- 26   
-
27 -def default_markup(text, version): -
28 return '<span title="%s">%s</span>' % ( - 29 html_escape(_unicode(version), 1), text) -
30 -
31 -def html_annotate(doclist, markup=default_markup): -
32 """ - 33 doclist should be ordered from oldest to newest, like:: - 34 - 35 >>> version1 = 'Hello World' - 36 >>> version2 = 'Goodbye World' - 37 >>> print(html_annotate([(version1, 'version 1'), - 38 ... (version2, 'version 2')])) - 39 <span title="version 2">Goodbye</span> <span title="version 1">World</span> - 40 - 41 The documents must be *fragments* (str/UTF8 or unicode), not - 42 complete documents - 43 - 44 The markup argument is a function to markup the spans of words. - 45 This function is called like markup('Hello', 'version 2'), and - 46 returns HTML. The first argument is text and never includes any - 47 markup. The default uses a span with a title: - 48 - 49 >>> print(default_markup('Some Text', 'by Joe')) - 50 <span title="by Joe">Some Text</span> - 51 """ - 52 # The basic strategy we have is to split the documents up into - 53 # logical tokens (which are words with attached markup). We then - 54 # do diffs of each of the versions to track when a token first - 55 # appeared in the document; the annotation attached to the token - 56 # is the version where it first appeared. - 57 tokenlist = [tokenize_annotated(doc, version) - 58 for doc, version in doclist] - 59 cur_tokens = tokenlist[0] - 60 for tokens in tokenlist[1:]: - 61 html_annotate_merge_annotations(cur_tokens, tokens) - 62 cur_tokens = tokens - 63 - 64 # After we've tracked all the tokens, we can combine spans of text - 65 # that are adjacent and have the same annotation - 66 cur_tokens = compress_tokens(cur_tokens) - 67 # And finally add markup - 68 result = markup_serialize_tokens(cur_tokens, markup) - 69 return ''.join(result).strip() -
70 -
71 -def tokenize_annotated(doc, annotation): -
72 """Tokenize a document and add an annotation attribute to each token - 73 """ - 74 tokens = tokenize(doc, include_hrefs=False) - 75 for tok in tokens: - 76 tok.annotation = annotation - 77 return tokens - 78 -
79 -def html_annotate_merge_annotations(tokens_old, tokens_new): -
80 """Merge the annotations from tokens_old into tokens_new, when the - 81 tokens in the new document already existed in the old document. - 82 """ - 83 s = InsensitiveSequenceMatcher(a=tokens_old, b=tokens_new) - 84 commands = s.get_opcodes() - 85 - 86 for command, i1, i2, j1, j2 in commands: - 87 if command == 'equal': - 88 eq_old = tokens_old[i1:i2] - 89 eq_new = tokens_new[j1:j2] - 90 copy_annotations(eq_old, eq_new) - 91 -
92 -def copy_annotations(src, dest): -
93 """ - 94 Copy annotations from the tokens listed in src to the tokens in dest - 95 """ - 96 assert len(src) == len(dest) - 97 for src_tok, dest_tok in zip(src, dest): - 98 dest_tok.annotation = src_tok.annotation - 99 -
100 -def compress_tokens(tokens): -
101 """ -102 Combine adjacent tokens when there is no HTML between the tokens, -103 and they share an annotation -104 """ -105 result = [tokens[0]] -106 for tok in tokens[1:]: -107 if (not result[-1].post_tags and -108 not tok.pre_tags and -109 result[-1].annotation == tok.annotation): -110 compress_merge_back(result, tok) -111 else: -112 result.append(tok) -113 return result -
114 -
115 -def compress_merge_back(tokens, tok): -
116 """ Merge tok into the last element of tokens (modifying the list of -117 tokens in-place). """ -118 last = tokens[-1] -119 if type(last) is not token or type(tok) is not token: -120 tokens.append(tok) -121 else: -122 text = _unicode(last) -123 if last.trailing_whitespace: -124 text += last.trailing_whitespace -125 text += tok -126 merged = token(text, -127 pre_tags=last.pre_tags, -128 post_tags=tok.post_tags, -129 trailing_whitespace=tok.trailing_whitespace) -130 merged.annotation = last.annotation -131 tokens[-1] = merged -132 -
133 -def markup_serialize_tokens(tokens, markup_func): -
134 """ -135 Serialize the list of tokens into a list of text chunks, calling -136 markup_func around text to add annotations. -137 """ -138 for token in tokens: -139 for pre in token.pre_tags: -140 yield pre -141 html = token.html() -142 html = markup_func(html, token.annotation) -143 if token.trailing_whitespace: -144 html += token.trailing_whitespace -145 yield html -146 for post in token.post_tags: -147 yield post -
148 -149 -150 ############################################################ -151 ## HTML Diffs -152 ############################################################ -153 -
154 -def htmldiff(old_html, new_html): -
155 ## FIXME: this should take parsed documents too, and use their body -156 ## or other content. -157 """ Do a diff of the old and new document. The documents are HTML -158 *fragments* (str/UTF8 or unicode), they are not complete documents -159 (i.e., no <html> tag). -160 -161 Returns HTML with <ins> and <del> tags added around the -162 appropriate text. -163 -164 Markup is generally ignored, with the markup from new_html -165 preserved, and possibly some markup from old_html (though it is -166 considered acceptable to lose some of the old markup). Only the -167 words in the HTML are diffed. The exception is <img> tags, which -168 are treated like words, and the href attribute of <a> tags, which -169 are noted inside the tag itself when there are changes. -170 """ -171 old_html_tokens = tokenize(old_html) -172 new_html_tokens = tokenize(new_html) -173 result = htmldiff_tokens(old_html_tokens, new_html_tokens) -174 result = ''.join(result).strip() -175 return fixup_ins_del_tags(result) -
176 -
177 -def htmldiff_tokens(html1_tokens, html2_tokens): -
178 """ Does a diff on the tokens themselves, returning a list of text -179 chunks (not tokens). -180 """ -181 # There are several passes as we do the differences. The tokens -182 # isolate the portion of the content we care to diff; difflib does -183 # all the actual hard work at that point. -184 # -185 # Then we must create a valid document from pieces of both the old -186 # document and the new document. We generally prefer to take -187 # markup from the new document, and only do a best effort attempt -188 # to keep markup from the old document; anything that we can't -189 # resolve we throw away. Also we try to put the deletes as close -190 # to the location where we think they would have been -- because -191 # we are only keeping the markup from the new document, it can be -192 # fuzzy where in the new document the old text would have gone. -193 # Again we just do a best effort attempt. -194 s = InsensitiveSequenceMatcher(a=html1_tokens, b=html2_tokens) -195 commands = s.get_opcodes() -196 result = [] -197 for command, i1, i2, j1, j2 in commands: -198 if command == 'equal': -199 result.extend(expand_tokens(html2_tokens[j1:j2], equal=True)) -200 continue -201 if command == 'insert' or command == 'replace': -202 ins_tokens = expand_tokens(html2_tokens[j1:j2]) -203 merge_insert(ins_tokens, result) -204 if command == 'delete' or command == 'replace': -205 del_tokens = expand_tokens(html1_tokens[i1:i2]) -206 merge_delete(del_tokens, result) -207 # If deletes were inserted directly as <del> then we'd have an -208 # invalid document at this point. Instead we put in special -209 # markers, and when the complete diffed document has been created -210 # we try to move the deletes around and resolve any problems. -211 result = cleanup_delete(result) -212 -213 return result -
214 -
215 -def expand_tokens(tokens, equal=False): -
216 """Given a list of tokens, return a generator of the chunks of -217 text for the data in the tokens. -218 """ -219 for token in tokens: -220 for pre in token.pre_tags: -221 yield pre -222 if not equal or not token.hide_when_equal: -223 if token.trailing_whitespace: -224 yield token.html() + token.trailing_whitespace -225 else: -226 yield token.html() -227 for post in token.post_tags: -228 yield post -
229 -
230 -def merge_insert(ins_chunks, doc): -
231 """ doc is the already-handled document (as a list of text chunks); -232 here we add <ins>ins_chunks</ins> to the end of that. """ -233 # Though we don't throw away unbalanced_start or unbalanced_end -234 # (we assume there is accompanying markup later or earlier in the -235 # document), we only put <ins> around the balanced portion. -236 unbalanced_start, balanced, unbalanced_end = split_unbalanced(ins_chunks) -237 doc.extend(unbalanced_start) -238 if doc and not doc[-1].endswith(' '): -239 # Fix up the case where the word before the insert didn't end with -240 # a space -241 doc[-1] += ' ' -242 doc.append('<ins>') -243 if balanced and balanced[-1].endswith(' '): -244 # We move space outside of </ins> -245 balanced[-1] = balanced[-1][:-1] -246 doc.extend(balanced) -247 doc.append('</ins> ') -248 doc.extend(unbalanced_end) -
249 -250 # These are sentinals to represent the start and end of a <del> -251 # segment, until we do the cleanup phase to turn them into proper -252 # markup: -
253 -class DEL_START: -
254 pass -
255 -class DEL_END: -
256 pass -
257 -
258 -class NoDeletes(Exception): -
259 """ Raised when the document no longer contains any pending deletes -260 (DEL_START/DEL_END) """ -
261 -
262 -def merge_delete(del_chunks, doc): -
263 """ Adds the text chunks in del_chunks to the document doc (another -264 list of text chunks) with marker to show it is a delete. -265 cleanup_delete later resolves these markers into <del> tags.""" -266 doc.append(DEL_START) -267 doc.extend(del_chunks) -268 doc.append(DEL_END) -
269 -
270 -def cleanup_delete(chunks): -
271 """ Cleans up any DEL_START/DEL_END markers in the document, replacing -272 them with <del></del>. To do this while keeping the document -273 valid, it may need to drop some tags (either start or end tags). -274 -275 It may also move the del into adjacent tags to try to move it to a -276 similar location where it was originally located (e.g., moving a -277 delete into preceding <div> tag, if the del looks like (DEL_START, -278 'Text</div>', DEL_END)""" -279 while 1: -280 # Find a pending DEL_START/DEL_END, splitting the document -281 # into stuff-preceding-DEL_START, stuff-inside, and -282 # stuff-following-DEL_END -283 try: -284 pre_delete, delete, post_delete = split_delete(chunks) -285 except NoDeletes: -286 # Nothing found, we've cleaned up the entire doc -287 break -288 # The stuff-inside-DEL_START/END may not be well balanced -289 # markup. First we figure out what unbalanced portions there are: -290 unbalanced_start, balanced, unbalanced_end = split_unbalanced(delete) -291 # Then we move the span forward and/or backward based on these -292 # unbalanced portions: -293 locate_unbalanced_start(unbalanced_start, pre_delete, post_delete) -294 locate_unbalanced_end(unbalanced_end, pre_delete, post_delete) -295 doc = pre_delete -296 if doc and not doc[-1].endswith(' '): -297 # Fix up case where the word before us didn't have a trailing space -298 doc[-1] += ' ' -299 doc.append('<del>') -300 if balanced and balanced[-1].endswith(' '): -301 # We move space outside of </del> -302 balanced[-1] = balanced[-1][:-1] -303 doc.extend(balanced) -304 doc.append('</del> ') -305 doc.extend(post_delete) -306 chunks = doc -307 return chunks -
308 -
309 -def split_unbalanced(chunks): -
310 """Return (unbalanced_start, balanced, unbalanced_end), where each is -311 a list of text and tag chunks. -312 -313 unbalanced_start is a list of all the tags that are opened, but -314 not closed in this span. Similarly, unbalanced_end is a list of -315 tags that are closed but were not opened. Extracting these might -316 mean some reordering of the chunks.""" -317 start = [] -318 end = [] -319 tag_stack = [] -320 balanced = [] -321 for chunk in chunks: -322 if not chunk.startswith('<'): -323 balanced.append(chunk) -324 continue -325 endtag = chunk[1] == '/' -326 name = chunk.split()[0].strip('<>/') -327 if name in empty_tags: -328 balanced.append(chunk) -329 continue -330 if endtag: -331 if tag_stack and tag_stack[-1][0] == name: -332 balanced.append(chunk) -333 name, pos, tag = tag_stack.pop() -334 balanced[pos] = tag -335 elif tag_stack: -336 start.extend([tag for name, pos, tag in tag_stack]) -337 tag_stack = [] -338 end.append(chunk) -339 else: -340 end.append(chunk) -341 else: -342 tag_stack.append((name, len(balanced), chunk)) -343 balanced.append(None) -344 start.extend( -345 [chunk for name, pos, chunk in tag_stack]) -346 balanced = [chunk for chunk in balanced if chunk is not None] -347 return start, balanced, end -
348 -
349 -def split_delete(chunks): -
350 """ Returns (stuff_before_DEL_START, stuff_inside_DEL_START_END, -351 stuff_after_DEL_END). Returns the first case found (there may be -352 more DEL_STARTs in stuff_after_DEL_END). Raises NoDeletes if -353 there's no DEL_START found. """ -354 try: -355 pos = chunks.index(DEL_START) -356 except ValueError: -357 raise NoDeletes -358 pos2 = chunks.index(DEL_END) -359 return chunks[:pos], chunks[pos+1:pos2], chunks[pos2+1:] -
360 -
361 -def locate_unbalanced_start(unbalanced_start, pre_delete, post_delete): -
362 """ pre_delete and post_delete implicitly point to a place in the -363 document (where the two were split). This moves that point (by -364 popping items from one and pushing them onto the other). It moves -365 the point to try to find a place where unbalanced_start applies. -366 -367 As an example:: -368 -369 >>> unbalanced_start = ['<div>'] -370 >>> doc = ['<p>', 'Text', '</p>', '<div>', 'More Text', '</div>'] -371 >>> pre, post = doc[:3], doc[3:] -372 >>> pre, post -373 (['<p>', 'Text', '</p>'], ['<div>', 'More Text', '</div>']) -374 >>> locate_unbalanced_start(unbalanced_start, pre, post) -375 >>> pre, post -376 (['<p>', 'Text', '</p>', '<div>'], ['More Text', '</div>']) -377 -378 As you can see, we moved the point so that the dangling <div> that -379 we found will be effectively replaced by the div in the original -380 document. If this doesn't work out, we just throw away -381 unbalanced_start without doing anything. -382 """ -383 while 1: -384 if not unbalanced_start: -385 # We have totally succeeded in finding the position -386 break -387 finding = unbalanced_start[0] -388 finding_name = finding.split()[0].strip('<>') -389 if not post_delete: -390 break -391 next = post_delete[0] -392 if next is DEL_START or not next.startswith('<'): -393 # Reached a word, we can't move the delete text forward -394 break -395 if next[1] == '/': -396 # Reached a closing tag, can we go further? Maybe not... -397 break -398 name = next.split()[0].strip('<>') -399 if name == 'ins': -400 # Can't move into an insert -401 break -402 assert name != 'del', ( -403 "Unexpected delete tag: %r" % next) -404 if name == finding_name: -405 unbalanced_start.pop(0) -406 pre_delete.append(post_delete.pop(0)) -407 else: -408 # Found a tag that doesn't match -409 break -
410 -
411 -def locate_unbalanced_end(unbalanced_end, pre_delete, post_delete): -
412 """ like locate_unbalanced_start, except handling end tags and -413 possibly moving the point earlier in the document. """ -414 while 1: -415 if not unbalanced_end: -416 # Success -417 break -418 finding = unbalanced_end[-1] -419 finding_name = finding.split()[0].strip('<>/') -420 if not pre_delete: -421 break -422 next = pre_delete[-1] -423 if next is DEL_END or not next.startswith('</'): -424 # A word or a start tag -425 break -426 name = next.split()[0].strip('<>/') -427 if name == 'ins' or name == 'del': -428 # Can't move into an insert or delete -429 break -430 if name == finding_name: -431 unbalanced_end.pop() -432 post_delete.insert(0, pre_delete.pop()) -433 else: -434 # Found a tag that doesn't match -435 break -
436 -
437 -class token(_unicode): -
438 """ Represents a diffable token, generally a word that is displayed to -439 the user. Opening tags are attached to this token when they are -440 adjacent (pre_tags) and closing tags that follow the word -441 (post_tags). Some exceptions occur when there are empty tags -442 adjacent to a word, so there may be close tags in pre_tags, or -443 open tags in post_tags. -444 -445 We also keep track of whether the word was originally followed by -446 whitespace, even though we do not want to treat the word as -447 equivalent to a similar word that does not have a trailing -448 space.""" -449 -450 # When this is true, the token will be eliminated from the -451 # displayed diff if no change has occurred: -452 hide_when_equal = False -453 -
454 - def __new__(cls, text, pre_tags=None, post_tags=None, trailing_whitespace=""): -
455 obj = _unicode.__new__(cls, text) -456 -457 if pre_tags is not None: -458 obj.pre_tags = pre_tags -459 else: -460 obj.pre_tags = [] -461 -462 if post_tags is not None: -463 obj.post_tags = post_tags -464 else: -465 obj.post_tags = [] -466 -467 obj.trailing_whitespace = trailing_whitespace -468 -469 return obj -
470 -
471 - def __repr__(self): -
472 return 'token(%s, %r, %r, %r)' % (_unicode.__repr__(self), self.pre_tags, -473 self.post_tags, self.trailing_whitespace) -
474 -
475 - def html(self): -
476 return _unicode(self) -
477 -
478 -class tag_token(token): -
479 -480 """ Represents a token that is actually a tag. Currently this is just -481 the <img> tag, which takes up visible space just like a word but -482 is only represented in a document by a tag. """ -483 -
484 - def __new__(cls, tag, data, html_repr, pre_tags=None, -485 post_tags=None, trailing_whitespace=""): -
486 obj = token.__new__(cls, "%s: %s" % (type, data), -487 pre_tags=pre_tags, -488 post_tags=post_tags, -489 trailing_whitespace=trailing_whitespace) -490 obj.tag = tag -491 obj.data = data -492 obj.html_repr = html_repr -493 return obj -
494 -
495 - def __repr__(self): -
496 return 'tag_token(%s, %s, html_repr=%s, post_tags=%r, pre_tags=%r, trailing_whitespace=%r)' % ( -497 self.tag, -498 self.data, -499 self.html_repr, -500 self.pre_tags, -501 self.post_tags, -502 self.trailing_whitespace) -
503 - def html(self): -
504 return self.html_repr -
505 -
506 -class href_token(token): -
507 -508 """ Represents the href in an anchor tag. Unlike other words, we only -509 show the href when it changes. """ -510 -511 hide_when_equal = True -512 -
513 - def html(self): -
514 return ' Link: %s' % self -
515 -
516 -def tokenize(html, include_hrefs=True): -
517 """ -518 Parse the given HTML and returns token objects (words with attached tags). -519 -520 This parses only the content of a page; anything in the head is -521 ignored, and the <head> and <body> elements are themselves -522 optional. The content is then parsed by lxml, which ensures the -523 validity of the resulting parsed document (though lxml may make -524 incorrect guesses when the markup is particular bad). -525 -526 <ins> and <del> tags are also eliminated from the document, as -527 that gets confusing. -528 -529 If include_hrefs is true, then the href attribute of <a> tags is -530 included as a special kind of diffable token.""" -531 if etree.iselement(html): -532 body_el = html -533 else: -534 body_el = parse_html(html, cleanup=True) -535 # Then we split the document into text chunks for each tag, word, and end tag: -536 chunks = flatten_el(body_el, skip_tag=True, include_hrefs=include_hrefs) -537 # Finally re-joining them into token objects: -538 return fixup_chunks(chunks) -
539 -
540 -def parse_html(html, cleanup=True): -
541 """ -542 Parses an HTML fragment, returning an lxml element. Note that the HTML will be -543 wrapped in a <div> tag that was not in the original document. -544 -545 If cleanup is true, make sure there's no <head> or <body>, and get -546 rid of any <ins> and <del> tags. -547 """ -548 if cleanup: -549 # This removes any extra markup or structure like <head>: -550 html = cleanup_html(html) -551 return fragment_fromstring(html, create_parent=True) -
552 -553 _body_re = re.compile(r'<body.*?>', re.I|re.S) -554 _end_body_re = re.compile(r'</body.*?>', re.I|re.S) -555 _ins_del_re = re.compile(r'</?(ins|del).*?>', re.I|re.S) -556 -
557 -def cleanup_html(html): -
558 """ This 'cleans' the HTML, meaning that any page structure is removed -559 (only the contents of <body> are used, if there is any <body). -560 Also <ins> and <del> tags are removed. """ -561 match = _body_re.search(html) -562 if match: -563 html = html[match.end():] -564 match = _end_body_re.search(html) -565 if match: -566 html = html[:match.start()] -567 html = _ins_del_re.sub('', html) -568 return html -
569 -570 -571 end_whitespace_re = re.compile(r'[ \t\n\r]$') -572 -
574 """ -575 This function takes a word, such as 'test\n\n' and returns ('test','\n\n') -576 """ -577 stripped_length = len(word.rstrip()) -578 return word[0:stripped_length], word[stripped_length:] -
579 -580 -
581 -def fixup_chunks(chunks): -
582 """ -583 This function takes a list of chunks and produces a list of tokens. -584 """ -585 tag_accum = [] -586 cur_word = None -587 result = [] -588 for chunk in chunks: -589 if isinstance(chunk, tuple): -590 if chunk[0] == 'img': -591 src = chunk[1] -592 tag, trailing_whitespace = split_trailing_whitespace(chunk[2]) -593 cur_word = tag_token('img', src, html_repr=tag, -594 pre_tags=tag_accum, -595 trailing_whitespace=trailing_whitespace) -596 tag_accum = [] -597 result.append(cur_word) -598 -599 elif chunk[0] == 'href': -600 href = chunk[1] -601 cur_word = href_token(href, pre_tags=tag_accum, trailing_whitespace=" ") -602 tag_accum = [] -603 result.append(cur_word) -604 continue -605 -606 if is_word(chunk): -607 chunk, trailing_whitespace = split_trailing_whitespace(chunk) -608 cur_word = token(chunk, pre_tags=tag_accum, trailing_whitespace=trailing_whitespace) -609 tag_accum = [] -610 result.append(cur_word) -611 -612 elif is_start_tag(chunk): -613 tag_accum.append(chunk) -614 -615 elif is_end_tag(chunk): -616 if tag_accum: -617 tag_accum.append(chunk) -618 else: -619 assert cur_word, ( -620 "Weird state, cur_word=%r, result=%r, chunks=%r of %r" -621 % (cur_word, result, chunk, chunks)) -622 cur_word.post_tags.append(chunk) -623 else: -624 assert(0) -625 -626 if not result: -627 return [token('', pre_tags=tag_accum)] -628 else: -629 result[-1].post_tags.extend(tag_accum) -630 -631 return result -
632 -633 -634 # All the tags in HTML that don't require end tags: -635 empty_tags = ( -636 'param', 'img', 'area', 'br', 'basefont', 'input', -637 'base', 'meta', 'link', 'col') -638 -639 block_level_tags = ( -640 'address', -641 'blockquote', -642 'center', -643 'dir', -644 'div', -645 'dl', -646 'fieldset', -647 'form', -648 'h1', -649 'h2', -650 'h3', -651 'h4', -652 'h5', -653 'h6', -654 'hr', -655 'isindex', -656 'menu', -657 'noframes', -658 'noscript', -659 'ol', -660 'p', -661 'pre', -662 'table', -663 'ul', -664 ) -665 -666 block_level_container_tags = ( -667 'dd', -668 'dt', -669 'frameset', -670 'li', -671 'tbody', -672 'td', -673 'tfoot', -674 'th', -675 'thead', -676 'tr', -677 ) -678 -679 -
680 -def flatten_el(el, include_hrefs, skip_tag=False): -
681 """ Takes an lxml element el, and generates all the text chunks for -682 that tag. Each start tag is a chunk, each word is a chunk, and each -683 end tag is a chunk. -684 -685 If skip_tag is true, then the outermost container tag is -686 not returned (just its contents).""" -687 if not skip_tag: -688 if el.tag == 'img': -689 yield ('img', el.get('src'), start_tag(el)) -690 else: -691 yield start_tag(el) -692 if el.tag in empty_tags and not el.text and not len(el) and not el.tail: -693 return -694 start_words = split_words(el.text) -695 for word in start_words: -696 yield html_escape(word) -697 for child in el: -698 for item in flatten_el(child, include_hrefs=include_hrefs): -699 yield item -700 if el.tag == 'a' and el.get('href') and include_hrefs: -701 yield ('href', el.get('href')) -702 if not skip_tag: -703 yield end_tag(el) -704 end_words = split_words(el.tail) -705 for word in end_words: -706 yield html_escape(word) -
707 -708 split_words_re = re.compile(r'\S+(?:\s+|$)', re.U) -709 -
710 -def split_words(text): -
711 """ Splits some text into words. Includes trailing whitespace -712 on each word when appropriate. """ -713 if not text or not text.strip(): -714 return [] -715 -716 words = split_words_re.findall(text) -717 return words -
718 -719 start_whitespace_re = re.compile(r'^[ \t\n\r]') -720 -
721 -def start_tag(el): -
722 """ -723 The text representation of the start tag for a tag. -724 """ -725 return '<%s%s>' % ( -726 el.tag, ''.join([' %s="%s"' % (name, html_escape(value, True)) -727 for name, value in el.attrib.items()])) -
728 -
729 -def end_tag(el): -
730 """ The text representation of an end tag for a tag. Includes -731 trailing whitespace when appropriate. """ -732 if el.tail and start_whitespace_re.search(el.tail): -733 extra = ' ' -734 else: -735 extra = '' -736 return '</%s>%s' % (el.tag, extra) -
737 -
738 -def is_word(tok): -
739 return not tok.startswith('<') -
740 -
741 -def is_end_tag(tok): -
742 return tok.startswith('</') -
743 -
744 -def is_start_tag(tok): -
745 return tok.startswith('<') and not tok.startswith('</') -
746 -
747 -def fixup_ins_del_tags(html): -
748 """ Given an html string, move any <ins> or <del> tags inside of any -749 block-level elements, e.g. transform <ins><p>word</p></ins> to -750 <p><ins>word</ins></p> """ -751 doc = parse_html(html, cleanup=False) -752 _fixup_ins_del_tags(doc) -753 html = serialize_html_fragment(doc, skip_outer=True) -754 return html -
755 -
756 -def serialize_html_fragment(el, skip_outer=False): -
757 """ Serialize a single lxml element as HTML. The serialized form -758 includes the elements tail. -759 -760 If skip_outer is true, then don't serialize the outermost tag -761 """ -762 assert not isinstance(el, basestring), ( -763 "You should pass in an element, not a string like %r" % el) -764 html = etree.tostring(el, method="html", encoding=_unicode) -765 if skip_outer: -766 # Get rid of the extra starting tag: -767 html = html[html.find('>')+1:] -768 # Get rid of the extra end tag: -769 html = html[:html.rfind('<')] -770 return html.strip() -771 else: -772 return html -
773 -
774 -def _fixup_ins_del_tags(doc): -
775 """fixup_ins_del_tags that works on an lxml document in-place -776 """ -777 for tag in ['ins', 'del']: -778 for el in doc.xpath('descendant-or-self::%s' % tag): -779 if not _contains_block_level_tag(el): -780 continue -781 _move_el_inside_block(el, tag=tag) -782 el.drop_tag() -
783 #_merge_element_contents(el) -784 -
786 """True if the element contains any block-level elements, like <p>, <td>, etc. -787 """ -788 if el.tag in block_level_tags or el.tag in block_level_container_tags: -789 return True -790 for child in el: -791 if _contains_block_level_tag(child): -792 return True -793 return False -
794 -
795 -def _move_el_inside_block(el, tag): -
796 """ helper for _fixup_ins_del_tags; actually takes the <ins> etc tags -797 and moves them inside any block-level tags. """ -798 for child in el: -799 if _contains_block_level_tag(child): -800 break -801 else: -802 import sys -803 # No block-level tags in any child -804 children_tag = etree.Element(tag) -805 children_tag.text = el.text -806 el.text = None -807 children_tag.extend(list(el)) -808 el[:] = [children_tag] -809 return -810 for child in list(el): -811 if _contains_block_level_tag(child): -812 _move_el_inside_block(child, tag) -813 if child.tail: -814 tail_tag = etree.Element(tag) -815 tail_tag.text = child.tail -816 child.tail = None -817 el.insert(el.index(child)+1, tail_tag) -818 else: -819 child_tag = etree.Element(tag) -820 el.replace(child, child_tag) -821 child_tag.append(child) -822 if el.text: -823 text_tag = etree.Element(tag) -824 text_tag.text = el.text -825 el.text = None -826 el.insert(0, text_tag) -
827 -
829 """ -830 Removes an element, but merges its contents into its place, e.g., -831 given <p>Hi <i>there!</i></p>, if you remove the <i> element you get -832 <p>Hi there!</p> -833 """ -834 parent = el.getparent() -835 text = el.text or '' -836 if el.tail: -837 if not len(el): -838 text += el.tail -839 else: -840 if el[-1].tail: -841 el[-1].tail += el.tail -842 else: -843 el[-1].tail = el.tail -844 index = parent.index(el) -845 if text: -846 if index == 0: -847 previous = None -848 else: -849 previous = parent[index-1] -850 if previous is None: -851 if parent.text: -852 parent.text += text -853 else: -854 parent.text = text -855 else: -856 if previous.tail: -857 previous.tail += text -858 else: -859 previous.tail = text -860 parent[index:index+1] = el.getchildren() -
861 -
862 -class InsensitiveSequenceMatcher(difflib.SequenceMatcher): -
863 """ -864 Acts like SequenceMatcher, but tries not to find very small equal -865 blocks amidst large spans of changes -866 """ -867 -868 threshold = 2 -869 -
870 - def get_matching_blocks(self): -
871 size = min(len(self.b), len(self.b)) -872 threshold = min(self.threshold, size / 4) -873 actual = difflib.SequenceMatcher.get_matching_blocks(self) -874 return [item for item in actual -875 if item[2] > threshold -876 or not item[2]] -
877 -878 if __name__ == '__main__': -879 from lxml.html import _diffcommand -880 _diffcommand.main() -881 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.diff.DEL_END-class.html b/doc/html/api/lxml.html.diff.DEL_END-class.html deleted file mode 100644 index a2e68a57..00000000 --- a/doc/html/api/lxml.html.diff.DEL_END-class.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - lxml.html.diff.DEL_END - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module diff :: - Class DEL_END - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DEL_END

source code

- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = 'DEL_END' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.diff.DEL_START-class.html b/doc/html/api/lxml.html.diff.DEL_START-class.html deleted file mode 100644 index 3148666c..00000000 --- a/doc/html/api/lxml.html.diff.DEL_START-class.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - lxml.html.diff.DEL_START - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module diff :: - Class DEL_START - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DEL_START

source code

- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = 'DEL_START' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.diff.InsensitiveSequenceMatcher-class.html b/doc/html/api/lxml.html.diff.InsensitiveSequenceMatcher-class.html deleted file mode 100644 index 058e1338..00000000 --- a/doc/html/api/lxml.html.diff.InsensitiveSequenceMatcher-class.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - lxml.html.diff.InsensitiveSequenceMatcher - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module diff :: - Class InsensitiveSequenceMatcher - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class InsensitiveSequenceMatcher

source code

-
-difflib.SequenceMatcher --+
-                          |
-                         InsensitiveSequenceMatcher
-
- -
-Acts like SequenceMatcher, but tries not to find very small equal -blocks amidst large spans of changes - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
get_matching_blocks(self)
- Return list of triples describing matching subsequences.
- source code - -
- -
-

Inherited from difflib.SequenceMatcher: - __init__, - find_longest_match, - get_grouped_opcodes, - get_opcodes, - quick_ratio, - ratio, - real_quick_ratio, - set_seq1, - set_seq2, - set_seqs -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - threshold = 2 -
-   - - __qualname__ = 'InsensitiveSequenceMatcher' -
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

get_matching_blocks(self) -

-
source code  -
- -

Return list of triples describing matching subsequences.

-

Each triple is of the form (i, j, n), and means that -a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in -i and in j. New in Python 2.5, it's also guaranteed that if -(i, j, n) and (i', j', n') are adjacent triples in the list, and -the second is not the last triple in the list, then i+n != i' or -j+n != j'. IOW, adjacent triples never describe adjacent equal -blocks.

-

The last triple is a dummy, (len(a), len(b), 0), and is the only -triple with n==0.

-
->>> s = SequenceMatcher(None, "abxcd", "abcd")
->>> s.get_matching_blocks()
-[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]
-
-
Overrides: - difflib.SequenceMatcher.get_matching_blocks -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.diff.NoDeletes-class.html b/doc/html/api/lxml.html.diff.NoDeletes-class.html deleted file mode 100644 index 87eb2125..00000000 --- a/doc/html/api/lxml.html.diff.NoDeletes-class.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - lxml.html.diff.NoDeletes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module diff :: - Class NoDeletes - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class NoDeletes

source code

-
-              object --+        
-                       |        
-exceptions.BaseException --+    
-                           |    
-        exceptions.Exception --+
-                               |
-                              NoDeletes
-
- -
-Raised when the document no longer contains any pending deletes -(DEL_START/DEL_END) - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from exceptions.Exception: - __init__, - __new__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = 'NoDeletes' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.diff.href_token-class.html b/doc/html/api/lxml.html.diff.href_token-class.html deleted file mode 100644 index ec6559e6..00000000 --- a/doc/html/api/lxml.html.diff.href_token-class.html +++ /dev/null @@ -1,348 +0,0 @@ - - - - - lxml.html.diff.href_token - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module diff :: - Class href_token - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class href_token

source code

-
-object --+            
-         |            
-basestring --+        
-             |        
-       unicode --+    
-                 |    
-             token --+
-                     |
-                    href_token
-
- -
-Represents the href in an anchor tag. Unlike other words, we only -show the href when it changes. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
html(self) - source code - -
- -
-

Inherited from token: - __new__, - __repr__ -

-

Inherited from unicode: - __add__, - __contains__, - __eq__, - __format__, - __ge__, - __getattribute__, - __getitem__, - __getnewargs__, - __getslice__, - __gt__, - __hash__, - __le__, - __len__, - __lt__, - __mod__, - __mul__, - __ne__, - __rmod__, - __rmul__, - __sizeof__, - __str__, - capitalize, - center, - count, - decode, - encode, - endswith, - expandtabs, - find, - format, - index, - isalnum, - isalpha, - isdecimal, - isdigit, - islower, - isnumeric, - isspace, - istitle, - isupper, - join, - ljust, - lower, - lstrip, - partition, - replace, - rfind, - rindex, - rjust, - rpartition, - rsplit, - rstrip, - split, - splitlines, - startswith, - strip, - swapcase, - title, - translate, - upper, - zfill -

-

Inherited from unicode (private): - _formatter_field_name_split, - _formatter_parser -

-

Inherited from object: - __delattr__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - hide_when_equal = True -
-   - - __qualname__ = 'href_token' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

html(self) -

-
source code  -
- - -
-
Overrides: - token.html -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.diff.tag_token-class.html b/doc/html/api/lxml.html.diff.tag_token-class.html deleted file mode 100644 index 3c068d0f..00000000 --- a/doc/html/api/lxml.html.diff.tag_token-class.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - lxml.html.diff.tag_token - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module diff :: - Class tag_token - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class tag_token

source code

-
-object --+            
-         |            
-basestring --+        
-             |        
-       unicode --+    
-                 |    
-             token --+
-                     |
-                    tag_token
-
- -
-Represents a token that is actually a tag. Currently this is just -the <img> tag, which takes up visible space just like a word but -is only represented in a document by a tag. - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(cls, - tag, - data, - html_repr, - pre_tags=None, - post_tags=None, - trailing_whitespace="") - source code - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-   - - - - - - -
html(self) - source code - -
- -
-

Inherited from unicode: - __add__, - __contains__, - __eq__, - __format__, - __ge__, - __getattribute__, - __getitem__, - __getnewargs__, - __getslice__, - __gt__, - __hash__, - __le__, - __len__, - __lt__, - __mod__, - __mul__, - __ne__, - __rmod__, - __rmul__, - __sizeof__, - __str__, - capitalize, - center, - count, - decode, - encode, - endswith, - expandtabs, - find, - format, - index, - isalnum, - isalpha, - isdecimal, - isdigit, - islower, - isnumeric, - isspace, - istitle, - isupper, - join, - ljust, - lower, - lstrip, - partition, - replace, - rfind, - rindex, - rjust, - rpartition, - rsplit, - rstrip, - split, - splitlines, - startswith, - strip, - swapcase, - title, - translate, - upper, - zfill -

-

Inherited from unicode (private): - _formatter_field_name_split, - _formatter_parser -

-

Inherited from object: - __delattr__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - __qualname__ = 'tag_token' -
-

Inherited from token: - hide_when_equal -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(cls, - tag, - data, - html_repr, - pre_tags=None, - post_tags=None, - trailing_whitespace="") -

-
source code  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

html(self) -

-
source code  -
- - -
-
Overrides: - token.html -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.diff.token-class.html b/doc/html/api/lxml.html.diff.token-class.html deleted file mode 100644 index f26c7a29..00000000 --- a/doc/html/api/lxml.html.diff.token-class.html +++ /dev/null @@ -1,423 +0,0 @@ - - - - - lxml.html.diff.token - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module diff :: - Class token - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class token

source code

-
-object --+        
-         |        
-basestring --+    
-             |    
-       unicode --+
-                 |
-                token
-
- -
Known Subclasses:
-
- -
- -
-

Represents a diffable token, generally a word that is displayed to -the user. Opening tags are attached to this token when they are -adjacent (pre_tags) and closing tags that follow the word -(post_tags). Some exceptions occur when there are empty tags -adjacent to a word, so there may be close tags in pre_tags, or -open tags in post_tags.

-

We also keep track of whether the word was originally followed by -whitespace, even though we do not want to treat the word as -equivalent to a similar word that does not have a trailing -space.

- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(cls, - text, - pre_tags=None, - post_tags=None, - trailing_whitespace="") - source code - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-   - - - - - - -
html(self) - source code - -
- -
-

Inherited from unicode: - __add__, - __contains__, - __eq__, - __format__, - __ge__, - __getattribute__, - __getitem__, - __getnewargs__, - __getslice__, - __gt__, - __hash__, - __le__, - __len__, - __lt__, - __mod__, - __mul__, - __ne__, - __rmod__, - __rmul__, - __sizeof__, - __str__, - capitalize, - center, - count, - decode, - encode, - endswith, - expandtabs, - find, - format, - index, - isalnum, - isalpha, - isdecimal, - isdigit, - islower, - isnumeric, - isspace, - istitle, - isupper, - join, - ljust, - lower, - lstrip, - partition, - replace, - rfind, - rindex, - rjust, - rpartition, - rsplit, - rstrip, - split, - splitlines, - startswith, - strip, - swapcase, - title, - translate, - upper, - zfill -

-

Inherited from unicode (private): - _formatter_field_name_split, - _formatter_parser -

-

Inherited from object: - __delattr__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - hide_when_equal = False -
-   - - __qualname__ = 'token' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(cls, - text, - pre_tags=None, - post_tags=None, - trailing_whitespace="") -

-
source code  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.formfill-module.html b/doc/html/api/lxml.html.formfill-module.html deleted file mode 100644 index 228ac337..00000000 --- a/doc/html/api/lxml.html.formfill-module.html +++ /dev/null @@ -1,587 +0,0 @@ - - - - - lxml.html.formfill - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module formfill - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module formfill

source code

- - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - basestring
- str(object='') -> string -
-   - - FormNotFound
- Raised when no form can be found -
-   - - DefaultErrorCreator -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
fill_form(el, - values, - form_id=None, - form_index=None) - source code - -
- -
-   - - - - - - -
fill_form_html(html, - values, - form_id=None, - form_index=None) - source code - -
- -
-   - - - - - - -
_fill_form(el, - values) - source code - -
- -
-   - - - - - - -
_takes_multiple(input) - source code - -
- -
-   - - - - - - -
_fill_multiple(input, - value) - source code - -
- -
-   - - - - - - -
_check(el, - check) - source code - -
- -
-   - - - - - - -
_select(el, - select) - source code - -
- -
-   - - - - - - -
_fill_single(input, - value) - source code - -
- -
-   - - - - - - -
_find_form(el, - form_id=None, - form_index=None) - source code - -
- -
-   - - - - - - -
_find_form_ids(el) - source code - -
- -
-   - - - - - - -
insert_errors(el, - errors, - form_id=None, - form_index=None, - error_class='error', - error_creator=<lxml.html.formfill.DefaultErrorCreator object>) - source code - -
- -
-   - - - - - - -
insert_errors_html(html, - values, - **kw) - source code - -
- -
-   - - - - - - -
_insert_error(el, - error, - error_class, - error_creator) - source code - -
- -
-   - - - - - - -
_add_class(el, - class_name) - source code - -
- -
-   - - - - - - -
_find_elements_for_name(form, - name, - error) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - _form_name_xpath = descendant-or-self::form[name=$name]|descen... -
-   - - _input_xpath = descendant-or-self::input|descendant-or-self::s... -
-   - - _label_for_xpath = //label[@for=$for_id]|//x:label[@for=$for_id] -
-   - - _name_xpath = descendant-or-self::*[@name=$name] -
-   - - default_error_creator = <lxml.html.formfill.DefaultErrorCreato... -
-   - - __package__ = 'lxml.html' -
-   - - _tag = 'x:textarea' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

_form_name_xpath

- -
-
-
-
Value:
-
-descendant-or-self::form[name=$name]|descendant-or-self::x:form[name=$\
-name]
-
-
-
-
-
- -
- -
-

_input_xpath

- -
-
-
-
Value:
-
-descendant-or-self::input|descendant-or-self::select|descendant-or-sel\
-f::textarea|descendant-or-self::x:input|descendant-or-self::x:select|d\
-escendant-or-self::x:textarea
-
-
-
-
-
- -
- -
-

default_error_creator

- -
-
-
-
Value:
-
-<lxml.html.formfill.DefaultErrorCreator object>
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.formfill-pysrc.html b/doc/html/api/lxml.html.formfill-pysrc.html deleted file mode 100644 index 8d04d73c..00000000 --- a/doc/html/api/lxml.html.formfill-pysrc.html +++ /dev/null @@ -1,816 +0,0 @@ - - - - - lxml.html.formfill - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module formfill - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.html.formfill

-
-  1  from lxml.etree import XPath, ElementBase 
-  2  from lxml.html import fromstring, XHTML_NAMESPACE 
-  3  from lxml.html import _forms_xpath, _options_xpath, _nons, _transform_result 
-  4  from lxml.html import defs 
-  5  import copy 
-  6   
-  7  try: 
-  8      basestring 
-  9  except NameError: 
- 10      # Python 3 
- 11      basestring = str 
- 12   
- 13  __all__ = ['FormNotFound', 'fill_form', 'fill_form_html', 
- 14             'insert_errors', 'insert_errors_html', 
- 15             'DefaultErrorCreator'] 
- 16   
-
17 -class FormNotFound(LookupError): -
18 """ - 19 Raised when no form can be found - 20 """ -
21 - 22 _form_name_xpath = XPath('descendant-or-self::form[name=$name]|descendant-or-self::x:form[name=$name]', namespaces={'x':XHTML_NAMESPACE}) - 23 _input_xpath = XPath('|'.join(['descendant-or-self::'+_tag for _tag in ('input','select','textarea','x:input','x:select','x:textarea')]), - 24 namespaces={'x':XHTML_NAMESPACE}) - 25 _label_for_xpath = XPath('//label[@for=$for_id]|//x:label[@for=$for_id]', - 26 namespaces={'x':XHTML_NAMESPACE}) - 27 _name_xpath = XPath('descendant-or-self::*[@name=$name]') - 28 -
29 -def fill_form( - 30 el, - 31 values, - 32 form_id=None, - 33 form_index=None, - 34 ): -
35 el = _find_form(el, form_id=form_id, form_index=form_index) - 36 _fill_form(el, values) -
37 -
38 -def fill_form_html(html, values, form_id=None, form_index=None): -
39 result_type = type(html) - 40 if isinstance(html, basestring): - 41 doc = fromstring(html) - 42 else: - 43 doc = copy.deepcopy(html) - 44 fill_form(doc, values, form_id=form_id, form_index=form_index) - 45 return _transform_result(result_type, doc) -
46 -
47 -def _fill_form(el, values): -
48 counts = {} - 49 if hasattr(values, 'mixed'): - 50 # For Paste request parameters - 51 values = values.mixed() - 52 inputs = _input_xpath(el) - 53 for input in inputs: - 54 name = input.get('name') - 55 if not name: - 56 continue - 57 if _takes_multiple(input): - 58 value = values.get(name, []) - 59 if not isinstance(value, (list, tuple)): - 60 value = [value] - 61 _fill_multiple(input, value) - 62 elif name not in values: - 63 continue - 64 else: - 65 index = counts.get(name, 0) - 66 counts[name] = index + 1 - 67 value = values[name] - 68 if isinstance(value, (list, tuple)): - 69 try: - 70 value = value[index] - 71 except IndexError: - 72 continue - 73 elif index > 0: - 74 continue - 75 _fill_single(input, value) -
76 -
77 -def _takes_multiple(input): -
78 if _nons(input.tag) == 'select' and input.get('multiple'): - 79 # FIXME: multiple="0"? - 80 return True - 81 type = input.get('type', '').lower() - 82 if type in ('radio', 'checkbox'): - 83 return True - 84 return False -
85 -
86 -def _fill_multiple(input, value): -
87 type = input.get('type', '').lower() - 88 if type == 'checkbox': - 89 v = input.get('value') - 90 if v is None: - 91 if not value: - 92 result = False - 93 else: - 94 result = value[0] - 95 if isinstance(value, basestring): - 96 # The only valid "on" value for an unnamed checkbox is 'on' - 97 result = result == 'on' - 98 _check(input, result) - 99 else: -100 _check(input, v in value) -101 elif type == 'radio': -102 v = input.get('value') -103 _check(input, v in value) -104 else: -105 assert _nons(input.tag) == 'select' -106 for option in _options_xpath(input): -107 v = option.get('value') -108 if v is None: -109 # This seems to be the default, at least on IE -110 # FIXME: but I'm not sure -111 v = option.text_content() -112 _select(option, v in value) -
113 -
114 -def _check(el, check): -
115 if check: -116 el.set('checked', '') -117 else: -118 if 'checked' in el.attrib: -119 del el.attrib['checked'] -
120 -
121 -def _select(el, select): -
122 if select: -123 el.set('selected', '') -124 else: -125 if 'selected' in el.attrib: -126 del el.attrib['selected'] -
127 -
128 -def _fill_single(input, value): -
129 if _nons(input.tag) == 'textarea': -130 input.text = value -131 else: -132 input.set('value', value) -
133 -
134 -def _find_form(el, form_id=None, form_index=None): -
135 if form_id is None and form_index is None: -136 forms = _forms_xpath(el) -137 for form in forms: -138 return form -139 raise FormNotFound( -140 "No forms in page") -141 if form_id is not None: -142 form = el.get_element_by_id(form_id) -143 if form is not None: -144 return form -145 forms = _form_name_xpath(el, name=form_id) -146 if forms: -147 return forms[0] -148 else: -149 raise FormNotFound( -150 "No form with the name or id of %r (forms: %s)" -151 % (id, ', '.join(_find_form_ids(el)))) -152 if form_index is not None: -153 forms = _forms_xpath(el) -154 try: -155 return forms[form_index] -156 except IndexError: -157 raise FormNotFound( -158 "There is no form with the index %r (%i forms found)" -159 % (form_index, len(forms))) -
160 -
161 -def _find_form_ids(el): -
162 forms = _forms_xpath(el) -163 if not forms: -164 yield '(no forms)' -165 return -166 for index, form in enumerate(forms): -167 if form.get('id'): -168 if form.get('name'): -169 yield '%s or %s' % (form.get('id'), -170 form.get('name')) -171 else: -172 yield form.get('id') -173 elif form.get('name'): -174 yield form.get('name') -175 else: -176 yield '(unnamed form %s)' % index -
177 -178 ############################################################ -179 ## Error filling -180 ############################################################ -181 -
182 -class DefaultErrorCreator(object): -
183 insert_before = True -184 block_inside = True -185 error_container_tag = 'div' -186 error_message_class = 'error-message' -187 error_block_class = 'error-block' -188 default_message = "Invalid" -189 -
190 - def __init__(self, **kw): -
191 for name, value in kw.items(): -192 if not hasattr(self, name): -193 raise TypeError( -194 "Unexpected keyword argument: %s" % name) -195 setattr(self, name, value) -
196 -
197 - def __call__(self, el, is_block, message): -
198 error_el = el.makeelement(self.error_container_tag) -199 if self.error_message_class: -200 error_el.set('class', self.error_message_class) -201 if is_block and self.error_block_class: -202 error_el.set('class', error_el.get('class', '')+' '+self.error_block_class) -203 if message is None or message == '': -204 message = self.default_message -205 if isinstance(message, ElementBase): -206 error_el.append(message) -207 else: -208 assert isinstance(message, basestring), ( -209 "Bad message; should be a string or element: %r" % message) -210 error_el.text = message or self.default_message -211 if is_block and self.block_inside: -212 if self.insert_before: -213 error_el.tail = el.text -214 el.text = None -215 el.insert(0, error_el) -216 else: -217 el.append(error_el) -218 else: -219 parent = el.getparent() -220 pos = parent.index(el) -221 if self.insert_before: -222 parent.insert(pos, error_el) -223 else: -224 error_el.tail = el.tail -225 el.tail = None -226 parent.insert(pos+1, error_el) -
227 -228 default_error_creator = DefaultErrorCreator() -229 -230 -
231 -def insert_errors( -232 el, -233 errors, -234 form_id=None, -235 form_index=None, -236 error_class="error", -237 error_creator=default_error_creator, -238 ): -
239 el = _find_form(el, form_id=form_id, form_index=form_index) -240 for name, error in errors.items(): -241 if error is None: -242 continue -243 for error_el, message in _find_elements_for_name(el, name, error): -244 assert isinstance(message, (basestring, type(None), ElementBase)), ( -245 "Bad message: %r" % message) -246 _insert_error(error_el, message, error_class, error_creator) -
247 -
248 -def insert_errors_html(html, values, **kw): -
249 result_type = type(html) -250 if isinstance(html, basestring): -251 doc = fromstring(html) -252 else: -253 doc = copy.deepcopy(html) -254 insert_errors(doc, values, **kw) -255 return _transform_result(result_type, doc) -
256 -
257 -def _insert_error(el, error, error_class, error_creator): -
258 if _nons(el.tag) in defs.empty_tags or _nons(el.tag) == 'textarea': -259 is_block = False -260 else: -261 is_block = True -262 if _nons(el.tag) != 'form' and error_class: -263 _add_class(el, error_class) -264 if el.get('id'): -265 labels = _label_for_xpath(el, for_id=el.get('id')) -266 if labels: -267 for label in labels: -268 _add_class(label, error_class) -269 error_creator(el, is_block, error) -
270 -
271 -def _add_class(el, class_name): -
272 if el.get('class'): -273 el.set('class', el.get('class')+' '+class_name) -274 else: -275 el.set('class', class_name) -
276 -
277 -def _find_elements_for_name(form, name, error): -
278 if name is None: -279 # An error for the entire form -280 yield form, error -281 return -282 if name.startswith('#'): -283 # By id -284 el = form.get_element_by_id(name[1:]) -285 if el is not None: -286 yield el, error -287 return -288 els = _name_xpath(form, name=name) -289 if not els: -290 # FIXME: should this raise an exception? -291 return -292 if not isinstance(error, (list, tuple)): -293 yield els[0], error -294 return -295 # FIXME: if error is longer than els, should it raise an error? -296 for el, err in zip(els, error): -297 if err is None: -298 continue -299 yield el, err -
300 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.formfill.DefaultErrorCreator-class.html b/doc/html/api/lxml.html.formfill.DefaultErrorCreator-class.html deleted file mode 100644 index 3fead56c..00000000 --- a/doc/html/api/lxml.html.formfill.DefaultErrorCreator-class.html +++ /dev/null @@ -1,326 +0,0 @@ - - - - - lxml.html.formfill.DefaultErrorCreator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module formfill :: - Class DefaultErrorCreator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DefaultErrorCreator

source code

-
-object --+
-         |
-        DefaultErrorCreator
-
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - **kw)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__call__(self, - el, - is_block, - message) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - insert_before = True -
-   - - block_inside = True -
-   - - error_container_tag = 'div' -
-   - - error_message_class = 'error-message' -
-   - - error_block_class = 'error-block' -
-   - - default_message = 'Invalid' -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - **kw) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.formfill.FormNotFound-class.html b/doc/html/api/lxml.html.formfill.FormNotFound-class.html deleted file mode 100644 index ead88476..00000000 --- a/doc/html/api/lxml.html.formfill.FormNotFound-class.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - lxml.html.formfill.FormNotFound - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module formfill :: - Class FormNotFound - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class FormNotFound

source code

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-        exceptions.StandardError --+    
-                                   |    
-              exceptions.LookupError --+
-                                       |
-                                      FormNotFound
-
- -
-Raised when no form can be found - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from exceptions.LookupError: - __init__, - __new__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.html5parser-module.html b/doc/html/api/lxml.html.html5parser-module.html deleted file mode 100644 index 2d57a8d1..00000000 --- a/doc/html/api/lxml.html.html5parser-module.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - lxml.html.html5parser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module html5parser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module html5parser

source code

-An interface to html5lib that mimics the lxml.html interface. - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - HTMLParser
- An html5lib HTML parser with lxml as tree. -
-   - - XHTMLParser
- An html5lib XHTML Parser with lxml as tree. -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
_find_tag(tree, - tag) - source code - -
- -
-   - - - - - - -
document_fromstring(html, - guess_charset=None, - parser=None)
- Parse a whole document into a string.
- source code - -
- -
-   - - - - - - -
fragments_fromstring(html, - no_leading_text=False, - guess_charset=None, - parser=None)
- Parses several HTML elements, returning a list of elements.
- source code - -
- -
-   - - - - - - -
fragment_fromstring(html, - create_parent=False, - guess_charset=None, - parser=None)
- Parses a single HTML element; it is an error if there is more than -one element, or if anything but whitespace precedes or follows the -element.
- source code - -
- -
-   - - - - - - -
fromstring(html, - guess_charset=None, - parser=None)
- Parse the html, returning a single element/document.
- source code - -
- -
-   - - - - - - -
parse(filename_url_or_file, - guess_charset=None, - parser=None)
- Parse a filename, URL, or file-like object into an HTML document -tree. Note: this returns a tree, not an element. Use -parse(...).getroot() to get the document root.
- source code - -
- -
-   - - - - - - -
_looks_like_url(str) - source code - -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - xhtml_parser = XHTMLParser() -
-   - - html_parser = <lxml.html.html5parser.HTMLParser object> -
-   - - __package__ = 'lxml.html' -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

document_fromstring(html, - guess_charset=None, - parser=None) -

-
source code  -
- -

Parse a whole document into a string.

-

If guess_charset is true, or if the input is not Unicode but a -byte string, the chardet library will perform charset guessing -on the string.

-
-
-
-
- -
- -
- - -
-

fragments_fromstring(html, - no_leading_text=False, - guess_charset=None, - parser=None) -

-
source code  -
- -

Parses several HTML elements, returning a list of elements.

-

The first item in the list may be a string. If no_leading_text is true, -then it will be an error if there is leading text, and it will always be -a list of only elements.

-

If guess_charset is true, the chardet library will perform charset -guessing on the string.

-
-
-
-
- -
- -
- - -
-

fragment_fromstring(html, - create_parent=False, - guess_charset=None, - parser=None) -

-
source code  -
- -

Parses a single HTML element; it is an error if there is more than -one element, or if anything but whitespace precedes or follows the -element.

-

If 'create_parent' is true (or is a tag name) then a parent node -will be created to encapsulate the HTML in a single element. In -this case, leading or trailing text is allowed.

-

If guess_charset is true, the chardet library will perform charset -guessing on the string.

-
-
-
-
- -
- -
- - -
-

fromstring(html, - guess_charset=None, - parser=None) -

-
source code  -
- -

Parse the html, returning a single element/document.

-

This tries to minimally parse the chunk of text, without knowing if it -is a fragment or a document.

-

'base_url' will set the document's base_url attribute (and the tree's -docinfo.URL)

-

If guess_charset is true, or if the input is not Unicode but a -byte string, the chardet library will perform charset guessing -on the string.

-
-
-
-
- -
- -
- - -
-

parse(filename_url_or_file, - guess_charset=None, - parser=None) -

-
source code  -
- -

Parse a filename, URL, or file-like object into an HTML document -tree. Note: this returns a tree, not an element. Use -parse(...).getroot() to get the document root.

-

If guess_charset is true, the useChardet option is passed into -html5lib to enable character detection. This option is on by default -when parsing from URLs, off by default when parsing from file(-like) -objects (which tend to return Unicode more often than not), and on by -default when parsing from a file path (which is read in binary mode).

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.html5parser-pysrc.html b/doc/html/api/lxml.html.html5parser-pysrc.html deleted file mode 100644 index 80000962..00000000 --- a/doc/html/api/lxml.html.html5parser-pysrc.html +++ /dev/null @@ -1,694 +0,0 @@ - - - - - lxml.html.html5parser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module html5parser - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.html.html5parser

-
-  1  """ 
-  2  An interface to html5lib that mimics the lxml.html interface. 
-  3  """ 
-  4  import sys 
-  5  import string 
-  6   
-  7  from html5lib import HTMLParser as _HTMLParser 
-  8  from html5lib.treebuilders.etree_lxml import TreeBuilder 
-  9  from lxml import etree 
- 10  from lxml.html import Element, XHTML_NAMESPACE, _contains_block_level_tag 
- 11   
- 12  # python3 compatibility 
- 13  try: 
- 14      _strings = basestring 
- 15  except NameError: 
- 16      _strings = (bytes, str) 
- 17  try: 
- 18      from urllib2 import urlopen 
- 19  except ImportError: 
- 20      from urllib.request import urlopen 
- 21  try: 
- 22      from urlparse import urlparse 
- 23  except ImportError: 
- 24      from urllib.parse import urlparse 
- 25   
- 26   
-
27 -class HTMLParser(_HTMLParser): -
28 """An html5lib HTML parser with lxml as tree.""" - 29 -
30 - def __init__(self, strict=False, **kwargs): -
31 _HTMLParser.__init__(self, strict=strict, tree=TreeBuilder, **kwargs) -
32 - 33 - 34 try: - 35 from html5lib import XHTMLParser as _XHTMLParser - 36 except ImportError: - 37 pass - 38 else: -
39 - class XHTMLParser(_XHTMLParser): -
40 """An html5lib XHTML Parser with lxml as tree.""" - 41 -
42 - def __init__(self, strict=False, **kwargs): -
43 _XHTMLParser.__init__(self, strict=strict, tree=TreeBuilder, **kwargs) -
44 - 45 xhtml_parser = XHTMLParser() - 46 - 47 -
48 -def _find_tag(tree, tag): -
49 elem = tree.find(tag) - 50 if elem is not None: - 51 return elem - 52 return tree.find('{%s}%s' % (XHTML_NAMESPACE, tag)) -
53 - 54 -
55 -def document_fromstring(html, guess_charset=None, parser=None): -
56 """ - 57 Parse a whole document into a string. - 58 - 59 If `guess_charset` is true, or if the input is not Unicode but a - 60 byte string, the `chardet` library will perform charset guessing - 61 on the string. - 62 """ - 63 if not isinstance(html, _strings): - 64 raise TypeError('string required') - 65 - 66 if parser is None: - 67 parser = html_parser - 68 - 69 options = {} - 70 if guess_charset is None and isinstance(html, bytes): - 71 # html5lib does not accept useChardet as an argument, if it - 72 # detected the html argument would produce unicode objects. - 73 guess_charset = True - 74 if guess_charset is not None: - 75 options['useChardet'] = guess_charset - 76 return parser.parse(html, **options).getroot() -
77 - 78 -
79 -def fragments_fromstring(html, no_leading_text=False, - 80 guess_charset=None, parser=None): -
81 """Parses several HTML elements, returning a list of elements. - 82 - 83 The first item in the list may be a string. If no_leading_text is true, - 84 then it will be an error if there is leading text, and it will always be - 85 a list of only elements. - 86 - 87 If `guess_charset` is true, the `chardet` library will perform charset - 88 guessing on the string. - 89 """ - 90 if not isinstance(html, _strings): - 91 raise TypeError('string required') - 92 - 93 if parser is None: - 94 parser = html_parser - 95 - 96 options = {} - 97 if guess_charset is None and isinstance(html, bytes): - 98 # html5lib does not accept useChardet as an argument, if it - 99 # detected the html argument would produce unicode objects. -100 guess_charset = False -101 if guess_charset is not None: -102 options['useChardet'] = guess_charset -103 children = parser.parseFragment(html, 'div', **options) -104 if children and isinstance(children[0], _strings): -105 if no_leading_text: -106 if children[0].strip(): -107 raise etree.ParserError('There is leading text: %r' % -108 children[0]) -109 del children[0] -110 return children -
111 -112 -
113 -def fragment_fromstring(html, create_parent=False, -114 guess_charset=None, parser=None): -
115 """Parses a single HTML element; it is an error if there is more than -116 one element, or if anything but whitespace precedes or follows the -117 element. -118 -119 If 'create_parent' is true (or is a tag name) then a parent node -120 will be created to encapsulate the HTML in a single element. In -121 this case, leading or trailing text is allowed. -122 -123 If `guess_charset` is true, the `chardet` library will perform charset -124 guessing on the string. -125 """ -126 if not isinstance(html, _strings): -127 raise TypeError('string required') -128 -129 accept_leading_text = bool(create_parent) -130 -131 elements = fragments_fromstring( -132 html, guess_charset=guess_charset, parser=parser, -133 no_leading_text=not accept_leading_text) -134 -135 if create_parent: -136 if not isinstance(create_parent, _strings): -137 create_parent = 'div' -138 new_root = Element(create_parent) -139 if elements: -140 if isinstance(elements[0], _strings): -141 new_root.text = elements[0] -142 del elements[0] -143 new_root.extend(elements) -144 return new_root -145 -146 if not elements: -147 raise etree.ParserError('No elements found') -148 if len(elements) > 1: -149 raise etree.ParserError('Multiple elements found') -150 result = elements[0] -151 if result.tail and result.tail.strip(): -152 raise etree.ParserError('Element followed by text: %r' % result.tail) -153 result.tail = None -154 return result -
155 -156 -
157 -def fromstring(html, guess_charset=None, parser=None): -
158 """Parse the html, returning a single element/document. -159 -160 This tries to minimally parse the chunk of text, without knowing if it -161 is a fragment or a document. -162 -163 'base_url' will set the document's base_url attribute (and the tree's -164 docinfo.URL) -165 -166 If `guess_charset` is true, or if the input is not Unicode but a -167 byte string, the `chardet` library will perform charset guessing -168 on the string. -169 """ -170 if not isinstance(html, _strings): -171 raise TypeError('string required') -172 doc = document_fromstring(html, parser=parser, -173 guess_charset=guess_charset) -174 -175 # document starts with doctype or <html>, full document! -176 start = html[:50] -177 if isinstance(start, bytes): -178 # Allow text comparison in python3. -179 # Decode as ascii, that also covers latin-1 and utf-8 for the -180 # characters we need. -181 start = start.decode('ascii', 'replace') -182 -183 start = start.lstrip().lower() -184 if start.startswith('<html') or start.startswith('<!doctype'): -185 return doc -186 -187 head = _find_tag(doc, 'head') -188 -189 # if the head is not empty we have a full document -190 if len(head): -191 return doc -192 -193 body = _find_tag(doc, 'body') -194 -195 # The body has just one element, so it was probably a single -196 # element passed in -197 if (len(body) == 1 and (not body.text or not body.text.strip()) -198 and (not body[-1].tail or not body[-1].tail.strip())): -199 return body[0] -200 -201 # Now we have a body which represents a bunch of tags which have the -202 # content that was passed in. We will create a fake container, which -203 # is the body tag, except <body> implies too much structure. -204 if _contains_block_level_tag(body): -205 body.tag = 'div' -206 else: -207 body.tag = 'span' -208 return body -
209 -210 -
211 -def parse(filename_url_or_file, guess_charset=None, parser=None): -
212 """Parse a filename, URL, or file-like object into an HTML document -213 tree. Note: this returns a tree, not an element. Use -214 ``parse(...).getroot()`` to get the document root. -215 -216 If ``guess_charset`` is true, the ``useChardet`` option is passed into -217 html5lib to enable character detection. This option is on by default -218 when parsing from URLs, off by default when parsing from file(-like) -219 objects (which tend to return Unicode more often than not), and on by -220 default when parsing from a file path (which is read in binary mode). -221 """ -222 if parser is None: -223 parser = html_parser -224 if not isinstance(filename_url_or_file, _strings): -225 fp = filename_url_or_file -226 if guess_charset is None: -227 # assume that file-like objects return Unicode more often than bytes -228 guess_charset = False -229 elif _looks_like_url(filename_url_or_file): -230 fp = urlopen(filename_url_or_file) -231 if guess_charset is None: -232 # assume that URLs return bytes -233 guess_charset = True -234 else: -235 fp = open(filename_url_or_file, 'rb') -236 if guess_charset is None: -237 guess_charset = True -238 -239 options = {} -240 # html5lib does not accept useChardet as an argument, if it -241 # detected the html argument would produce unicode objects. -242 if guess_charset: -243 options['useChardet'] = guess_charset -244 return parser.parse(fp, **options) -
245 -246 -
247 -def _looks_like_url(str): -
248 scheme = urlparse(str)[0] -249 if not scheme: -250 return False -251 elif (sys.platform == 'win32' and -252 scheme in string.ascii_letters -253 and len(scheme) == 1): -254 # looks like a 'normal' absolute path -255 return False -256 else: -257 return True -
258 -259 -260 html_parser = HTMLParser() -261 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.html5parser.HTMLParser-class.html b/doc/html/api/lxml.html.html5parser.HTMLParser-class.html deleted file mode 100644 index dc26c591..00000000 --- a/doc/html/api/lxml.html.html5parser.HTMLParser-class.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - lxml.html.html5parser.HTMLParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module html5parser :: - Class HTMLParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HTMLParser

source code

-
-                     object --+    
-                              |    
-html5lib.html5parser.HTMLParser --+
-                                  |
-                                 HTMLParser
-
- -
-An html5lib HTML parser with lxml as tree. - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - strict=False, - **kwargs)
- strict - raise an exception when a parse error is encountered
- source code - -
- -
-

Inherited from html5lib.html5parser.HTMLParser: - adjustForeignAttributes, - adjustMathMLAttributes, - adjustSVGAttributes, - isHTMLIntegrationPoint, - isMathMLTextIntegrationPoint, - mainLoop, - normalizeToken, - normalizedTokens, - parse, - parseError, - parseFragment, - parseRCDataRawtext, - reparseTokenNormal, - reset, - resetInsertionMode -

-

Inherited from html5lib.html5parser.HTMLParser (private): - _parse -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - strict=False, - **kwargs) -
(Constructor) -

-
source code  -
- -

strict - raise an exception when a parse error is encountered

-

tree - a treebuilder class controlling the type of tree that will be -returned. Built in treebuilders can be accessed through -html5lib.treebuilders.getTreeBuilder(treeType)

-

tokenizer - a class that provides a stream of tokens to the treebuilder. -This may be replaced for e.g. a sanitizer which converts some tags to -text

-
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.html5parser.XHTMLParser-class.html b/doc/html/api/lxml.html.html5parser.XHTMLParser-class.html deleted file mode 100644 index 7dd67a0b..00000000 --- a/doc/html/api/lxml.html.html5parser.XHTMLParser-class.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - lxml.html.html5parser.XHTMLParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module html5parser :: - Class XHTMLParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XHTMLParser

source code

-
-html5lib.XHTMLParser --+
-                       |
-                      XHTMLParser
-
- -
-An html5lib XHTML Parser with lxml as tree. - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - strict=False, - **kwargs) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.soupparser-module.html b/doc/html/api/lxml.html.soupparser-module.html deleted file mode 100644 index bd86e2f2..00000000 --- a/doc/html/api/lxml.html.soupparser-module.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - lxml.html.soupparser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module soupparser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module soupparser

source code

-External interface to the BeautifulSoup HTML parser. - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - _PseudoTag -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
fromstring(data, - beautifulsoup=None, - makeelement=None, - **bsargs)
- Parse a string of HTML data into an Element tree using the -BeautifulSoup parser.
- source code - -
- -
-   - - - - - - -
parse(file, - beautifulsoup=None, - makeelement=None, - **bsargs)
- Parse a file into an ElemenTree using the BeautifulSoup parser.
- source code - -
- -
-   - - - - - - -
convert_tree(beautiful_soup_tree, - makeelement=None)
- Convert a BeautifulSoup tree to a list of Element trees.
- source code - -
- -
-   - - - - - - -
_parse(source, - beautifulsoup, - makeelement, - **bsargs) - source code - -
- -
-   - - - - - - -
_parse_doctype_declaration(...)
- match(string[, pos[, endpos]]) --> match object or None. -Matches zero or more characters at the beginning of the string
- source code - -
- -
-   - - - - - - -
_convert_tree(beautiful_soup_tree, - makeelement) - source code - -
- -
-   - - - - - - -
_init_node_converters(makeelement) - source code - -
- -
-   - - - - - - -
handle_entities(...)
- sub(repl, string[, count = 0]) --> newstring -Return the string obtained by replacing the leftmost non-overlapping -occurrences of pattern in string by the replacement repl.
- source code - -
- -
- character - - - - - - -
unichr(i)
- Return a string of one character with ordinal i; 0 <= i < 256.
- - -
- -
-   - - - - - - -
unescape(string) - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - _DECLARATION_OR_DOCTYPE = (<class 'bs4.element.Declaration'>, ... -
-   - - __package__ = 'lxml.html' -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

fromstring(data, - beautifulsoup=None, - makeelement=None, - **bsargs) -

-
source code  -
- -

Parse a string of HTML data into an Element tree using the -BeautifulSoup parser.

-

Returns the root <html> Element of the tree.

-

You can pass a different BeautifulSoup parser through the -beautifulsoup keyword, and a diffent Element factory function -through the makeelement keyword. By default, the standard -BeautifulSoup class and the default factory of lxml.html are -used.

-
-
-
-
- -
- -
- - -
-

parse(file, - beautifulsoup=None, - makeelement=None, - **bsargs) -

-
source code  -
- -

Parse a file into an ElemenTree using the BeautifulSoup parser.

-

You can pass a different BeautifulSoup parser through the -beautifulsoup keyword, and a diffent Element factory function -through the makeelement keyword. By default, the standard -BeautifulSoup class and the default factory of lxml.html are -used.

-
-
-
-
- -
- -
- - -
-

convert_tree(beautiful_soup_tree, - makeelement=None) -

-
source code  -
- -

Convert a BeautifulSoup tree to a list of Element trees.

-

Returns a list instead of a single root Element to support -HTML-like soup with more than one root element.

-

You can pass a different Element factory through the makeelement -keyword.

-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

_DECLARATION_OR_DOCTYPE

- -
-
-
-
Value:
-
-(<class 'bs4.element.Declaration'>, <class 'bs4.element.Doctype'>)
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.soupparser-pysrc.html b/doc/html/api/lxml.html.soupparser-pysrc.html deleted file mode 100644 index 4dbcc935..00000000 --- a/doc/html/api/lxml.html.soupparser-pysrc.html +++ /dev/null @@ -1,568 +0,0 @@ - - - - - lxml.html.soupparser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module soupparser - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.html.soupparser

-
-  1  """External interface to the BeautifulSoup HTML parser. 
-  2  """ 
-  3   
-  4  __all__ = ["fromstring", "parse", "convert_tree"] 
-  5   
-  6  import re 
-  7  from lxml import etree, html 
-  8   
-  9  try: 
- 10      from bs4 import ( 
- 11          BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableString, 
- 12          Declaration, Doctype) 
- 13      _DECLARATION_OR_DOCTYPE = (Declaration, Doctype) 
- 14  except ImportError: 
- 15      from BeautifulSoup import ( 
- 16          BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableString, 
- 17          Declaration) 
- 18      _DECLARATION_OR_DOCTYPE = Declaration 
-
19 - 20 - 21 -def fromstring(data, beautifulsoup=None, makeelement=None, **bsargs): -
22 """Parse a string of HTML data into an Element tree using the - 23 BeautifulSoup parser. - 24 - 25 Returns the root ``<html>`` Element of the tree. - 26 - 27 You can pass a different BeautifulSoup parser through the - 28 `beautifulsoup` keyword, and a diffent Element factory function - 29 through the `makeelement` keyword. By default, the standard - 30 ``BeautifulSoup`` class and the default factory of `lxml.html` are - 31 used. - 32 """ - 33 return _parse(data, beautifulsoup, makeelement, **bsargs) -
34 -
35 - 36 -def parse(file, beautifulsoup=None, makeelement=None, **bsargs): -
37 """Parse a file into an ElemenTree using the BeautifulSoup parser. - 38 - 39 You can pass a different BeautifulSoup parser through the - 40 `beautifulsoup` keyword, and a diffent Element factory function - 41 through the `makeelement` keyword. By default, the standard - 42 ``BeautifulSoup`` class and the default factory of `lxml.html` are - 43 used. - 44 """ - 45 if not hasattr(file, 'read'): - 46 file = open(file) - 47 root = _parse(file, beautifulsoup, makeelement, **bsargs) - 48 return etree.ElementTree(root) -
49 -
50 - 51 -def convert_tree(beautiful_soup_tree, makeelement=None): -
52 """Convert a BeautifulSoup tree to a list of Element trees. - 53 - 54 Returns a list instead of a single root Element to support - 55 HTML-like soup with more than one root element. - 56 - 57 You can pass a different Element factory through the `makeelement` - 58 keyword. - 59 """ - 60 root = _convert_tree(beautiful_soup_tree, makeelement) - 61 children = root.getchildren() - 62 for child in children: - 63 root.remove(child) - 64 return children -
65 -
66 - 67 # helpers - 68 - 69 -def _parse(source, beautifulsoup, makeelement, **bsargs): -
70 if beautifulsoup is None: - 71 beautifulsoup = BeautifulSoup - 72 if hasattr(beautifulsoup, "HTML_ENTITIES"): # bs3 - 73 if 'convertEntities' not in bsargs: - 74 bsargs['convertEntities'] = 'html' - 75 if hasattr(beautifulsoup, "DEFAULT_BUILDER_FEATURES"): # bs4 - 76 if 'features' not in bsargs: - 77 bsargs['features'] = 'html.parser' # use Python html parser - 78 tree = beautifulsoup(source, **bsargs) - 79 root = _convert_tree(tree, makeelement) - 80 # from ET: wrap the document in a html root element, if necessary - 81 if len(root) == 1 and root[0].tag == "html": - 82 return root[0] - 83 root.tag = "html" - 84 return root -
85 - 86 - 87 _parse_doctype_declaration = re.compile( - 88 r'(?:\s|[<!])*DOCTYPE\s*HTML' - 89 r'(?:\s+PUBLIC)?(?:\s+(\'[^\']*\'|"[^"]*"))?' - 90 r'(?:\s+(\'[^\']*\'|"[^"]*"))?', - 91 re.IGNORECASE).match -
92 - 93 - 94 -class _PseudoTag: -
95 # Minimal imitation of BeautifulSoup.Tag -
96 - def __init__(self, contents): -
97 self.name = 'html' - 98 self.attrs = [] - 99 self.contents = contents -
100 -
101 - def __iter__(self): -
102 return self.contents.__iter__() -
103 -
104 -105 -def _convert_tree(beautiful_soup_tree, makeelement): -
106 if makeelement is None: -107 makeelement = html.html_parser.makeelement -108 -109 # Split the tree into three parts: -110 # i) everything before the root element: document type -111 # declaration, comments, processing instructions, whitespace -112 # ii) the root(s), -113 # iii) everything after the root: comments, processing -114 # instructions, whitespace -115 first_element_idx = last_element_idx = None -116 html_root = declaration = None -117 for i, e in enumerate(beautiful_soup_tree): -118 if isinstance(e, Tag): -119 if first_element_idx is None: -120 first_element_idx = i -121 last_element_idx = i -122 if html_root is None and e.name and e.name.lower() == 'html': -123 html_root = e -124 elif declaration is None and isinstance(e, _DECLARATION_OR_DOCTYPE): -125 declaration = e -126 -127 # For a nice, well-formatted document, the variable roots below is -128 # a list consisting of a single <html> element. However, the document -129 # may be a soup like '<meta><head><title>Hello</head><body>Hi -130 # all<\p>'. In this example roots is a list containing meta, head -131 # and body elements. -132 if first_element_idx is None: -133 pre_root = post_root = [] -134 roots = beautiful_soup_tree.contents -135 else: -136 pre_root = beautiful_soup_tree.contents[:first_element_idx] -137 roots = beautiful_soup_tree.contents[first_element_idx:last_element_idx+1] -138 post_root = beautiful_soup_tree.contents[last_element_idx+1:] -139 -140 # Reorganize so that there is one <html> root... -141 if html_root is not None: -142 # ... use existing one if possible, ... -143 i = roots.index(html_root) -144 html_root.contents = roots[:i] + html_root.contents + roots[i+1:] -145 else: -146 # ... otherwise create a new one. -147 html_root = _PseudoTag(roots) -148 -149 convert_node = _init_node_converters(makeelement) -150 -151 # Process pre_root -152 res_root = convert_node(html_root) -153 prev = res_root -154 for e in reversed(pre_root): -155 converted = convert_node(e) -156 if converted is not None: -157 prev.addprevious(converted) -158 prev = converted -159 -160 # ditto for post_root -161 prev = res_root -162 for e in post_root: -163 converted = convert_node(e) -164 if converted is not None: -165 prev.addnext(converted) -166 prev = converted -167 -168 if declaration is not None: -169 try: -170 # bs4 provides full Doctype string -171 doctype_string = declaration.output_ready() -172 except AttributeError: -173 doctype_string = declaration.string -174 -175 match = _parse_doctype_declaration(doctype_string) -176 if not match: -177 # Something is wrong if we end up in here. Since soupparser should -178 # tolerate errors, do not raise Exception, just let it pass. -179 pass -180 else: -181 external_id, sys_uri = match.groups() -182 docinfo = res_root.getroottree().docinfo -183 # strip quotes and update DOCTYPE values (any of None, '', '...') -184 docinfo.public_id = external_id and external_id[1:-1] -185 docinfo.system_url = sys_uri and sys_uri[1:-1] -186 -187 return res_root -
188 -
189 -190 -def _init_node_converters(makeelement): -
191 converters = {} -192 ordered_node_types = [] -193 -194 def converter(*types): -195 def add(handler): -196 for t in types: -197 converters[t] = handler -198 ordered_node_types.append(t) -199 return handler -
200 return add -201 -202 def find_best_converter(node): -203 for t in ordered_node_types: -204 if isinstance(node, t): -205 return converters[t] -206 return None -207 -208 def convert_node(bs_node, parent=None): -209 # duplicated in convert_tag() below -210 try: -211 handler = converters[type(bs_node)] -212 except KeyError: -213 handler = converters[type(bs_node)] = find_best_converter(bs_node) -214 if handler is None: -215 return None -216 return handler(bs_node, parent) -217 -218 def map_attrs(bs_attrs): -219 if isinstance(bs_attrs, dict): # bs4 -220 attribs = {} -221 for k, v in bs_attrs.items(): -222 if isinstance(v, list): -223 v = " ".join(v) -224 attribs[k] = unescape(v) -225 else: -226 attribs = dict((k, unescape(v)) for k, v in bs_attrs) -227 return attribs -228 -229 def append_text(parent, text): -230 if len(parent) == 0: -231 parent.text = (parent.text or '') + text -232 else: -233 parent[-1].tail = (parent[-1].tail or '') + text -234 -235 # converters are tried in order of their definition -236 -237 @converter(Tag, _PseudoTag) -238 def convert_tag(bs_node, parent): -239 attrs = bs_node.attrs -240 if parent is not None: -241 attribs = map_attrs(attrs) if attrs else None -242 res = etree.SubElement(parent, bs_node.name, attrib=attribs) -243 else: -244 attribs = map_attrs(attrs) if attrs else {} -245 res = makeelement(bs_node.name, attrib=attribs) -246 -247 for child in bs_node: -248 # avoid double recursion by inlining convert_node(), see above -249 try: -250 handler = converters[type(child)] -251 except KeyError: -252 pass -253 else: -254 if handler is not None: -255 handler(child, res) -256 continue -257 convert_node(child, res) -258 return res -259 -260 @converter(Comment) -261 def convert_comment(bs_node, parent): -262 res = html.HtmlComment(bs_node) -263 if parent is not None: -264 parent.append(res) -265 return res -266 -267 @converter(ProcessingInstruction) -268 def convert_pi(bs_node, parent): -269 if bs_node.endswith('?'): -270 # The PI is of XML style (<?as df?>) but BeautifulSoup -271 # interpreted it as being SGML style (<?as df>). Fix. -272 bs_node = bs_node[:-1] -273 res = etree.ProcessingInstruction(*bs_node.split(' ', 1)) -274 if parent is not None: -275 parent.append(res) -276 return res -277 -278 @converter(NavigableString) -279 def convert_text(bs_node, parent): -280 if parent is not None: -281 append_text(parent, unescape(bs_node)) -282 return None -283 -284 return convert_node -285 -286 -287 # copied from ET's ElementSoup -288 -289 try: -290 from html.entities import name2codepoint # Python 3 -291 except ImportError: -292 from htmlentitydefs import name2codepoint -293 -294 -295 handle_entities = re.compile(r"&(\w+);").sub -296 -297 -298 try: -299 unichr -300 except NameError: -301 # Python 3 -302 unichr = chr -
303 -304 -305 -def unescape(string): -
306 if not string: -307 return '' -308 # work around oddities in BeautifulSoup's entity handling -309 def unescape_entity(m): -310 try: -311 return unichr(name2codepoint[m.group(1)]) -312 except KeyError: -313 return m.group(0) # use as is -
314 return handle_entities(unescape_entity, string) -315 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.soupparser._PseudoTag-class.html b/doc/html/api/lxml.html.soupparser._PseudoTag-class.html deleted file mode 100644 index 0523c56d..00000000 --- a/doc/html/api/lxml.html.soupparser._PseudoTag-class.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - lxml.html.soupparser._PseudoTag - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module soupparser :: - Class _PseudoTag - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _PseudoTag

source code

- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - contents) - source code - -
- -
-   - - - - - - -
__iter__(self) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.usedoctest-module.html b/doc/html/api/lxml.html.usedoctest-module.html deleted file mode 100644 index eb22b8f2..00000000 --- a/doc/html/api/lxml.html.usedoctest-module.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - lxml.html.usedoctest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module usedoctest - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module usedoctest

source code

-

Doctest module for HTML comparison.

-

Usage:

-
->>> import lxml.html.usedoctest
->>> # now do your HTML doctests ...
-
-

See lxml.doctestcompare.

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.html.usedoctest-pysrc.html b/doc/html/api/lxml.html.usedoctest-pysrc.html deleted file mode 100644 index 5beb18e7..00000000 --- a/doc/html/api/lxml.html.usedoctest-pysrc.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - lxml.html.usedoctest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package html :: - Module usedoctest - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.html.usedoctest

-
- 1  """Doctest module for HTML comparison. 
- 2   
- 3  Usage:: 
- 4   
- 5     >>> import lxml.html.usedoctest 
- 6     >>> # now do your HTML doctests ... 
- 7   
- 8  See `lxml.doctestcompare`. 
- 9  """ 
-10   
-11  from lxml import doctestcompare 
-12   
-13  doctestcompare.temp_install(html=True, del_module=__name__) 
-14   
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.includes-module.html b/doc/html/api/lxml.includes-module.html deleted file mode 100644 index 2e623f08..00000000 --- a/doc/html/api/lxml.includes-module.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - lxml.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package includes - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Package includes

source code

- - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __package__ = None
- hash(x) -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.includes-pysrc.html b/doc/html/api/lxml.includes-pysrc.html deleted file mode 100644 index 9e4af022..00000000 --- a/doc/html/api/lxml.includes-pysrc.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - lxml.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package includes - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Package lxml.includes

-
-1   
-2   
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.isoschematron-module.html b/doc/html/api/lxml.isoschematron-module.html deleted file mode 100644 index d46cb005..00000000 --- a/doc/html/api/lxml.isoschematron-module.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - lxml.isoschematron - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package isoschematron - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Package isoschematron

source code

-The lxml.isoschematron package implements ISO Schematron support on top -of the pure-xslt 'skeleton' implementation. - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - unicode
- str(object='') -> string -
-   - - basestring
- str(object='') -> string -
-   - - Schematron
- An ISO Schematron validator. -
- - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
stylesheet_params(**kwargs)
- Convert keyword args to a dictionary of stylesheet parameters. -XSL stylesheet parameters must be XPath expressions, i.e.:
- source code - -
- -
-   - - - - - - -
_stylesheet_param_dict(paramsDict, - kwargsDict)
- Return a copy of paramsDict, updated with kwargsDict entries, wrapped as -stylesheet arguments. -kwargsDict entries with a value of None are ignored.
- source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - XML_SCHEMA_NS = 'http://www.w3.org/2001/XMLSchema' -
-   - - RELAXNG_NS = 'http://relaxng.org/ns/structure/1.0' -
-   - - SCHEMATRON_NS = 'http://purl.oclc.org/dsdl/schematron' -
-   - - SVRL_NS = 'http://purl.oclc.org/dsdl/svrl' -
-   - - _schematron_root = '{http://purl.oclc.org/dsdl/schematron}schema' -
-   - - _xml_schema_root = '{http://www.w3.org/2001/XMLSchema}schema' -
-   - - _resources_dir = '/home/stefan/source/Python/lxml/lxml-release... -
-   - - extract_xsd = <lxml.etree.XSLT object> -
-   - - extract_rng = <lxml.etree.XSLT object> -
-   - - iso_dsdl_include = <lxml.etree.XSLT object> -
-   - - iso_abstract_expand = <lxml.etree.XSLT object> -
-   - - iso_svrl_for_xslt1 = <lxml.etree.XSLT object> -
-   - - svrl_validation_errors = //svrl:failed-assert -
-   - - schematron_schema_valid = <lxml.etree.RelaxNG object> -
-   - - __package__ = 'lxml.isoschematron' -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

stylesheet_params(**kwargs) -

-
source code  -
- -

Convert keyword args to a dictionary of stylesheet parameters. -XSL stylesheet parameters must be XPath expressions, i.e.:

-
    -
  • string expressions, like "'5'"
  • -
  • simple (number) expressions, like "5"
  • -
  • valid XPath expressions, like "/a/b/text()"
  • -
-

This function converts native Python keyword arguments to stylesheet -parameters following these rules: -If an arg is a string wrap it with XSLT.strparam(). -If an arg is an XPath object use its path string. -If arg is None raise TypeError. -Else convert arg to string.

-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

_resources_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/isoschematron/r\
-esources'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.isoschematron-pysrc.html b/doc/html/api/lxml.isoschematron-pysrc.html deleted file mode 100644 index e49ba203..00000000 --- a/doc/html/api/lxml.isoschematron-pysrc.html +++ /dev/null @@ -1,660 +0,0 @@ - - - - - lxml.isoschematron - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package isoschematron - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Package lxml.isoschematron

-
-  1  """The ``lxml.isoschematron`` package implements ISO Schematron support on top 
-  2  of the pure-xslt 'skeleton' implementation. 
-  3  """ 
-  4   
-  5  import sys 
-  6  import os.path 
-  7  from lxml import etree as _etree # due to validator __init__ signature 
-  8   
-  9   
- 10  # some compat stuff, borrowed from lxml.html 
- 11  try: 
- 12      unicode 
- 13  except NameError: 
- 14      # Python 3 
- 15      unicode = str 
- 16  try: 
- 17      basestring 
- 18  except NameError: 
- 19      # Python 3 
- 20      basestring = str 
- 21   
- 22   
- 23  __all__ = ['extract_xsd', 'extract_rng', 'iso_dsdl_include', 
- 24             'iso_abstract_expand', 'iso_svrl_for_xslt1', 
- 25             'svrl_validation_errors', 'schematron_schema_valid', 
- 26             'stylesheet_params', 'Schematron'] 
- 27   
- 28   
- 29  # some namespaces 
- 30  #FIXME: Maybe lxml should provide a dedicated place for common namespace 
- 31  #FIXME: definitions? 
- 32  XML_SCHEMA_NS = "http://www.w3.org/2001/XMLSchema" 
- 33  RELAXNG_NS = "http://relaxng.org/ns/structure/1.0" 
- 34  SCHEMATRON_NS = "http://purl.oclc.org/dsdl/schematron" 
- 35  SVRL_NS = "http://purl.oclc.org/dsdl/svrl" 
- 36   
- 37   
- 38  # some helpers 
- 39  _schematron_root = '{%s}schema' % SCHEMATRON_NS 
- 40  _xml_schema_root = '{%s}schema' % XML_SCHEMA_NS 
- 41  _resources_dir = os.path.join(os.path.dirname(__file__), 'resources') 
- 42   
- 43   
- 44  # the iso-schematron skeleton implementation steps aka xsl transformations 
- 45  extract_xsd = _etree.XSLT(_etree.parse( 
- 46      os.path.join(_resources_dir, 'xsl', 'XSD2Schtrn.xsl'))) 
- 47  extract_rng = _etree.XSLT(_etree.parse( 
- 48      os.path.join(_resources_dir, 'xsl', 'RNG2Schtrn.xsl'))) 
- 49  iso_dsdl_include = _etree.XSLT(_etree.parse( 
- 50      os.path.join(_resources_dir, 'xsl', 'iso-schematron-xslt1', 
- 51                   'iso_dsdl_include.xsl'))) 
- 52  iso_abstract_expand = _etree.XSLT(_etree.parse( 
- 53      os.path.join(_resources_dir, 'xsl', 'iso-schematron-xslt1', 
- 54                   'iso_abstract_expand.xsl'))) 
- 55  iso_svrl_for_xslt1 = _etree.XSLT(_etree.parse( 
- 56      os.path.join(_resources_dir, 
- 57                   'xsl', 'iso-schematron-xslt1', 'iso_svrl_for_xslt1.xsl'))) 
- 58   
- 59   
- 60  # svrl result accessors 
- 61  svrl_validation_errors = _etree.XPath( 
- 62      '//svrl:failed-assert', namespaces={'svrl': SVRL_NS}) 
- 63   
- 64   
- 65  # RelaxNG validator for schematron schemas 
- 66  schematron_schema_valid = _etree.RelaxNG(_etree.parse( 
- 67      os.path.join(_resources_dir, 'rng', 'iso-schematron.rng'))) 
-
68 - 69 - 70 -def stylesheet_params(**kwargs): -
71 """Convert keyword args to a dictionary of stylesheet parameters. - 72 XSL stylesheet parameters must be XPath expressions, i.e.: - 73 - 74 * string expressions, like "'5'" - 75 * simple (number) expressions, like "5" - 76 * valid XPath expressions, like "/a/b/text()" - 77 - 78 This function converts native Python keyword arguments to stylesheet - 79 parameters following these rules: - 80 If an arg is a string wrap it with XSLT.strparam(). - 81 If an arg is an XPath object use its path string. - 82 If arg is None raise TypeError. - 83 Else convert arg to string. - 84 """ - 85 result = {} - 86 for key, val in kwargs.items(): - 87 if isinstance(val, basestring): - 88 val = _etree.XSLT.strparam(val) - 89 elif val is None: - 90 raise TypeError('None not allowed as a stylesheet parameter') - 91 elif not isinstance(val, _etree.XPath): - 92 val = unicode(val) - 93 result[key] = val - 94 return result -
95 -
96 - 97 # helper function for use in Schematron __init__ - 98 -def _stylesheet_param_dict(paramsDict, kwargsDict): -
99 """Return a copy of paramsDict, updated with kwargsDict entries, wrapped as -100 stylesheet arguments. -101 kwargsDict entries with a value of None are ignored. -102 """ -103 # beware of changing mutable default arg -104 paramsDict = dict(paramsDict) -105 for k, v in kwargsDict.items(): -106 if v is not None: # None values do not override -107 paramsDict[k] = v -108 paramsDict = stylesheet_params(**paramsDict) -109 return paramsDict -
110 -
111 -112 -class Schematron(_etree._Validator): -
113 """An ISO Schematron validator. -114 -115 Pass a root Element or an ElementTree to turn it into a validator. -116 Alternatively, pass a filename as keyword argument 'file' to parse from -117 the file system. -118 -119 Schematron is a less well known, but very powerful schema language. -120 The main idea is to use the capabilities of XPath to put restrictions on -121 the structure and the content of XML documents. -122 -123 The standard behaviour is to fail on ``failed-assert`` findings only -124 (``ASSERTS_ONLY``). To change this, you can either pass a report filter -125 function to the ``error_finder`` parameter (e.g. ``ASSERTS_AND_REPORTS`` -126 or a custom ``XPath`` object), or subclass isoschematron.Schematron for -127 complete control of the validation process. -128 -129 Built on the Schematron language 'reference' skeleton pure-xslt -130 implementation, the validator is created as an XSLT 1.0 stylesheet using -131 these steps: -132 -133 0) (Extract from XML Schema or RelaxNG schema) -134 1) Process inclusions -135 2) Process abstract patterns -136 3) Compile the schematron schema to XSLT -137 -138 The ``include`` and ``expand`` keyword arguments can be used to switch off -139 steps 1) and 2). -140 To set parameters for steps 1), 2) and 3) hand parameter dictionaries to the -141 keyword arguments ``include_params``, ``expand_params`` or -142 ``compile_params``. -143 For convenience, the compile-step parameter ``phase`` is also exposed as a -144 keyword argument ``phase``. This takes precedence if the parameter is also -145 given in the parameter dictionary. -146 -147 If ``store_schematron`` is set to True, the (included-and-expanded) -148 schematron document tree is stored and available through the ``schematron`` -149 property. -150 If ``store_xslt`` is set to True, the validation XSLT document tree will be -151 stored and can be retrieved through the ``validator_xslt`` property. -152 With ``store_report`` set to True (default: False), the resulting validation -153 report document gets stored and can be accessed as the ``validation_report`` -154 property. -155 -156 Here is a usage example:: -157 -158 >>> from lxml import etree -159 >>> from lxml.isoschematron import Schematron -160 -161 >>> schematron = Schematron(etree.XML(''' -162 ... <schema xmlns="http://purl.oclc.org/dsdl/schematron" > -163 ... <pattern id="id_only_attribute"> -164 ... <title>id is the only permitted attribute name</title> -165 ... <rule context="*"> -166 ... <report test="@*[not(name()='id')]">Attribute -167 ... <name path="@*[not(name()='id')]"/> is forbidden<name/> -168 ... </report> -169 ... </rule> -170 ... </pattern> -171 ... </schema>'''), -172 ... error_finder=Schematron.ASSERTS_AND_REPORTS) -173 -174 >>> xml = etree.XML(''' -175 ... <AAA name="aaa"> -176 ... <BBB id="bbb"/> -177 ... <CCC color="ccc"/> -178 ... </AAA> -179 ... ''') -180 -181 >>> schematron.validate(xml) -182 False -183 -184 >>> xml = etree.XML(''' -185 ... <AAA id="aaa"> -186 ... <BBB id="bbb"/> -187 ... <CCC/> -188 ... </AAA> -189 ... ''') -190 -191 >>> schematron.validate(xml) -192 True -193 """ -194 -195 # libxml2 error categorization for validation errors -196 _domain = _etree.ErrorDomains.SCHEMATRONV -197 _level = _etree.ErrorLevels.ERROR -198 _error_type = _etree.ErrorTypes.SCHEMATRONV_ASSERT -199 -200 # convenience definitions for common behaviours -201 ASSERTS_ONLY = svrl_validation_errors # Default -202 ASSERTS_AND_REPORTS = _etree.XPath( -203 '//svrl:failed-assert | //svrl:successful-report', -204 namespaces={'svrl': SVRL_NS}) -205 -
206 - def _extract(self, element): -
207 """Extract embedded schematron schema from non-schematron host schema. -208 This method will only be called by __init__ if the given schema document -209 is not a schematron schema by itself. -210 Must return a schematron schema document tree or None. -211 """ -212 schematron = None -213 if element.tag == _xml_schema_root: -214 schematron = self._extract_xsd(element) -215 elif element.nsmap[element.prefix] == RELAXNG_NS: -216 # RelaxNG does not have a single unique root element -217 schematron = self._extract_rng(element) -218 return schematron -
219 -220 # customization points -221 # etree.XSLT objects that provide the extract, include, expand, compile -222 # steps -223 _extract_xsd = extract_xsd -224 _extract_rng = extract_rng -225 _include = iso_dsdl_include -226 _expand = iso_abstract_expand -227 _compile = iso_svrl_for_xslt1 -228 -229 # etree.xpath object that determines input document validity when applied to -230 # the svrl result report; must return a list of result elements (empty if -231 # valid) -232 _validation_errors = ASSERTS_ONLY -233 -
234 - def __init__(self, etree=None, file=None, include=True, expand=True, -235 include_params={}, expand_params={}, compile_params={}, -236 store_schematron=False, store_xslt=False, store_report=False, -237 phase=None, error_finder=ASSERTS_ONLY): -
238 super(Schematron, self).__init__() -239 -240 self._store_report = store_report -241 self._schematron = None -242 self._validator_xslt = None -243 self._validation_report = None -244 if error_finder is not self.ASSERTS_ONLY: -245 self._validation_errors = error_finder -246 -247 # parse schema document, may be a schematron schema or an XML Schema or -248 # a RelaxNG schema with embedded schematron rules -249 root = None -250 try: -251 if etree is not None: -252 if _etree.iselement(etree): -253 root = etree -254 else: -255 root = etree.getroot() -256 elif file is not None: -257 root = _etree.parse(file).getroot() -258 except Exception: -259 raise _etree.SchematronParseError( -260 "No tree or file given: %s" % sys.exc_info()[1]) -261 if root is None: -262 raise ValueError("Empty tree") -263 if root.tag == _schematron_root: -264 schematron = root -265 else: -266 schematron = self._extract(root) -267 if schematron is None: -268 raise _etree.SchematronParseError( -269 "Document is not a schematron schema or schematron-extractable") -270 # perform the iso-schematron skeleton implementation steps to get a -271 # validating xslt -272 if include: -273 schematron = self._include(schematron, **include_params) -274 if expand: -275 schematron = self._expand(schematron, **expand_params) -276 if not schematron_schema_valid(schematron): -277 raise _etree.SchematronParseError( -278 "invalid schematron schema: %s" % -279 schematron_schema_valid.error_log) -280 if store_schematron: -281 self._schematron = schematron -282 # add new compile keyword args here if exposing them -283 compile_kwargs = {'phase': phase} -284 compile_params = _stylesheet_param_dict(compile_params, compile_kwargs) -285 validator_xslt = self._compile(schematron, **compile_params) -286 if store_xslt: -287 self._validator_xslt = validator_xslt -288 self._validator = _etree.XSLT(validator_xslt) -
289 -
290 - def __call__(self, etree): -
291 """Validate doc using Schematron. -292 -293 Returns true if document is valid, false if not. -294 """ -295 self._clear_error_log() -296 result = self._validator(etree) -297 if self._store_report: -298 self._validation_report = result -299 errors = self._validation_errors(result) -300 if errors: -301 if _etree.iselement(etree): -302 fname = etree.getroottree().docinfo.URL or '<file>' -303 else: -304 fname = etree.docinfo.URL or '<file>' -305 for error in errors: -306 # Does svrl report the line number, anywhere? Don't think so. -307 self._append_log_message( -308 domain=self._domain, type=self._error_type, -309 level=self._level, line=0, -310 message=_etree.tostring(error, encoding='unicode'), -311 filename=fname) -312 return False -313 return True -
314 -315 @property -
316 - def schematron(self): -
317 """ISO-schematron schema document (None if object has been initialized -318 with store_schematron=False). -319 """ -320 return self._schematron -
321 -322 @property -
323 - def validator_xslt(self): -
324 """ISO-schematron skeleton implementation XSLT validator document (None -325 if object has been initialized with store_xslt=False). -326 """ -327 return self._validator_xslt -
328 -329 @property -
330 - def validation_report(self): -
331 """ISO-schematron validation result report (None if result-storing has -332 been turned off). -333 """ -334 return self._validation_report -
335 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.isoschematron.Schematron-class.html b/doc/html/api/lxml.isoschematron.Schematron-class.html deleted file mode 100644 index f008ac9b..00000000 --- a/doc/html/api/lxml.isoschematron.Schematron-class.html +++ /dev/null @@ -1,650 +0,0 @@ - - - - - lxml.isoschematron.Schematron - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package isoschematron :: - Class Schematron - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Schematron

source code

-
-      object --+    
-               |    
-etree._Validator --+
-                   |
-                  Schematron
-
- -
-

An ISO Schematron validator.

-

Pass a root Element or an ElementTree to turn it into a validator. -Alternatively, pass a filename as keyword argument 'file' to parse from -the file system.

-

Schematron is a less well known, but very powerful schema language. -The main idea is to use the capabilities of XPath to put restrictions on -the structure and the content of XML documents.

-

The standard behaviour is to fail on failed-assert findings only -(ASSERTS_ONLY). To change this, you can either pass a report filter -function to the error_finder parameter (e.g. ASSERTS_AND_REPORTS -or a custom XPath object), or subclass isoschematron.Schematron for -complete control of the validation process.

-

Built on the Schematron language 'reference' skeleton pure-xslt -implementation, the validator is created as an XSLT 1.0 stylesheet using -these steps:

-
-
    -
  1. (Extract from XML Schema or RelaxNG schema)
  2. -
  3. Process inclusions
  4. -
  5. Process abstract patterns
  6. -
  7. Compile the schematron schema to XSLT
  8. -
-
-

The include and expand keyword arguments can be used to switch off -steps 1) and 2). -To set parameters for steps 1), 2) and 3) hand parameter dictionaries to the -keyword arguments include_params, expand_params or -compile_params. -For convenience, the compile-step parameter phase is also exposed as a -keyword argument phase. This takes precedence if the parameter is also -given in the parameter dictionary.

-

If store_schematron is set to True, the (included-and-expanded) -schematron document tree is stored and available through the schematron -property. -If store_xslt is set to True, the validation XSLT document tree will be -stored and can be retrieved through the validator_xslt property. -With store_report set to True (default: False), the resulting validation -report document gets stored and can be accessed as the validation_report -property.

-

Here is a usage example:

-
->>> from lxml import etree
->>> from lxml.isoschematron import Schematron
-
->>> schematron = Schematron(etree.XML('''
-... <schema xmlns="http://purl.oclc.org/dsdl/schematron" >
-...   <pattern id="id_only_attribute">
-...     <title>id is the only permitted attribute name</title>
-...     <rule context="*">
-...       <report test="@*[not(name()='id')]">Attribute
-...         <name path="@*[not(name()='id')]"/> is forbidden<name/>
-...       </report>
-...     </rule>
-...   </pattern>
-... </schema>'''),
-... error_finder=Schematron.ASSERTS_AND_REPORTS)
-
->>> xml = etree.XML('''
-... <AAA name="aaa">
-...   <BBB id="bbb"/>
-...   <CCC color="ccc"/>
-... </AAA>
-... ''')
-
->>> schematron.validate(xml)
-False
-
->>> xml = etree.XML('''
-... <AAA id="aaa">
-...   <BBB id="bbb"/>
-...   <CCC/>
-... </AAA>
-... ''')
-
->>> schematron.validate(xml)
-True
-
- - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
_extract(self, - element)
- Extract embedded schematron schema from non-schematron host schema. -This method will only be called by __init__ if the given schema document -is not a schematron schema by itself. -Must return a schematron schema document tree or None.
- source code - -
- -
-   - - - - - - -
__init__(self, - etree=None, - file=None, - include=True, - expand=True, - include_params={}, - expand_params={}, - compile_params={}, - store_schematron=False, - store_xslt=False, - store_report=False, - phase=None, - error_finder=//svrl:failed-assert)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__call__(self, - etree)
- Validate doc using Schematron.
- source code - -
- -
-

Inherited from etree._Validator: - __new__, - assertValid, - assert_, - validate -

-

Inherited from etree._Validator (private): - _append_log_message, - _clear_error_log -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - _domain = 28 -
-   - - _level = 2 -
-   - - _error_type = 4000 -
-   - - ASSERTS_ONLY = //svrl:failed-assert -
-   - - ASSERTS_AND_REPORTS = //svrl:failed-assert | //svrl:successful... -
-   - - _extract_xsd = <lxml.etree.XSLT object> -
-   - - _extract_rng = <lxml.etree.XSLT object> -
-   - - _include = <lxml.etree.XSLT object> -
-   - - _expand = <lxml.etree.XSLT object> -
-   - - _compile = <lxml.etree.XSLT object> -
-   - - _validation_errors = //svrl:failed-assert -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - schematron
- ISO-schematron schema document (None if object has been initialized -with store_schematron=False). -
-   - - validator_xslt
- ISO-schematron skeleton implementation XSLT validator document (None -if object has been initialized with store_xslt=False). -
-   - - validation_report
- ISO-schematron validation result report (None if result-storing has -been turned off). -
-

Inherited from etree._Validator: - error_log -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - etree=None, - file=None, - include=True, - expand=True, - include_params={}, - expand_params={}, - compile_params={}, - store_schematron=False, - store_xslt=False, - store_report=False, - phase=None, - error_finder=//svrl:failed-assert) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__call__(self, - etree) -
(Call operator) -

-
source code  -
- -

Validate doc using Schematron.

-

Returns true if document is valid, false if not.

-
-
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

ASSERTS_AND_REPORTS

- -
-
-
-
Value:
-
-//svrl:failed-assert | //svrl:successful-report
-
-
-
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

schematron

- ISO-schematron schema document (None if object has been initialized -with store_schematron=False). -
-
Get Method:
-
unreachable.schematron(self) - - ISO-schematron schema document (None if object has been initialized -with store_schematron=False). -
-
-
-
- -
- -
-

validator_xslt

- ISO-schematron skeleton implementation XSLT validator document (None -if object has been initialized with store_xslt=False). -
-
Get Method:
-
unreachable.validator_xslt(self) - - ISO-schematron skeleton implementation XSLT validator document (None -if object has been initialized with store_xslt=False). -
-
-
-
- -
- -
-

validation_report

- ISO-schematron validation result report (None if result-storing has -been turned off). -
-
Get Method:
-
unreachable.validation_report(self) - - ISO-schematron validation result report (None if result-storing has -been turned off). -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify-module.html b/doc/html/api/lxml.objectify-module.html deleted file mode 100644 index 8e58b5aa..00000000 --- a/doc/html/api/lxml.objectify-module.html +++ /dev/null @@ -1,1159 +0,0 @@ - - - - - lxml.objectify - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module objectify

-The lxml.objectify module implements a Python object API for XML. -It is based on lxml.etree. - -
-

Version: - 4.2.2 -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - BoolElement
- Boolean type base on string values: 'true' or 'false'. -
-   - - ElementMaker
- ElementMaker(self, namespace=None, nsmap=None, annotate=True, makeelement=None) -
-   - - FloatElement -
-   - - IntElement -
-   - - LongElement -
-   - - NoneElement -
-   - - NumberElement -
-   - - ObjectPath
- ObjectPath(path) -Immutable object that represents a compiled object path. -
-   - - ObjectifiedDataElement
- This is the base class for all data type Elements. Subclasses should -override the 'pyval' property and possibly the __str__ method. -
-   - - ObjectifiedElement
- Main XML Element class. -
-   - - ObjectifyElementClassLookup
- ObjectifyElementClassLookup(self, tree_class=None, empty_data_class=None) -Element class lookup method that uses the objectify classes. -
-   - - PyType
- PyType(self, name, type_check, type_class, stringify=None) -User defined type. -
-   - - StringElement
- String data class. -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
DataElement(_value, - attrib=None, - nsmap=None, - _pytype=None, - _xsi=None, - **_attributes)
- Create a new element from a Python value and XML attributes taken from -keyword arguments or a dictionary passed as second argument.
- - -
- -
-   - - - - - - -
Element(_tag, - attrib=None, - nsmap=None, - _pytype=None, - **_attributes)
- Objectify specific version of the lxml.etree Element() factory that -always creates a structural (tree) element.
- - -
- -
-   - - - - - - -
SubElement(_parent, - _tag, - attrib=None, - nsmap=None, - **_extra)
- Subelement factory. This function creates an element instance, and -appends it to an existing element.
- - -
- -
-   - - - - - - -
XML(xml, - parser=None, - base_url=None)
- Objectify specific version of the lxml.etree XML() literal factory -that uses the objectify parser.
- - -
- -
-   - - - - - - -
__checkBool(...) - - -
- -
-   - - - - - - -
__lower_bool(...) - - -
- -
-   - - - - - - -
__parseBool(...) - - -
- -
-   - - - - - - -
__unpickleElementTree(...) - - -
- -
-   - - - - - - -
annotate(element_or_tree, - ignore_old=True, - ignore_xsi=False, - empty_pytype=None, - empty_type=None, - annotate_xsi=0, - annotate_pytype=1)
- Recursively annotates the elements of an XML tree with 'xsi:type' -and/or 'py:pytype' attributes.
- - -
- -
-   - - - - - - -
deannotate(element_or_tree, - pytype=True, - xsi=True, - xsi_nil=False, - cleanup_namespaces=False)
- Recursively de-annotate the elements of an XML tree by removing 'py:pytype' -and/or 'xsi:type' attributes and/or 'xsi:nil' attributes.
- - -
- -
-   - - - - - - -
dump(...)
- dump(_Element element not None)
- - -
- -
-   - - - - - - -
enable_recursive_str(on=True)
- Enable a recursively generated tree representation for str(element), -based on objectify.dump(element).
- - -
- -
-   - - - - - - -
fromstring(xml, - parser=None, - base_url=None)
- Objectify specific version of the lxml.etree fromstring() function -that uses the objectify parser.
- - -
- -
-   - - - - - - -
getRegisteredTypes()
- Returns a list of the currently registered PyType objects.
- - -
- -
-   - - - - - - -
makeparser(remove_blank_text=True, - **kw)
- Create a new XML parser for objectify trees.
- - -
- -
-   - - - - - - -
parse(f, - parser=None, - base_url=None)
- Parse a file or file-like object with the objectify parser.
- - -
- -
-   - - - - - - -
pyannotate(element_or_tree, - ignore_old=False, - ignore_xsi=False, - empty_pytype=None)
- Recursively annotates the elements of an XML tree with 'pytype' -attributes.
- - -
- -
-   - - - - - - -
pytypename(obj)
- Find the name of the corresponding PyType for a Python object.
- - -
- -
-   - - - - - - -
set_default_parser(new_parser= None)
- Replace the default parser used by objectify's Element() and -fromstring() functions.
- - -
- -
-   - - - - - - -
set_pytype_attribute_tag(attribute_tag=None)
- Change name and namespace of the XML attribute that holds Python type -information.
- - -
- -
-   - - - - - - -
xsiannotate(element_or_tree, - ignore_old=False, - ignore_pytype=False, - empty_type=None)
- Recursively annotates the elements of an XML tree with 'xsi:type' -attributes.
- - -
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - E = <lxml.objectify.ElementMaker object> -
-   - - PYTYPE_ATTRIBUTE = '{http://codespeak.net/lxml/objectify/pytyp... -
-   - - __package__ = None
- hash(x) -
-   - - __test__ = {} -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

DataElement(_value, - attrib=None, - nsmap=None, - _pytype=None, - _xsi=None, - **_attributes) -

-
  -
- -

Create a new element from a Python value and XML attributes taken from -keyword arguments or a dictionary passed as second argument.

-

Automatically adds a 'pytype' attribute for the Python type of the value, -if the type can be identified. If '_pytype' or '_xsi' are among the -keyword arguments, they will be used instead.

-

If the _value argument is an ObjectifiedDataElement instance, its py:pytype, -xsi:type and other attributes and nsmap are reused unless they are redefined -in attrib and/or keyword arguments.

-
-
-
-
- -
- -
- - -
-

Element(_tag, - attrib=None, - nsmap=None, - _pytype=None, - **_attributes) -

-
  -
- -

Objectify specific version of the lxml.etree Element() factory that -always creates a structural (tree) element.

-

NOTE: requires parser based element class lookup activated in lxml.etree!

-
-
-
-
- -
- -
- - -
-

XML(xml, - parser=None, - base_url=None) -

-
  -
- -

Objectify specific version of the lxml.etree XML() literal factory -that uses the objectify parser.

-

You can pass a different parser as second argument.

-

The base_url keyword argument allows to set the original base URL of -the document to support relative Paths when looking up external entities -(DTD, XInclude, ...).

-
-
-
-
- -
- -
- - -
-

annotate(element_or_tree, - ignore_old=True, - ignore_xsi=False, - empty_pytype=None, - empty_type=None, - annotate_xsi=0, - annotate_pytype=1) -

-
  -
- -

Recursively annotates the elements of an XML tree with 'xsi:type' -and/or 'py:pytype' attributes.

-

If the 'ignore_old' keyword argument is True (the default), current -'py:pytype' attributes will be ignored for the type annotation. Set to False -if you want reuse existing 'py:pytype' information (iff appropriate for the -element text value).

-

If the 'ignore_xsi' keyword argument is False (the default), existing -'xsi:type' attributes will be used for the type annotation, if they fit the -element text values.

-

Note that the mapping from Python types to XSI types is usually ambiguous. -Currently, only the first XSI type name in the corresponding PyType -definition will be used for annotation. Thus, you should consider naming -the widest type first if you define additional types.

-

The default 'py:pytype' annotation of empty elements can be set with the -empty_pytype keyword argument. Pass 'str', for example, to make -string values the default.

-

The default 'xsi:type' annotation of empty elements can be set with the -empty_type keyword argument. The default is not to annotate empty -elements. Pass 'string', for example, to make string values the default.

-

The keyword arguments 'annotate_xsi' (default: 0) and 'annotate_pytype' -(default: 1) control which kind(s) of annotation to use.

-
-
-
-
- -
- -
- - -
-

deannotate(element_or_tree, - pytype=True, - xsi=True, - xsi_nil=False, - cleanup_namespaces=False) -

-
  -
- -

Recursively de-annotate the elements of an XML tree by removing 'py:pytype' -and/or 'xsi:type' attributes and/or 'xsi:nil' attributes.

-

If the 'pytype' keyword argument is True (the default), 'py:pytype' -attributes will be removed. If the 'xsi' keyword argument is True (the -default), 'xsi:type' attributes will be removed. -If the 'xsi_nil' keyword argument is True (default: False), 'xsi:nil' -attributes will be removed.

-

Note that this does not touch the namespace declarations by -default. If you want to remove unused namespace declarations from -the tree, pass the option cleanup_namespaces=True.

-
-
-
-
- -
- -
- - -
-

dump(...) -

-
  -
- -

dump(_Element element not None)

-

Return a recursively generated string representation of an element.

-
-
-
-
- -
- -
- - -
-

fromstring(xml, - parser=None, - base_url=None) -

-
  -
- -

Objectify specific version of the lxml.etree fromstring() function -that uses the objectify parser.

-

You can pass a different parser as second argument.

-

The base_url keyword argument allows to set the original base URL of -the document to support relative Paths when looking up external entities -(DTD, XInclude, ...).

-
-
-
-
- -
- -
- - -
-

getRegisteredTypes() -

-
  -
- -

Returns a list of the currently registered PyType objects.

-

To add a new type, retrieve this list and call unregister() for all -entries. Then add the new type at a suitable position (possibly replacing -an existing one) and call register() for all entries.

-

This is necessary if the new type interferes with the type check functions -of existing ones (normally only int/float/bool) and must the tried before -other types. To add a type that is not yet parsable by the current type -check functions, you can simply register() it, which will append it to the -end of the type list.

-
-
-
-
- -
- -
- - -
-

makeparser(remove_blank_text=True, - **kw) -

-
  -
- -

Create a new XML parser for objectify trees.

-

You can pass all keyword arguments that are supported by -etree.XMLParser(). Note that this parser defaults to removing -blank text. You can disable this by passing the -remove_blank_text boolean keyword option yourself.

-
-
-
-
- -
- -
- - -
-

parse(f, - parser=None, - base_url=None) -

-
  -
- -

Parse a file or file-like object with the objectify parser.

-

You can pass a different parser as second argument.

-

The base_url keyword allows setting a URL for the document -when parsing from a file-like object. This is needed when looking -up external entities (DTD, XInclude, ...) with relative paths.

-
-
-
-
- -
- -
- - -
-

pyannotate(element_or_tree, - ignore_old=False, - ignore_xsi=False, - empty_pytype=None) -

-
  -
- -

Recursively annotates the elements of an XML tree with 'pytype' -attributes.

-

If the 'ignore_old' keyword argument is True (the default), current 'pytype' -attributes will be ignored and replaced. Otherwise, they will be checked -and only replaced if they no longer fit the current text value.

-

Setting the keyword argument ignore_xsi to True makes the function -additionally ignore existing xsi:type annotations. The default is to -use them as a type hint.

-

The default annotation of empty elements can be set with the -empty_pytype keyword argument. The default is not to annotate empty -elements. Pass 'str', for example, to make string values the default.

-
-
-
-
- -
- -
- - -
-

set_default_parser(new_parser= None) -

-
  -
- -

Replace the default parser used by objectify's Element() and -fromstring() functions.

-

The new parser must be an etree.XMLParser.

-

Call without arguments to reset to the original parser.

-
-
-
-
- -
- -
- - -
-

set_pytype_attribute_tag(attribute_tag=None) -

-
  -
- -

Change name and namespace of the XML attribute that holds Python type -information.

-

Do not use this unless you know what you are doing.

-

Reset by calling without argument.

-

Default: "{http://codespeak.net/lxml/objectify/pytype}pytype"

-
-
-
-
- -
- -
- - -
-

xsiannotate(element_or_tree, - ignore_old=False, - ignore_pytype=False, - empty_type=None) -

-
  -
- -

Recursively annotates the elements of an XML tree with 'xsi:type' -attributes.

-

If the 'ignore_old' keyword argument is True (the default), current -'xsi:type' attributes will be ignored and replaced. Otherwise, they will be -checked and only replaced if they no longer fit the current text value.

-

Note that the mapping from Python types to XSI types is usually ambiguous. -Currently, only the first XSI type name in the corresponding PyType -definition will be used for annotation. Thus, you should consider naming -the widest type first if you define additional types.

-

Setting the keyword argument ignore_pytype to True makes the function -additionally ignore existing pytype annotations. The default is to -use them as a type hint.

-

The default annotation of empty elements can be set with the -empty_type keyword argument. The default is not to annotate empty -elements. Pass 'string', for example, to make string values the default.

-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

PYTYPE_ATTRIBUTE

- -
-
-
-
Value:
-
-'{http://codespeak.net/lxml/objectify/pytype}pytype'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.BoolElement-class.html b/doc/html/api/lxml.objectify.BoolElement-class.html deleted file mode 100644 index 1eab804d..00000000 --- a/doc/html/api/lxml.objectify.BoolElement-class.html +++ /dev/null @@ -1,825 +0,0 @@ - - - - - lxml.objectify.BoolElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class BoolElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class BoolElement

-
-    object --+                        
-             |                        
-etree._Element --+                    
-                 |                    
- etree.ElementBase --+                
-                     |                
-    ObjectifiedElement --+            
-                         |            
-    ObjectifiedDataElement --+        
-                             |        
-                 NumberElement --+    
-                                 |    
-                        IntElement --+
-                                     |
-                                    BoolElement
-
- -
-

Boolean type base on string values: 'true' or 'false'.

-

Note that this inherits from IntElement to mimic the behaviour of -Python's bool type.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__eq__(x, - y)
- x==y
- - -
- -
-   - - - - - - -
__ge__(x, - y)
- x>=y
- - -
- -
-   - - - - - - -
__gt__(x, - y)
- x>y
- - -
- -
-   - - - - - - -
__hash__(x)
- hash(x)
- - -
- -
-   - - - - - - -
__le__(x, - y)
- x<=y
- - -
- -
-   - - - - - - -
__lt__(x, - y)
- x<y
- - -
- -
-   - - - - - - -
__ne__(x, - y)
- x!=y
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__nonzero__(x)
- x != 0
- - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
__str__(x)
- str(x)
- - -
- -
-   - - - - - - -
_init(...)
- Called after object initialisation. Custom subclasses may override -this if they recursively call _init() in the superclasses.
- - -
- -
-

Inherited from NumberElement: - __abs__, - __add__, - __and__, - __complex__, - __div__, - __float__, - __hex__, - __int__, - __invert__, - __long__, - __lshift__, - __mod__, - __mul__, - __neg__, - __oct__, - __or__, - __pos__, - __pow__, - __radd__, - __rand__, - __rdiv__, - __rlshift__, - __rmod__, - __rmul__, - __ror__, - __rpow__, - __rrshift__, - __rshift__, - __rsub__, - __rtruediv__, - __rxor__, - __sub__, - __truediv__, - __xor__ -

-

Inherited from NumberElement (private): - _setValueParser -

-

Inherited from ObjectifiedDataElement (private): - _setText -

-

Inherited from ObjectifiedElement: - __delattr__, - __delitem__, - __getattr__, - __getattribute__, - __getitem__, - __iter__, - __len__, - __reduce__, - __setattr__, - __setitem__, - addattr, - countchildren, - descendantpaths, - getchildren -

-

Inherited from etree.ElementBase: - __init__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __reversed__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from object: - __format__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - pyval -
-

Inherited from ObjectifiedElement: - text -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__eq__(x, - y) -
(Equality operator) -

-
  -
- - x==y -
-
Overrides: - NumberElement.__eq__ -
-
-
-
- -
- -
- - -
-

__ge__(x, - y) -
(Greater-than-or-equals operator) -

-
  -
- - x>=y -
-
Overrides: - NumberElement.__ge__ -
-
-
-
- -
- -
- - -
-

__gt__(x, - y) -
(Greater-than operator) -

-
  -
- - x>y -
-
Overrides: - NumberElement.__gt__ -
-
-
-
- -
- -
- - -
-

__hash__(x) -
(Hashing function) -

-
  -
- - hash(x) -
-
Overrides: - object.__hash__ -
-
-
-
- -
- -
- - -
-

__le__(x, - y) -
(Less-than-or-equals operator) -

-
  -
- - x<=y -
-
Overrides: - NumberElement.__le__ -
-
-
-
- -
- -
- - -
-

__lt__(x, - y) -
(Less-than operator) -

-
  -
- - x<y -
-
Overrides: - NumberElement.__lt__ -
-
-
-
- -
- -
- - -
-

__ne__(x, - y) -

-
  -
- - x!=y -
-
Overrides: - NumberElement.__ne__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__nonzero__(x) -
(Boolean test operator) -

-
  -
- - x != 0 -
-
Overrides: - etree._Element.__nonzero__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
- -
- -
- - -
-

__str__(x) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
-
-
-
- -
- -
- - -
-

_init(...) -

-
  -
- - Called after object initialisation. Custom subclasses may override -this if they recursively call _init() in the superclasses. -
-
Overrides: - etree._Element._init -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.ElementMaker-class.html b/doc/html/api/lxml.objectify.ElementMaker-class.html deleted file mode 100644 index 25077643..00000000 --- a/doc/html/api/lxml.objectify.ElementMaker-class.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - lxml.objectify.ElementMaker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class ElementMaker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementMaker

-
-object --+
-         |
-        ElementMaker
-
- -
-

ElementMaker(self, namespace=None, nsmap=None, annotate=True, makeelement=None)

-

An ElementMaker that can be used for constructing trees.

-

Example:

-
->>> M = ElementMaker(annotate=False)
->>> attributes = {'class': 'par'}
->>> html = M.html( M.body( M.p('hello', attributes, M.br, 'objectify', style="font-weight: bold") ) )
-
->>> from lxml.etree import tostring
->>> print(tostring(html, method='html').decode('ascii'))
-<html><body><p style="font-weight: bold" class="par">hello<br>objectify</p></body></html>
-
-

To create tags that are not valid Python identifiers, call the factory -directly and pass the tag name as first argument:

-
->>> root = M('tricky-tag', 'some text')
->>> print(root.tag)
-tricky-tag
->>> print(root.text)
-some text
-
-

Note that this module has a predefined ElementMaker instance called E.

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(x, - ...)
- x(...)
- - -
- -
-   - - - - - - -
__getattr__(...) - - -
- -
-   - - - - - - -
__getattribute__(...)
- x.__getattribute__('name') <==> x.name
- - -
- -
-   - - - - - - -
__init__(self, - namespace=None, - nsmap=None, - annotate=True, - makeelement=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__getattribute__(...) -

-
  -
- - x.__getattribute__('name') <==> x.name -
-
Overrides: - object.__getattribute__ -
-
-
-
- -
- -
- - -
-

__init__(self, - namespace=None, - nsmap=None, - annotate=True, - makeelement=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.FloatElement-class.html b/doc/html/api/lxml.objectify.FloatElement-class.html deleted file mode 100644 index ab9738ad..00000000 --- a/doc/html/api/lxml.objectify.FloatElement-class.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - - lxml.objectify.FloatElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class FloatElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class FloatElement

-
-    object --+                    
-             |                    
-etree._Element --+                
-                 |                
- etree.ElementBase --+            
-                     |            
-    ObjectifiedElement --+        
-                         |        
-    ObjectifiedDataElement --+    
-                             |    
-                 NumberElement --+
-                                 |
-                                FloatElement
-
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
_init(...)
- Called after object initialisation. Custom subclasses may override -this if they recursively call _init() in the superclasses.
- - -
- -
-

Inherited from NumberElement: - __abs__, - __add__, - __and__, - __complex__, - __div__, - __eq__, - __float__, - __ge__, - __gt__, - __hash__, - __hex__, - __int__, - __invert__, - __le__, - __long__, - __lshift__, - __lt__, - __mod__, - __mul__, - __ne__, - __neg__, - __nonzero__, - __oct__, - __or__, - __pos__, - __pow__, - __radd__, - __rand__, - __rdiv__, - __repr__, - __rlshift__, - __rmod__, - __rmul__, - __ror__, - __rpow__, - __rrshift__, - __rshift__, - __rsub__, - __rtruediv__, - __rxor__, - __str__, - __sub__, - __truediv__, - __xor__ -

-

Inherited from NumberElement (private): - _setValueParser -

-

Inherited from ObjectifiedDataElement (private): - _setText -

-

Inherited from ObjectifiedElement: - __delattr__, - __delitem__, - __getattr__, - __getattribute__, - __getitem__, - __iter__, - __len__, - __reduce__, - __setattr__, - __setitem__, - addattr, - countchildren, - descendantpaths, - getchildren -

-

Inherited from etree.ElementBase: - __init__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __reversed__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from object: - __format__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from NumberElement: - pyval -

-

Inherited from ObjectifiedElement: - text -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

_init(...) -

-
  -
- - Called after object initialisation. Custom subclasses may override -this if they recursively call _init() in the superclasses. -
-
Overrides: - etree._Element._init -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.IntElement-class.html b/doc/html/api/lxml.objectify.IntElement-class.html deleted file mode 100644 index 8617440f..00000000 --- a/doc/html/api/lxml.objectify.IntElement-class.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - lxml.objectify.IntElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class IntElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class IntElement

-
-    object --+                    
-             |                    
-etree._Element --+                
-                 |                
- etree.ElementBase --+            
-                     |            
-    ObjectifiedElement --+        
-                         |        
-    ObjectifiedDataElement --+    
-                             |    
-                 NumberElement --+
-                                 |
-                                IntElement
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
_init(...)
- Called after object initialisation. Custom subclasses may override -this if they recursively call _init() in the superclasses.
- - -
- -
-

Inherited from NumberElement: - __abs__, - __add__, - __and__, - __complex__, - __div__, - __eq__, - __float__, - __ge__, - __gt__, - __hash__, - __hex__, - __int__, - __invert__, - __le__, - __long__, - __lshift__, - __lt__, - __mod__, - __mul__, - __ne__, - __neg__, - __nonzero__, - __oct__, - __or__, - __pos__, - __pow__, - __radd__, - __rand__, - __rdiv__, - __repr__, - __rlshift__, - __rmod__, - __rmul__, - __ror__, - __rpow__, - __rrshift__, - __rshift__, - __rsub__, - __rtruediv__, - __rxor__, - __str__, - __sub__, - __truediv__, - __xor__ -

-

Inherited from NumberElement (private): - _setValueParser -

-

Inherited from ObjectifiedDataElement (private): - _setText -

-

Inherited from ObjectifiedElement: - __delattr__, - __delitem__, - __getattr__, - __getattribute__, - __getitem__, - __iter__, - __len__, - __reduce__, - __setattr__, - __setitem__, - addattr, - countchildren, - descendantpaths, - getchildren -

-

Inherited from etree.ElementBase: - __init__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __reversed__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from object: - __format__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from NumberElement: - pyval -

-

Inherited from ObjectifiedElement: - text -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

_init(...) -

-
  -
- - Called after object initialisation. Custom subclasses may override -this if they recursively call _init() in the superclasses. -
-
Overrides: - etree._Element._init -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.LongElement-class.html b/doc/html/api/lxml.objectify.LongElement-class.html deleted file mode 100644 index 6be332ef..00000000 --- a/doc/html/api/lxml.objectify.LongElement-class.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - - lxml.objectify.LongElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class LongElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LongElement

-
-    object --+                    
-             |                    
-etree._Element --+                
-                 |                
- etree.ElementBase --+            
-                     |            
-    ObjectifiedElement --+        
-                         |        
-    ObjectifiedDataElement --+    
-                             |    
-                 NumberElement --+
-                                 |
-                                LongElement
-
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
_init(...)
- Called after object initialisation. Custom subclasses may override -this if they recursively call _init() in the superclasses.
- - -
- -
-

Inherited from NumberElement: - __abs__, - __add__, - __and__, - __complex__, - __div__, - __eq__, - __float__, - __ge__, - __gt__, - __hash__, - __hex__, - __int__, - __invert__, - __le__, - __long__, - __lshift__, - __lt__, - __mod__, - __mul__, - __ne__, - __neg__, - __nonzero__, - __oct__, - __or__, - __pos__, - __pow__, - __radd__, - __rand__, - __rdiv__, - __repr__, - __rlshift__, - __rmod__, - __rmul__, - __ror__, - __rpow__, - __rrshift__, - __rshift__, - __rsub__, - __rtruediv__, - __rxor__, - __str__, - __sub__, - __truediv__, - __xor__ -

-

Inherited from NumberElement (private): - _setValueParser -

-

Inherited from ObjectifiedDataElement (private): - _setText -

-

Inherited from ObjectifiedElement: - __delattr__, - __delitem__, - __getattr__, - __getattribute__, - __getitem__, - __iter__, - __len__, - __reduce__, - __setattr__, - __setitem__, - addattr, - countchildren, - descendantpaths, - getchildren -

-

Inherited from etree.ElementBase: - __init__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __reversed__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from object: - __format__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from NumberElement: - pyval -

-

Inherited from ObjectifiedElement: - text -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

_init(...) -

-
  -
- - Called after object initialisation. Custom subclasses may override -this if they recursively call _init() in the superclasses. -
-
Overrides: - etree._Element._init -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.NoneElement-class.html b/doc/html/api/lxml.objectify.NoneElement-class.html deleted file mode 100644 index 9d35c941..00000000 --- a/doc/html/api/lxml.objectify.NoneElement-class.html +++ /dev/null @@ -1,596 +0,0 @@ - - - - - lxml.objectify.NoneElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class NoneElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class NoneElement

-
-    object --+                
-             |                
-etree._Element --+            
-                 |            
- etree.ElementBase --+        
-                     |        
-    ObjectifiedElement --+    
-                         |    
-    ObjectifiedDataElement --+
-                             |
-                            NoneElement
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__eq__(x, - y)
- x==y
- - -
- -
-   - - - - - - -
__ge__(x, - y)
- x>=y
- - -
- -
-   - - - - - - -
__gt__(x, - y)
- x>y
- - -
- -
-   - - - - - - -
__hash__(x)
- hash(x)
- - -
- -
-   - - - - - - -
__le__(x, - y)
- x<=y
- - -
- -
-   - - - - - - -
__lt__(x, - y)
- x<y
- - -
- -
-   - - - - - - -
__ne__(x, - y)
- x!=y
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__nonzero__(x)
- x != 0
- - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
__str__(x)
- str(x)
- - -
- -
-

Inherited from ObjectifiedDataElement (private): - _setText -

-

Inherited from ObjectifiedElement: - __delattr__, - __delitem__, - __getattr__, - __getattribute__, - __getitem__, - __iter__, - __len__, - __reduce__, - __setattr__, - __setitem__, - addattr, - countchildren, - descendantpaths, - getchildren -

-

Inherited from etree.ElementBase: - __init__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __reversed__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from object: - __format__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - pyval -
-

Inherited from ObjectifiedElement: - text -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__hash__(x) -
(Hashing function) -

-
  -
- - hash(x) -
-
Overrides: - object.__hash__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__nonzero__(x) -
(Boolean test operator) -

-
  -
- - x != 0 -
-
Overrides: - etree._Element.__nonzero__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
- -
- -
- - -
-

__str__(x) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.NumberElement-class.html b/doc/html/api/lxml.objectify.NumberElement-class.html deleted file mode 100644 index 23ac7799..00000000 --- a/doc/html/api/lxml.objectify.NumberElement-class.html +++ /dev/null @@ -1,1242 +0,0 @@ - - - - - lxml.objectify.NumberElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class NumberElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class NumberElement

-
-    object --+                
-             |                
-etree._Element --+            
-                 |            
- etree.ElementBase --+        
-                     |        
-    ObjectifiedElement --+    
-                         |    
-    ObjectifiedDataElement --+
-                             |
-                            NumberElement
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__abs__(x)
- abs(x)
- - -
- -
-   - - - - - - -
__add__(x, - y)
- x+y
- - -
- -
-   - - - - - - -
__and__(x, - y)
- x&y
- - -
- -
-   - - - - - - -
__complex__(...) - - -
- -
-   - - - - - - -
__div__(x, - y)
- x/y
- - -
- -
-   - - - - - - -
__eq__(x, - y)
- x==y
- - -
- -
-   - - - - - - -
__float__(x)
- float(x)
- - -
- -
-   - - - - - - -
__ge__(x, - y)
- x>=y
- - -
- -
-   - - - - - - -
__gt__(x, - y)
- x>y
- - -
- -
-   - - - - - - -
__hash__(x)
- hash(x)
- - -
- -
-   - - - - - - -
__hex__(x)
- hex(x)
- - -
- -
-   - - - - - - -
__int__(x)
- int(x)
- - -
- -
-   - - - - - - -
__invert__(x)
- ~x
- - -
- -
-   - - - - - - -
__le__(x, - y)
- x<=y
- - -
- -
-   - - - - - - -
__long__(x)
- long(x)
- - -
- -
-   - - - - - - -
__lshift__(x, - y)
- x<<y
- - -
- -
-   - - - - - - -
__lt__(x, - y)
- x<y
- - -
- -
-   - - - - - - -
__mod__(x, - y)
- x%y
- - -
- -
-   - - - - - - -
__mul__(x, - y)
- x*y
- - -
- -
-   - - - - - - -
__ne__(x, - y)
- x!=y
- - -
- -
-   - - - - - - -
__neg__(x)
- -x
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__nonzero__(x)
- x != 0
- - -
- -
-   - - - - - - -
__oct__(x)
- oct(x)
- - -
- -
-   - - - - - - -
__or__(x, - y)
- x|y
- - -
- -
-   - - - - - - -
__pos__(x)
- +x
- - -
- -
-   - - - - - - -
__pow__(x, - y, - z=...)
- pow(x, y[, z])
- - -
- -
-   - - - - - - -
__radd__(x, - y)
- y+x
- - -
- -
-   - - - - - - -
__rand__(x, - y)
- y&x
- - -
- -
-   - - - - - - -
__rdiv__(x, - y)
- y/x
- - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
__rlshift__(x, - y)
- y<<x
- - -
- -
-   - - - - - - -
__rmod__(x, - y)
- y%x
- - -
- -
-   - - - - - - -
__rmul__(x, - y)
- y*x
- - -
- -
-   - - - - - - -
__ror__(x, - y)
- y|x
- - -
- -
-   - - - - - - -
__rpow__(y, - x, - z=...)
- pow(x, y[, z])
- - -
- -
-   - - - - - - -
__rrshift__(x, - y)
- y>>x
- - -
- -
-   - - - - - - -
__rshift__(x, - y)
- x>>y
- - -
- -
-   - - - - - - -
__rsub__(x, - y)
- y-x
- - -
- -
-   - - - - - - -
__rtruediv__(x, - y)
- y/x
- - -
- -
-   - - - - - - -
__rxor__(x, - y)
- y^x
- - -
- -
-   - - - - - - -
__str__(x)
- str(x)
- - -
- -
-   - - - - - - -
__sub__(x, - y)
- x-y
- - -
- -
-   - - - - - - -
__truediv__(x, - y)
- x/y
- - -
- -
-   - - - - - - -
__xor__(x, - y)
- x^y
- - -
- -
-   - - - - - - -
_setValueParser(...)
- Set the function that parses the Python value from a string.
- - -
- -
-

Inherited from ObjectifiedDataElement (private): - _setText -

-

Inherited from ObjectifiedElement: - __delattr__, - __delitem__, - __getattr__, - __getattribute__, - __getitem__, - __iter__, - __len__, - __reduce__, - __setattr__, - __setitem__, - addattr, - countchildren, - descendantpaths, - getchildren -

-

Inherited from etree.ElementBase: - __init__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __reversed__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from object: - __format__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - pyval -
-

Inherited from ObjectifiedElement: - text -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__hash__(x) -
(Hashing function) -

-
  -
- - hash(x) -
-
Overrides: - object.__hash__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__nonzero__(x) -
(Boolean test operator) -

-
  -
- - x != 0 -
-
Overrides: - etree._Element.__nonzero__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
- -
- -
- - -
-

__str__(x) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
-
-
-
- -
- -
- - -
-

_setValueParser(...) -

-
  -
- -

Set the function that parses the Python value from a string.

-

Do not use this unless you know what you are doing.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.ObjectPath-class.html b/doc/html/api/lxml.objectify.ObjectPath-class.html deleted file mode 100644 index 2a4f5300..00000000 --- a/doc/html/api/lxml.objectify.ObjectPath-class.html +++ /dev/null @@ -1,475 +0,0 @@ - - - - - lxml.objectify.ObjectPath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class ObjectPath - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ObjectPath

-
-object --+
-         |
-        ObjectPath
-
- -
-

ObjectPath(path) -Immutable object that represents a compiled object path.

-

Example for a path: 'root.child[1].{other}child[25]'

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(...)
- Follow the attribute path in the object structure and return the -target attribute value.
- - -
- -
-   - - - - - - -
__init__(path)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__str__(x)
- str(x)
- - -
- -
-   - - - - - - -
addattr(self, - root, - value)
- Append a value to the target element in a subtree.
- - -
- -
-   - - - - - - -
hasattr(self, - root) - - -
- -
-   - - - - - - -
setattr(self, - root, - value)
- Set the value of the target element in a subtree.
- - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - find -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__call__(...) -
(Call operator) -

-
  -
- -

Follow the attribute path in the object structure and return the -target attribute value.

-

If it it not found, either returns a default value (if one was passed -as second argument) or raises AttributeError.

-
-
-
-
- -
- -
- - -
-

__init__(path) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__str__(x) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
-
-
-
- -
- -
- - -
-

addattr(self, - root, - value) -

-
  -
- -

Append a value to the target element in a subtree.

-

If any of the children on the path does not exist, it is created.

-
-
-
-
- -
- -
- - -
-

setattr(self, - root, - value) -

-
  -
- -

Set the value of the target element in a subtree.

-

If any of the children on the path does not exist, it is created.

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.ObjectifiedDataElement-class.html b/doc/html/api/lxml.objectify.ObjectifiedDataElement-class.html deleted file mode 100644 index a2786d69..00000000 --- a/doc/html/api/lxml.objectify.ObjectifiedDataElement-class.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - - lxml.objectify.ObjectifiedDataElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class ObjectifiedDataElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ObjectifiedDataElement

-
-    object --+            
-             |            
-etree._Element --+        
-                 |        
- etree.ElementBase --+    
-                     |    
-    ObjectifiedElement --+
-                         |
-                        ObjectifiedDataElement
-
- -
Known Subclasses:
-
- -
- -
-This is the base class for all data type Elements. Subclasses should -override the 'pyval' property and possibly the __str__ method. - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
__str__(x)
- str(x)
- - -
- -
-   - - - - - - -
_setText(...)
- For use in subclasses only. Don't use unless you know what you are -doing.
- - -
- -
-

Inherited from ObjectifiedElement: - __delattr__, - __delitem__, - __getattr__, - __getattribute__, - __getitem__, - __iter__, - __len__, - __reduce__, - __setattr__, - __setitem__, - addattr, - countchildren, - descendantpaths, - getchildren -

-

Inherited from etree.ElementBase: - __init__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __nonzero__, - __reversed__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - pyval -
-

Inherited from ObjectifiedElement: - text -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
- -
- -
- - -
-

__str__(x) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.ObjectifiedElement-class.html b/doc/html/api/lxml.objectify.ObjectifiedElement-class.html deleted file mode 100644 index d360bdf2..00000000 --- a/doc/html/api/lxml.objectify.ObjectifiedElement-class.html +++ /dev/null @@ -1,883 +0,0 @@ - - - - - lxml.objectify.ObjectifiedElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class ObjectifiedElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ObjectifiedElement

-
-    object --+        
-             |        
-etree._Element --+    
-                 |    
- etree.ElementBase --+
-                     |
-                    ObjectifiedElement
-
- -
Known Subclasses:
-
- -
- -
-

Main XML Element class.

-

Element children are accessed as object attributes. Multiple children -with the same name are available through a list index. Example:

-
->>> root = XML("<root><c1><c2>0</c2><c2>1</c2></c1></root>")
->>> second_c2 = root.c1.c2[1]
->>> print(second_c2.text)
-1
-
-

Note that you cannot (and must not) instantiate this class or its -subclasses.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__delattr__(...)
- x.__delattr__('name') <==> del x.name
- - -
- -
-   - - - - - - -
__delitem__(x, - y)
- del x[y]
- - -
- -
-   - - - - - - -
__getattr__(...)
- Return the (first) child with the given tag name. If no namespace -is provided, the child will be looked up in the same one as self.
- - -
- -
-   - - - - - - -
__getattribute__(...)
- x.__getattribute__('name') <==> x.name
- - -
- -
-   - - - - - - -
__getitem__(...)
- Return a sibling, counting from the first child of the parent. The -method behaves like both a dict and a sequence.
- - -
- -
-   - - - - - - -
__iter__(...)
- Iterate over self and all siblings with the same tag.
- - -
- -
-   - - - - - - -
__len__(...)
- Count self and siblings with the same tag.
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__reduce__(...)
- helper for pickle
- - -
- -
-   - - - - - - -
__setattr__(...)
- Set the value of the (first) child with the given tag name. If no -namespace is provided, the child will be looked up in the same one as -self.
- - -
- -
-   - - - - - - -
__setitem__(...)
- Set the value of a sibling, counting from the first child of the -parent. Implements key assignment, item assignment and slice -assignment.
- - -
- -
-   - - - - - - -
__str__(x)
- str(x)
- - -
- -
-   - - - - - - -
addattr(self, - tag, - value)
- Add a child value to the element.
- - -
- -
-   - - - - - - -
countchildren(self)
- Return the number of children of this element, regardless of their -name.
- - -
- -
-   - - - - - - -
descendantpaths(self, - prefix=None)
- Returns a list of object path expressions for all descendants.
- - -
- -
-   - - - - - - -
getchildren(self)
- Returns a sequence of all direct children. The elements are -returned in document order.
- - -
- -
-

Inherited from etree.ElementBase: - __init__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __nonzero__, - __repr__, - __reversed__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - text
- Text before the first subelement. This is either a string or -the value None, if there was no text. -
-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__delattr__(...) -

-
  -
- - x.__delattr__('name') <==> del x.name -
-
Overrides: - object.__delattr__ -
-
-
-
- -
- -
- - -
-

__delitem__(x, - y) -
(Index deletion operator) -

-
  -
- - del x[y] -
-
Overrides: - etree._Element.__delitem__ -
-
-
-
- -
- -
- - -
-

__getattribute__(...) -

-
  -
- - x.__getattribute__('name') <==> x.name -
-
Overrides: - object.__getattribute__ -
-
-
-
- -
- -
- - -
-

__getitem__(...) -
(Indexing operator) -

-
  -
- -

Return a sibling, counting from the first child of the parent. The -method behaves like both a dict and a sequence.

-
    -
  • If argument is an integer, returns the sibling at that position.
  • -
  • If argument is a string, does the same as getattr(). This can be -used to provide namespaces for element lookup, or to look up -children with special names (text etc.).
  • -
  • If argument is a slice object, returns the matching slice.
  • -
-
-
Overrides: - etree._Element.__getitem__ -
-
-
-
- -
- -
- - -
-

__iter__(...) -

-
  -
- - Iterate over self and all siblings with the same tag. -
-
Overrides: - etree._Element.__iter__ -
-
-
-
- -
- -
- - -
-

__len__(...) -
(Length operator) -

-
  -
- - Count self and siblings with the same tag. -
-
Overrides: - etree._Element.__len__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__reduce__(...) -

-
  -
- - helper for pickle -
-
Overrides: - object.__reduce__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__setattr__(...) -

-
  -
- - Set the value of the (first) child with the given tag name. If no -namespace is provided, the child will be looked up in the same one as -self. -
-
Overrides: - object.__setattr__ -
-
-
-
- -
- -
- - -
-

__setitem__(...) -
(Index assignment operator) -

-
  -
- -

Set the value of a sibling, counting from the first child of the -parent. Implements key assignment, item assignment and slice -assignment.

-
    -
  • If argument is an integer, sets the sibling at that position.
  • -
  • If argument is a string, does the same as setattr(). This is used -to provide namespaces for element lookup.
  • -
  • If argument is a sequence (list, tuple, etc.), assign the contained -items to the siblings.
  • -
-
-
Overrides: - etree._Element.__setitem__ -
-
-
-
- -
- -
- - -
-

__str__(x) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
-
-
-
- -
- -
- - -
-

addattr(self, - tag, - value) -

-
  -
- -

Add a child value to the element.

-

As opposed to append(), it sets a data value, not an element.

-
-
-
-
- -
- -
- - -
-

getchildren(self) -

-
  -
- - Returns a sequence of all direct children. The elements are -returned in document order. -
-
Overrides: - etree._Element.getchildren -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.ObjectifyElementClassLookup-class.html b/doc/html/api/lxml.objectify.ObjectifyElementClassLookup-class.html deleted file mode 100644 index 5bf3d39a..00000000 --- a/doc/html/api/lxml.objectify.ObjectifyElementClassLookup-class.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - lxml.objectify.ObjectifyElementClassLookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class ObjectifyElementClassLookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ObjectifyElementClassLookup

-
-              object --+    
-                       |    
-etree.ElementClassLookup --+
-                           |
-                          ObjectifyElementClassLookup
-
- -
-ObjectifyElementClassLookup(self, tree_class=None, empty_data_class=None) -Element class lookup method that uses the objectify classes. - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - tree_class=None, - empty_data_class=None)
- Lookup mechanism for objectify.
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - tree_class=None, - empty_data_class=None) -
(Constructor) -

-
  -
- -

Lookup mechanism for objectify.

-

The default Element classes can be replaced by passing subclasses of -ObjectifiedElement and ObjectifiedDataElement as keyword arguments. -'tree_class' defines inner tree classes (defaults to -ObjectifiedElement), 'empty_data_class' defines the default class for -empty data elements (defaults to StringElement).

-
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.PyType-class.html b/doc/html/api/lxml.objectify.PyType-class.html deleted file mode 100644 index 300b7074..00000000 --- a/doc/html/api/lxml.objectify.PyType-class.html +++ /dev/null @@ -1,469 +0,0 @@ - - - - - lxml.objectify.PyType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class PyType - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class PyType

-
-object --+
-         |
-        PyType
-
- -
-

PyType(self, name, type_check, type_class, stringify=None) -User defined type.

-

Named type that contains a type check function, a type class that -inherits from ObjectifiedDataElement and an optional "stringification" -function. The type check must take a string as argument and raise -ValueError or TypeError if it cannot handle the string value. It may be -None in which case it is not considered for type guessing. For registered -named types, the 'stringify' function (or unicode() if None) is used to -convert a Python object with type name 'name' to the string representation -stored in the XML tree.

-

Example:

-
-PyType('int', int, MyIntClass).register()
-
-

Note that the order in which types are registered matters. The first -matching type will be used.

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - name, - type_check, - type_class, - stringify=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
register(self, - before=None, - after=None)
- Register the type.
- - -
- -
-   - - - - - - -
unregister(self) - - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - name -
-   - - stringify -
-   - - type_check -
-   - - xmlSchemaTypes
- The list of XML Schema datatypes this Python type maps to. -
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - name, - type_check, - type_class, - stringify=None) -
(Constructor) -

-
  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
- -
- -
- - -
-

register(self, - before=None, - after=None) -

-
  -
- -

Register the type.

-

The additional keyword arguments 'before' and 'after' accept a -sequence of type names that must appear before/after the new type in -the type list. If any of them is not currently known, it is simply -ignored. Raises ValueError if the dependencies cannot be fulfilled.

-
-
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

xmlSchemaTypes

-

The list of XML Schema datatypes this Python type maps to.

-

Note that this must be set before registering the type!

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.objectify.StringElement-class.html b/doc/html/api/lxml.objectify.StringElement-class.html deleted file mode 100644 index b176e403..00000000 --- a/doc/html/api/lxml.objectify.StringElement-class.html +++ /dev/null @@ -1,755 +0,0 @@ - - - - - lxml.objectify.StringElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module objectify :: - Class StringElement - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class StringElement

-
-    object --+                
-             |                
-etree._Element --+            
-                 |            
- etree.ElementBase --+        
-                     |        
-    ObjectifiedElement --+    
-                         |    
-    ObjectifiedDataElement --+
-                             |
-                            StringElement
-
- -
-

String data class.

-

Note that this class does not support the sequence protocol of strings: -len(), iter(), str_attr[0], str_attr[0:1], etc. are not supported. -Instead, use the .text attribute to get a 'real' string.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__add__(x, - y)
- x+y
- - -
- -
-   - - - - - - -
__complex__(...) - - -
- -
-   - - - - - - -
__eq__(x, - y)
- x==y
- - -
- -
-   - - - - - - -
__float__(x)
- float(x)
- - -
- -
-   - - - - - - -
__ge__(x, - y)
- x>=y
- - -
- -
-   - - - - - - -
__gt__(x, - y)
- x>y
- - -
- -
-   - - - - - - -
__hash__(x)
- hash(x)
- - -
- -
-   - - - - - - -
__int__(x)
- int(x)
- - -
- -
-   - - - - - - -
__le__(x, - y)
- x<=y
- - -
- -
-   - - - - - - -
__long__(x)
- long(x)
- - -
- -
-   - - - - - - -
__lt__(x, - y)
- x<y
- - -
- -
-   - - - - - - -
__mod__(x, - y)
- x%y
- - -
- -
-   - - - - - - -
__mul__(x, - y)
- x*y
- - -
- -
-   - - - - - - -
__ne__(x, - y)
- x!=y
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__nonzero__(x)
- x != 0
- - -
- -
-   - - - - - - -
__radd__(x, - y)
- y+x
- - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
__rmod__(x, - y)
- y%x
- - -
- -
-   - - - - - - -
__rmul__(x, - y)
- y*x
- - -
- -
-   - - - - - - -
strlen(...) - - -
- -
-

Inherited from ObjectifiedDataElement: - __str__ -

-

Inherited from ObjectifiedDataElement (private): - _setText -

-

Inherited from ObjectifiedElement: - __delattr__, - __delitem__, - __getattr__, - __getattribute__, - __getitem__, - __iter__, - __len__, - __reduce__, - __setattr__, - __setitem__, - addattr, - countchildren, - descendantpaths, - getchildren -

-

Inherited from etree.ElementBase: - __init__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __reversed__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from object: - __format__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - pyval -
-

Inherited from ObjectifiedElement: - text -

-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__hash__(x) -
(Hashing function) -

-
  -
- - hash(x) -
-
Overrides: - object.__hash__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__nonzero__(x) -
(Boolean test operator) -

-
  -
- - x != 0 -
-
Overrides: - etree._Element.__nonzero__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.pyclasslookup-module.html b/doc/html/api/lxml.pyclasslookup-module.html deleted file mode 100644 index fa7efffd..00000000 --- a/doc/html/api/lxml.pyclasslookup-module.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - lxml.pyclasslookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module pyclasslookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module pyclasslookup

source code

- - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __package__ = 'lxml' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.pyclasslookup-pysrc.html b/doc/html/api/lxml.pyclasslookup-pysrc.html deleted file mode 100644 index 8ada4095..00000000 --- a/doc/html/api/lxml.pyclasslookup-pysrc.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - lxml.pyclasslookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module pyclasslookup - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.pyclasslookup

-
-1  # dummy module for backwards compatibility 
-2   
-3  from lxml.etree import PythonElementClassLookup 
-4   
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.sax-module.html b/doc/html/api/lxml.sax-module.html deleted file mode 100644 index 6b545626..00000000 --- a/doc/html/api/lxml.sax-module.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - lxml.sax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module sax - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module sax

source code

-

SAX-based adapter to copy trees from/to the Python standard library.

-

Use the ElementTreeContentHandler class to build an ElementTree from -SAX events.

-

Use the ElementTreeProducer class or the saxify() function to fire -the SAX events of an ElementTree against a SAX ContentHandler.

-

See http://codespeak.net/lxml/sax.html

- - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - SaxError
- General SAX error. -
-   - - ElementTreeContentHandler
- Build an lxml ElementTree from SAX events. -
-   - - ElementTreeProducer
- Produces SAX events for an element and children. -
- - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
_getNsTag(tag) - source code - -
- -
-   - - - - - - -
saxify(element_or_tree, - content_handler)
- One-shot helper to generate SAX events from an XML tree and fire -them against a SAX ContentHandler.
- source code - -
- -
- - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __package__ = 'lxml' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.sax-pysrc.html b/doc/html/api/lxml.sax-pysrc.html deleted file mode 100644 index 2c866015..00000000 --- a/doc/html/api/lxml.sax-pysrc.html +++ /dev/null @@ -1,599 +0,0 @@ - - - - - lxml.sax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module sax - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.sax

-
-  1  """ 
-  2  SAX-based adapter to copy trees from/to the Python standard library. 
-  3   
-  4  Use the `ElementTreeContentHandler` class to build an ElementTree from 
-  5  SAX events. 
-  6   
-  7  Use the `ElementTreeProducer` class or the `saxify()` function to fire 
-  8  the SAX events of an ElementTree against a SAX ContentHandler. 
-  9   
- 10  See http://codespeak.net/lxml/sax.html 
- 11  """ 
- 12   
- 13  from xml.sax.handler import ContentHandler 
- 14  from lxml import etree 
- 15  from lxml.etree import ElementTree, SubElement 
- 16  from lxml.etree import Comment, ProcessingInstruction 
- 17   
- 18   
-
19 -class SaxError(etree.LxmlError): -
20 """General SAX error. - 21 """ -
22 - 23 -
24 -def _getNsTag(tag): -
25 if tag[0] == '{': - 26 return tuple(tag[1:].split('}', 1)) - 27 else: - 28 return (None, tag) -
29 - 30 -
31 -class ElementTreeContentHandler(ContentHandler): -
32 """Build an lxml ElementTree from SAX events. - 33 """ -
34 - def __init__(self, makeelement=None): -
35 ContentHandler.__init__(self) - 36 self._root = None - 37 self._root_siblings = [] - 38 self._element_stack = [] - 39 self._default_ns = None - 40 self._ns_mapping = { None : [None] } - 41 self._new_mappings = {} - 42 if makeelement is None: - 43 makeelement = etree.Element - 44 self._makeelement = makeelement -
45 -
46 - def _get_etree(self): -
47 "Contains the generated ElementTree after parsing is finished." - 48 return ElementTree(self._root) -
49 - 50 etree = property(_get_etree, doc=_get_etree.__doc__) - 51 -
52 - def setDocumentLocator(self, locator): -
53 pass -
54 -
55 - def startDocument(self): -
56 pass -
57 -
58 - def endDocument(self): -
59 pass -
60 -
61 - def startPrefixMapping(self, prefix, uri): -
62 self._new_mappings[prefix] = uri - 63 try: - 64 self._ns_mapping[prefix].append(uri) - 65 except KeyError: - 66 self._ns_mapping[prefix] = [uri] - 67 if prefix is None: - 68 self._default_ns = uri -
69 -
70 - def endPrefixMapping(self, prefix): -
71 ns_uri_list = self._ns_mapping[prefix] - 72 ns_uri_list.pop() - 73 if prefix is None: - 74 self._default_ns = ns_uri_list[-1] -
75 -
76 - def _buildTag(self, ns_name_tuple): -
77 ns_uri, local_name = ns_name_tuple - 78 if ns_uri: - 79 el_tag = "{%s}%s" % ns_name_tuple - 80 elif self._default_ns: - 81 el_tag = "{%s}%s" % (self._default_ns, local_name) - 82 else: - 83 el_tag = local_name - 84 return el_tag -
85 -
86 - def startElementNS(self, ns_name, qname, attributes=None): -
87 el_name = self._buildTag(ns_name) - 88 if attributes: - 89 attrs = {} - 90 try: - 91 iter_attributes = attributes.iteritems() - 92 except AttributeError: - 93 iter_attributes = attributes.items() - 94 - 95 for name_tuple, value in iter_attributes: - 96 if name_tuple[0]: - 97 attr_name = "{%s}%s" % name_tuple - 98 else: - 99 attr_name = name_tuple[1] -100 attrs[attr_name] = value -101 else: -102 attrs = None -103 -104 element_stack = self._element_stack -105 if self._root is None: -106 element = self._root = \ -107 self._makeelement(el_name, attrs, self._new_mappings) -108 if self._root_siblings and hasattr(element, 'addprevious'): -109 for sibling in self._root_siblings: -110 element.addprevious(sibling) -111 del self._root_siblings[:] -112 else: -113 element = SubElement(element_stack[-1], el_name, -114 attrs, self._new_mappings) -115 element_stack.append(element) -116 -117 self._new_mappings.clear() -
118 -
119 - def processingInstruction(self, target, data): -
120 pi = ProcessingInstruction(target, data) -121 if self._root is None: -122 self._root_siblings.append(pi) -123 else: -124 self._element_stack[-1].append(pi) -
125 -
126 - def endElementNS(self, ns_name, qname): -
127 element = self._element_stack.pop() -128 el_tag = self._buildTag(ns_name) -129 if el_tag != element.tag: -130 raise SaxError("Unexpected element closed: " + el_tag) -
131 -
132 - def startElement(self, name, attributes=None): -
133 if attributes: -134 attributes = dict( -135 [((None, k), v) for k, v in attributes.items()] -136 ) -137 self.startElementNS((None, name), name, attributes) -
138 -
139 - def endElement(self, name): -
140 self.endElementNS((None, name), name) -
141 -
142 - def characters(self, data): -
143 last_element = self._element_stack[-1] -144 try: -145 # if there already is a child element, we must append to its tail -146 last_element = last_element[-1] -147 last_element.tail = (last_element.tail or '') + data -148 except IndexError: -149 # otherwise: append to the text -150 last_element.text = (last_element.text or '') + data -
151 -152 ignorableWhitespace = characters -
153 -154 -
155 -class ElementTreeProducer(object): -
156 """Produces SAX events for an element and children. -157 """ -
158 - def __init__(self, element_or_tree, content_handler): -
159 try: -160 element = element_or_tree.getroot() -161 except AttributeError: -162 element = element_or_tree -163 self._element = element -164 self._content_handler = content_handler -165 from xml.sax.xmlreader import AttributesNSImpl as attr_class -166 self._attr_class = attr_class -167 self._empty_attributes = attr_class({}, {}) -
168 -
169 - def saxify(self): -
170 self._content_handler.startDocument() -171 -172 element = self._element -173 if hasattr(element, 'getprevious'): -174 siblings = [] -175 sibling = element.getprevious() -176 while getattr(sibling, 'tag', None) is ProcessingInstruction: -177 siblings.append(sibling) -178 sibling = sibling.getprevious() -179 for sibling in siblings[::-1]: -180 self._recursive_saxify(sibling, {}) -181 -182 self._recursive_saxify(element, {}) -183 -184 if hasattr(element, 'getnext'): -185 sibling = element.getnext() -186 while getattr(sibling, 'tag', None) is ProcessingInstruction: -187 self._recursive_saxify(sibling, {}) -188 sibling = sibling.getnext() -189 -190 self._content_handler.endDocument() -
191 -
192 - def _recursive_saxify(self, element, prefixes): -
193 content_handler = self._content_handler -194 tag = element.tag -195 if tag is Comment or tag is ProcessingInstruction: -196 if tag is ProcessingInstruction: -197 content_handler.processingInstruction( -198 element.target, element.text) -199 if element.tail: -200 content_handler.characters(element.tail) -201 return -202 -203 new_prefixes = [] -204 build_qname = self._build_qname -205 attribs = element.items() -206 if attribs: -207 attr_values = {} -208 attr_qnames = {} -209 for attr_ns_name, value in attribs: -210 attr_ns_tuple = _getNsTag(attr_ns_name) -211 attr_values[attr_ns_tuple] = value -212 attr_qnames[attr_ns_tuple] = build_qname( -213 attr_ns_tuple[0], attr_ns_tuple[1], prefixes, new_prefixes) -214 sax_attributes = self._attr_class(attr_values, attr_qnames) -215 else: -216 sax_attributes = self._empty_attributes -217 -218 ns_uri, local_name = _getNsTag(tag) -219 qname = build_qname(ns_uri, local_name, prefixes, new_prefixes) -220 -221 for prefix, uri in new_prefixes: -222 content_handler.startPrefixMapping(prefix, uri) -223 content_handler.startElementNS((ns_uri, local_name), -224 qname, sax_attributes) -225 if element.text: -226 content_handler.characters(element.text) -227 for child in element: -228 self._recursive_saxify(child, prefixes) -229 content_handler.endElementNS((ns_uri, local_name), qname) -230 for prefix, uri in new_prefixes: -231 content_handler.endPrefixMapping(prefix) -232 if element.tail: -233 content_handler.characters(element.tail) -
234 -
235 - def _build_qname(self, ns_uri, local_name, prefixes, new_prefixes): -
236 if ns_uri is None: -237 return local_name -238 try: -239 prefix = prefixes[ns_uri] -240 except KeyError: -241 prefix = prefixes[ns_uri] = 'ns%02d' % len(prefixes) -242 new_prefixes.append( (prefix, ns_uri) ) -243 return prefix + ':' + local_name -
244 -
245 -def saxify(element_or_tree, content_handler): -
246 """One-shot helper to generate SAX events from an XML tree and fire -247 them against a SAX ContentHandler. -248 """ -249 return ElementTreeProducer(element_or_tree, content_handler).saxify() -
250 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.sax.ElementTreeContentHandler-class.html b/doc/html/api/lxml.sax.ElementTreeContentHandler-class.html deleted file mode 100644 index 28169e25..00000000 --- a/doc/html/api/lxml.sax.ElementTreeContentHandler-class.html +++ /dev/null @@ -1,894 +0,0 @@ - - - - - lxml.sax.ElementTreeContentHandler - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module sax :: - Class ElementTreeContentHandler - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementTreeContentHandler

source code

-
-xml.sax.handler.ContentHandler --+
-                                 |
-                                ElementTreeContentHandler
-
- -
-Build an lxml ElementTree from SAX events. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - makeelement=None) - source code - -
- -
-   - - - - - - -
_get_etree(self)
- Contains the generated ElementTree after parsing is finished.
- source code - -
- -
-   - - - - - - -
setDocumentLocator(self, - locator)
- Called by the parser to give the application a locator for -locating the origin of document events.
- source code - -
- -
-   - - - - - - -
startDocument(self)
- Receive notification of the beginning of a document.
- source code - -
- -
-   - - - - - - -
endDocument(self)
- Receive notification of the end of a document.
- source code - -
- -
-   - - - - - - -
startPrefixMapping(self, - prefix, - uri)
- Begin the scope of a prefix-URI Namespace mapping.
- source code - -
- -
-   - - - - - - -
endPrefixMapping(self, - prefix)
- End the scope of a prefix-URI mapping.
- source code - -
- -
-   - - - - - - -
_buildTag(self, - ns_name_tuple) - source code - -
- -
-   - - - - - - -
startElementNS(self, - ns_name, - qname, - attributes=None)
- Signals the start of an element in namespace mode.
- source code - -
- -
-   - - - - - - -
processingInstruction(self, - target, - data)
- Receive notification of a processing instruction.
- source code - -
- -
-   - - - - - - -
endElementNS(self, - ns_name, - qname)
- Signals the end of an element in namespace mode.
- source code - -
- -
-   - - - - - - -
startElement(self, - name, - attributes=None)
- Signals the start of an element in non-namespace mode.
- source code - -
- -
-   - - - - - - -
endElement(self, - name)
- Signals the end of an element in non-namespace mode.
- source code - -
- -
-   - - - - - - -
characters(self, - data)
- Receive notification of character data.
- source code - -
- -
-   - - - - - - -
ignorableWhitespace(self, - data)
- Receive notification of character data.
- source code - -
- -
-

Inherited from xml.sax.handler.ContentHandler: - skippedEntity -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-   - - etree
- Contains the generated ElementTree after parsing is finished. -
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - makeelement=None) -
(Constructor) -

-
source code  -
- - -
-
Overrides: - xml.sax.handler.ContentHandler.__init__ -
-
-
-
- -
- -
- - -
-

setDocumentLocator(self, - locator) -

-
source code  -
- -

Called by the parser to give the application a locator for -locating the origin of document events.

-

SAX parsers are strongly encouraged (though not absolutely -required) to supply a locator: if it does so, it must supply -the locator to the application by invoking this method before -invoking any of the other methods in the DocumentHandler -interface.

-

The locator allows the application to determine the end -position of any document-related event, even if the parser is -not reporting an error. Typically, the application will use -this information for reporting its own errors (such as -character content that does not match an application's -business rules). The information returned by the locator is -probably not sufficient for use with a search engine.

-

Note that the locator will return correct information only -during the invocation of the events in this interface. The -application should not attempt to use it at any other time.

-
-
Overrides: - xml.sax.handler.ContentHandler.setDocumentLocator -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

startDocument(self) -

-
source code  -
- -

Receive notification of the beginning of a document.

-

The SAX parser will invoke this method only once, before any -other methods in this interface or in DTDHandler (except for -setDocumentLocator).

-
-
Overrides: - xml.sax.handler.ContentHandler.startDocument -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

endDocument(self) -

-
source code  -
- -

Receive notification of the end of a document.

-

The SAX parser will invoke this method only once, and it will -be the last method invoked during the parse. The parser shall -not invoke this method until it has either abandoned parsing -(because of an unrecoverable error) or reached the end of -input.

-
-
Overrides: - xml.sax.handler.ContentHandler.endDocument -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

startPrefixMapping(self, - prefix, - uri) -

-
source code  -
- -

Begin the scope of a prefix-URI Namespace mapping.

-

The information from this event is not necessary for normal -Namespace processing: the SAX XML reader will automatically -replace prefixes for element and attribute names when the -http://xml.org/sax/features/namespaces feature is true (the -default).

-

There are cases, however, when applications need to use -prefixes in character data or in attribute values, where they -cannot safely be expanded automatically; the -start/endPrefixMapping event supplies the information to the -application to expand prefixes in those contexts itself, if -necessary.

-

Note that start/endPrefixMapping events are not guaranteed to -be properly nested relative to each-other: all -startPrefixMapping events will occur before the corresponding -startElement event, and all endPrefixMapping events will occur -after the corresponding endElement event, but their order is -not guaranteed.

-
-
Overrides: - xml.sax.handler.ContentHandler.startPrefixMapping -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

endPrefixMapping(self, - prefix) -

-
source code  -
- -

End the scope of a prefix-URI mapping.

-

See startPrefixMapping for details. This event will always -occur after the corresponding endElement event, but the order -of endPrefixMapping events is not otherwise guaranteed.

-
-
Overrides: - xml.sax.handler.ContentHandler.endPrefixMapping -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

startElementNS(self, - ns_name, - qname, - attributes=None) -

-
source code  -
- -

Signals the start of an element in namespace mode.

-

The name parameter contains the name of the element type as a -(uri, localname) tuple, the qname parameter the raw XML 1.0 -name used in the source document, and the attrs parameter -holds an instance of the Attributes class containing the -attributes of the element.

-

The uri part of the name tuple is None for elements which have -no namespace.

-
-
Overrides: - xml.sax.handler.ContentHandler.startElementNS -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

processingInstruction(self, - target, - data) -

-
source code  -
- -

Receive notification of a processing instruction.

-

The Parser will invoke this method once for each processing -instruction found: note that processing instructions may occur -before or after the main document element.

-

A SAX parser should never report an XML declaration (XML 1.0, -section 2.8) or a text declaration (XML 1.0, section 4.3.1) -using this method.

-
-
Overrides: - xml.sax.handler.ContentHandler.processingInstruction -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

endElementNS(self, - ns_name, - qname) -

-
source code  -
- -

Signals the end of an element in namespace mode.

-

The name parameter contains the name of the element type, just -as with the startElementNS event.

-
-
Overrides: - xml.sax.handler.ContentHandler.endElementNS -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

startElement(self, - name, - attributes=None) -

-
source code  -
- -

Signals the start of an element in non-namespace mode.

-

The name parameter contains the raw XML 1.0 name of the -element type as a string and the attrs parameter holds an -instance of the Attributes class containing the attributes of -the element.

-
-
Overrides: - xml.sax.handler.ContentHandler.startElement -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

endElement(self, - name) -

-
source code  -
- -

Signals the end of an element in non-namespace mode.

-

The name parameter contains the name of the element type, just -as with the startElement event.

-
-
Overrides: - xml.sax.handler.ContentHandler.endElement -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

characters(self, - data) -

-
source code  -
- -

Receive notification of character data.

-

The Parser will call this method to report each chunk of -character data. SAX parsers may return all contiguous -character data in a single chunk, or they may split it into -several chunks; however, all of the characters in any single -event must come from the same external entity so that the -Locator provides useful information.

-
-
Overrides: - xml.sax.handler.ContentHandler.characters -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

ignorableWhitespace(self, - data) -

-
source code  -
- -

Receive notification of character data.

-

The Parser will call this method to report each chunk of -character data. SAX parsers may return all contiguous -character data in a single chunk, or they may split it into -several chunks; however, all of the characters in any single -event must come from the same external entity so that the -Locator provides useful information.

-
-
Overrides: - xml.sax.handler.ContentHandler.ignorableWhitespace -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Property Details[hide private]
-
- -
- -
-

etree

- Contains the generated ElementTree after parsing is finished. -
-
Get Method:
-
_get_etree(self) - - Contains the generated ElementTree after parsing is finished. -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.sax.ElementTreeProducer-class.html b/doc/html/api/lxml.sax.ElementTreeProducer-class.html deleted file mode 100644 index afd5aabc..00000000 --- a/doc/html/api/lxml.sax.ElementTreeProducer-class.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - lxml.sax.ElementTreeProducer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module sax :: - Class ElementTreeProducer - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementTreeProducer

source code

-
-object --+
-         |
-        ElementTreeProducer
-
- -
-Produces SAX events for an element and children. - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - element_or_tree, - content_handler)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
saxify(self) - source code - -
- -
-   - - - - - - -
_recursive_saxify(self, - element, - prefixes) - source code - -
- -
-   - - - - - - -
_build_qname(self, - ns_uri, - local_name, - prefixes, - new_prefixes) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - element_or_tree, - content_handler) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.sax.SaxError-class.html b/doc/html/api/lxml.sax.SaxError-class.html deleted file mode 100644 index 8b09c946..00000000 --- a/doc/html/api/lxml.sax.SaxError-class.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - lxml.sax.SaxError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module sax :: - Class SaxError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SaxError

source code

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-                     etree.Error --+    
-                                   |    
-                     etree.LxmlError --+
-                                       |
-                                      SaxError
-
- -
-General SAX error. - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from etree.LxmlError: - __init__, - __new__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __str__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests-module.html b/doc/html/api/lxml.tests-module.html deleted file mode 100644 index f1272405..00000000 --- a/doc/html/api/lxml.tests-module.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - lxml.tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Package tests

source code

-The lxml test suite for lxml, ElementTree and cElementTree. - - - - - - - - -
- - - - - -
Submodules[hide private]
-
-
- -
- - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __package__ = None
- hash(x) -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests-pysrc.html b/doc/html/api/lxml.tests-pysrc.html deleted file mode 100644 index 571d3f6a..00000000 --- a/doc/html/api/lxml.tests-pysrc.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - lxml.tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Package lxml.tests

-
-1  """ 
-2  The lxml test suite for lxml, ElementTree and cElementTree. 
-3  """ 
-4   
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.common_imports-module.html b/doc/html/api/lxml.tests.common_imports-module.html deleted file mode 100644 index 38a2a0a8..00000000 --- a/doc/html/api/lxml.tests.common_imports-module.html +++ /dev/null @@ -1,560 +0,0 @@ - - - - - lxml.tests.common_imports - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module common_imports - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module common_imports

source code

- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - skipif
- Using a class because a function would bind into a method when used in classes -
-   - - HelperTestCase -
-   - - SillyFileLike -
-   - - LargeFileLike -
-   - - LargeFileLikeUnicode -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
make_version_tuple(version_string) - source code - -
- -
-   - - - - - - -
filter_by_version(test_class, - version_dict, - current_version)
- Remove test methods that do not work with the current lib version.
- source code - -
- -
-   - - - - - - -
_get_caller_relative_path(filename, - frame_depth=2) - source code - -
- -
-   - - - - - - -
_str(s, - encoding='UTF-8') - source code - -
- -
-   - - - - - - -
_bytes(s, - encoding='UTF-8') - source code - -
- -
-   - - - - - - -
_fix_traceback(...)
- sub(repl, string[, count = 0]) --> newstring -Return the string obtained by replacing the leftmost non-overlapping -occurrences of pattern in string by the replacement repl.
- source code - -
- -
-   - - - - - - -
_fix_exceptions(...)
- sub(repl, string[, count = 0]) --> newstring -Return the string obtained by replacing the leftmost non-overlapping -occurrences of pattern in string by the replacement repl.
- source code - -
- -
-   - - - - - - -
_fix_bytes(...)
- sub(repl, string[, count = 0]) --> newstring -Return the string obtained by replacing the leftmost non-overlapping -occurrences of pattern in string by the replacement repl.
- source code - -
- -
-   - - - - - - -
make_doctest(filename) - source code - -
- -
-   - - - - - - -
fileInTestDir(name) - source code - -
- -
-   - - - - - - -
path2url(path) - source code - -
- -
-   - - - - - - -
fileUrlInTestDir(name) - source code - -
- -
-   - - - - - - -
read_file(name, - mode='r') - source code - -
- -
-   - - - - - - -
write_to_file(name, - data, - mode='w') - source code - -
- -
-   - - - - - - -
readFileInTestDir(name, - mode='r') - source code - -
- -
-   - - - - - - -
canonicalize(xml) - source code - -
- -
-   - - - - - - -
unentitify(xml) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - IS_PYPY = False -
-   - - IS_PYTHON3 = False -
-   - - IS_PYTHON2 = True -
-   - - ET_VERSION = (1, 3, 0) -
-   - - CET_VERSION = (1, 0, 6) -
-   - - unichr_escape = re.compile(r'\\u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}') -
-   - - _fix_unicode = re.compile(r'(\s+)u(["\'])').sub -
-   - - doctest_parser = <doctest.DocTestParser object> -
-   - - __package__ = 'lxml.tests' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.common_imports-pysrc.html b/doc/html/api/lxml.tests.common_imports-pysrc.html deleted file mode 100644 index 68008b12..00000000 --- a/doc/html/api/lxml.tests.common_imports-pysrc.html +++ /dev/null @@ -1,630 +0,0 @@ - - - - - lxml.tests.common_imports - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module common_imports - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.common_imports

-
-  1  import os 
-  2  import os.path 
-  3  import re 
-  4  import gc 
-  5  import sys 
-  6  import unittest 
-  7   
-  8  try: 
-  9      import urlparse 
- 10  except ImportError: 
- 11      import urllib.parse as urlparse  
- 12   
- 13  try: 
- 14      from urllib import pathname2url 
- 15  except: 
- 16      from urllib.request import pathname2url 
- 17   
- 18  from lxml import etree, html 
- 19   
-
20 -def make_version_tuple(version_string): -
21 l = [] - 22 for part in re.findall('([0-9]+|[^0-9.]+)', version_string): - 23 try: - 24 l.append(int(part)) - 25 except ValueError: - 26 l.append(part) - 27 return tuple(l) -
28 - 29 IS_PYPY = (getattr(sys, 'implementation', None) == 'pypy' or - 30 getattr(sys, 'pypy_version_info', None) is not None) - 31 - 32 IS_PYTHON3 = sys.version_info[0] >= 3 - 33 IS_PYTHON2 = sys.version_info[0] < 3 - 34 - 35 from xml.etree import ElementTree - 36 - 37 if hasattr(ElementTree, 'VERSION'): - 38 ET_VERSION = make_version_tuple(ElementTree.VERSION) - 39 else: - 40 ET_VERSION = (0,0,0) - 41 - 42 from xml.etree import cElementTree - 43 - 44 if hasattr(cElementTree, 'VERSION'): - 45 CET_VERSION = make_version_tuple(cElementTree.VERSION) - 46 else: - 47 CET_VERSION = (0,0,0) - 48 -
49 -def filter_by_version(test_class, version_dict, current_version): -
50 """Remove test methods that do not work with the current lib version. - 51 """ - 52 find_required_version = version_dict.get - 53 def dummy_test_method(self): - 54 pass -
55 for name in dir(test_class): - 56 expected_version = find_required_version(name, (0,0,0)) - 57 if expected_version > current_version: - 58 setattr(test_class, name, dummy_test_method) - 59 - 60 import doctest - 61 - 62 try: - 63 next - 64 except NameError: -
65 - def next(it): -
66 return it.next() -
67 else: - 68 locals()['next'] = next - 69 - 70 - 71 try: - 72 import pytest - 73 except ImportError: -
74 - class skipif(object): -
75 "Using a class because a function would bind into a method when used in classes" -
76 - def __init__(self, *args): pass -
77 - def __call__(self, func, *args): return func -
78 else: - 79 skipif = pytest.mark.skipif - 80 -
81 -def _get_caller_relative_path(filename, frame_depth=2): -
82 module = sys.modules[sys._getframe(frame_depth).f_globals['__name__']] - 83 return os.path.normpath(os.path.join( - 84 os.path.dirname(getattr(module, '__file__', '')), filename)) -
85 - 86 from io import StringIO - 87 - 88 unichr_escape = re.compile(r'\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}') - 89 - 90 if sys.version_info[0] >= 3: - 91 # Python 3 - 92 from builtins import str as unicode - 93 from codecs import unicode_escape_decode - 94 _chr = chr -
95 - def _str(s, encoding="UTF-8"): -
96 return unichr_escape.sub(lambda x: unicode_escape_decode(x.group(0))[0], s) -
97 - def _bytes(s, encoding="UTF-8"): -
98 return s.encode(encoding) -
99 from io import BytesIO as _BytesIO -
100 - def BytesIO(*args): -
101 if args and isinstance(args[0], str): -102 args = (args[0].encode("UTF-8"),) -103 return _BytesIO(*args) -
104 -105 doctest_parser = doctest.DocTestParser() -106 _fix_unicode = re.compile(r'(\s+)u(["\'])').sub -107 _fix_exceptions = re.compile(r'(.*except [^(]*),\s*(.*:)').sub -
108 - def make_doctest(filename): -
109 filename = _get_caller_relative_path(filename) -110 doctests = read_file(filename) -111 doctests = _fix_unicode(r'\1\2', doctests) -112 doctests = _fix_exceptions(r'\1 as \2', doctests) -113 return doctest.DocTestCase( -114 doctest_parser.get_doctest( -115 doctests, {}, os.path.basename(filename), filename, 0)) -
116 else: -117 # Python 2 -118 from __builtin__ import unicode -119 _chr = unichr -
120 - def _str(s, encoding="UTF-8"): -
121 s = unicode(s, encoding=encoding) -122 return unichr_escape.sub(lambda x: -123 x.group(0).decode('unicode-escape'), -124 s) -
125 - def _bytes(s, encoding="UTF-8"): -
126 return s -
127 from io import BytesIO -128 -129 doctest_parser = doctest.DocTestParser() -130 _fix_traceback = re.compile(r'^(\s*)(?:\w+\.)+(\w*(?:Error|Exception|Invalid):)', re.M).sub -131 _fix_exceptions = re.compile(r'(.*except [^(]*)\s+as\s+(.*:)').sub -132 _fix_bytes = re.compile(r'(\s+)b(["\'])').sub -
133 - def make_doctest(filename): -
134 filename = _get_caller_relative_path(filename) -135 doctests = read_file(filename) -136 doctests = _fix_traceback(r'\1\2', doctests) -137 doctests = _fix_exceptions(r'\1, \2', doctests) -138 doctests = _fix_bytes(r'\1\2', doctests) -139 return doctest.DocTestCase( -140 doctest_parser.get_doctest( -141 doctests, {}, os.path.basename(filename), filename, 0)) -
142 -143 try: -144 skipIf = unittest.skipIf -145 except AttributeError: -
146 - def skipIf(condition, why): -
147 def _skip(thing): -148 import types -149 if isinstance(thing, (type, types.ClassType)): -150 return type(thing.__name__, (object,), {}) -151 else: -152 return None -
153 if condition: -154 return _skip -155 return lambda thing: thing -156 -157 -
158 -class HelperTestCase(unittest.TestCase): -
159 - def tearDown(self): -
160 gc.collect() -
161 -
162 - def parse(self, text, parser=None): -
163 f = BytesIO(text) if isinstance(text, bytes) else StringIO(text) -164 return etree.parse(f, parser=parser) -
165 -
166 - def _rootstring(self, tree): -
167 return etree.tostring(tree.getroot()).replace( -168 _bytes(' '), _bytes('')).replace(_bytes('\n'), _bytes('')) -
169 -170 -
171 -class SillyFileLike: -
172 - def __init__(self, xml_data=_bytes('<foo><bar/></foo>')): -
173 self.xml_data = xml_data -
174 -
175 - def read(self, amount=None): -
176 if self.xml_data: -177 if amount: -178 data = self.xml_data[:amount] -179 self.xml_data = self.xml_data[amount:] -180 else: -181 data = self.xml_data -182 self.xml_data = _bytes('') -183 return data -184 return _bytes('') -
185 -
186 -class LargeFileLike: -
187 - def __init__(self, charlen=100, depth=4, children=5): -
188 self.data = BytesIO() -189 self.chars = _bytes('a') * charlen -190 self.children = range(children) -191 self.more = self.iterelements(depth) -
192 -
193 - def iterelements(self, depth): -
194 yield _bytes('<root>') -195 depth -= 1 -196 if depth > 0: -197 for child in self.children: -198 for element in self.iterelements(depth): -199 yield element -200 yield self.chars -201 else: -202 yield self.chars -203 yield _bytes('</root>') -
204 -
205 - def read(self, amount=None): -
206 data = self.data -207 append = data.write -208 if amount: -209 for element in self.more: -210 append(element) -211 if data.tell() >= amount: -212 break -213 else: -214 for element in self.more: -215 append(element) -216 result = data.getvalue() -217 data.seek(0) -218 data.truncate() -219 if amount: -220 append(result[amount:]) -221 result = result[:amount] -222 return result -
223 -
224 -class LargeFileLikeUnicode(LargeFileLike): -
225 - def __init__(self, charlen=100, depth=4, children=5): -
226 LargeFileLike.__init__(self, charlen, depth, children) -227 self.data = StringIO() -228 self.chars = _str('a') * charlen -229 self.more = self.iterelements(depth) -
230 -
231 - def iterelements(self, depth): -
232 yield _str('<root>') -233 depth -= 1 -234 if depth > 0: -235 for child in self.children: -236 for element in self.iterelements(depth): -237 yield element -238 yield self.chars -239 else: -240 yield self.chars -241 yield _str('</root>') -
242 -
243 -def fileInTestDir(name): -
244 _testdir = os.path.dirname(__file__) -245 return os.path.join(_testdir, name) -
246 -
247 -def path2url(path): -
248 return urlparse.urljoin( -249 'file:', pathname2url(path)) -
250 -
251 -def fileUrlInTestDir(name): -
252 return path2url(fileInTestDir(name)) -
253 -
254 -def read_file(name, mode='r'): -
255 f = open(name, mode) -256 try: -257 data = f.read() -258 finally: -259 f.close() -260 return data -
261 -
262 -def write_to_file(name, data, mode='w'): -
263 f = open(name, mode) -264 try: -265 data = f.write(data) -266 finally: -267 f.close() -
268 -
269 -def readFileInTestDir(name, mode='r'): -
270 return read_file(fileInTestDir(name), mode) -
271 -
272 -def canonicalize(xml): -
273 tree = etree.parse(BytesIO(xml) if isinstance(xml, bytes) else StringIO(xml)) -274 f = BytesIO() -275 tree.write_c14n(f) -276 return f.getvalue() -
277 -
278 -def unentitify(xml): -
279 for entity_name, value in re.findall("(&#([0-9]+);)", xml): -280 xml = xml.replace(entity_name, unichr(int(value))) -281 return xml -
282 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.common_imports.HelperTestCase-class.html b/doc/html/api/lxml.tests.common_imports.HelperTestCase-class.html deleted file mode 100644 index 33fbd8b3..00000000 --- a/doc/html/api/lxml.tests.common_imports.HelperTestCase-class.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - - lxml.tests.common_imports.HelperTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module common_imports :: - Class HelperTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HelperTestCase

source code

-
-            object --+    
-                     |    
-unittest.case.TestCase --+
-                         |
-                        HelperTestCase
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
- source code - -
- -
-   - - - - - - -
parse(self, - text, - parser=None) - source code - -
- -
-   - - - - - - -
_rootstring(self, - tree) - source code - -
- -
-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

tearDown(self) -

-
source code  -
- - Hook method for deconstructing the test fixture after testing it. -
-
Overrides: - unittest.case.TestCase.tearDown -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.common_imports.LargeFileLike-class.html b/doc/html/api/lxml.tests.common_imports.LargeFileLike-class.html deleted file mode 100644 index c6cb1b4d..00000000 --- a/doc/html/api/lxml.tests.common_imports.LargeFileLike-class.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - lxml.tests.common_imports.LargeFileLike - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module common_imports :: - Class LargeFileLike - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LargeFileLike

source code

-
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - charlen=100, - depth=4, - children=5) - source code - -
- -
-   - - - - - - -
iterelements(self, - depth) - source code - -
- -
-   - - - - - - -
read(self, - amount=None) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.common_imports.LargeFileLikeUnicode-class.html b/doc/html/api/lxml.tests.common_imports.LargeFileLikeUnicode-class.html deleted file mode 100644 index 7d866479..00000000 --- a/doc/html/api/lxml.tests.common_imports.LargeFileLikeUnicode-class.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - lxml.tests.common_imports.LargeFileLikeUnicode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module common_imports :: - Class LargeFileLikeUnicode - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class LargeFileLikeUnicode

source code

-
-LargeFileLike --+
-                |
-               LargeFileLikeUnicode
-
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - charlen=100, - depth=4, - children=5) - source code - -
- -
-   - - - - - - -
iterelements(self, - depth) - source code - -
- -
-

Inherited from LargeFileLike: - read -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - charlen=100, - depth=4, - children=5) -
(Constructor) -

-
source code  -
- - -
-
Overrides: - LargeFileLike.__init__ -
-
-
-
- -
- -
- - -
-

iterelements(self, - depth) -

-
source code  -
- - -
-
Overrides: - LargeFileLike.iterelements -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.common_imports.SillyFileLike-class.html b/doc/html/api/lxml.tests.common_imports.SillyFileLike-class.html deleted file mode 100644 index 7689f2b5..00000000 --- a/doc/html/api/lxml.tests.common_imports.SillyFileLike-class.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - lxml.tests.common_imports.SillyFileLike - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module common_imports :: - Class SillyFileLike - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SillyFileLike

source code

- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - xml_data='<foo><bar/></foo>') - source code - -
- -
-   - - - - - - -
read(self, - amount=None) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.common_imports.skipif-class.html b/doc/html/api/lxml.tests.common_imports.skipif-class.html deleted file mode 100644 index d81793d6..00000000 --- a/doc/html/api/lxml.tests.common_imports.skipif-class.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - lxml.tests.common_imports.skipif - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module common_imports :: - Class skipif - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class skipif

source code

-
-object --+
-         |
-        skipif
-
- -
-Using a class because a function would bind into a method when used in classes - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__call__(self, - func, - *args) - source code - -
- -
-   - - - - - - -
__init__(self, - *args)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - *args) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.dummy_http_server-module.html b/doc/html/api/lxml.tests.dummy_http_server-module.html deleted file mode 100644 index cf92c5e4..00000000 --- a/doc/html/api/lxml.tests.dummy_http_server-module.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - lxml.tests.dummy_http_server - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module dummy_http_server - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module dummy_http_server

source code

-Simple HTTP request dumper for tests in Python 2.5+. - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - WebServer
- A web server that starts a new thread for each request. -
-   - - _RequestHandler -
-   - - HTTPRequestCollector -
- - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
webserver(*args, - **kwds)
- Context manager entry point for the 'with' statement.
- source code - -
- -
-   - - - - - - -
build_web_server(app, - port, - host=None) - source code - -
- -
- - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

webserver(*args, - **kwds) -

-
source code  -
- -

Context manager entry point for the 'with' statement.

-

Pass 0 as port number to dynamically allocate a free port.

-

Usage:

-
-
with webserver(wsgi_app_function, 8080) as host_url:
-
do_ws_calls(host_url)
-
-
-
Decorators:
-
    -
  • @contextmanager
  • -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.dummy_http_server-pysrc.html b/doc/html/api/lxml.tests.dummy_http_server-pysrc.html deleted file mode 100644 index 69573e99..00000000 --- a/doc/html/api/lxml.tests.dummy_http_server-pysrc.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - lxml.tests.dummy_http_server - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module dummy_http_server - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.dummy_http_server

-
- 1  """ 
- 2  Simple HTTP request dumper for tests in Python 2.5+. 
- 3  """ 
- 4   
- 5  import sys 
- 6  from contextlib import contextmanager 
- 7   
- 8  try: 
- 9      import urlparse 
-10  except ImportError: 
-11      # Python 3 
-12      import urllib.parse as urlparse 
-
13 -14 -15 @contextmanager -16 -def webserver(app, port=0, host=None): -
17 """Context manager entry point for the 'with' statement. -18 -19 Pass 0 as port number to dynamically allocate a free port. -20 -21 Usage: -22 -23 with webserver(wsgi_app_function, 8080) as host_url: -24 do_ws_calls(host_url) -25 """ -26 server = build_web_server(app, port, host or '127.0.0.1') -27 host, port = server.socket.getsockname() -28 -29 import threading -30 thread = threading.Thread(target=server.serve_forever, -31 kwargs={'poll_interval': 0.5}) -32 thread.setDaemon(True) -33 thread.start() -34 try: -35 yield 'http://%s:%s/' % (host, port) # yield control to 'with' body -36 finally: -37 server.shutdown() -38 server.server_close() -39 thread.join(timeout=1) -
40 -41 -42 try: -43 from SocketServer import ThreadingMixIn -44 except ImportError: -45 # Python 3 -46 from socketserver import ThreadingMixIn -47 -48 import wsgiref.simple_server as wsgiserver -
49 -class WebServer(wsgiserver.WSGIServer, ThreadingMixIn): -
50 """A web server that starts a new thread for each request. -51 """ -
52 -
53 -54 -class _RequestHandler(wsgiserver.WSGIRequestHandler): -
55 - def get_stderr(self): -
56 # don't write to stderr -57 return sys.stdout -
58 -
59 - def log_message(self, format, *args): -
60 # message = "wsmock(%s) %s" % (self.address_string(), format % args) -61 pass # don't log messages -
62 -
63 -64 -def build_web_server(app, port, host=None): -
65 server = wsgiserver.make_server( -66 host or '', port, app, -67 server_class=WebServer, -68 handler_class=_RequestHandler) -69 return server -
70 -
71 -72 -class HTTPRequestCollector(object): -
73 - def __init__(self, response_data, response_code=200, headers=()): -
74 self.requests = [] -75 self.response_code = response_code -76 self.response_data = response_data -77 self.headers = list(headers or ()) -
78 -
79 - def __call__(self, environ, start_response): -
80 self.requests.append(( -81 environ.get('PATH_INFO'), -82 urlparse.parse_qsl(environ.get('QUERY_STRING')))) -83 start_response('%s OK' % self.response_code, self.headers) -84 return [self.response_data] -
85 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.dummy_http_server.HTTPRequestCollector-class.html b/doc/html/api/lxml.tests.dummy_http_server.HTTPRequestCollector-class.html deleted file mode 100644 index 1e8da627..00000000 --- a/doc/html/api/lxml.tests.dummy_http_server.HTTPRequestCollector-class.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - - lxml.tests.dummy_http_server.HTTPRequestCollector - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module dummy_http_server :: - Class HTTPRequestCollector - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HTTPRequestCollector

source code

-
-object --+
-         |
-        HTTPRequestCollector
-
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - response_data, - response_code=200, - headers=())
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__call__(self, - environ, - start_response) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - response_data, - response_code=200, - headers=()) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.dummy_http_server.WebServer-class.html b/doc/html/api/lxml.tests.dummy_http_server.WebServer-class.html deleted file mode 100644 index d6056b9c..00000000 --- a/doc/html/api/lxml.tests.dummy_http_server.WebServer-class.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - lxml.tests.dummy_http_server.WebServer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module dummy_http_server :: - Class WebServer - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class WebServer

source code

-
-SocketServer.BaseServer --+            
-                          |            
-     SocketServer.TCPServer --+        
-                              |        
-      BaseHTTPServer.HTTPServer --+    
-                                  |    
-   wsgiref.simple_server.WSGIServer --+
-                                      |
-        SocketServer.ThreadingMixIn --+
-                                      |
-                                     WebServer
-
- -
-A web server that starts a new thread for each request. - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from wsgiref.simple_server.WSGIServer: - get_app, - server_bind, - set_app, - setup_environ -

-

Inherited from SocketServer.TCPServer: - __init__, - close_request, - fileno, - get_request, - server_activate, - server_close, - shutdown_request -

-

Inherited from SocketServer.BaseServer: - finish_request, - handle_error, - handle_request, - handle_timeout, - process_request, - serve_forever, - shutdown, - verify_request -

-

Inherited from SocketServer.BaseServer (private): - _handle_request_noblock -

-

Inherited from SocketServer.ThreadingMixIn: - process_request_thread -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from wsgiref.simple_server.WSGIServer: - application -

-

Inherited from BaseHTTPServer.HTTPServer: - allow_reuse_address -

-

Inherited from SocketServer.TCPServer: - address_family, - request_queue_size, - socket_type -

-

Inherited from SocketServer.BaseServer: - timeout -

-

Inherited from SocketServer.ThreadingMixIn: - daemon_threads -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.dummy_http_server._RequestHandler-class.html b/doc/html/api/lxml.tests.dummy_http_server._RequestHandler-class.html deleted file mode 100644 index 4b15523a..00000000 --- a/doc/html/api/lxml.tests.dummy_http_server._RequestHandler-class.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - lxml.tests.dummy_http_server._RequestHandler - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module dummy_http_server :: - Class _RequestHandler - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _RequestHandler

source code

-
-SocketServer.BaseRequestHandler --+            
-                                  |            
-  SocketServer.StreamRequestHandler --+        
-                                      |        
-  BaseHTTPServer.BaseHTTPRequestHandler --+    
-                                          |    
-   wsgiref.simple_server.WSGIRequestHandler --+
-                                              |
-                                             _RequestHandler
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: - MessageClass -

-
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
get_stderr(self) - source code - -
- -
-   - - - - - - -
log_message(self, - format, - *args)
- Log an arbitrary message.
- source code - -
- -
-

Inherited from wsgiref.simple_server.WSGIRequestHandler: - get_environ, - handle -

-

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: - address_string, - date_time_string, - end_headers, - handle_one_request, - log_date_time_string, - log_error, - log_request, - parse_request, - send_error, - send_header, - send_response, - version_string -

-

Inherited from SocketServer.StreamRequestHandler: - finish, - setup -

-

Inherited from SocketServer.BaseRequestHandler: - __init__ -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from wsgiref.simple_server.WSGIRequestHandler: - server_version -

-

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: - default_request_version, - error_content_type, - error_message_format, - monthname, - protocol_version, - responses, - sys_version, - weekdayname -

-

Inherited from SocketServer.StreamRequestHandler: - disable_nagle_algorithm, - rbufsize, - timeout, - wbufsize -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

get_stderr(self) -

-
source code  -
- - -
-
Overrides: - wsgiref.simple_server.WSGIRequestHandler.get_stderr -
-
-
-
- -
- -
- - -
-

log_message(self, - format, - *args) -

-
source code  -
- -

Log an arbitrary message.

-

This is used by all other logging functions. Override -it if you have specific logging wishes.

-

The first argument, FORMAT, is a format string for the -message to be logged. If the format string contains -any % escapes requiring parameters, they should be -specified as subsequent arguments (it's just like -printf!).

-

The client ip address and current date/time are prefixed to every -message.

-
-
Overrides: - BaseHTTPServer.BaseHTTPRequestHandler.log_message -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.selftest-module.html b/doc/html/api/lxml.tests.selftest-module.html deleted file mode 100644 index a975efeb..00000000 --- a/doc/html/api/lxml.tests.selftest-module.html +++ /dev/null @@ -1,1200 +0,0 @@ - - - - - lxml.tests.selftest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module selftest - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module selftest

source code

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
stdout() - source code - -
- -
-   - - - - - - -
fix_compatibility(xml_data) - source code - -
- -
-   - - - - - - -
serialize(elem, - **options) - source code - -
- -
-   - - - - - - -
summarize(elem) - source code - -
- -
-   - - - - - - -
summarize_list(seq) - source code - -
- -
-   - - - - - - -
normalize_crlf(tree) - source code - -
- -
-   - - - - - - -
check_string(string) - source code - -
- -
-   - - - - - - -
check_string_or_none(value) - source code - -
- -
-   - - - - - - -
check_mapping(mapping) - source code - -
- -
-   - - - - - - -
check_element(element) - source code - -
- -
-   - - - - - - -
check_element_tree(tree) - source code - -
- -
-   - - - - - - -
interface()
- Test element tree interface.
- source code - -
- -
-   - - - - - - -
simpleops() - source code - -
- -
-   - - - - - - -
find()
- Test find methods (including xpath syntax).
- source code - -
- -
-   - - - - - - -
bad_find()
- Check bad or unsupported path expressions.
- source code - -
- -
-   - - - - - - -
parsefile()
- Test parsing from file.
- source code - -
- -
-   - - - - - - -
parseliteral()
- ## >>> sequence = ["<html><body>", "text</bo", "dy></html>"] -## >>> element = ElementTree.fromstringlist(sequence) -## >>> ElementTree.ElementTree(element).write(stdout()) -## <html><body>text</body></html>
- source code - -
- -
-   - - - - - - -
iterparse()
- Test iterparse interface.
- source code - -
- -
-   - - - - - - -
writefile()
- ## Test tag suppression -## >>> elem.tag = None -## >>> serialize(elem) -## 'text<subtag>subtext</subtag>'
- source code - -
- -
-   - - - - - - -
writestring() - source code - -
- -
-   - - - - - - -
encoding()
- Test encoding issues.
- source code - -
- -
-   - - - - - - -
iterators()
- Test iterators.
- source code - -
- -
-   - - - - - - -
namespace()
- Test namespace issues.
- source code - -
- -
-   - - - - - - -
qname()
- Test QName handling.
- source code - -
- -
-   - - - - - - -
xpath_tokenizer(p)
- Test the XPath tokenizer.
- source code - -
- -
-   - - - - - - -
xinclude_loader(href, - parse='xml', - encoding=None) - source code - -
- -
-   - - - - - - -
xinclude()
- Basic inclusion example (XInclude C.1)
- source code - -
- -
-   - - - - - - -
xinclude_default() - source code - -
- -
-   - - - - - - -
bug_xmltoolkit25()
- typo in ElementTree.findtext
- source code - -
- -
-   - - - - - - -
bug_xmltoolkit28()
- .//tag causes exceptions
- source code - -
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - SAMPLE_XML = ElementTree.XML(... -
-   - - ENTITY_XML = '<!DOCTYPE points [\n<!ENTITY % user-entities SYS... -
-   - - XINCLUDE = {'C1.xml': '<?xml version=\'1.0\'?>\n<document xmln... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

find() -

-
source code  -
- -

Test find methods (including xpath syntax).

-
->>> elem = SAMPLE_XML
->>> elem.find("tag").tag
-'tag'
->>> ElementTree.ElementTree(elem).find("tag").tag
-'tag'
->>> elem.find("section/tag").tag
-'tag'
->>> ElementTree.ElementTree(elem).find("section/tag").tag
-'tag'
->>> elem.findtext("tag")
-'text'
->>> elem.findtext("tog")
->>> elem.findtext("tog", "default")
-'default'
->>> ElementTree.ElementTree(elem).findtext("tag")
-'text'
->>> elem.findtext("section/tag")
-'subtext'
->>> ElementTree.ElementTree(elem).findtext("section/tag")
-'subtext'
->>> summarize_list(elem.findall("tag"))
-['tag', 'tag']
->>> summarize_list(elem.findall("*"))
-['tag', 'tag', 'section']
->>> summarize_list(elem.findall(".//tag"))
-['tag', 'tag', 'tag']
->>> summarize_list(elem.findall("section/tag"))
-['tag']
->>> summarize_list(elem.findall("section//tag"))
-['tag']
->>> summarize_list(elem.findall("section/*"))
-['tag']
->>> summarize_list(elem.findall("section//*"))
-['tag']
->>> summarize_list(elem.findall("section/.//*"))
-['tag']
->>> summarize_list(elem.findall("*/*"))
-['tag']
->>> summarize_list(elem.findall("*//*"))
-['tag']
->>> summarize_list(elem.findall("*/tag"))
-['tag']
->>> summarize_list(elem.findall("*/./tag"))
-['tag']
->>> summarize_list(elem.findall("./tag"))
-['tag', 'tag']
->>> summarize_list(elem.findall(".//tag"))
-['tag', 'tag', 'tag']
->>> summarize_list(elem.findall("././tag"))
-['tag', 'tag']
->>> summarize_list(elem.findall(".//tag[@class]"))
-['tag', 'tag', 'tag']
->>> summarize_list(elem.findall(".//tag[@class='a']"))
-['tag']
->>> summarize_list(elem.findall(".//tag[@class='b']"))
-['tag', 'tag']
->>> summarize_list(elem.findall(".//tag[@id]"))
-['tag']
->>> summarize_list(elem.findall(".//section[tag]"))
-['section']
->>> summarize_list(elem.findall(".//section[element]"))
-[]
->>> summarize_list(elem.findall("../tag"))
-[]
->>> summarize_list(elem.findall("section/../tag"))
-['tag', 'tag']
->>> summarize_list(ElementTree.ElementTree(elem).findall("./tag"))
-['tag', 'tag']
-

FIXME: ET's Path module handles this case incorrectly; this gives -a warning in 1.3, and the behaviour will be modified in 1.4.

-
->>> summarize_list(ElementTree.ElementTree(elem).findall("/tag"))
-['tag', 'tag']
-
-
-
-
- -
- -
- - -
-

bad_find() -

-
source code  -
- -

Check bad or unsupported path expressions.

-
->>> elem = SAMPLE_XML
->>> elem.findall("/tag")
-Traceback (most recent call last):
-SyntaxError: cannot use absolute path on element
-

# this is supported in ET 1.3: -#>>> elem.findall("section//") -#Traceback (most recent call last): -#SyntaxError: invalid path

-
-
-
-
- -
- -
- - -
-

parsefile() -

-
source code  -
- -
-

Test parsing from file.

-
->>> tree = ElementTree.parse("samples/simple.xml")
->>> normalize_crlf(tree)
->>> tree.write(stdout())
-<root>
-   <element key="value">text</element>
-   <element>text</element>tail
-   <empty-element/>
-</root>
->>> tree = ElementTree.parse("samples/simple-ns.xml")
->>> normalize_crlf(tree)
->>> tree.write(stdout())
-<root xmlns="http://namespace/">
-   <element key="value">text</element>
-   <element>text</element>tail
-   <empty-element/>
-</root>
-
-

## <ns0:root xmlns:ns0="http://namespace/"> -## <ns0:element key="value">text</ns0:element> -## <ns0:element>text</ns0:element>tail -## <ns0:empty-element/> -## </ns0:root>

-
-
-
-
- -
- -
- - -
-

parseliteral() -

-
source code  -
- -
-
->>> element = ElementTree.XML("<html><body>text</body></html>")
->>> ElementTree.ElementTree(element).write(stdout())
-<html><body>text</body></html>
->>> element = ElementTree.fromstring("<html><body>text</body></html>")
->>> ElementTree.ElementTree(element).write(stdout())
-<html><body>text</body></html>
-
-

## >>> sequence = ["<html><body>", "text</bo", "dy></html>"] -## >>> element = ElementTree.fromstringlist(sequence) -## >>> ElementTree.ElementTree(element).write(stdout()) -## <html><body>text</body></html>

-
-
->>> print(repr(ElementTree.tostring(element)).lstrip('b'))
-'<html><body>text</body></html>'
-
-

# looks different in lxml -# >>> print(ElementTree.tostring(element, "ascii")) -# <?xml version='1.0' encoding='ascii'?> -# <html><body>text</body></html>

-
-
->>> _, ids = ElementTree.XMLID("<html><body>text</body></html>")
->>> len(ids)
-0
->>> _, ids = ElementTree.XMLID("<html><body id='body'>text</body></html>")
->>> len(ids)
-1
->>> ids["body"].tag
-'body'
-
-
-
-
-
- -
- -
- - -
-

namespace() -

-
source code  -
- -

Test namespace issues.

-
    -
  1. xml namespace
  2. -
-
->>> elem = ElementTree.XML("<tag xml:lang='en' />")
->>> serialize(elem) # 1.1
-'<tag xml:lang="en"/>'
-
    -
  1. other "well-known" namespaces
  2. -
-
->>> elem = ElementTree.XML("<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' />")
->>> serialize(elem) # 2.1
-'<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>'
-
->>> elem = ElementTree.XML("<html:html xmlns:html='http://www.w3.org/1999/xhtml' />")
->>> serialize(elem) # 2.2
-'<html:html xmlns:html="http://www.w3.org/1999/xhtml"/>'
-
->>> elem = ElementTree.XML("<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope' />")
->>> serialize(elem) # 2.3
-'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope"/>'
-
    -
  1. unknown namespaces
  2. -
-
-
-
-
- -
- -
- - -
-

qname() -

-
source code  -
- -
-

Test QName handling.

-
    -
  1. decorated tags
  2. -
-
->>> elem = ElementTree.Element("{uri}tag")
->>> serialize(elem) # 1.1
-'<ns0:tag xmlns:ns0="uri"/>'
->>> elem = ElementTree.Element(ElementTree.QName("{uri}tag"))
->>> serialize(elem) # 1.2
-'<ns0:tag xmlns:ns0="uri"/>'
->>> elem = ElementTree.Element(ElementTree.QName("uri", "tag"))
->>> serialize(elem) # 1.3
-'<ns0:tag xmlns:ns0="uri"/>'
-
-

# ns/attribute order ...

-

## 2) decorated attributes

-

## >>> elem.clear() -## >>> elem.attrib["{uri}key"] = "value" -## >>> serialize(elem) # 2.1 -## '<ns0:tag ns0:key="value" xmlns:ns0="uri"/>'

-

## >>> elem.clear() -## >>> elem.attrib[ElementTree.QName("{uri}key")] = "value" -## >>> serialize(elem) # 2.2 -## '<ns0:tag ns0:key="value" xmlns:ns0="uri"/>'

-

## 3) decorated values are not converted by default, but the -## QName wrapper can be used for values

-

## >>> elem.clear() -## >>> elem.attrib["{uri}key"] = "{uri}value" -## >>> serialize(elem) # 3.1 -## '<ns0:tag ns0:key="{uri}value" xmlns:ns0="uri"/>'

-

## >>> elem.clear() -## >>> elem.attrib["{uri}key"] = ElementTree.QName("{uri}value") -## >>> serialize(elem) # 3.2 -## '<ns0:tag ns0:key="ns0:value" xmlns:ns0="uri"/>'

-

## >>> elem.clear() -## >>> subelem = ElementTree.Element("tag") -## >>> subelem.attrib["{uri1}key"] = ElementTree.QName("{uri2}value") -## >>> elem.append(subelem) -## >>> elem.append(subelem) -## >>> serialize(elem) # 3.3 -## '<ns0:tag xmlns:ns0="uri"><tag ns1:key="ns2:value" xmlns:ns1="uri1" xmlns:ns2="uri2"/><tag ns1:key="ns2:value" xmlns:ns1="uri1" xmlns:ns2="uri2"/></ns0:tag>'

-
-
-
-
- -
- -
- - -
-

xinclude() -

-
source code  -
- -
-

Basic inclusion example (XInclude C.1)

-
->>> document = xinclude_loader("C1.xml")
->>> ElementInclude.include(document, xinclude_loader)
->>> print(serialize(document)) # C1
-<document>
-  <p>120 Mz is adequate for an average home user.</p>
-  <disclaimer>
-  <p>The opinions represented herein represent those of the individual
-  and should not be interpreted as official policy endorsed by this
-  organization.</p>
-</disclaimer>
-</document>
-

Textual inclusion example (XInclude C.2)

-
->>> document = xinclude_loader("C2.xml")
->>> ElementInclude.include(document, xinclude_loader)
->>> print(serialize(document)) # C2
-<document>
-  <p>This document has been accessed
-  324387 times.</p>
-</document>
-

Textual inclusion of XML example (XInclude C.3)

-
->>> document = xinclude_loader("C3.xml")
->>> ElementInclude.include(document, xinclude_loader)
->>> print(serialize(document)) # C3
-<document>
-  <p>The following is the source of the "data.xml" resource:</p>
-  <example>&lt;?xml version='1.0'?&gt;
-&lt;data&gt;
-  &lt;item&gt;&lt;![CDATA[Brooks &amp; Shields]]&gt;&lt;/item&gt;
-&lt;/data&gt;
-</example>
-</document>
-
-

## Fallback example (XInclude C.5) -## Note! Fallback support is not yet implemented

-

## >>> document = xinclude_loader("C5.xml") -## >>> ElementInclude.include(document, xinclude_loader) -## Traceback (most recent call last): -## IOError: resource not found -## >>> # print(serialize(document)) # C5

-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

SAMPLE_XML

- -
-
-
-
Value:
-
-ElementTree.XML("""
-<body>
-  <tag class='a'>text</tag>
-  <tag class='b' />
-   <section>
-    <tag class='b' id='inner'>subtext</tag>
-   </section>
-</body>
-...
-
-
-
-
-
- -
- -
-

ENTITY_XML

- -
-
-
-
Value:
-
-'''<!DOCTYPE points [
-<!ENTITY % user-entities SYSTEM \'user-entities.xml\'>
-%user-entities;
-]>
-<document>&entity;</document>
-'''
-
-
-
-
-
- -
- -
-

XINCLUDE

- -
-
-
-
Value:
-
-{'C1.xml': '''<?xml version=\'1.0\'?>
-<document xmlns:xi="http://www.w3.org/2001/XInclude">
-  <p>120 Mz is adequate for an average home user.</p>
-  <xi:include href="disclaimer.xml"/>
-</document>
-''',
- 'C2.xml': '''<?xml version=\'1.0\'?>
-<document xmlns:xi="http://www.w3.org/2001/XInclude">
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.selftest-pysrc.html b/doc/html/api/lxml.tests.selftest-pysrc.html deleted file mode 100644 index 84e72ea2..00000000 --- a/doc/html/api/lxml.tests.selftest-pysrc.html +++ /dev/null @@ -1,1536 +0,0 @@ - - - - - lxml.tests.selftest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module selftest - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.selftest

-
-   1  # $Id: selftest.py 3276 2007-09-12 06:52:30Z fredrik $ 
-   2  # -*- coding: iso-8859-1 -*- 
-   3  # elementtree selftest program 
-   4   
-   5  # this test script uses Python's "doctest" module to check that the 
-   6  # *test script* works as expected. 
-   7   
-   8  # TODO: add more elementtree method tests 
-   9  # TODO: add xml/html parsing tests 
-  10  # TODO: etc 
-  11   
-  12  import re, sys 
-  13   
-
14 -def stdout(): -
15 if sys.version_info[0] < 3: - 16 return sys.stdout - 17 class bytes_stdout(object): - 18 def write(self, data): - 19 if isinstance(data, bytes): - 20 data = data.decode('ISO8859-1') - 21 sys.stdout.write(data) -
22 return bytes_stdout() - 23 - 24 try: - 25 from StringIO import StringIO as BytesIO - 26 except ImportError: - 27 from io import BytesIO - 28 - 29 from lxml import etree as ElementTree - 30 from lxml import _elementpath as ElementPath - 31 from lxml import ElementInclude - 32 ET = ElementTree - 33 - 34 #from elementtree import ElementTree - 35 #from elementtree import ElementPath - 36 #from elementtree import ElementInclude - 37 #from elementtree import HTMLTreeBuilder - 38 #from elementtree import SimpleXMLWriter - 39 -
40 -def fix_compatibility(xml_data): -
41 xml_data = re.sub(r'\s*xmlns:[a-z0-9]+="http://www.w3.org/2001/XInclude"', '', xml_data) - 42 xml_data = xml_data.replace(' />', '/>') - 43 if xml_data[-1:] == '\n': - 44 xml_data = xml_data[:-1] - 45 return xml_data -
46 -
47 -def serialize(elem, **options): -
48 file = BytesIO() - 49 tree = ElementTree.ElementTree(elem) - 50 tree.write(file, **options) - 51 if sys.version_info[0] < 3: - 52 try: - 53 encoding = options["encoding"] - 54 except KeyError: - 55 encoding = "utf-8" - 56 else: - 57 encoding = 'ISO8859-1' - 58 result = fix_compatibility(file.getvalue().decode(encoding)) - 59 if sys.version_info[0] < 3: - 60 result = result.encode(encoding) - 61 return result -
62 -
63 -def summarize(elem): -
64 return elem.tag -
65 -
66 -def summarize_list(seq): -
67 return list(map(summarize, seq)) -
68 -
69 -def normalize_crlf(tree): -
70 for elem in tree.getiterator(): - 71 if elem.text: elem.text = elem.text.replace("\r\n", "\n") - 72 if elem.tail: elem.tail = elem.tail.replace("\r\n", "\n") -
73 - 74 SAMPLE_XML = ElementTree.XML(""" - 75 <body> - 76 <tag class='a'>text</tag> - 77 <tag class='b' /> - 78 <section> - 79 <tag class='b' id='inner'>subtext</tag> - 80 </section> - 81 </body> - 82 """) - 83 - 84 # - 85 # interface tests - 86 -
87 -def check_string(string): -
88 len(string) - 89 for char in string: - 90 if len(char) != 1: - 91 print("expected one-character string, got %r" % char) - 92 new_string = string + "" - 93 new_string = string + " " - 94 string[:0] -
95 -
96 -def check_string_or_none(value): -
97 if value is None: - 98 return - 99 return check_string(value) -
100 -
101 -def check_mapping(mapping): -
102 len(mapping) - 103 keys = mapping.keys() - 104 items = mapping.items() - 105 for key in keys: - 106 item = mapping[key] - 107 mapping["key"] = "value" - 108 if mapping["key"] != "value": - 109 print("expected value string, got %r" % mapping["key"]) -
110 -
111 -def check_element(element): -
112 if not hasattr(element, "tag"): - 113 print("no tag member") - 114 if not hasattr(element, "attrib"): - 115 print("no attrib member") - 116 if not hasattr(element, "text"): - 117 print("no text member") - 118 if not hasattr(element, "tail"): - 119 print("no tail member") - 120 check_string(element.tag) - 121 check_mapping(element.attrib) - 122 check_string_or_none(element.text) - 123 check_string_or_none(element.tail) - 124 for elem in element: - 125 check_element(elem) -
126 -
127 -def check_element_tree(tree): -
128 check_element(tree.getroot()) -
129 - 130 # -------------------------------------------------------------------- - 131 # element tree tests - 132 -
133 -def sanity(): -
134 """ - 135 >>> from elementtree.ElementTree import * - 136 >>> from elementtree.ElementInclude import * - 137 >>> from elementtree.ElementPath import * - 138 >>> from elementtree.HTMLTreeBuilder import * - 139 >>> from elementtree.SimpleXMLWriter import * - 140 >>> from elementtree.TidyTools import * - 141 """ -
142 - 143 # doesn't work with lxml.etree - 144 del sanity - 145 -
146 -def version(): -
147 """ - 148 >>> ElementTree.VERSION - 149 '1.3a2' - 150 """ -
151 - 152 # doesn't work with lxml.etree - 153 del version - 154 -
155 -def interface(): -
156 """ - 157 Test element tree interface. - 158 - 159 >>> element = ElementTree.Element("tag") - 160 >>> check_element(element) - 161 >>> tree = ElementTree.ElementTree(element) - 162 >>> check_element_tree(tree) - 163 """ -
164 -
165 -def simpleops(): -
166 """ - 167 >>> elem = ElementTree.XML("<body><tag/></body>") - 168 >>> serialize(elem) - 169 '<body><tag/></body>' - 170 >>> e = ElementTree.Element("tag2") - 171 >>> elem.append(e) - 172 >>> serialize(elem) - 173 '<body><tag/><tag2/></body>' - 174 >>> elem.remove(e) - 175 >>> serialize(elem) - 176 '<body><tag/></body>' - 177 >>> elem.insert(0, e) - 178 >>> serialize(elem) - 179 '<body><tag2/><tag/></body>' - 180 >>> elem.remove(e) - 181 >>> elem.extend([e]) - 182 >>> serialize(elem) - 183 '<body><tag/><tag2/></body>' - 184 >>> elem.remove(e) - 185 """ -
186 -
187 -def simplefind(): -
188 """ - 189 Test find methods using the elementpath fallback. - 190 - 191 >>> CurrentElementPath = ElementTree.ElementPath - 192 >>> ElementTree.ElementPath = ElementTree._SimpleElementPath() - 193 >>> elem = SAMPLE_XML - 194 >>> elem.find("tag").tag - 195 'tag' - 196 >>> ElementTree.ElementTree(elem).find("tag").tag - 197 'tag' - 198 >>> elem.findtext("tag") - 199 'text' - 200 >>> elem.findtext("tog") - 201 >>> elem.findtext("tog", "default") - 202 'default' - 203 >>> ElementTree.ElementTree(elem).findtext("tag") - 204 'text' - 205 >>> summarize_list(elem.findall("tag")) - 206 ['tag', 'tag'] - 207 >>> summarize_list(elem.findall(".//tag")) - 208 ['tag', 'tag', 'tag'] - 209 - 210 Path syntax doesn't work in this case. - 211 - 212 >>> elem.find("section/tag") - 213 >>> elem.findtext("section/tag") - 214 >>> elem.findall("section/tag") - 215 [] - 216 - 217 >>> ElementTree.ElementPath = CurrentElementPath - 218 """ -
219 - 220 # doesn't work with lxml.etree - 221 del simplefind - 222 -
223 -def find(): -
224 """ - 225 Test find methods (including xpath syntax). - 226 - 227 >>> elem = SAMPLE_XML - 228 >>> elem.find("tag").tag - 229 'tag' - 230 >>> ElementTree.ElementTree(elem).find("tag").tag - 231 'tag' - 232 >>> elem.find("section/tag").tag - 233 'tag' - 234 >>> ElementTree.ElementTree(elem).find("section/tag").tag - 235 'tag' - 236 >>> elem.findtext("tag") - 237 'text' - 238 >>> elem.findtext("tog") - 239 >>> elem.findtext("tog", "default") - 240 'default' - 241 >>> ElementTree.ElementTree(elem).findtext("tag") - 242 'text' - 243 >>> elem.findtext("section/tag") - 244 'subtext' - 245 >>> ElementTree.ElementTree(elem).findtext("section/tag") - 246 'subtext' - 247 >>> summarize_list(elem.findall("tag")) - 248 ['tag', 'tag'] - 249 >>> summarize_list(elem.findall("*")) - 250 ['tag', 'tag', 'section'] - 251 >>> summarize_list(elem.findall(".//tag")) - 252 ['tag', 'tag', 'tag'] - 253 >>> summarize_list(elem.findall("section/tag")) - 254 ['tag'] - 255 >>> summarize_list(elem.findall("section//tag")) - 256 ['tag'] - 257 >>> summarize_list(elem.findall("section/*")) - 258 ['tag'] - 259 >>> summarize_list(elem.findall("section//*")) - 260 ['tag'] - 261 >>> summarize_list(elem.findall("section/.//*")) - 262 ['tag'] - 263 >>> summarize_list(elem.findall("*/*")) - 264 ['tag'] - 265 >>> summarize_list(elem.findall("*//*")) - 266 ['tag'] - 267 >>> summarize_list(elem.findall("*/tag")) - 268 ['tag'] - 269 >>> summarize_list(elem.findall("*/./tag")) - 270 ['tag'] - 271 >>> summarize_list(elem.findall("./tag")) - 272 ['tag', 'tag'] - 273 >>> summarize_list(elem.findall(".//tag")) - 274 ['tag', 'tag', 'tag'] - 275 >>> summarize_list(elem.findall("././tag")) - 276 ['tag', 'tag'] - 277 >>> summarize_list(elem.findall(".//tag[@class]")) - 278 ['tag', 'tag', 'tag'] - 279 >>> summarize_list(elem.findall(".//tag[@class='a']")) - 280 ['tag'] - 281 >>> summarize_list(elem.findall(".//tag[@class='b']")) - 282 ['tag', 'tag'] - 283 >>> summarize_list(elem.findall(".//tag[@id]")) - 284 ['tag'] - 285 >>> summarize_list(elem.findall(".//section[tag]")) - 286 ['section'] - 287 >>> summarize_list(elem.findall(".//section[element]")) - 288 [] - 289 >>> summarize_list(elem.findall("../tag")) - 290 [] - 291 >>> summarize_list(elem.findall("section/../tag")) - 292 ['tag', 'tag'] - 293 >>> summarize_list(ElementTree.ElementTree(elem).findall("./tag")) - 294 ['tag', 'tag'] - 295 - 296 FIXME: ET's Path module handles this case incorrectly; this gives - 297 a warning in 1.3, and the behaviour will be modified in 1.4. - 298 - 299 >>> summarize_list(ElementTree.ElementTree(elem).findall("/tag")) - 300 ['tag', 'tag'] - 301 """ -
302 -
303 -def bad_find(): -
304 """ - 305 Check bad or unsupported path expressions. - 306 - 307 >>> elem = SAMPLE_XML - 308 >>> elem.findall("/tag") - 309 Traceback (most recent call last): - 310 SyntaxError: cannot use absolute path on element - 311 - 312 # this is supported in ET 1.3: - 313 #>>> elem.findall("section//") - 314 #Traceback (most recent call last): - 315 #SyntaxError: invalid path - 316 """ -
317 -
318 -def parsefile(): -
319 """ - 320 Test parsing from file. - 321 - 322 >>> tree = ElementTree.parse("samples/simple.xml") - 323 >>> normalize_crlf(tree) - 324 >>> tree.write(stdout()) - 325 <root> - 326 <element key="value">text</element> - 327 <element>text</element>tail - 328 <empty-element/> - 329 </root> - 330 >>> tree = ElementTree.parse("samples/simple-ns.xml") - 331 >>> normalize_crlf(tree) - 332 >>> tree.write(stdout()) - 333 <root xmlns="http://namespace/"> - 334 <element key="value">text</element> - 335 <element>text</element>tail - 336 <empty-element/> - 337 </root> - 338 - 339 ## <ns0:root xmlns:ns0="http://namespace/"> - 340 ## <ns0:element key="value">text</ns0:element> - 341 ## <ns0:element>text</ns0:element>tail - 342 ## <ns0:empty-element/> - 343 ## </ns0:root> - 344 """ -
345 -
346 -def parsehtml(): -
347 """ - 348 Test HTML parsing. - 349 - 350 >>> # p = HTMLTreeBuilder.TreeBuilder() - 351 >>> p = ElementTree.HTMLParser() - 352 >>> p.feed("<p><p>spam<b>egg</b></p>") - 353 >>> serialize(p.close()) - 354 '<p>spam<b>egg</b></p>' - 355 """ -
356 - 357 # doesn't work with lxml.etree - 358 del parsehtml - 359 -
360 -def parseliteral(): -
361 r""" - 362 >>> element = ElementTree.XML("<html><body>text</body></html>") - 363 >>> ElementTree.ElementTree(element).write(stdout()) - 364 <html><body>text</body></html> - 365 >>> element = ElementTree.fromstring("<html><body>text</body></html>") - 366 >>> ElementTree.ElementTree(element).write(stdout()) - 367 <html><body>text</body></html> - 368 - 369 ## >>> sequence = ["<html><body>", "text</bo", "dy></html>"] - 370 ## >>> element = ElementTree.fromstringlist(sequence) - 371 ## >>> ElementTree.ElementTree(element).write(stdout()) - 372 ## <html><body>text</body></html> - 373 - 374 >>> print(repr(ElementTree.tostring(element)).lstrip('b')) - 375 '<html><body>text</body></html>' - 376 - 377 # looks different in lxml - 378 # >>> print(ElementTree.tostring(element, "ascii")) - 379 # <?xml version='1.0' encoding='ascii'?> - 380 # <html><body>text</body></html> - 381 - 382 >>> _, ids = ElementTree.XMLID("<html><body>text</body></html>") - 383 >>> len(ids) - 384 0 - 385 >>> _, ids = ElementTree.XMLID("<html><body id='body'>text</body></html>") - 386 >>> len(ids) - 387 1 - 388 >>> ids["body"].tag - 389 'body' - 390 """ -
391 -
392 -def simpleparsefile(): -
393 """ - 394 Test the xmllib-based parser. - 395 - 396 >>> from elementtree import SimpleXMLTreeBuilder - 397 >>> parser = SimpleXMLTreeBuilder.TreeBuilder() - 398 >>> tree = ElementTree.parse("samples/simple.xml", parser) - 399 >>> normalize_crlf(tree) - 400 >>> tree.write(sys.stdout) - 401 <root> - 402 <element key="value">text</element> - 403 <element>text</element>tail - 404 <empty-element /> - 405 </root> - 406 """ -
407 - 408 # doesn't work with lxml.etree - 409 del simpleparsefile - 410 -
411 -def iterparse(): -
412 """ - 413 Test iterparse interface. - 414 - 415 >>> iterparse = ElementTree.iterparse - 416 - 417 >>> context = iterparse("samples/simple.xml") - 418 >>> for action, elem in context: - 419 ... print("%s %s" % (action, elem.tag)) - 420 end element - 421 end element - 422 end empty-element - 423 end root - 424 >>> context.root.tag - 425 'root' - 426 - 427 >>> context = iterparse("samples/simple-ns.xml") - 428 >>> for action, elem in context: - 429 ... print("%s %s" % (action, elem.tag)) - 430 end {http://namespace/}element - 431 end {http://namespace/}element - 432 end {http://namespace/}empty-element - 433 end {http://namespace/}root - 434 - 435 >>> events = () - 436 >>> context = iterparse("samples/simple.xml", events) - 437 >>> for action, elem in context: - 438 ... print("%s %s" % (action, elem.tag)) - 439 - 440 >>> events = () - 441 >>> context = iterparse("samples/simple.xml", events=events) - 442 >>> for action, elem in context: - 443 ... print("%s %s" % (action, elem.tag)) - 444 - 445 >>> events = ("start", "end") - 446 >>> context = iterparse("samples/simple.xml", events) - 447 >>> for action, elem in context: - 448 ... print("%s %s" % (action, elem.tag)) - 449 start root - 450 start element - 451 end element - 452 start element - 453 end element - 454 start empty-element - 455 end empty-element - 456 end root - 457 - 458 >>> events = ("start", "end", "start-ns", "end-ns") - 459 >>> context = iterparse("samples/simple-ns.xml", events) - 460 >>> for action, elem in context: - 461 ... if action in ("start", "end"): - 462 ... print("%s %s" % (action, elem.tag)) - 463 ... else: - 464 ... print("%s %s" % (action, elem)) - 465 start-ns ('', 'http://namespace/') - 466 start {http://namespace/}root - 467 start {http://namespace/}element - 468 end {http://namespace/}element - 469 start {http://namespace/}element - 470 end {http://namespace/}element - 471 start {http://namespace/}empty-element - 472 end {http://namespace/}empty-element - 473 end {http://namespace/}root - 474 end-ns None - 475 - 476 """ -
477 -
478 -def fancyparsefile(): -
479 """ - 480 Test the "fancy" parser. - 481 - 482 Sanity check. - 483 >>> from elementtree import XMLTreeBuilder - 484 >>> parser = XMLTreeBuilder.FancyTreeBuilder() - 485 >>> tree = ElementTree.parse("samples/simple.xml", parser) - 486 >>> normalize_crlf(tree) - 487 >>> tree.write(sys.stdout) - 488 <root> - 489 <element key="value">text</element> - 490 <element>text</element>tail - 491 <empty-element /> - 492 </root> - 493 - 494 Callback check. - 495 >>> class MyFancyParser(XMLTreeBuilder.FancyTreeBuilder): - 496 ... def start(self, elem): - 497 ... print("START %s" % elem.tag) - 498 ... def end(self, elem): - 499 ... print("END %s" % elem.tag) - 500 >>> parser = MyFancyParser() - 501 >>> tree = ElementTree.parse("samples/simple.xml", parser) - 502 START root - 503 START element - 504 END element - 505 START element - 506 END element - 507 START empty-element - 508 END empty-element - 509 END root - 510 """ -
511 - 512 # doesn't work with lxml.etree - 513 del fancyparsefile - 514 -
515 -def writefile(): -
516 """ - 517 >>> elem = ElementTree.Element("tag") - 518 >>> elem.text = "text" - 519 >>> serialize(elem) - 520 '<tag>text</tag>' - 521 >>> ElementTree.SubElement(elem, "subtag").text = "subtext" - 522 >>> serialize(elem) - 523 '<tag>text<subtag>subtext</subtag></tag>' - 524 - 525 ## Test tag suppression - 526 ## >>> elem.tag = None - 527 ## >>> serialize(elem) - 528 ## 'text<subtag>subtext</subtag>' - 529 """ -
530 -
531 -def writestring(): -
532 """ - 533 >>> elem = ElementTree.XML("<html><body>text</body></html>") - 534 >>> print(repr(ElementTree.tostring(elem)).lstrip('b')) - 535 '<html><body>text</body></html>' - 536 >>> elem = ElementTree.fromstring("<html><body>text</body></html>") - 537 >>> print(repr(ElementTree.tostring(elem)).lstrip('b')) - 538 '<html><body>text</body></html>' - 539 """ -
540 -
541 -def encoding(): -
542 r""" - 543 Test encoding issues. - 544 - 545 >>> elem = ElementTree.Element("tag") - 546 >>> elem.text = u'abc' - 547 >>> serialize(elem) - 548 '<tag>abc</tag>' - 549 >>> serialize(elem, encoding="utf-8") - 550 '<tag>abc</tag>' - 551 >>> serialize(elem, encoding="us-ascii") - 552 '<tag>abc</tag>' - 553 >>> serialize(elem, encoding="iso-8859-1").lower() - 554 "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>abc</tag>" - 555 - 556 >>> elem.text = "<&\"\'>" - 557 >>> serialize(elem) - 558 '<tag>&lt;&amp;"\'&gt;</tag>' - 559 >>> serialize(elem, encoding="utf-8") - 560 '<tag>&lt;&amp;"\'&gt;</tag>' - 561 >>> serialize(elem, encoding="us-ascii") # cdata characters - 562 '<tag>&lt;&amp;"\'&gt;</tag>' - 563 >>> serialize(elem, encoding="iso-8859-1").lower() - 564 '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag>&lt;&amp;"\'&gt;</tag>' - 565 - 566 >>> elem.attrib["key"] = "<&\"\'>" - 567 >>> elem.text = None - 568 >>> serialize(elem) - 569 '<tag key="&lt;&amp;&quot;\'&gt;"/>' - 570 >>> serialize(elem, encoding="utf-8") - 571 '<tag key="&lt;&amp;&quot;\'&gt;"/>' - 572 >>> serialize(elem, encoding="us-ascii") - 573 '<tag key="&lt;&amp;&quot;\'&gt;"/>' - 574 >>> serialize(elem, encoding="iso-8859-1").lower() - 575 '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="&lt;&amp;&quot;\'&gt;"/>' - 576 - 577 >>> elem.text = u'\xe5\xf6\xf6<>' - 578 >>> elem.attrib.clear() - 579 >>> serialize(elem) - 580 '<tag>&#229;&#246;&#246;&lt;&gt;</tag>' - 581 >>> serialize(elem, encoding="utf-8") - 582 '<tag>\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;</tag>' - 583 >>> serialize(elem, encoding="us-ascii") - 584 '<tag>&#229;&#246;&#246;&lt;&gt;</tag>' - 585 >>> serialize(elem, encoding="iso-8859-1").lower() - 586 "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>\xe5\xf6\xf6&lt;&gt;</tag>" - 587 - 588 >>> elem.attrib["key"] = u'\xe5\xf6\xf6<>' - 589 >>> elem.text = None - 590 >>> serialize(elem) - 591 '<tag key="&#229;&#246;&#246;&lt;&gt;"/>' - 592 >>> serialize(elem, encoding="utf-8") - 593 '<tag key="\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;"/>' - 594 >>> serialize(elem, encoding="us-ascii") - 595 '<tag key="&#229;&#246;&#246;&lt;&gt;"/>' - 596 >>> serialize(elem, encoding="iso-8859-1").lower() - 597 '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="\xe5\xf6\xf6&lt;&gt;"/>' - 598 """ -
599 - 600 if sys.version_info[0] >= 3: - 601 encoding.__doc__ = encoding.__doc__.replace("u'", "'") - 602 -
603 -def methods(): -
604 r""" - 605 Test serialization methods. - 606 - 607 >>> e = ET.XML("<html><link/><script>1 &lt; 2</script></html>") - 608 >>> e.tail = "\n" - 609 >>> serialize(e) - 610 '<html><link /><script>1 &lt; 2</script></html>\n' - 611 >>> serialize(e, method=None) - 612 '<html><link /><script>1 &lt; 2</script></html>\n' - 613 >>> serialize(e, method="xml") - 614 '<html><link /><script>1 &lt; 2</script></html>\n' - 615 >>> serialize(e, method="html") - 616 '<html><link><script>1 < 2</script></html>\n' - 617 >>> serialize(e, method="text") - 618 '1 < 2\n' - 619 - 620 """ -
621 - 622 # doesn't work with lxml.etree - 623 del methods - 624 -
625 -def iterators(): -
626 """ - 627 Test iterators. - 628 - 629 >>> e = ET.XML("<html><body>this is a <i>paragraph</i>.</body>..</html>") - 630 >>> summarize_list(e.iter()) - 631 ['html', 'body', 'i'] - 632 >>> summarize_list(e.find("body").iter()) - 633 ['body', 'i'] - 634 >>> "".join(e.itertext()) - 635 'this is a paragraph...' - 636 >>> "".join(e.find("body").itertext()) - 637 'this is a paragraph.' - 638 """ -
639 - 640 ENTITY_XML = """\ - 641 <!DOCTYPE points [ - 642 <!ENTITY % user-entities SYSTEM 'user-entities.xml'> - 643 %user-entities; - 644 ]> - 645 <document>&entity;</document> - 646 """ - 647 -
648 -def entity(): -
649 """ - 650 Test entity handling. - 651 - 652 1) bad entities - 653 - 654 >>> ElementTree.XML("<document>&entity;</document>") - 655 Traceback (most recent call last): - 656 ExpatError: undefined entity: line 1, column 10 - 657 - 658 >>> ElementTree.XML(ENTITY_XML) - 659 Traceback (most recent call last): - 660 ExpatError: undefined entity &entity;: line 5, column 10 - 661 - 662 (add more tests here) - 663 - 664 """ -
665 - 666 # doesn't work with lxml.etree - 667 del entity - 668 -
669 -def error(xml): -
670 """ - 671 Test error handling. - 672 - 673 >>> error("foo").position - 674 (1, 0) - 675 >>> error("<tag>&foo;</tag>").position - 676 (1, 5) - 677 >>> error("foobar<").position - 678 (1, 6) - 679 - 680 """ - 681 try: - 682 ET.XML(xml) - 683 except ET.ParseError: - 684 return sys.exc_value -
685 - 686 # doesn't work with lxml.etree -> different positions - 687 del error - 688 -
689 -def namespace(): -
690 """ - 691 Test namespace issues. - 692 - 693 1) xml namespace - 694 - 695 >>> elem = ElementTree.XML("<tag xml:lang='en' />") - 696 >>> serialize(elem) # 1.1 - 697 '<tag xml:lang="en"/>' - 698 - 699 2) other "well-known" namespaces - 700 - 701 >>> elem = ElementTree.XML("<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' />") - 702 >>> serialize(elem) # 2.1 - 703 '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>' - 704 - 705 >>> elem = ElementTree.XML("<html:html xmlns:html='http://www.w3.org/1999/xhtml' />") - 706 >>> serialize(elem) # 2.2 - 707 '<html:html xmlns:html="http://www.w3.org/1999/xhtml"/>' - 708 - 709 >>> elem = ElementTree.XML("<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope' />") - 710 >>> serialize(elem) # 2.3 - 711 '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope"/>' - 712 - 713 3) unknown namespaces - 714 - 715 """ -
716 -
717 -def qname(): -
718 """ - 719 Test QName handling. - 720 - 721 1) decorated tags - 722 - 723 >>> elem = ElementTree.Element("{uri}tag") - 724 >>> serialize(elem) # 1.1 - 725 '<ns0:tag xmlns:ns0="uri"/>' - 726 >>> elem = ElementTree.Element(ElementTree.QName("{uri}tag")) - 727 >>> serialize(elem) # 1.2 - 728 '<ns0:tag xmlns:ns0="uri"/>' - 729 >>> elem = ElementTree.Element(ElementTree.QName("uri", "tag")) - 730 >>> serialize(elem) # 1.3 - 731 '<ns0:tag xmlns:ns0="uri"/>' - 732 - 733 # ns/attribute order ... - 734 - 735 ## 2) decorated attributes - 736 - 737 ## >>> elem.clear() - 738 ## >>> elem.attrib["{uri}key"] = "value" - 739 ## >>> serialize(elem) # 2.1 - 740 ## '<ns0:tag ns0:key="value" xmlns:ns0="uri"/>' - 741 - 742 ## >>> elem.clear() - 743 ## >>> elem.attrib[ElementTree.QName("{uri}key")] = "value" - 744 ## >>> serialize(elem) # 2.2 - 745 ## '<ns0:tag ns0:key="value" xmlns:ns0="uri"/>' - 746 - 747 ## 3) decorated values are not converted by default, but the - 748 ## QName wrapper can be used for values - 749 - 750 ## >>> elem.clear() - 751 ## >>> elem.attrib["{uri}key"] = "{uri}value" - 752 ## >>> serialize(elem) # 3.1 - 753 ## '<ns0:tag ns0:key="{uri}value" xmlns:ns0="uri"/>' - 754 - 755 ## >>> elem.clear() - 756 ## >>> elem.attrib["{uri}key"] = ElementTree.QName("{uri}value") - 757 ## >>> serialize(elem) # 3.2 - 758 ## '<ns0:tag ns0:key="ns0:value" xmlns:ns0="uri"/>' - 759 - 760 ## >>> elem.clear() - 761 ## >>> subelem = ElementTree.Element("tag") - 762 ## >>> subelem.attrib["{uri1}key"] = ElementTree.QName("{uri2}value") - 763 ## >>> elem.append(subelem) - 764 ## >>> elem.append(subelem) - 765 ## >>> serialize(elem) # 3.3 - 766 ## '<ns0:tag xmlns:ns0="uri"><tag ns1:key="ns2:value" xmlns:ns1="uri1" xmlns:ns2="uri2"/><tag ns1:key="ns2:value" xmlns:ns1="uri1" xmlns:ns2="uri2"/></ns0:tag>' - 767 - 768 """ -
769 -
770 -def xpath_tokenizer(p): -
771 """ - 772 Test the XPath tokenizer. - 773 - 774 >>> # tests from the xml specification - 775 >>> xpath_tokenizer("*") - 776 ['*'] - 777 >>> xpath_tokenizer("text()") - 778 ['text', '()'] - 779 >>> xpath_tokenizer("@name") - 780 ['@', 'name'] - 781 >>> xpath_tokenizer("@*") - 782 ['@', '*'] - 783 >>> xpath_tokenizer("para[1]") - 784 ['para', '[', '1', ']'] - 785 >>> xpath_tokenizer("para[last()]") - 786 ['para', '[', 'last', '()', ']'] - 787 >>> xpath_tokenizer("*/para") - 788 ['*', '/', 'para'] - 789 >>> xpath_tokenizer("/doc/chapter[5]/section[2]") - 790 ['/', 'doc', '/', 'chapter', '[', '5', ']', '/', 'section', '[', '2', ']'] - 791 >>> xpath_tokenizer("chapter//para") - 792 ['chapter', '//', 'para'] - 793 >>> xpath_tokenizer("//para") - 794 ['//', 'para'] - 795 >>> xpath_tokenizer("//olist/item") - 796 ['//', 'olist', '/', 'item'] - 797 >>> xpath_tokenizer(".") - 798 ['.'] - 799 >>> xpath_tokenizer(".//para") - 800 ['.', '//', 'para'] - 801 >>> xpath_tokenizer("..") - 802 ['..'] - 803 >>> xpath_tokenizer("../@lang") - 804 ['..', '/', '@', 'lang'] - 805 >>> xpath_tokenizer("chapter[title]") - 806 ['chapter', '[', 'title', ']'] - 807 >>> xpath_tokenizer("employee[@secretary and @assistant]") - 808 ['employee', '[', '@', 'secretary', '', 'and', '', '@', 'assistant', ']'] - 809 - 810 >>> # additional tests - 811 >>> xpath_tokenizer("{http://spam}egg") - 812 ['{http://spam}egg'] - 813 >>> xpath_tokenizer("./spam.egg") - 814 ['.', '/', 'spam.egg'] - 815 >>> xpath_tokenizer(".//{http://spam}egg") - 816 ['.', '//', '{http://spam}egg'] - 817 """ - 818 out = [] - 819 for op, tag in ElementPath.xpath_tokenizer(p): - 820 out.append(op or tag) - 821 return out -
822 - 823 # - 824 # xinclude tests (samples from appendix C of the xinclude specification) - 825 - 826 XINCLUDE = {} - 827 - 828 XINCLUDE["C1.xml"] = """\ - 829 <?xml version='1.0'?> - 830 <document xmlns:xi="http://www.w3.org/2001/XInclude"> - 831 <p>120 Mz is adequate for an average home user.</p> - 832 <xi:include href="disclaimer.xml"/> - 833 </document> - 834 """ - 835 - 836 XINCLUDE["disclaimer.xml"] = """\ - 837 <?xml version='1.0'?> - 838 <disclaimer> - 839 <p>The opinions represented herein represent those of the individual - 840 and should not be interpreted as official policy endorsed by this - 841 organization.</p> - 842 </disclaimer> - 843 """ - 844 - 845 XINCLUDE["C2.xml"] = """\ - 846 <?xml version='1.0'?> - 847 <document xmlns:xi="http://www.w3.org/2001/XInclude"> - 848 <p>This document has been accessed - 849 <xi:include href="count.txt" parse="text"/> times.</p> - 850 </document> - 851 """ - 852 - 853 XINCLUDE["count.txt"] = "324387" - 854 - 855 XINCLUDE["C3.xml"] = """\ - 856 <?xml version='1.0'?> - 857 <document xmlns:xi="http://www.w3.org/2001/XInclude"> - 858 <p>The following is the source of the "data.xml" resource:</p> - 859 <example><xi:include href="data.xml" parse="text"/></example> - 860 </document> - 861 """ - 862 - 863 XINCLUDE["data.xml"] = """\ - 864 <?xml version='1.0'?> - 865 <data> - 866 <item><![CDATA[Brooks & Shields]]></item> - 867 </data> - 868 """ - 869 - 870 XINCLUDE["C5.xml"] = """\ - 871 <?xml version='1.0'?> - 872 <div xmlns:xi="http://www.w3.org/2001/XInclude"> - 873 <xi:include href="example.txt" parse="text"> - 874 <xi:fallback> - 875 <xi:include href="fallback-example.txt" parse="text"> - 876 <xi:fallback><a href="mailto:bob@example.org">Report error</a></xi:fallback> - 877 </xi:include> - 878 </xi:fallback> - 879 </xi:include> - 880 </div> - 881 """ - 882 - 883 XINCLUDE["default.xml"] = """\ - 884 <?xml version='1.0'?> - 885 <document xmlns:xi="http://www.w3.org/2001/XInclude"> - 886 <p>Example.</p> - 887 <xi:include href="samples/simple.xml"/> - 888 </document> - 889 """ - 890 -
891 -def xinclude_loader(href, parse="xml", encoding=None): -
892 try: - 893 data = XINCLUDE[href] - 894 except KeyError: - 895 raise IOError("resource not found") - 896 if parse == "xml": - 897 return ElementTree.XML(data) - 898 return data -
899 -
900 -def xinclude(): -
901 r""" - 902 Basic inclusion example (XInclude C.1) - 903 - 904 >>> document = xinclude_loader("C1.xml") - 905 >>> ElementInclude.include(document, xinclude_loader) - 906 >>> print(serialize(document)) # C1 - 907 <document> - 908 <p>120 Mz is adequate for an average home user.</p> - 909 <disclaimer> - 910 <p>The opinions represented herein represent those of the individual - 911 and should not be interpreted as official policy endorsed by this - 912 organization.</p> - 913 </disclaimer> - 914 </document> - 915 - 916 Textual inclusion example (XInclude C.2) - 917 - 918 >>> document = xinclude_loader("C2.xml") - 919 >>> ElementInclude.include(document, xinclude_loader) - 920 >>> print(serialize(document)) # C2 - 921 <document> - 922 <p>This document has been accessed - 923 324387 times.</p> - 924 </document> - 925 - 926 Textual inclusion of XML example (XInclude C.3) - 927 - 928 >>> document = xinclude_loader("C3.xml") - 929 >>> ElementInclude.include(document, xinclude_loader) - 930 >>> print(serialize(document)) # C3 - 931 <document> - 932 <p>The following is the source of the "data.xml" resource:</p> - 933 <example>&lt;?xml version='1.0'?&gt; - 934 &lt;data&gt; - 935 &lt;item&gt;&lt;![CDATA[Brooks &amp; Shields]]&gt;&lt;/item&gt; - 936 &lt;/data&gt; - 937 </example> - 938 </document> - 939 - 940 ## Fallback example (XInclude C.5) - 941 ## Note! Fallback support is not yet implemented - 942 - 943 ## >>> document = xinclude_loader("C5.xml") - 944 ## >>> ElementInclude.include(document, xinclude_loader) - 945 ## Traceback (most recent call last): - 946 ## IOError: resource not found - 947 ## >>> # print(serialize(document)) # C5 - 948 - 949 """ -
950 -
951 -def xinclude_default(): -
952 """ - 953 >>> document = xinclude_loader("default.xml") - 954 >>> ElementInclude.include(document) - 955 >>> print(serialize(document)) # default - 956 <document> - 957 <p>Example.</p> - 958 <root> - 959 <element key="value">text</element> - 960 <element>text</element>tail - 961 <empty-element/> - 962 </root> - 963 </document> - 964 """ -
965 - 966 # - 967 # xmlwriter - 968 -
969 -def xmlwriter(): -
970 r""" - 971 >>> file = BytesIO() - 972 >>> w = SimpleXMLWriter.XMLWriter(file) - 973 >>> html = w.start("html") - 974 >>> x = w.start("head") - 975 >>> w.element("title", "my document") - 976 >>> w.data("\n") - 977 >>> w.element("meta", name="hello", value="goodbye") - 978 >>> w.data("\n") - 979 >>> w.end() - 980 >>> x = w.start("body") - 981 >>> w.element("h1", "this is a heading") - 982 >>> w.data("\n") - 983 >>> w.element("p", u"this is a paragraph") - 984 >>> w.data("\n") - 985 >>> w.element("p", u"reserved characters: <&>") - 986 >>> w.data("\n") - 987 >>> w.element("p", u"detta är också ett stycke") - 988 >>> w.data("\n") - 989 >>> w.close(html) - 990 >>> print(file.getvalue()) - 991 <html><head><title>my document</title> - 992 <meta name="hello" value="goodbye" /> - 993 </head><body><h1>this is a heading</h1> - 994 <p>this is a paragraph</p> - 995 <p>reserved characters: &lt;&amp;&gt;</p> - 996 <p>detta &#228;r ocks&#229; ett stycke</p> - 997 </body></html> - 998 """ -
999 -1000 # doesn't work with lxml.etree -1001 del xmlwriter -1002 -1003 # -------------------------------------------------------------------- -1004 # reported bugs -1005 -
1006 -def bug_xmltoolkit21(): -
1007 """ -1008 marshaller gives obscure errors for non-string values -1009 -1010 >>> elem = ElementTree.Element(123) -1011 >>> serialize(elem) # tag -1012 Traceback (most recent call last): -1013 TypeError: cannot serialize 123 (type int) -1014 >>> elem = ElementTree.Element("elem") -1015 >>> elem.text = 123 -1016 >>> serialize(elem) # text -1017 Traceback (most recent call last): -1018 TypeError: cannot serialize 123 (type int) -1019 >>> elem = ElementTree.Element("elem") -1020 >>> elem.tail = 123 -1021 >>> serialize(elem) # tail -1022 Traceback (most recent call last): -1023 TypeError: cannot serialize 123 (type int) -1024 >>> elem = ElementTree.Element("elem") -1025 >>> elem.set(123, "123") -1026 >>> serialize(elem) # attribute key -1027 Traceback (most recent call last): -1028 TypeError: cannot serialize 123 (type int) -1029 >>> elem = ElementTree.Element("elem") -1030 >>> elem.set("123", 123) -1031 >>> serialize(elem) # attribute value -1032 Traceback (most recent call last): -1033 TypeError: cannot serialize 123 (type int) -1034 -1035 """ -
1036 -1037 # doesn't work with lxml.etree -1038 del bug_xmltoolkit21 -1039 -
1040 -def bug_xmltoolkit25(): -
1041 """ -1042 typo in ElementTree.findtext -1043 -1044 >>> tree = ElementTree.ElementTree(SAMPLE_XML) -1045 >>> tree.findtext("tag") -1046 'text' -1047 >>> tree.findtext("section/tag") -1048 'subtext' -1049 """ -
1050 -
1051 -def bug_xmltoolkit28(): -
1052 """ -1053 .//tag causes exceptions -1054 -1055 >>> tree = ElementTree.XML("<doc><table><tbody/></table></doc>") -1056 >>> summarize_list(tree.findall(".//thead")) -1057 [] -1058 >>> summarize_list(tree.findall(".//tbody")) -1059 ['tbody'] -1060 """ -
1061 -
1062 -def bug_xmltoolkitX1(): -
1063 """ -1064 dump() doesn't flush the output buffer -1065 -1066 >>> tree = ElementTree.XML("<doc><table><tbody/></table></doc>") -1067 >>> ElementTree.dump(tree); sys.stdout.write("tail") -1068 <doc><table><tbody /></table></doc> -1069 tail -1070 """ -
1071 -1072 # doesn't work with lxml.etree -1073 del bug_xmltoolkitX1 -1074 -
1075 -def bug_xmltoolkit39(): -
1076 """ -1077 non-ascii element and attribute names doesn't work -1078 -1079 >>> tree = ElementTree.XML("<?xml version='1.0' encoding='iso-8859-1'?><täg />") -1080 >>> ElementTree.tostring(tree, "utf-8") -1081 '<t\\xc3\\xa4g />' -1082 -1083 >>> tree = ElementTree.XML("<?xml version='1.0' encoding='iso-8859-1'?><tag ättr='v&#228;lue' />") -1084 >>> tree.attrib -1085 {u'\\xe4ttr': u'v\\xe4lue'} -1086 >>> ElementTree.tostring(tree, "utf-8") -1087 '<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />' -1088 -1089 >>> tree = ElementTree.XML("<?xml version='1.0' encoding='iso-8859-1'?><täg>text</täg>") -1090 >>> ElementTree.tostring(tree, "utf-8") -1091 '<t\\xc3\\xa4g>text</t\\xc3\\xa4g>' -1092 -1093 >>> tree = ElementTree.Element(u"täg") -1094 >>> ElementTree.tostring(tree, "utf-8") -1095 '<t\\xc3\\xa4g />' -1096 -1097 >>> tree = ElementTree.Element("tag") -1098 >>> tree.set(u"ättr", u"välue") -1099 >>> ElementTree.tostring(tree, "utf-8") -1100 '<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />' -1101 -1102 """ -
1103 -1104 # doesn't work with lxml.etree -1105 del bug_xmltoolkit39 -1106 -
1107 -def bug_xmltoolkit45(): -
1108 """ -1109 problems parsing mixed unicode/non-ascii html documents -1110 -1111 latin-1 text -1112 >>> p = HTMLTreeBuilder.TreeBuilder() -1113 >>> p.feed("<p>välue</p>") -1114 >>> serialize(p.close()) -1115 '<p>v&#228;lue</p>' -1116 -1117 utf-8 text -1118 >>> p = HTMLTreeBuilder.TreeBuilder(encoding="utf-8") -1119 >>> p.feed("<p>v\xc3\xa4lue</p>") -1120 >>> serialize(p.close()) -1121 '<p>v&#228;lue</p>' -1122 -1123 utf-8 text using meta tag -1124 >>> p = HTMLTreeBuilder.TreeBuilder() -1125 >>> p.feed("<html><meta http-equiv='Content-Type' content='text/html; charset=utf-8'><p>v\xc3\xa4lue</p></html>") -1126 >>> serialize(p.close().find("p")) -1127 '<p>v&#228;lue</p>' -1128 -1129 latin-1 character references -1130 >>> p = HTMLTreeBuilder.TreeBuilder() -1131 >>> p.feed("<p>v&#228;lue</p>") -1132 >>> serialize(p.close()) -1133 '<p>v&#228;lue</p>' -1134 -1135 latin-1 character entities -1136 >>> p = HTMLTreeBuilder.TreeBuilder() -1137 >>> p.feed("<p>v&auml;lue</p>") -1138 >>> serialize(p.close()) -1139 '<p>v&#228;lue</p>' -1140 -1141 mixed latin-1 text and unicode entities -1142 >>> p = HTMLTreeBuilder.TreeBuilder() -1143 >>> p.feed("<p>&#8221;välue&#8221;</p>") -1144 >>> serialize(p.close()) -1145 '<p>&#8221;v&#228;lue&#8221;</p>' -1146 -1147 mixed unicode and latin-1 entities -1148 >>> p = HTMLTreeBuilder.TreeBuilder() -1149 >>> p.feed("<p>&#8221;v&auml;lue&#8221;</p>") -1150 >>> serialize(p.close()) -1151 '<p>&#8221;v&#228;lue&#8221;</p>' -1152 -1153 """ -
1154 -1155 # doesn't work with lxml.etree -1156 del bug_xmltoolkit45 -1157 -
1158 -def bug_xmltoolkit46(): -
1159 """ -1160 problems parsing open BR tags -1161 -1162 >>> p = HTMLTreeBuilder.TreeBuilder() -1163 >>> p.feed("<p>key<br>value</p>") -1164 >>> serialize(p.close()) -1165 '<p>key<br />value</p>' -1166 -1167 """ -
1168 -1169 # doesn't work with lxml.etree -1170 del bug_xmltoolkit46 -1171 -
1172 -def bug_xmltoolkit54(): -
1173 """ -1174 problems handling internally defined entities -1175 -1176 >>> e = ElementTree.XML("<!DOCTYPE doc [<!ENTITY ldots '&#x8230;'>]><doc>&ldots;</doc>") -1177 >>> serialize(e) -1178 '<doc>&#33328;</doc>' -1179 """ -
1180 -1181 # doesn't work with lxml.etree -1182 del bug_xmltoolkit54 -1183 -
1184 -def bug_xmltoolkit55(): -
1185 """ -1186 make sure we're reporting the first error, not the last -1187 -1188 >>> e = ElementTree.XML("<!DOCTYPE doc SYSTEM 'doc.dtd'><doc>&ldots;&ndots;&rdots;</doc>") -1189 Traceback (most recent call last): -1190 ParseError: undefined entity &ldots;: line 1, column 36 -1191 """ -
1192 -1193 # doesn't work with lxml.etree -1194 del bug_xmltoolkit55 -1195 -
1196 -def bug_200708_version(): -
1197 """ -1198 >>> parser = ET.XMLParser() -1199 >>> parser.version -1200 'Expat 2.0.0' -1201 >>> parser.feed(open("samples/simple.xml").read()) -1202 >>> print(serialize(parser.close())) -1203 <root> -1204 <element key="value">text</element> -1205 <element>text</element>tail -1206 <empty-element /> -1207 </root> -1208 """ -
1209 -1210 # doesn't work with lxml.etree -1211 del bug_200708_version -1212 -
1213 -def bug_200708_newline(): -
1214 r""" -1215 -1216 Preserve newlines in attributes. -1217 -1218 >>> e = ET.Element('SomeTag', text="def _f():\n return 3\n") -1219 >>> ET.tostring(e) -1220 '<SomeTag text="def _f():&#10; return 3&#10;" />' -1221 >>> ET.XML(ET.tostring(e)).get("text") -1222 'def _f():\n return 3\n' -1223 >>> ET.tostring(ET.XML(ET.tostring(e))) -1224 '<SomeTag text="def _f():&#10; return 3&#10;" />' -1225 """ -
1226 -1227 # doesn't work with lxml.etree -1228 del bug_200708_newline -1229 -
1231 """ -1232 -1233 >>> e = ET.Element("{default}elem") -1234 >>> s = ET.SubElement(e, "{default}elem") -1235 >>> serialize(e, default_namespace="default") # 1 -1236 '<elem xmlns="default"><elem /></elem>' -1237 -1238 >>> e = ET.Element("{default}elem") -1239 >>> s = ET.SubElement(e, "{default}elem") -1240 >>> s = ET.SubElement(e, "{not-default}elem") -1241 >>> serialize(e, default_namespace="default") # 2 -1242 '<elem xmlns="default" xmlns:ns1="not-default"><elem /><ns1:elem /></elem>' -1243 -1244 >>> e = ET.Element("{default}elem") -1245 >>> s = ET.SubElement(e, "{default}elem") -1246 >>> s = ET.SubElement(e, "elem") # unprefixed name -1247 >>> serialize(e, default_namespace="default") # 3 -1248 Traceback (most recent call last): -1249 ValueError: cannot use non-qualified names with default_namespace option -1250 -1251 """ -
1252 -1253 # doesn't work with lxml.etree -1254 del bug_200709_default_namespace -1255 -1256 # -------------------------------------------------------------------- -1257 -1258 if __name__ == "__main__": -1259 import doctest, selftest -1260 failed, tested = doctest.testmod(selftest) -1261 print("%d tests ok." % (tested - failed)) -1262 if failed > 0: -1263 print("%d tests failed. Exiting with non-zero return code." % failed) -1264 sys.exit(1) -1265 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.selftest2-module.html b/doc/html/api/lxml.tests.selftest2-module.html deleted file mode 100644 index b5196160..00000000 --- a/doc/html/api/lxml.tests.selftest2-module.html +++ /dev/null @@ -1,699 +0,0 @@ - - - - - lxml.tests.selftest2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module selftest2 - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module selftest2

source code

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
stdout() - source code - -
- -
-   - - - - - - -
unserialize(text) - source code - -
- -
-   - - - - - - -
serialize(elem, - encoding=None) - source code - -
- -
-   - - - - - - -
summarize(elem) - source code - -
- -
-   - - - - - - -
summarize_list(seq) - source code - -
- -
-   - - - - - - -
check_string(string) - source code - -
- -
-   - - - - - - -
check_mapping(mapping) - source code - -
- -
-   - - - - - - -
check_element(element) - source code - -
- -
-   - - - - - - -
check_element_tree(tree) - source code - -
- -
-   - - - - - - -
element()
- Test element tree interface.
- source code - -
- -
-   - - - - - - -
parsefile()
- Test parsing from file. Note that we're opening the files in -here; by default, the 'parse' function opens the file in binary -mode, and doctest doesn't filter out carriage returns.
- source code - -
- -
-   - - - - - - -
writefile() - source code - -
- -
-   - - - - - - -
encoding()
- Test encoding issues.
- source code - -
- -
-   - - - - - - -
qname()
- Test QName handling.
- source code - -
- -
-   - - - - - - -
cdata()
- Test CDATA handling (etc).
- source code - -
- -
-   - - - - - - -
find()
- Test find methods (including xpath syntax).
- source code - -
- -
-   - - - - - - -
copy()
- Test copy handling (etc).
- source code - -
- -
-   - - - - - - -
attrib()
- Test attribute handling.
- source code - -
- -
-   - - - - - - -
makeelement()
- Test makeelement handling.
- source code - -
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - SAMPLE_XML = unserialize(... -
-   - - SAMPLE_XML_NS = unserialize(... -
-   - - ENTITY_XML = '<!DOCTYPE points [\n<!ENTITY % user-entities SYS... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

qname() -

-
source code  -
- -
-

Test QName handling.

-
    -
  1. decorated tags
  2. -
-
->>> elem = ElementTree.Element("{uri}tag")
->>> serialize(elem) # 1.1
-'<ns0:tag xmlns:ns0="uri"/>'
-
-

## 2) decorated attributes

-

## >>> elem.attrib["{uri}key"] = "value" -## >>> serialize(elem) # 2.1 -## '<ns0:tag ns0:key="value" xmlns:ns0="uri"/>'

-
-
-
-
- -
- -
- - -
-

copy() -

-
source code  -
- -
-

Test copy handling (etc).

-
->>> import copy
->>> e1 = unserialize("<tag>hello<foo/></tag>")
->>> # e2 = copy.copy(e1)
->>> e3 = copy.deepcopy(e1)
->>> e1.find("foo").tag = "bar"
-
->>> serialize(e1).replace(' ', '')
-'<tag>hello<bar/></tag>'
-
-

## >>> serialize(e2).replace(' ', '') -## '<tag>hello<bar/></tag>'

-
-
->>> serialize(e3).replace(' ', '')
-'<tag>hello<foo/></tag>'
-
-
-
-
-
-
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

SAMPLE_XML

- -
-
-
-
Value:
-
-unserialize("""
-<body>
-  <tag>text</tag>
-  <tag />
-  <section>
-    <tag>subtext</tag>
-  </section>
-</body>
-...
-
-
-
-
-
- -
- -
-

SAMPLE_XML_NS

- -
-
-
-
Value:
-
-unserialize("""
-<body xmlns="http://effbot.org/ns">
-  <tag>text</tag>
-  <tag />
-  <section>
-    <tag>subtext</tag>
-  </section>
-</body>
-...
-
-
-
-
-
- -
- -
-

ENTITY_XML

- -
-
-
-
Value:
-
-'''<!DOCTYPE points [
-<!ENTITY % user-entities SYSTEM \'user-entities.xml\'>
-%user-entities;
-]>
-<document>&entity;</document>
-'''
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.selftest2-pysrc.html b/doc/html/api/lxml.tests.selftest2-pysrc.html deleted file mode 100644 index eb5da0e9..00000000 --- a/doc/html/api/lxml.tests.selftest2-pysrc.html +++ /dev/null @@ -1,659 +0,0 @@ - - - - - lxml.tests.selftest2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module selftest2 - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.selftest2

-
-  1  # $Id: selftest.py 2213 2005-01-11 18:49:47Z fredrik $ 
-  2  # elementtree selftest program 
-  3   
-  4  # this test script uses Python's "doctest" module to check that the 
-  5  # *test script* works as expected. 
-  6   
-  7  import sys 
-  8   
-  9  try: 
- 10      from StringIO import StringIO 
- 11      BytesIO = StringIO 
- 12  except ImportError: 
- 13      from io import BytesIO, StringIO 
- 14   
- 15  from lxml import etree as ElementTree 
- 16   
-
17 -def stdout(): -
18 if sys.version_info[0] < 3: - 19 return sys.stdout - 20 class bytes_stdout(object): - 21 def write(self, data): - 22 if isinstance(data, bytes): - 23 data = data.decode('ISO8859-1') - 24 sys.stdout.write(data) -
25 return bytes_stdout() - 26 -
27 -def unserialize(text): -
28 file = StringIO(text) - 29 tree = ElementTree.parse(file) - 30 return tree.getroot() -
31 -
32 -def serialize(elem, encoding=None): -
33 file = BytesIO() - 34 tree = ElementTree.ElementTree(elem) - 35 if encoding: - 36 tree.write(file, encoding=encoding) - 37 else: - 38 tree.write(file) - 39 result = file.getvalue() - 40 if sys.version_info[0] >= 3: - 41 result = result.decode('ISO8859-1') - 42 result = result.replace(' />', '/>') - 43 if result[-1:] == '\n': - 44 result = result[:-1] - 45 return result -
46 -
47 -def summarize(elem): -
48 return elem.tag -
49 -
50 -def summarize_list(seq): -
51 return list(map(summarize, seq)) -
52 - 53 SAMPLE_XML = unserialize(""" - 54 <body> - 55 <tag>text</tag> - 56 <tag /> - 57 <section> - 58 <tag>subtext</tag> - 59 </section> - 60 </body> - 61 """) - 62 - 63 SAMPLE_XML_NS = unserialize(""" - 64 <body xmlns="http://effbot.org/ns"> - 65 <tag>text</tag> - 66 <tag /> - 67 <section> - 68 <tag>subtext</tag> - 69 </section> - 70 </body> - 71 """) - 72 - 73 # interface tests - 74 -
75 -def check_string(string): -
76 len(string) - 77 for char in string: - 78 if len(char) != 1: - 79 print("expected one-character string, got %r" % char) - 80 new_string = string + "" - 81 new_string = string + " " - 82 string[:0] -
83 -
84 -def check_mapping(mapping): -
85 len(mapping) - 86 keys = mapping.keys() - 87 items = mapping.items() - 88 for key in keys: - 89 item = mapping[key] - 90 mapping["key"] = "value" - 91 if mapping["key"] != "value": - 92 print("expected value string, got %r" % mapping["key"]) -
93 -
94 -def check_element(element): -
95 if not hasattr(element, "tag"): - 96 print("no tag member") - 97 if not hasattr(element, "attrib"): - 98 print("no attrib member") - 99 if not hasattr(element, "text"): -100 print("no text member") -101 if not hasattr(element, "tail"): -102 print("no tail member") -103 check_string(element.tag) -104 check_mapping(element.attrib) -105 if element.text != None: -106 check_string(element.text) -107 if element.tail != None: -108 check_string(element.tail) -
109 -
110 -def check_element_tree(tree): -
111 check_element(tree.getroot()) -
112 -
113 -def element(): -
114 """ -115 Test element tree interface. -116 -117 >>> element = ElementTree.Element("tag") -118 >>> check_element(element) -119 >>> tree = ElementTree.ElementTree(element) -120 >>> check_element_tree(tree) -121 """ -
122 -
123 -def parsefile(): -
124 """ -125 Test parsing from file. Note that we're opening the files in -126 here; by default, the 'parse' function opens the file in binary -127 mode, and doctest doesn't filter out carriage returns. -128 -129 >>> file = open("samples/simple.xml", "rb") -130 >>> tree = ElementTree.parse(file) -131 >>> file.close() -132 >>> tree.write(stdout()) -133 <root> -134 <element key="value">text</element> -135 <element>text</element>tail -136 <empty-element/> -137 </root> -138 >>> file = open("samples/simple-ns.xml", "rb") -139 >>> tree = ElementTree.parse(file) -140 >>> file.close() -141 >>> tree.write(stdout()) -142 <root xmlns="http://namespace/"> -143 <element key="value">text</element> -144 <element>text</element>tail -145 <empty-element/> -146 </root> -147 """ -
148 -
149 -def writefile(): -
150 """ -151 >>> elem = ElementTree.Element("tag") -152 >>> elem.text = "text" -153 >>> serialize(elem) -154 '<tag>text</tag>' -155 >>> ElementTree.SubElement(elem, "subtag").text = "subtext" -156 >>> serialize(elem) -157 '<tag>text<subtag>subtext</subtag></tag>' -158 """ -
159 -
160 -def encoding(): -
161 r""" -162 Test encoding issues. -163 -164 >>> elem = ElementTree.Element("tag") -165 >>> elem.text = u'abc' -166 >>> serialize(elem) -167 '<tag>abc</tag>' -168 >>> serialize(elem, "utf-8") -169 '<tag>abc</tag>' -170 >>> serialize(elem, "us-ascii") -171 '<tag>abc</tag>' -172 >>> serialize(elem, "iso-8859-1").lower() -173 "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>abc</tag>" -174 -175 >>> elem.text = "<&\"\'>" -176 >>> serialize(elem) -177 '<tag>&lt;&amp;"\'&gt;</tag>' -178 >>> serialize(elem, "utf-8") -179 '<tag>&lt;&amp;"\'&gt;</tag>' -180 >>> serialize(elem, "us-ascii") # cdata characters -181 '<tag>&lt;&amp;"\'&gt;</tag>' -182 >>> serialize(elem, "iso-8859-1").lower() -183 '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag>&lt;&amp;"\'&gt;</tag>' -184 -185 >>> elem.attrib["key"] = "<&\"\'>" -186 >>> elem.text = None -187 >>> serialize(elem) -188 '<tag key="&lt;&amp;&quot;\'&gt;"/>' -189 >>> serialize(elem, "utf-8") -190 '<tag key="&lt;&amp;&quot;\'&gt;"/>' -191 >>> serialize(elem, "us-ascii") -192 '<tag key="&lt;&amp;&quot;\'&gt;"/>' -193 >>> serialize(elem, "iso-8859-1").lower() -194 '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="&lt;&amp;&quot;\'&gt;"/>' -195 -196 >>> elem.text = u'\xe5\xf6\xf6<>' -197 >>> elem.attrib.clear() -198 >>> serialize(elem) -199 '<tag>&#229;&#246;&#246;&lt;&gt;</tag>' -200 >>> serialize(elem, "utf-8") -201 '<tag>\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;</tag>' -202 >>> serialize(elem, "us-ascii") -203 '<tag>&#229;&#246;&#246;&lt;&gt;</tag>' -204 >>> serialize(elem, "iso-8859-1").lower() -205 "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>\xe5\xf6\xf6&lt;&gt;</tag>" -206 -207 >>> elem.attrib["key"] = u'\xe5\xf6\xf6<>' -208 >>> elem.text = None -209 >>> serialize(elem) -210 '<tag key="&#229;&#246;&#246;&lt;&gt;"/>' -211 >>> serialize(elem, "utf-8") -212 '<tag key="\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;"/>' -213 >>> serialize(elem, "us-ascii") -214 '<tag key="&#229;&#246;&#246;&lt;&gt;"/>' -215 >>> serialize(elem, "iso-8859-1").lower() -216 '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="\xe5\xf6\xf6&lt;&gt;"/>' -217 -218 """ -
219 -220 if sys.version_info[0] >= 3: -221 encoding.__doc__ = encoding.__doc__.replace("u'", "'") -222 -
223 -def qname(): -
224 """ -225 Test QName handling. -226 -227 1) decorated tags -228 -229 >>> elem = ElementTree.Element("{uri}tag") -230 >>> serialize(elem) # 1.1 -231 '<ns0:tag xmlns:ns0="uri"/>' -232 -233 ## 2) decorated attributes -234 -235 ## >>> elem.attrib["{uri}key"] = "value" -236 ## >>> serialize(elem) # 2.1 -237 ## '<ns0:tag ns0:key="value" xmlns:ns0="uri"/>' -238 -239 """ -
240 -
241 -def cdata(): -
242 """ -243 Test CDATA handling (etc). -244 -245 >>> serialize(unserialize("<tag>hello</tag>")) -246 '<tag>hello</tag>' -247 >>> serialize(unserialize("<tag>&#104;&#101;&#108;&#108;&#111;</tag>")) -248 '<tag>hello</tag>' -249 >>> serialize(unserialize("<tag><![CDATA[hello]]></tag>")) -250 '<tag>hello</tag>' -251 -252 """ -
253 -
254 -def find(): -
255 """ -256 Test find methods (including xpath syntax). -257 -258 >>> elem = SAMPLE_XML -259 >>> elem.find("tag").tag -260 'tag' -261 >>> ElementTree.ElementTree(elem).find("tag").tag -262 'tag' -263 >>> elem.find("section/tag").tag -264 'tag' -265 >>> ElementTree.ElementTree(elem).find("section/tag").tag -266 'tag' -267 >>> elem.findtext("tag") -268 'text' -269 >>> elem.findtext("tog", "default") -270 'default' -271 >>> ElementTree.ElementTree(elem).findtext("tag") -272 'text' -273 >>> elem.findtext("section/tag") -274 'subtext' -275 >>> ElementTree.ElementTree(elem).findtext("section/tag") -276 'subtext' -277 >>> summarize_list(elem.findall("tag")) -278 ['tag', 'tag'] -279 >>> summarize_list(elem.findall("*")) -280 ['tag', 'tag', 'section'] -281 >>> summarize_list(elem.findall(".//tag")) -282 ['tag', 'tag', 'tag'] -283 >>> summarize_list(elem.findall("section/tag")) -284 ['tag'] -285 >>> summarize_list(elem.findall("section//tag")) -286 ['tag'] -287 >>> summarize_list(elem.findall("section/*")) -288 ['tag'] -289 >>> summarize_list(elem.findall("section//*")) -290 ['tag'] -291 >>> summarize_list(elem.findall("section/.//*")) -292 ['tag'] -293 >>> summarize_list(elem.findall("*/*")) -294 ['tag'] -295 >>> summarize_list(elem.findall("*//*")) -296 ['tag'] -297 >>> summarize_list(elem.findall("*/tag")) -298 ['tag'] -299 >>> summarize_list(elem.findall("*/./tag")) -300 ['tag'] -301 >>> summarize_list(elem.findall("./tag")) -302 ['tag', 'tag'] -303 >>> summarize_list(elem.findall(".//tag")) -304 ['tag', 'tag', 'tag'] -305 >>> summarize_list(elem.findall("././tag")) -306 ['tag', 'tag'] -307 >>> summarize_list(ElementTree.ElementTree(elem).findall("/tag")) -308 ['tag', 'tag'] -309 >>> summarize_list(ElementTree.ElementTree(elem).findall("./tag")) -310 ['tag', 'tag'] -311 >>> elem = SAMPLE_XML_NS -312 >>> summarize_list(elem.findall("tag")) -313 [] -314 >>> summarize_list(elem.findall("{http://effbot.org/ns}tag")) -315 ['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag'] -316 >>> summarize_list(elem.findall(".//{http://effbot.org/ns}tag")) -317 ['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag'] -318 """ -
319 -320 # XXX only deep copying is supported -321 -
322 -def copy(): -
323 """ -324 Test copy handling (etc). -325 -326 >>> import copy -327 >>> e1 = unserialize("<tag>hello<foo/></tag>") -328 >>> # e2 = copy.copy(e1) -329 >>> e3 = copy.deepcopy(e1) -330 >>> e1.find("foo").tag = "bar" -331 -332 >>> serialize(e1).replace(' ', '') -333 '<tag>hello<bar/></tag>' -334 -335 ## >>> serialize(e2).replace(' ', '') -336 ## '<tag>hello<bar/></tag>' -337 -338 >>> serialize(e3).replace(' ', '') -339 '<tag>hello<foo/></tag>' -340 -341 """ -
342 -
343 -def attrib(): -
344 """ -345 Test attribute handling. -346 -347 >>> elem = ElementTree.Element("tag") -348 >>> elem.get("key") # 1.1 -349 >>> elem.get("key", "default") # 1.2 -350 'default' -351 >>> elem.set("key", "value") -352 >>> elem.get("key") # 1.3 -353 'value' -354 -355 >>> elem = ElementTree.Element("tag", key="value") -356 >>> elem.get("key") # 2.1 -357 'value' -358 >>> elem.attrib # 2.2 -359 {'key': 'value'} -360 -361 >>> elem = ElementTree.Element("tag", {"key": "value"}) -362 >>> elem.get("key") # 3.1 -363 'value' -364 >>> elem.attrib # 3.2 -365 {'key': 'value'} -366 -367 >>> elem = ElementTree.Element("tag", {"key": "other"}, key="value") -368 >>> elem.get("key") # 4.1 -369 'value' -370 >>> elem.attrib # 4.2 -371 {'key': 'value'} -372 -373 """ -
374 -
375 -def makeelement(): -
376 """ -377 Test makeelement handling. -378 -379 >>> elem = ElementTree.Element("tag") -380 >>> subelem = elem.makeelement("subtag", {"key": "value"}) -381 >>> elem.append(subelem) -382 >>> serialize(elem) -383 '<tag><subtag key="value"/></tag>' -384 -385 >>> elem.clear() -386 >>> serialize(elem) -387 '<tag/>' -388 >>> elem.append(subelem) -389 >>> serialize(elem) -390 '<tag><subtag key="value"/></tag>' -391 -392 """ -
393 -394 ## def observer(): -395 ## """ -396 ## Test observers. -397 -398 ## >>> def observer(action, elem): -399 ## ... print("%s %s" % (action, elem.tag)) -400 ## >>> builder = ElementTree.TreeBuilder() -401 ## >>> builder.addobserver(observer) -402 ## >>> parser = ElementTree.XMLParser(builder) -403 ## >>> file = open("samples/simple.xml", "rb") -404 ## >>> parser.feed(file.read()) -405 ## start root -406 ## start element -407 ## end element -408 ## start element -409 ## end element -410 ## start empty-element -411 ## end empty-element -412 ## end root -413 ## >>> file.close() -414 -415 ## """ -416 -417 ENTITY_XML = """\ -418 <!DOCTYPE points [ -419 <!ENTITY % user-entities SYSTEM 'user-entities.xml'> -420 %user-entities; -421 ]> -422 <document>&entity;</document> -423 """ -424 -425 ## def entity(): -426 ## """ -427 ## Test entity handling. -428 -429 ## 1) bad entities -430 -431 ## >>> ElementTree.XML("<document>&entity;</document>") -432 ## Traceback (most recent call last): -433 ## SyntaxError: undefined entity: line 1, column 10 -434 -435 ## 2) custom entity -436 -437 ## >>> parser = ElementTree.XMLParser() -438 ## >>> parser.entity["entity"] = "text" -439 ## >>> parser.feed(ENTITY_XML) -440 ## >>> root = parser.close() -441 ## >>> serialize(root) -442 ## '<document>text</document>' -443 -444 ## """ -445 -446 if __name__ == "__main__": -447 import doctest, selftest2 -448 failed, tested = doctest.testmod(selftest2) -449 print("%d tests ok." % (tested - failed)) -450 if failed > 0: -451 print("%d tests failed. Exiting with non-zero return code." % failed) -452 sys.exit(1) -453 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_builder-module.html b/doc/html/api/lxml.tests.test_builder-module.html deleted file mode 100644 index 2bede692..00000000 --- a/doc/html/api/lxml.tests.test_builder-module.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - lxml.tests.test_builder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_builder - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_builder

source code

- - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - BuilderTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_builder-pysrc.html b/doc/html/api/lxml.tests.test_builder-pysrc.html deleted file mode 100644 index 3f574040..00000000 --- a/doc/html/api/lxml.tests.test_builder-pysrc.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - lxml.tests.test_builder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_builder - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_builder

-
- 1  # -*- coding: utf-8 -*- 
- 2  import unittest 
- 3   
- 4  """ 
- 5  Tests that ElementMaker works properly. 
- 6  """ 
- 7   
- 8  import sys, os.path 
- 9  from lxml import etree 
-10  from lxml.builder import E 
-11   
-12  this_dir = os.path.dirname(__file__) 
-13  if this_dir not in sys.path: 
-14      sys.path.insert(0, this_dir) # needed for Py3 
-15   
-16  from common_imports import HelperTestCase, BytesIO, _bytes 
-17   
-18   
-
19 -class BuilderTestCase(HelperTestCase): -
20 etree = etree -21 -
23 class StringSubclass(str): pass -24 wrapped = E.b(StringSubclass('Hello')) -25 self.assertEqual(_bytes('<b>Hello</b>'), etree.tostring(wrapped)) -
26 -
27 - def test_unknown_type_raises(self): -
28 class UnknownType(object): -29 pass -
30 self.assertRaises(TypeError, E.b, UnknownType()) -
31 -
32 - def test_cdata(self): -
33 wrapped = E.b(etree.CDATA('Hello')) -34 self.assertEqual(_bytes('<b><![CDATA[Hello]]></b>'), etree.tostring(wrapped)) -
35 -
36 - def test_cdata_solo(self): -
37 self.assertRaises(ValueError, E.b, 'Hello', etree.CDATA('World')) -
38 -39 -
40 -def test_suite(): -
41 suite = unittest.TestSuite() -42 suite.addTests([unittest.makeSuite(BuilderTestCase)]) -43 return suite -
44 -45 if __name__ == '__main__': -46 print('to test use test.py %s' % __file__) -47 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_builder.BuilderTestCase-class.html b/doc/html/api/lxml.tests.test_builder.BuilderTestCase-class.html deleted file mode 100644 index f4375e73..00000000 --- a/doc/html/api/lxml.tests.test_builder.BuilderTestCase-class.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - - lxml.tests.test_builder.BuilderTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_builder :: - Class BuilderTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class BuilderTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               BuilderTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_build_from_xpath_result(self) - source code - -
- -
-   - - - - - - -
test_unknown_type_raises(self) - source code - -
- -
-   - - - - - - -
test_cdata(self) - source code - -
- -
-   - - - - - - -
test_cdata_solo(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_classlookup-module.html b/doc/html/api/lxml.tests.test_classlookup-module.html deleted file mode 100644 index 41c71115..00000000 --- a/doc/html/api/lxml.tests.test_classlookup-module.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - lxml.tests.test_classlookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_classlookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_classlookup

source code

-Tests for different Element class lookup mechanisms. - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ProxyTestCase
- Basic tests for element proxy behaviour. -
-   - - ClassLookupTestCase
- Test cases for different Element class lookup mechanisms. -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - xml_str = '<root xmlns="myNS" xmlns:other="otherNS">\n <c1 a1... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
- -
- -
-

xml_str

- -
-
-
-
Value:
-
-'''<root xmlns="myNS" xmlns:other="otherNS">
-  <c1 a1="A1" a2="A2" other:a3="A3">
-    <c2 a1="C2">0</c2>
-    <c2>1</c2>
-    <other:c2>2</other:c2>
-  </c1>
-</root>'''
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_classlookup-pysrc.html b/doc/html/api/lxml.tests.test_classlookup-pysrc.html deleted file mode 100644 index 77c64f09..00000000 --- a/doc/html/api/lxml.tests.test_classlookup-pysrc.html +++ /dev/null @@ -1,1292 +0,0 @@ - - - - - lxml.tests.test_classlookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_classlookup - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_classlookup

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Tests for different Element class lookup mechanisms. 
-  5  """ 
-  6   
-  7   
-  8  import unittest, os.path, sys, gc 
-  9   
- 10  this_dir = os.path.dirname(__file__) 
- 11  if this_dir not in sys.path: 
- 12      sys.path.insert(0, this_dir) # needed for Py3 
- 13   
- 14  from common_imports import etree, HelperTestCase, SillyFileLike, fileInTestDir 
- 15  from common_imports import canonicalize, _bytes, _str, BytesIO, StringIO 
- 16   
- 17  xml_str = _bytes('''\ 
- 18  <root xmlns="myNS" xmlns:other="otherNS"> 
- 19    <c1 a1="A1" a2="A2" other:a3="A3"> 
- 20      <c2 a1="C2">0</c2> 
- 21      <c2>1</c2> 
- 22      <other:c2>2</other:c2> 
- 23    </c1> 
- 24  </root>''') 
- 25   
- 26   
-
27 -class ProxyTestCase(HelperTestCase): -
28 """Basic tests for element proxy behaviour. - 29 """ - 30 etree = etree - 31 -
32 - def test_proxy_reuse(self): -
33 root = etree.XML('<a><b><c/></b></a>') - 34 b = root.find('b') - 35 self.assertTrue(b is root[0]) -
36 -
37 - def test_proxy_reuse_after_gc(self): -
38 root = etree.XML('<a><b><c/></b></a>') - 39 b = root.find('b') - 40 self.assertTrue(self.etree.iselement(b)) - 41 gc.collect() - 42 self.assertTrue(b is root[0]) -
43 -
45 root = etree.XML('<a><b><c/></b></a>') - 46 b = root.find('b') - 47 self.assertTrue(self.etree.iselement(b)) - 48 c = b.find('c') - 49 self.assertTrue(self.etree.iselement(c)) - 50 del root - 51 gc.collect() - 52 self.assertTrue(b[0] is c) -
53 -
54 - def test_proxy_hashing(self): -
55 root = etree.XML('<a><b><c/></b></a>') - 56 old_elements = set(root.iter()) - 57 elements = root.iter() - 58 del root - 59 gc.collect() - 60 - 61 missing = len(old_elements) - 62 self.assertEqual(3, missing) - 63 for new in elements: - 64 for old in old_elements: - 65 if old == new: - 66 self.assertTrue(old is new) - 67 missing -= 1 - 68 break - 69 else: - 70 self.assertTrue(False, "element '%s' is missing" % new.tag) - 71 self.assertEqual(0, missing) -
72 -
73 - def test_element_base(self): -
74 el = self.etree.ElementBase() - 75 self.assertEqual('ElementBase', el.tag) - 76 root = self.etree.ElementBase() - 77 root.append(el) - 78 self.assertEqual('ElementBase', root[0].tag) -
79 -
80 - def test_element_base_children(self): -
81 el = self.etree.ElementBase(etree.ElementBase()) - 82 self.assertEqual('ElementBase', el.tag) - 83 self.assertEqual(1, len(el)) - 84 self.assertEqual('ElementBase', el[0].tag) - 85 - 86 root = self.etree.ElementBase() - 87 root.append(el) - 88 self.assertEqual('ElementBase', root[0].tag) - 89 self.assertEqual('ElementBase', root[0][0].tag) -
90 -
91 - def test_comment_base(self): -
92 el = self.etree.CommentBase('some text') - 93 self.assertEqual(self.etree.Comment, el.tag) - 94 self.assertEqual('some text', el.text) - 95 root = self.etree.Element('root') - 96 root.append(el) - 97 self.assertEqual('some text', root[0].text) -
98 -
99 - def test_pi_base(self): -
100 el = self.etree.PIBase('the target', 'some text') -101 self.assertEqual(self.etree.ProcessingInstruction, el.tag) -102 self.assertEqual('some text', el.text) -103 root = self.etree.Element('root') -104 root.append(el) -105 self.assertEqual('some text', root[0].text) -
106 -107 -
108 -class ClassLookupTestCase(HelperTestCase): -
109 """Test cases for different Element class lookup mechanisms. -110 """ -111 etree = etree -112 -
113 - def tearDown(self): -
116 -
117 - def test_namespace_lookup(self): -
118 class TestElement(etree.ElementBase): -119 FIND_ME = "namespace class" -
120 -121 lookup = etree.ElementNamespaceClassLookup() -122 etree.set_element_class_lookup(lookup) -123 -124 ns = lookup.get_namespace("myNS") -125 ns[None] = TestElement -126 -127 root = etree.XML(xml_str) -128 self.assertEqual(root.FIND_ME, -129 TestElement.FIND_ME) -130 self.assertEqual(root[0].FIND_ME, -131 TestElement.FIND_ME) -132 self.assertFalse(hasattr(root[0][-1], 'FIND_ME')) -
133 -
134 - def test_default_class_lookup(self): -
135 class TestElement(etree.ElementBase): -136 FIND_ME = "default element" -
137 class TestComment(etree.CommentBase): -138 FIND_ME = "default comment" -139 class TestPI(etree.PIBase): -140 FIND_ME = "default pi" -141 -142 parser = etree.XMLParser() -143 -144 lookup = etree.ElementDefaultClassLookup( -145 element=TestElement, comment=TestComment, pi=TestPI) -146 parser.set_element_class_lookup(lookup) -147 -148 root = etree.XML(_bytes("""<?xml version='1.0'?> -149 <root> -150 <?myPI?> -151 <!-- hi --> -152 </root> -153 """), parser) -154 -155 self.assertEqual("default element", root.FIND_ME) -156 self.assertEqual("default pi", root[0].FIND_ME) -157 self.assertEqual("default comment", root[1].FIND_ME) -158 -
160 class TestElement(etree.ElementBase): -161 FIND_ME = "default element" -
162 class TestComment(etree.CommentBase): -163 FIND_ME = "default comment" -164 class TestPI(etree.PIBase): -165 FIND_ME = "default pi" -166 -167 parser = etree.XMLPullParser(events=('start', 'end', 'comment', 'pi')) -168 lookup = etree.ElementDefaultClassLookup( -169 element=TestElement, comment=TestComment, pi=TestPI) -170 parser.set_element_class_lookup(lookup) -171 -172 events_seen = [] -173 -174 def add_events(events): -175 for ev, el in events: -176 events_seen.append((ev, el.FIND_ME)) -177 -178 parser.feed("""<?xml version='1.0'?> -179 <root> -180 <?myPI?> -181 """) -182 add_events(parser.read_events()) -183 -184 parser.feed("<!-- hi -->") -185 add_events(parser.read_events()) -186 -187 parser.feed("</root>") -188 root = parser.close() -189 add_events(parser.read_events()) -190 -191 self.assertEqual([ -192 ('start', "default element"), -193 ('pi', "default pi"), -194 ('comment', "default comment"), -195 ('end', "default element"), -196 ], events_seen) -197 -198 self.assertEqual("default element", root.FIND_ME) -199 self.assertEqual("default pi", root[0].FIND_ME) -200 self.assertEqual("default comment", root[1].FIND_ME) -201 -
202 - def test_evil_class_lookup(self): -
203 class MyLookup(etree.CustomElementClassLookup): -204 def lookup(self, t, d, ns, name): -205 if name == 'none': -206 return None -207 elif name == 'obj': -208 return object() -209 else: -210 return etree.ElementBase -
211 -212 parser = etree.XMLParser() -213 parser.set_element_class_lookup(MyLookup()) -214 -215 root = etree.XML(_bytes('<none/>'), parser) -216 self.assertEqual('none', root.tag) -217 -218 self.assertRaises( -219 TypeError, -220 etree.XML, _bytes("<obj />"), parser) -221 -222 root = etree.XML(_bytes('<root/>'), parser) -223 self.assertEqual('root', root.tag) -224 -
226 class MyLookup(etree.CustomElementClassLookup): -227 def lookup(self, t, d, ns, name): -228 if t == 'element': -229 if name == 'root': -230 return etree.ElementBase -231 return etree.CommentBase -232 elif t == 'comment': -233 return etree.PIBase -234 elif t == 'PI': -235 return etree.EntityBase -236 elif t == 'entity': -237 return etree.ElementBase -238 else: -239 raise ValueError('got type %s' % t) -
240 -241 parser = etree.XMLParser(resolve_entities=False) -242 parser.set_element_class_lookup(MyLookup()) -243 -244 root = etree.XML(_bytes('<root></root>'), parser) -245 self.assertEqual('root', root.tag) -246 self.assertEqual(etree.ElementBase, type(root)) -247 -248 root = etree.XML(_bytes("<root><test/></root>"), parser) -249 self.assertRaises(TypeError, root.__getitem__, 0) -250 -251 root = etree.XML(_bytes("<root><!-- test --></root>"), parser) -252 self.assertRaises(TypeError, root.__getitem__, 0) -253 -254 root = etree.XML(_bytes("<root><?test?></root>"), parser) -255 self.assertRaises(TypeError, root.__getitem__, 0) -256 -257 root = etree.XML( -258 _bytes('<!DOCTYPE root [<!ENTITY myent "ent">]>' -259 '<root>&myent;</root>'), -260 parser) -261 self.assertRaises(TypeError, root.__getitem__, 0) -262 -263 root = etree.XML(_bytes('<root><root/></root>'), parser) -264 self.assertEqual('root', root[0].tag) -265 -
267 class TestElement(etree.ElementBase): -268 FIND_ME = "attribute_based" -
269 -270 class_dict = {"A1" : TestElement} -271 -272 lookup = etree.AttributeBasedElementClassLookup( -273 "a1", class_dict) -274 etree.set_element_class_lookup(lookup) -275 -276 root = etree.XML(xml_str) -277 self.assertFalse(hasattr(root, 'FIND_ME')) -278 self.assertEqual(root[0].FIND_ME, -279 TestElement.FIND_ME) -280 self.assertFalse(hasattr(root[0][0], 'FIND_ME')) -281 -
282 - def test_custom_lookup(self): -
283 class TestElement(etree.ElementBase): -284 FIND_ME = "custom" -
285 -286 class MyLookup(etree.CustomElementClassLookup): -287 def lookup(self, t, d, ns, name): -288 if name == 'c1': -289 return TestElement -290 -291 etree.set_element_class_lookup( MyLookup() ) -292 -293 root = etree.XML(xml_str) -294 self.assertFalse(hasattr(root, 'FIND_ME')) -295 self.assertEqual(root[0].FIND_ME, -296 TestElement.FIND_ME) -297 self.assertFalse(hasattr(root[0][1], 'FIND_ME')) -298 -
300 class TestElement1(etree.ElementBase): -301 FIND_ME = "custom" -
302 -303 class TestElement2(etree.ElementBase): -304 FIND_ME = "nsclasses" -305 -306 class MyLookup(etree.CustomElementClassLookup): -307 def lookup(self, t, d, ns, name): -308 if name == 'c1': -309 return TestElement1 -310 -311 lookup = etree.ElementNamespaceClassLookup( MyLookup() ) -312 etree.set_element_class_lookup(lookup) -313 -314 ns = lookup.get_namespace("otherNS") -315 ns[None] = TestElement2 -316 -317 root = etree.XML(xml_str) -318 self.assertFalse(hasattr(root, 'FIND_ME')) -319 self.assertEqual(root[0].FIND_ME, -320 TestElement1.FIND_ME) -321 self.assertFalse(hasattr(root[0][1], 'FIND_ME')) -322 self.assertEqual(root[0][-1].FIND_ME, -323 TestElement2.FIND_ME) -324 -
325 - def test_parser_based_lookup(self): -
326 class TestElement(etree.ElementBase): -327 FIND_ME = "parser_based" -
328 -329 lookup = etree.ParserBasedElementClassLookup() -330 etree.set_element_class_lookup(lookup) -331 -332 class MyLookup(etree.CustomElementClassLookup): -333 def lookup(self, t, d, ns, name): -334 return TestElement -335 -336 parser = etree.XMLParser() -337 parser.set_element_class_lookup( MyLookup() ) -338 -339 root = etree.parse(BytesIO(xml_str), parser).getroot() -340 self.assertEqual(root.FIND_ME, -341 TestElement.FIND_ME) -342 self.assertEqual(root[0].FIND_ME, -343 TestElement.FIND_ME) -344 -345 root = etree.parse(BytesIO(xml_str)).getroot() -346 self.assertFalse(hasattr(root, 'FIND_ME')) -347 self.assertFalse(hasattr(root[0], 'FIND_ME')) -348 -
349 - def test_class_lookup_reentry(self): -
350 XML = self.etree.XML -351 -352 class TestElement(etree.ElementBase): -353 FIND_ME = "here" -
354 -355 root = None -356 class MyLookup(etree.CustomElementClassLookup): -357 el = None -358 def lookup(self, t, d, ns, name): -359 if root is not None: # not in the parser -360 if self.el is None and name == "a": -361 self.el = [] -362 self.el.append(root.find(name)) -363 return TestElement -364 -365 parser = self.etree.XMLParser() -366 parser.set_element_class_lookup(MyLookup()) -367 -368 root = XML(_bytes('<root><a>A</a><b xmlns="test">B</b></root>'), -369 parser) -370 -371 a = root[0] -372 self.assertEqual(a.tag, "a") -373 self.assertEqual(root[0].tag, "a") -374 del a -375 self.assertEqual(root[0].tag, "a") -376 -
378 class Lookup(etree.CustomElementClassLookup): -379 def __init__(self): -380 # no super call here, so no fallback is set -381 pass -
382 -383 def lookup(self, node_type, document, namespace, name): -384 return Foo -385 -386 class Foo(etree.ElementBase): -387 def custom(self): -388 return "test" -389 -390 parser = self.etree.XMLParser() -391 parser.set_element_class_lookup( Lookup() ) -392 -393 root = etree.XML('<foo/>', parser) -394 -395 self.assertEqual("test", root.custom()) -396 -397 -
398 -def test_suite(): -
399 suite = unittest.TestSuite() -400 suite.addTests([unittest.makeSuite(ProxyTestCase)]) -401 suite.addTests([unittest.makeSuite(ClassLookupTestCase)]) -402 return suite -
403 -404 if __name__ == '__main__': -405 print('to test use test.py %s' % __file__) -406 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_classlookup.ClassLookupTestCase-class.html b/doc/html/api/lxml.tests.test_classlookup.ClassLookupTestCase-class.html deleted file mode 100644 index 9428357a..00000000 --- a/doc/html/api/lxml.tests.test_classlookup.ClassLookupTestCase-class.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - - lxml.tests.test_classlookup.ClassLookupTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_classlookup :: - Class ClassLookupTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ClassLookupTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ClassLookupTestCase
-
- -
-Test cases for different Element class lookup mechanisms. - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
- source code - -
- -
-   - - - - - - -
test_namespace_lookup(self) - source code - -
- -
-   - - - - - - -
test_default_class_lookup(self) - source code - -
- -
-   - - - - - - -
test_default_class_lookup_pull_parser(self) - source code - -
- -
-   - - - - - - -
test_evil_class_lookup(self) - source code - -
- -
-   - - - - - - -
test_class_lookup_type_mismatch(self) - source code - -
- -
-   - - - - - - -
test_attribute_based_lookup(self) - source code - -
- -
-   - - - - - - -
test_custom_lookup(self) - source code - -
- -
-   - - - - - - -
test_custom_lookup_ns_fallback(self) - source code - -
- -
-   - - - - - - -
test_parser_based_lookup(self) - source code - -
- -
-   - - - - - - -
test_class_lookup_reentry(self) - source code - -
- -
-   - - - - - - -
test_lookup_without_fallback(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

tearDown(self) -

-
source code  -
- - Hook method for deconstructing the test fixture after testing it. -
-
Overrides: - unittest.case.TestCase.tearDown -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_classlookup.ProxyTestCase-class.html b/doc/html/api/lxml.tests.test_classlookup.ProxyTestCase-class.html deleted file mode 100644 index 99ccb838..00000000 --- a/doc/html/api/lxml.tests.test_classlookup.ProxyTestCase-class.html +++ /dev/null @@ -1,517 +0,0 @@ - - - - - lxml.tests.test_classlookup.ProxyTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_classlookup :: - Class ProxyTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ProxyTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ProxyTestCase
-
- -
-Basic tests for element proxy behaviour. - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_proxy_reuse(self) - source code - -
- -
-   - - - - - - -
test_proxy_reuse_after_gc(self) - source code - -
- -
-   - - - - - - -
test_proxy_reuse_after_del_root(self) - source code - -
- -
-   - - - - - - -
test_proxy_hashing(self) - source code - -
- -
-   - - - - - - -
test_element_base(self) - source code - -
- -
-   - - - - - - -
test_element_base_children(self) - source code - -
- -
-   - - - - - - -
test_comment_base(self) - source code - -
- -
-   - - - - - - -
test_pi_base(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_css-module.html b/doc/html/api/lxml.tests.test_css-module.html deleted file mode 100644 index 54f855fe..00000000 --- a/doc/html/api/lxml.tests.test_css-module.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - lxml.tests.test_css - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_css - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_css

source code

- - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - CSSTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - HTML = '\n<div>\n <a href="foo">link</a>\n <a>anchor</a>\n</... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

HTML

- -
-
-
-
Value:
-
-'''
-<div>
-  <a href="foo">link</a>
-  <a>anchor</a>
-</div>
-'''
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_css-pysrc.html b/doc/html/api/lxml.tests.test_css-pysrc.html deleted file mode 100644 index 9ada2d47..00000000 --- a/doc/html/api/lxml.tests.test_css-pysrc.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - lxml.tests.test_css - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_css - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_css

-
- 1  import unittest 
- 2   
- 3  import lxml.html 
- 4   
- 5  from lxml.tests.common_imports import doctest, HelperTestCase, skipif 
- 6   
- 7  try: 
- 8      import cssselect 
- 9  except ImportError: 
-10      cssselect = None 
-11   
-12   
-13  HTML = ''' 
-14  <div> 
-15    <a href="foo">link</a> 
-16    <a>anchor</a> 
-17  </div> 
-18  ''' 
-19   
-20   
-
21 -class CSSTestCase(HelperTestCase): -
22 -23 pytestmark = skipif('cssselect is None') -24 -
25 - def test_cssselect(self): -
26 div, = lxml.html.fromstring(HTML).xpath('//div') -27 -28 def count(selector, expected_count, **kwargs): -29 result = div.cssselect(selector, **kwargs) -30 self.assertEqual(len(result), expected_count) -
31 -32 count('div', 1) -33 count('a', 2) -34 count('em', 0) -35 # Element names are case-insensitive in HTML -36 count('DIV', 1) -37 # ... but not in XHTML or XML -38 count('DIV', 0, translator='xhtml') -39 count('DIV', 0, translator='xml') -40 -41 # :contains() is case-insensitive in lxml -42 count(':contains("link")', 2) # div, a -43 count(':contains("LInk")', 2) -44 # Whatever the document language -45 count(':contains("LInk")', 2, translator='xhtml') -46 count(':contains("LInk")', 2, translator='xml') -47 # ... but not in upstream cssselect -48 import cssselect -49 count(':contains("link")', 2, translator=cssselect.HTMLTranslator()) -50 count(':contains("LInk")', 0, translator=cssselect.HTMLTranslator()) -
51 -52 -
53 -def test_suite(): -
54 suite = unittest.TestSuite() -55 try: -56 import cssselect -57 except ImportError: -58 # no 'cssselect' installed -59 print("Skipping tests in lxml.cssselect - external cssselect package is not installed") -60 return suite -61 -62 import lxml.cssselect -63 suite.addTests(doctest.DocTestSuite(lxml.cssselect)) -64 suite.addTests([unittest.makeSuite(CSSTestCase)]) -65 return suite -
66 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_css.CSSTestCase-class.html b/doc/html/api/lxml.tests.test_css.CSSTestCase-class.html deleted file mode 100644 index e3eb4d85..00000000 --- a/doc/html/api/lxml.tests.test_css.CSSTestCase-class.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - - lxml.tests.test_css.CSSTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_css :: - Class CSSTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class CSSTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               CSSTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_cssselect(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - pytestmark = <lxml.tests.common_imports.skipif object> -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_doctestcompare-module.html b/doc/html/api/lxml.tests.test_doctestcompare-module.html deleted file mode 100644 index 957d6047..00000000 --- a/doc/html/api/lxml.tests.test_doctestcompare-module.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - lxml.tests.test_doctestcompare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_doctestcompare - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_doctestcompare

source code

- - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - DummyInput -
-   - - DoctestCompareTest -
- - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
indent(elem, - level=0) - source code - -
- -
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __package__ = 'lxml.tests' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_doctestcompare-pysrc.html b/doc/html/api/lxml.tests.test_doctestcompare-pysrc.html deleted file mode 100644 index e47be87b..00000000 --- a/doc/html/api/lxml.tests.test_doctestcompare-pysrc.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - lxml.tests.test_doctestcompare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_doctestcompare - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_doctestcompare

-
-  1  import sys 
-  2  import unittest 
-  3   
-  4  from lxml import etree 
-  5  from lxml.tests.common_imports import HelperTestCase 
-  6  from lxml.doctestcompare import LXMLOutputChecker, PARSE_HTML, PARSE_XML 
-  7   
-  8   
-
9 -class DummyInput: -
10 - def __init__(self, **kw): -
11 for name, value in kw.items(): - 12 setattr(self, name, value) -
13 - 14 -
15 -def indent(elem, level=0): -
16 i = "\n" + level*" " - 17 if len(elem): - 18 if not elem.text or not elem.text.strip(): - 19 elem.text = i + " " - 20 if not elem.tail or not elem.tail.strip(): - 21 elem.tail = i - 22 for elem in elem: - 23 indent(elem, level+1) - 24 if not elem.tail or not elem.tail.strip(): - 25 elem.tail = i - 26 else: - 27 if level and (not elem.tail or not elem.tail.strip()): - 28 elem.tail = i -
29 - 30 -
31 -class DoctestCompareTest(HelperTestCase): -
32 _checker = LXMLOutputChecker() - 33 -
34 - def compare(self, want, got, html=False): -
35 if html: - 36 options = PARSE_HTML - 37 else: - 38 options = PARSE_XML - 39 - 40 parse = self._checker.get_parser(want, got, options) - 41 want_doc = parse(want) - 42 got_doc = parse(got) - 43 return self._checker.collect_diff( - 44 want_doc, got_doc, html, indent=0).lstrip() -
45 -
46 - def assert_diff(self, want, got, diff, html=False): -
47 self.assertEqual(self.compare(want, got, html), diff) -
48 -
49 - def assert_nodiff(self, want, got, html=False): -
50 root = etree.fromstring(want) - 51 root.tail = '\n' - 52 indent(root) - 53 diff = etree.tostring( - 54 root, encoding='unicode', method=html and 'html' or 'xml') - 55 self.assert_diff(want, got, diff, html=html) -
56 -
57 - def test_equal_input(self): -
58 self.assert_nodiff( - 59 '<p title="expected">Expected</p>', - 60 '<p title="expected">Expected</p>') -
61 -
62 - def test_differing_tags(self): -
63 self.assert_diff( - 64 '<p title="expected">Expected</p>', - 65 '<b title="expected">Expected</b>', - 66 '<p (got: b) title="expected">Expected</p (got: b)>\n') -
67 -
68 - def test_tags_upper_lower_case(self): -
69 self.assert_diff( - 70 '<p title="expected">Expected</p>', - 71 '<P title="expected">Expected</P>', - 72 '<p (got: P) title="expected">Expected</p (got: P)>\n') -
73 -
75 self.assert_nodiff( - 76 '<html><body><p title="expected">Expected</p></body></html>', - 77 '<HTML><BODY><P title="expected">Expected</P></BODY></HTML>', - 78 html=True) -
79 -
80 - def test_differing_attributes(self): -
81 self.assert_diff( - 82 '<p title="expected">Expected</p>', - 83 '<p title="actual">Actual</p>', - 84 '<p title="expected (got: actual)">Expected (got: Actual)</p>\n') -
85 -
86 - def test_extra_children(self): -
87 # https://bugs.launchpad.net/lxml/+bug/1238503 - 88 self.assert_diff( - 89 '<p><span>One</span></p>', - 90 '<p><span>One</span><b>Two</b><em>Three</em></p>', - 91 '<p>\n' - 92 ' <span>One</span>\n' - 93 ' +<b>Two</b>\n' - 94 ' +<em>Three</em>\n' - 95 '</p>\n') -
96 -
97 - def test_missing_children(self): -
98 self.assert_diff( - 99 '<p><span>One</span><b>Two</b><em>Three</em></p>', -100 '<p><span>One</span></p>', -101 '<p>\n' -102 ' <span>One</span>\n' -103 ' -<b>Two</b>\n' -104 ' -<em>Three</em>\n' -105 '</p>\n') -
106 -
107 - def test_extra_attributes(self): -
108 self.assert_diff( -109 '<p><span class="foo">Text</span></p>', -110 '<p><span class="foo" id="bar">Text</span></p>', -111 '<p>\n' -112 ' <span class="foo" +id="bar">Text</span>\n' -113 '</p>\n') -
114 -
115 - def test_missing_attributes(self): -
116 self.assert_diff( -117 '<p><span class="foo" id="bar">Text</span></p>', -118 '<p><span class="foo">Text</span></p>', -119 '<p>\n' -120 ' <span class="foo" -id="bar">Text</span>\n' -121 '</p>\n') -
122 -123 -
124 -def test_suite(): -
125 suite = unittest.TestSuite() -126 if sys.version_info >= (2,4): -127 suite.addTests([unittest.makeSuite(DoctestCompareTest)]) -128 return suite -
129 -130 -131 if __name__ == '__main__': -132 unittest.main() -133 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_doctestcompare.DoctestCompareTest-class.html b/doc/html/api/lxml.tests.test_doctestcompare.DoctestCompareTest-class.html deleted file mode 100644 index b4a7b819..00000000 --- a/doc/html/api/lxml.tests.test_doctestcompare.DoctestCompareTest-class.html +++ /dev/null @@ -1,554 +0,0 @@ - - - - - lxml.tests.test_doctestcompare.DoctestCompareTest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_doctestcompare :: - Class DoctestCompareTest - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DoctestCompareTest

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               DoctestCompareTest
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
compare(self, - want, - got, - html=False) - source code - -
- -
-   - - - - - - -
assert_diff(self, - want, - got, - diff, - html=False) - source code - -
- -
-   - - - - - - -
assert_nodiff(self, - want, - got, - html=False) - source code - -
- -
-   - - - - - - -
test_equal_input(self) - source code - -
- -
-   - - - - - - -
test_differing_tags(self) - source code - -
- -
-   - - - - - - -
test_tags_upper_lower_case(self) - source code - -
- -
-   - - - - - - -
test_tags_upper_lower_case_html(self) - source code - -
- -
-   - - - - - - -
test_differing_attributes(self) - source code - -
- -
-   - - - - - - -
test_extra_children(self) - source code - -
- -
-   - - - - - - -
test_missing_children(self) - source code - -
- -
-   - - - - - - -
test_extra_attributes(self) - source code - -
- -
-   - - - - - - -
test_missing_attributes(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - _checker = <lxml.doctestcompare.LXMLOutputChecker object> -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_doctestcompare.DummyInput-class.html b/doc/html/api/lxml.tests.test_doctestcompare.DummyInput-class.html deleted file mode 100644 index 335bd304..00000000 --- a/doc/html/api/lxml.tests.test_doctestcompare.DummyInput-class.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - lxml.tests.test_doctestcompare.DummyInput - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_doctestcompare :: - Class DummyInput - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class DummyInput

source code

- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - **kw) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_dtd-module.html b/doc/html/api/lxml.tests.test_dtd-module.html deleted file mode 100644 index 009fa217..00000000 --- a/doc/html/api/lxml.tests.test_dtd-module.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - - lxml.tests.test_dtd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_dtd - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_dtd

source code

-Test cases related to DTD parsing and validation - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ETreeDtdTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_dtd-pysrc.html b/doc/html/api/lxml.tests.test_dtd-pysrc.html deleted file mode 100644 index 9651e443..00000000 --- a/doc/html/api/lxml.tests.test_dtd-pysrc.html +++ /dev/null @@ -1,1258 +0,0 @@ - - - - - lxml.tests.test_dtd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_dtd - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_dtd

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Test cases related to DTD parsing and validation 
-  5  """ 
-  6   
-  7  import unittest, sys, os.path 
-  8   
-  9  this_dir = os.path.dirname(__file__) 
- 10  if this_dir not in sys.path: 
- 11      sys.path.insert(0, this_dir)  # needed for Py3 
- 12   
- 13  from common_imports import etree, html, BytesIO, _bytes, _str 
- 14  from common_imports import HelperTestCase, make_doctest, skipIf 
- 15  from common_imports import fileInTestDir, fileUrlInTestDir 
-
16 - 17 - 18 -class ETreeDtdTestCase(HelperTestCase): -
19 - def test_dtd(self): -
20 pass -
21 -
22 - def test_dtd_file(self): -
23 parse = etree.parse - 24 tree = parse(fileInTestDir("test.xml")) - 25 root = tree.getroot() - 26 - 27 dtd = etree.DTD(fileInTestDir("test.dtd")) - 28 self.assertTrue(dtd.validate(root)) -
29 -
30 - def test_dtd_stringio(self): -
31 root = etree.XML(_bytes("<b/>")) - 32 dtd = etree.DTD(BytesIO("<!ELEMENT b EMPTY>")) - 33 self.assertTrue(dtd.validate(root)) -
34 -
35 - def test_dtd_parse_invalid(self): -
36 fromstring = etree.fromstring - 37 parser = etree.XMLParser(dtd_validation=True) - 38 xml = _bytes('<!DOCTYPE b SYSTEM "%s"><b><a/></b>' % - 39 fileInTestDir("test.dtd")) - 40 self.assertRaises(etree.XMLSyntaxError, - 41 fromstring, xml, parser=parser) -
42 -
44 fromstring = etree.fromstring - 45 dtd_filename = fileUrlInTestDir("__nosuch.dtd") - 46 parser = etree.XMLParser(dtd_validation=True) - 47 xml = _bytes('<!DOCTYPE b SYSTEM "%s"><b><a/></b>' % dtd_filename) - 48 self.assertRaises(etree.XMLSyntaxError, - 49 fromstring, xml, parser=parser) - 50 errors = None - 51 try: - 52 fromstring(xml, parser=parser) - 53 except etree.XMLSyntaxError: - 54 e = sys.exc_info()[1] - 55 self.assertTrue(e.error_log) - 56 self.assertTrue(parser.error_log) - 57 errors = [entry.message for entry in e.error_log - 58 if dtd_filename in entry.message] - 59 self.assertTrue(errors) -
60 -
61 - def test_dtd_parse_valid(self): -
62 parser = etree.XMLParser(dtd_validation=True) - 63 xml = ('<!DOCTYPE a SYSTEM "%s"><a><b/></a>' % - 64 fileUrlInTestDir("test.dtd")) - 65 root = etree.fromstring(xml, parser=parser) -
66 -
68 parser = etree.XMLParser(dtd_validation=True) - 69 xml = ('<!DOCTYPE a SYSTEM "%s"><a><b/></a>' % - 70 fileUrlInTestDir("test.dtd")) - 71 root = etree.fromstring(xml, parser=parser) -
72 -
74 parser = etree.XMLParser(dtd_validation=True) - 75 xml = '<!DOCTYPE a SYSTEM "test.dtd"><a><b/></a>' - 76 root = etree.fromstring( - 77 xml, parser=parser, base_url=fileUrlInTestDir("test.xml")) -
78 -
80 parser = etree.XMLParser(dtd_validation=True) - 81 xml = '<!DOCTYPE a SYSTEM "test.dtd"><a><b/></a>' - 82 root = etree.fromstring( - 83 xml, parser=parser, base_url=fileUrlInTestDir("test.xml")) -
84 -
85 - def test_dtd_invalid(self): -
86 root = etree.XML("<b><a/></b>") - 87 dtd = etree.DTD(BytesIO("<!ELEMENT b EMPTY>")) - 88 self.assertRaises(etree.DocumentInvalid, dtd.assertValid, root) -
89 -
90 - def test_dtd_assertValid(self): -
91 root = etree.XML("<b><a/></b>") - 92 dtd = etree.DTD(BytesIO("<!ELEMENT b (a)><!ELEMENT a EMPTY>")) - 93 dtd.assertValid(root) -
94 -
95 - def test_dtd_internal(self): -
96 root = etree.XML(_bytes(''' - 97 <!DOCTYPE b SYSTEM "none" [ - 98 <!ELEMENT b (a)> - 99 <!ELEMENT a EMPTY> -100 ]> -101 <b><a/></b> -102 ''')) -103 dtd = etree.ElementTree(root).docinfo.internalDTD -104 self.assertTrue(dtd) -105 dtd.assertValid(root) -
106 -
107 - def test_dtd_internal_invalid(self): -
108 root = etree.XML(_bytes(''' -109 <!DOCTYPE b SYSTEM "none" [ -110 <!ELEMENT b (a)> -111 <!ELEMENT a (c)> -112 <!ELEMENT c EMPTY> -113 ]> -114 <b><a/></b> -115 ''')) -116 dtd = etree.ElementTree(root).docinfo.internalDTD -117 self.assertTrue(dtd) -118 self.assertFalse(dtd.validate(root)) -
119 -
121 root = etree.XML(_bytes(''' -122 <a><b id="id1"/><b id="id2"/><b id="id1"/></a> -123 ''')) -124 dtd = etree.DTD(BytesIO(_bytes(""" -125 <!ELEMENT a (b*)> -126 <!ATTLIST b -127 id ID #REQUIRED -128 > -129 <!ELEMENT b EMPTY> -130 """))) -131 self.assertFalse(dtd.validate(root)) -132 self.assertTrue(dtd.error_log) -133 self.assertTrue([error for error in dtd.error_log -134 if 'id1' in error.message]) -
135 -
136 - def test_dtd_api_internal(self): -
137 root = etree.XML(_bytes(''' -138 <!DOCTYPE b SYSTEM "none" [ -139 <!ATTLIST a -140 attr1 (x | y | z) "z" -141 attr2 CDATA #FIXED "X" -142 > -143 <!ELEMENT b (a)> -144 <!ELEMENT a EMPTY> -145 ]> -146 <b><a/></b> -147 ''')) -148 dtd = etree.ElementTree(root).docinfo.internalDTD -149 self.assertTrue(dtd) -150 dtd.assertValid(root) -151 -152 seen = [] -153 for el in dtd.iterelements(): -154 if el.name == 'a': -155 self.assertEqual(2, len(el.attributes())) -156 for attr in el.iterattributes(): -157 if attr.name == 'attr1': -158 self.assertEqual('enumeration', attr.type) -159 self.assertEqual('none', attr.default) -160 self.assertEqual('z', attr.default_value) -161 values = attr.values() -162 values.sort() -163 self.assertEqual(['x', 'y', 'z'], values) -164 else: -165 self.assertEqual('attr2', attr.name) -166 self.assertEqual('cdata', attr.type) -167 self.assertEqual('fixed', attr.default) -168 self.assertEqual('X', attr.default_value) -169 else: -170 self.assertEqual('b', el.name) -171 self.assertEqual(0, len(el.attributes())) -172 seen.append(el.name) -173 seen.sort() -174 self.assertEqual(['a', 'b'], seen) -175 self.assertEqual(2, len(dtd.elements())) -
176 -
177 - def test_internal_dtds(self): -
178 for el_count in range(2, 5): -179 for attr_count in range(4): -180 root = etree.XML(_bytes(''' -181 <!DOCTYPE el0 SYSTEM "none" [ -182 ''' + ''.join([''' -183 <!ATTLIST el%d -184 attr%d (x | y | z) "z" -185 > -186 ''' % (e, a) for a in range(attr_count) for e in range(el_count) -187 ]) + ''.join([''' -188 <!ELEMENT el%d EMPTY> -189 ''' % e for e in range(1, el_count) -190 ]) + ''' -191 ''' + '<!ELEMENT el0 (%s)>' % '|'.join([ -192 'el%d' % e for e in range(1, el_count)]) + ''' -193 ]> -194 <el0><el1 %s /></el0> -195 ''' % ' '.join(['attr%d="x"' % a for a in range(attr_count)]))) -196 dtd = etree.ElementTree(root).docinfo.internalDTD -197 self.assertTrue(dtd) -198 dtd.assertValid(root) -199 -200 e = -1 -201 for e, el in enumerate(dtd.iterelements()): -202 self.assertEqual(attr_count, len(el.attributes())) -203 a = -1 -204 for a, attr in enumerate(el.iterattributes()): -205 self.assertEqual('enumeration', attr.type) -206 self.assertEqual('none', attr.default) -207 self.assertEqual('z', attr.default_value) -208 values = sorted(attr.values()) -209 self.assertEqual(['x', 'y', 'z'], values) -210 self.assertEqual(attr_count - 1, a) -211 self.assertEqual(el_count - 1, e) -212 self.assertEqual(el_count, len(dtd.elements())) -
213 -
214 - def test_dtd_broken(self): -
215 self.assertRaises(etree.DTDParseError, etree.DTD, -216 BytesIO("<!ELEMENT b HONKEY>")) -
217 -
218 - def test_parse_file_dtd(self): -
219 parser = etree.XMLParser(attribute_defaults=True) -220 -221 tree = etree.parse(fileInTestDir('test.xml'), parser) -222 root = tree.getroot() -223 -224 self.assertEqual( -225 "valueA", -226 root.get("default")) -227 self.assertEqual( -228 "valueB", -229 root[0].get("default")) -
230 -231 @skipIf(etree.LIBXML_VERSION == (2, 9, 0), -232 "DTD loading is broken for incremental parsing in libxml2 2.9.0") -
234 iterparse = etree.iterparse -235 iterator = iterparse(fileInTestDir("test.xml"), events=('start',), -236 attribute_defaults=True) -237 attributes = [ element.get("default") -238 for event, element in iterator ] -239 self.assertEqual( -240 ["valueA", "valueB"], -241 attributes) -
242 -243 @skipIf(etree.LIBXML_VERSION == (2, 9, 0), -244 "DTD loading is broken for incremental parsing in libxml2 2.9.0") -
246 iterparse = etree.iterparse -247 iterator = iterparse(fileInTestDir("test.xml"), events=('end',), -248 attribute_defaults=True) -249 attributes = [ element.get("default") -250 for event, element in iterator ] -251 self.assertEqual( -252 ["valueB", "valueA"], -253 attributes) -
254 -
255 - def test_dtd_attrs(self): -
256 dtd = etree.DTD(fileUrlInTestDir("test.dtd")) -257 -258 # Test DTD.system_url attribute -259 self.assertTrue(dtd.system_url.endswith("test.dtd")) -260 -261 # Test elements and their attributes -262 a = dtd.elements()[0] -263 self.assertEqual(a.name, "a") -264 self.assertEqual(a.type, "element") -265 self.assertEqual(a.content.name, "b") -266 self.assertEqual(a.content.type, "element") -267 self.assertEqual(a.content.occur, "once") -268 -269 aattr = a.attributes()[0] -270 self.assertEqual(aattr.name, "default") -271 self.assertEqual(aattr.type, "enumeration") -272 self.assertEqual(aattr.values(), ["valueA", "valueB"]) -273 self.assertEqual(aattr.default_value, "valueA") -274 -275 b = dtd.elements()[1] -276 self.assertEqual(b.name, "b") -277 self.assertEqual(b.type, "empty") -278 self.assertEqual(b.content, None) -279 -280 # Test entities and their attributes -281 c = dtd.entities()[0] -282 self.assertEqual(c.name, "c") -283 self.assertEqual(c.orig, "&#42;") -284 self.assertEqual(c.content, "*") -285 -286 # Test DTD.name attribute -287 root = etree.XML(_bytes(''' -288 <!DOCTYPE a SYSTEM "none" [ -289 <!ELEMENT a EMPTY> -290 ]> -291 <a/> -292 ''')) -293 dtd = etree.ElementTree(root).docinfo.internalDTD -294 self.assertEqual(dtd.name, "a") -295 -296 # Test DTD.name and DTD.systemID attributes -297 parser = etree.XMLParser(dtd_validation=True) -298 xml = '<!DOCTYPE a SYSTEM "test.dtd"><a><b/></a>' -299 root = etree.fromstring(xml, parser=parser, -300 base_url=fileUrlInTestDir("test.xml")) -301 -302 dtd = root.getroottree().docinfo.internalDTD -303 self.assertEqual(dtd.name, "a") -304 self.assertEqual(dtd.system_url, "test.dtd") -
305 -
307 # Standard allows quotes in systemliteral, but in that case -308 # systemliteral must be escaped with single quotes. -309 # See http://www.w3.org/TR/REC-xml/#sec-prolog-dtd. -310 root = etree.XML('''<!DOCTYPE a PUBLIC 'foo' '"'><a/>''') -311 doc = root.getroottree() -312 self.assertEqual(doc.docinfo.doctype, -313 '''<!DOCTYPE a PUBLIC "foo" '"'>''') -314 self.assertEqual(etree.tostring(doc), -315 _bytes('''<!DOCTYPE a PUBLIC "foo" '"'>\n<a/>''')) -
316 -
318 root = etree.XML('''<!DOCTYPE a SYSTEM '"'><a/>''') -319 doc = root.getroottree() -320 self.assertEqual(doc.docinfo.doctype, '''<!DOCTYPE a SYSTEM '"'>''') -321 self.assertEqual(etree.tostring(doc), -322 _bytes('''<!DOCTYPE a SYSTEM '"'>\n<a/>''')) -
323 -
324 - def test_declaration_apos(self): -
325 root = etree.XML('''<!DOCTYPE a SYSTEM "'"><a/>''') -326 doc = root.getroottree() -327 self.assertEqual(doc.docinfo.doctype, '''<!DOCTYPE a SYSTEM "'">''') -328 self.assertEqual(etree.tostring(doc), -329 _bytes('''<!DOCTYPE a SYSTEM "'">\n<a/>''')) -
330 -
331 - def test_ietf_decl(self): -
332 html_data = ( -333 '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">\n' -334 '<html></html>') -335 root = etree.HTML(html_data) -336 doc = root.getroottree() -337 self.assertEqual(doc.docinfo.doctype, -338 '<!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN">') -339 self.assertEqual(etree.tostring(doc, method='html'), _bytes(html_data)) -
340 -
341 - def test_set_decl_public(self): -
342 doc = etree.Element('test').getroottree() -343 doc.docinfo.public_id = 'bar' -344 doc.docinfo.system_url = 'baz' -345 self.assertEqual(doc.docinfo.doctype, -346 '<!DOCTYPE test PUBLIC "bar" "baz">') -347 self.assertEqual(etree.tostring(doc), -348 _bytes('<!DOCTYPE test PUBLIC "bar" "baz">\n<test/>')) -
349 -
350 - def test_html_decl(self): -
351 # Slightly different to one above: when we create an html element, -352 # we do not start with a blank slate. -353 doc = html.Element('html').getroottree() -354 doc.docinfo.public_id = 'bar' -355 doc.docinfo.system_url = 'baz' -356 self.assertEqual(doc.docinfo.doctype, -357 '<!DOCTYPE html PUBLIC "bar" "baz">') -358 self.assertEqual(etree.tostring(doc), -359 _bytes('<!DOCTYPE html PUBLIC "bar" "baz">\n<html/>')) -
360 -
361 - def test_clean_doctype(self): -
362 doc = html.Element('html').getroottree() -363 self.assertTrue(doc.docinfo.doctype != '') -364 doc.docinfo.clear() -365 self.assertTrue(doc.docinfo.doctype == '') -
366 -
367 - def test_set_decl_system(self): -
368 doc = etree.Element('test').getroottree() -369 doc.docinfo.system_url = 'baz' -370 self.assertEqual(doc.docinfo.doctype, -371 '<!DOCTYPE test SYSTEM "baz">') -372 self.assertEqual(etree.tostring(doc), -373 _bytes('<!DOCTYPE test SYSTEM "baz">\n<test/>')) -
374 -
375 - def test_empty_decl(self): -
376 doc = etree.Element('test').getroottree() -377 doc.docinfo.public_id = None -378 self.assertEqual(doc.docinfo.doctype, -379 '<!DOCTYPE test>') -380 self.assertTrue(doc.docinfo.public_id is None) -381 self.assertTrue(doc.docinfo.system_url is None) -382 self.assertEqual(etree.tostring(doc), -383 _bytes('<!DOCTYPE test>\n<test/>')) -
384 -
385 - def test_invalid_decl_1(self): -
386 docinfo = etree.Element('test').getroottree().docinfo -387 -388 def set_public_id(value): -389 docinfo.public_id = value -
390 self.assertRaises(ValueError, set_public_id, _str('ä')) -391 self.assertRaises(ValueError, set_public_id, _str('qwerty ä asdf')) -
392 -
393 - def test_invalid_decl_2(self): -
394 docinfo = etree.Element('test').getroottree().docinfo -395 -396 def set_system_url(value): -397 docinfo.system_url = value -
398 self.assertRaises(ValueError, set_system_url, '\'"') -399 self.assertRaises(ValueError, set_system_url, '"\'') -400 self.assertRaises(ValueError, set_system_url, ' " \' ') -401 -
402 - def test_comment_before_dtd(self): -
403 data = '<!--comment--><!DOCTYPE test>\n<!-- --><test/>' -404 doc = etree.fromstring(data).getroottree() -405 self.assertEqual(etree.tostring(doc), -406 _bytes(data)) -
407 -
408 -409 -def test_suite(): -
410 suite = unittest.TestSuite() -411 suite.addTests([unittest.makeSuite(ETreeDtdTestCase)]) -412 suite.addTests( -413 [make_doctest('../../../doc/validation.txt')]) -414 return suite -
415 -416 if __name__ == '__main__': -417 print('to test use test.py %s' % __file__) -418 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_dtd.ETreeDtdTestCase-class.html b/doc/html/api/lxml.tests.test_dtd.ETreeDtdTestCase-class.html deleted file mode 100644 index 8560235a..00000000 --- a/doc/html/api/lxml.tests.test_dtd.ETreeDtdTestCase-class.html +++ /dev/null @@ -1,938 +0,0 @@ - - - - - lxml.tests.test_dtd.ETreeDtdTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_dtd :: - Class ETreeDtdTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeDtdTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeDtdTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_dtd(self) - source code - -
- -
-   - - - - - - -
test_dtd_file(self) - source code - -
- -
-   - - - - - - -
test_dtd_stringio(self) - source code - -
- -
-   - - - - - - -
test_dtd_parse_invalid(self) - source code - -
- -
-   - - - - - - -
test_dtd_parse_file_not_found(self) - source code - -
- -
-   - - - - - - -
test_dtd_parse_valid(self) - source code - -
- -
-   - - - - - - -
test_dtd_parse_valid_file_url(self) - source code - -
- -
-   - - - - - - -
test_dtd_parse_valid_relative(self) - source code - -
- -
-   - - - - - - -
test_dtd_parse_valid_relative_file_url(self) - source code - -
- -
-   - - - - - - -
test_dtd_invalid(self) - source code - -
- -
-   - - - - - - -
test_dtd_assertValid(self) - source code - -
- -
-   - - - - - - -
test_dtd_internal(self) - source code - -
- -
-   - - - - - - -
test_dtd_internal_invalid(self) - source code - -
- -
-   - - - - - - -
test_dtd_invalid_duplicate_id(self) - source code - -
- -
-   - - - - - - -
test_dtd_api_internal(self) - source code - -
- -
-   - - - - - - -
test_internal_dtds(self) - source code - -
- -
-   - - - - - - -
test_dtd_broken(self) - source code - -
- -
-   - - - - - - -
test_parse_file_dtd(self) - source code - -
- -
-   - - - - - - -
test_iterparse_file_dtd_start(self) - source code - -
- -
-   - - - - - - -
test_iterparse_file_dtd_end(self) - source code - -
- -
-   - - - - - - -
test_dtd_attrs(self) - source code - -
- -
-   - - - - - - -
test_declaration_escape_quote_pid(self) - source code - -
- -
-   - - - - - - -
test_declaration_quote_withoutpid(self) - source code - -
- -
-   - - - - - - -
test_declaration_apos(self) - source code - -
- -
-   - - - - - - -
test_ietf_decl(self) - source code - -
- -
-   - - - - - - -
test_set_decl_public(self) - source code - -
- -
-   - - - - - - -
test_html_decl(self) - source code - -
- -
-   - - - - - - -
test_clean_doctype(self) - source code - -
- -
-   - - - - - - -
test_set_decl_system(self) - source code - -
- -
-   - - - - - - -
test_empty_decl(self) - source code - -
- -
-   - - - - - - -
test_invalid_decl_1(self) - source code - -
- -
-   - - - - - - -
test_invalid_decl_2(self) - source code - -
- -
-   - - - - - - -
test_comment_before_dtd(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

test_iterparse_file_dtd_start(self) -

-
source code  -
- - -
-
Decorators:
-
    -
  • @skipIf(etree.LIBXML_VERSION== (2, 9, 0), "DTD loading is broken for incremental parsing in libxml2 2.9.0")
  • -
-
-
-
- -
- -
- - -
-

test_iterparse_file_dtd_end(self) -

-
source code  -
- - -
-
Decorators:
-
    -
  • @skipIf(etree.LIBXML_VERSION== (2, 9, 0), "DTD loading is broken for incremental parsing in libxml2 2.9.0")
  • -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementpath-module.html b/doc/html/api/lxml.tests.test_elementpath-module.html deleted file mode 100644 index ecd27e6f..00000000 --- a/doc/html/api/lxml.tests.test_elementpath-module.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - lxml.tests.test_elementpath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementpath - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_elementpath

source code

-Tests for the ElementPath implementation. - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - EtreeElementPathTestCase -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
summarize(elem) - source code - -
- -
-   - - - - - - -
summarize_list(seq) - source code - -
- -
-   - - - - - - -
normalize_crlf(tree) - source code - -
- -
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __package__ = 'lxml.tests' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementpath-pysrc.html b/doc/html/api/lxml.tests.test_elementpath-pysrc.html deleted file mode 100644 index 22d54b1f..00000000 --- a/doc/html/api/lxml.tests.test_elementpath-pysrc.html +++ /dev/null @@ -1,656 +0,0 @@ - - - - - lxml.tests.test_elementpath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementpath - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_elementpath

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Tests for the ElementPath implementation. 
-  5  """ 
-  6   
-  7  from __future__ import absolute_import 
-  8   
-  9  import unittest 
- 10  from copy import deepcopy 
- 11  from .common_imports import etree, HelperTestCase 
- 12   
- 13   
-
14 -def summarize(elem): -
15 return elem.tag -
16 -
17 -def summarize_list(seq): -
18 return list(map(summarize, seq)) -
19 -
20 -def normalize_crlf(tree): -
21 for elem in tree.getiterator(): - 22 if elem.text: elem.text = elem.text.replace("\r\n", "\n") - 23 if elem.tail: elem.tail = elem.tail.replace("\r\n", "\n") -
24 - 25 -
26 -class EtreeElementPathTestCase(HelperTestCase): -
27 etree = etree - 28 from lxml import _elementpath - 29 -
30 - def test_cache(self): -
31 self._elementpath._cache.clear() - 32 el = self.etree.XML(b'<a><b><c/><c/></b></a>') - 33 self.assertFalse(self._elementpath._cache) - 34 - 35 self.assertTrue(el.findall('b/c')) - 36 self.assertEqual(1, len(self._elementpath._cache)) - 37 self.assertTrue(el.findall('b/c')) - 38 self.assertEqual(1, len(self._elementpath._cache)) - 39 self.assertFalse(el.findall('xxx')) - 40 self.assertEqual(2, len(self._elementpath._cache)) - 41 self.assertFalse(el.findall('xxx')) - 42 self.assertEqual(2, len(self._elementpath._cache)) - 43 self.assertTrue(el.findall('b/c')) - 44 self.assertEqual(2, len(self._elementpath._cache)) -
45 -
46 - def _assert_tokens(self, tokens, path, namespaces=None): -
47 self.assertEqual(tokens, list(self._elementpath.xpath_tokenizer(path, namespaces))) -
48 -
49 - def test_tokenizer(self): -
50 assert_tokens = self._assert_tokens - 51 assert_tokens( - 52 [('/', '')], - 53 '/', - 54 ) - 55 assert_tokens( - 56 [('.', ''), ('/', ''), ('', 'a'), ('/', ''), ('', 'b'), ('/', ''), ('', 'c')], - 57 './a/b/c', - 58 ) - 59 assert_tokens( - 60 [('/', ''), ('', 'a'), ('/', ''), ('', 'b'), ('/', ''), ('', 'c')], - 61 '/a/b/c', - 62 ) - 63 assert_tokens( - 64 [('/', ''), ('', '{nsx}a'), ('/', ''), ('', '{nsy}b'), ('/', ''), ('', 'c')], - 65 '/x:a/y:b/c', - 66 {'x': 'nsx', 'y': 'nsy'}, - 67 ) - 68 assert_tokens( - 69 [('/', ''), ('', '{nsx}a'), ('/', ''), ('', '{nsy}b'), ('/', ''), ('', '{nsnone}c')], - 70 '/x:a/y:b/c', - 71 {'x': 'nsx', 'y': 'nsy', None: 'nsnone'}, - 72 ) -
73 -
74 - def test_tokenizer_predicates(self): -
75 assert_tokens = self._assert_tokens - 76 assert_tokens( - 77 [('', 'a'), ('[', ''), ('', 'b'), (']', '')], - 78 'a[b]', - 79 ) - 80 assert_tokens( - 81 [('', 'a'), ('[', ''), ('', 'b'), ('=', ''), ('"abc"', ''), (']', '')], - 82 'a[b="abc"]', - 83 ) - 84 assert_tokens( - 85 [('', 'a'), ('[', ''), ('.', ''), ('', ''), ('=', ''), ('', ''), ('"abc"', ''), (']', '')], - 86 'a[. = "abc"]', - 87 ) -
88 -
89 - def test_find(self): -
90 """ - 91 Test find methods (including xpath syntax). - 92 Originally copied from 'selftest.py'. - 93 """ - 94 elem = etree.XML(""" - 95 <body> - 96 <tag class='a'>text</tag> - 97 <tag class='b' /> - 98 <section> - 99 <tag class='b' id='inner'>subtext</tag> -100 </section> -101 </body> -102 """) -103 -104 self.assertEqual(elem.find("tag").tag, -105 'tag') -106 self.assertEqual(etree.ElementTree(elem).find("tag").tag, -107 'tag') -108 self.assertEqual(elem.find("section/tag").tag, -109 'tag') -110 self.assertEqual(etree.ElementTree(elem).find("section/tag").tag, -111 'tag') -112 -113 self.assertEqual(elem.findtext("tag"), -114 'text') -115 self.assertEqual(elem.findtext("tog"), -116 None) -117 self.assertEqual(elem.findtext("tog", "default"), -118 'default') -119 self.assertEqual(etree.ElementTree(elem).findtext("tag"), -120 'text') -121 self.assertEqual(elem.findtext("section/tag"), -122 'subtext') -123 self.assertEqual(etree.ElementTree(elem).findtext("section/tag"), -124 'subtext') -125 -126 self.assertEqual(summarize_list(elem.findall("tag")), -127 ['tag', 'tag']) -128 self.assertEqual(summarize_list(elem.findall("*")), -129 ['tag', 'tag', 'section']) -130 self.assertEqual(summarize_list(elem.findall(".//tag")), -131 ['tag', 'tag', 'tag']) -132 self.assertEqual(summarize_list(elem.findall("section/tag")), -133 ['tag']) -134 self.assertEqual(summarize_list(elem.findall("section//tag")), -135 ['tag']) -136 -137 self.assertEqual(summarize_list(elem.findall("section/*")), -138 ['tag']) -139 self.assertEqual(summarize_list(elem.findall("section//*")), -140 ['tag']) -141 self.assertEqual(summarize_list(elem.findall("section/.//*")), -142 ['tag']) -143 self.assertEqual(summarize_list(elem.findall("*/*")), -144 ['tag']) -145 self.assertEqual(summarize_list(elem.findall("*//*")), -146 ['tag']) -147 self.assertEqual(summarize_list(elem.findall("*/tag")), -148 ['tag']) -149 self.assertEqual(summarize_list(elem.findall("*/./tag")), -150 ['tag']) -151 self.assertEqual(summarize_list(elem.findall("./tag")), -152 ['tag', 'tag']) -153 self.assertEqual(summarize_list(elem.findall(".//tag")), -154 ['tag', 'tag', 'tag']) -155 self.assertEqual(summarize_list(elem.findall("././tag")), -156 ['tag', 'tag']) -157 -158 self.assertEqual(summarize_list(elem.findall(".//tag[@class]")), -159 ['tag', 'tag', 'tag']) -160 self.assertEqual(summarize_list(elem.findall(".//tag[ @class]")), -161 ['tag', 'tag', 'tag']) -162 self.assertEqual(summarize_list(elem.findall(".//tag[@class ]")), -163 ['tag', 'tag', 'tag']) -164 self.assertEqual(summarize_list(elem.findall(".//tag[ @class ]")), -165 ['tag', 'tag', 'tag']) -166 self.assertEqual(summarize_list(elem.findall(".//tag[@class='a']")), -167 ['tag']) -168 self.assertEqual(summarize_list(elem.findall('.//tag[@class="a"]')), -169 ['tag']) -170 self.assertEqual(summarize_list(elem.findall(".//tag[@class='b']")), -171 ['tag', 'tag']) -172 self.assertEqual(summarize_list(elem.findall('.//tag[@class="b"]')), -173 ['tag', 'tag']) -174 self.assertEqual(summarize_list(elem.findall('.//tag[@class = "b"]')), -175 ['tag', 'tag']) -176 self.assertEqual(summarize_list(elem.findall(".//tag[@id]")), -177 ['tag']) -178 self.assertEqual(summarize_list(elem.findall(".//tag[@class][@id]")), -179 ['tag']) -180 self.assertEqual(summarize_list(elem.findall(".//section[tag]")), -181 ['section']) -182 self.assertEqual(summarize_list(elem.findall(".//section[element]")), -183 []) -184 -185 self.assertEqual(summarize_list(elem.findall(".//section[tag='subtext']")), -186 ['section']) -187 self.assertEqual(summarize_list(elem.findall(".//section[tag ='subtext']")), -188 ['section']) -189 self.assertEqual(summarize_list(elem.findall(".//section[tag= 'subtext']")), -190 ['section']) -191 self.assertEqual(summarize_list(elem.findall(".//section[tag = 'subtext']")), -192 ['section']) -193 self.assertEqual(summarize_list(elem.findall(".//section[ tag = 'subtext' ]")), -194 ['section']) -195 self.assertEqual(summarize_list(elem.findall(".//tag[.='subtext']")), -196 ['tag']) -197 self.assertEqual(summarize_list(elem.findall(".//tag[. ='subtext']")), -198 ['tag']) -199 self.assertEqual(summarize_list(elem.findall('.//tag[.= "subtext"]')), -200 ['tag']) -201 self.assertEqual(summarize_list(elem.findall(".//tag[. = 'subtext']")), -202 ['tag']) -203 self.assertEqual(summarize_list(elem.findall(".//tag[. = 'subtext ']")), -204 []) -205 self.assertEqual(summarize_list(elem.findall(".//tag[.= ' subtext']")), -206 []) -207 -208 self.assertEqual(summarize_list(elem.findall("../tag")), -209 []) -210 self.assertEqual(summarize_list(elem.findall("section/../tag")), -211 ['tag', 'tag']) -212 self.assertEqual(summarize_list(etree.ElementTree(elem).findall("./tag")), -213 ['tag', 'tag']) -214 -215 # FIXME: ET's Path module handles this case incorrectly; this gives -216 # a warning in 1.3, and the behaviour will be modified in 1.4. -217 self.assertEqual(summarize_list(etree.ElementTree(elem).findall("/tag")), -218 ['tag', 'tag']) -219 -220 # duplicate section => 2x tag matches -221 elem[1] = deepcopy(elem[2]) -222 self.assertEqual(summarize_list(elem.findall(".//section[tag = 'subtext']")), -223 ['section', 'section']) -224 self.assertEqual(summarize_list(elem.findall(".//tag[. = 'subtext']")), -225 ['tag', 'tag']) -226 self.assertEqual(summarize_list(elem.findall(".//tag[@class][@id]")), -227 ['tag', 'tag']) -
228 -229 -230 #class ElementTreeElementPathTestCase(EtreeElementPathTestCase): -231 # import xml.etree.ElementTree as etree -232 # import xml.etree.ElementPath as _elementpath -233 -234 -
235 -def test_suite(): -
236 suite = unittest.TestSuite() -237 suite.addTests([unittest.makeSuite(EtreeElementPathTestCase)]) -238 #suite.addTests([unittest.makeSuite(ElementTreeElementPathTestCase)]) -239 return suite -
240 -241 -242 if __name__ == '__main__': -243 print('to test use test.py %s' % __file__) -244 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html b/doc/html/api/lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html deleted file mode 100644 index ac433c82..00000000 --- a/doc/html/api/lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html +++ /dev/null @@ -1,472 +0,0 @@ - - - - - lxml.tests.test_elementpath.EtreeElementPathTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementpath :: - Class EtreeElementPathTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class EtreeElementPathTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               EtreeElementPathTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_cache(self) - source code - -
- -
-   - - - - - - -
_assert_tokens(self, - tokens, - path, - namespaces=None) - source code - -
- -
-   - - - - - - -
test_tokenizer(self) - source code - -
- -
-   - - - - - - -
test_tokenizer_predicates(self) - source code - -
- -
-   - - - - - - -
test_find(self)
- Test find methods (including xpath syntax). -Originally copied from 'selftest.py'.
- source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementtree-module.html b/doc/html/api/lxml.tests.test_elementtree-module.html deleted file mode 100644 index 03d13a03..00000000 --- a/doc/html/api/lxml.tests.test_elementtree-module.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - lxml.tests.test_elementtree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementtree - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_elementtree

source code

-

Tests for the ElementTree API

-

Only test cases that apply equally well to etree and ElementTree -belong here. Note that there is a second test module called test_io.py -for IO related test cases.

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - _ETreeTestCaseBase -
-   - - _XMLPullParserTest -
-   - - ETreeTestCase -
-   - - ETreePullTestCase -
-   - - ElementTreeTestCase -
-   - - CElementTreeTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - cElementTree = None
- hash(x) -
-   - - ElementTreePullTestCase = None
- hash(x) -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementtree-pysrc.html b/doc/html/api/lxml.tests.test_elementtree-pysrc.html deleted file mode 100644 index 38229e54..00000000 --- a/doc/html/api/lxml.tests.test_elementtree-pysrc.html +++ /dev/null @@ -1,11817 +0,0 @@ - - - - - lxml.tests.test_elementtree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementtree - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_elementtree

-
-   1  # -*- coding: utf-8 -*- 
-   2   
-   3  """ 
-   4  Tests for the ElementTree API 
-   5   
-   6  Only test cases that apply equally well to etree and ElementTree 
-   7  belong here. Note that there is a second test module called test_io.py 
-   8  for IO related test cases. 
-   9  """ 
-  10   
-  11  import unittest 
-  12  import os, re, tempfile, copy, operator, sys 
-  13   
-  14  this_dir = os.path.dirname(__file__) 
-  15  if this_dir not in sys.path: 
-  16      sys.path.insert(0, this_dir) # needed for Py3 
-  17   
-  18  from common_imports import BytesIO, etree 
-  19  from common_imports import ElementTree, cElementTree, ET_VERSION, CET_VERSION 
-  20  from common_imports import filter_by_version, fileInTestDir, canonicalize, HelperTestCase 
-  21  from common_imports import _str, _bytes, unicode, next 
-  22   
-  23  if cElementTree is not None and (CET_VERSION <= (1,0,7) or sys.version_info >= (3,3)): 
-  24      cElementTree = None 
-  25   
-  26  if ElementTree is not None: 
-  27      print("Comparing with ElementTree %s" % getattr(ElementTree, "VERSION", "?")) 
-  28   
-  29  if cElementTree is not None: 
-  30      print("Comparing with cElementTree %s" % getattr(cElementTree, "VERSION", "?")) 
-
31 - 32 -class _ETreeTestCaseBase(HelperTestCase): -
33 etree = None - 34 required_versions_ET = {} - 35 required_versions_cET = {} - 36 -
37 - def XMLParser(self, **kwargs): -
38 try: - 39 XMLParser = self.etree.XMLParser - 40 except AttributeError: - 41 assert 'ElementTree' in self.etree.__name__ - 42 XMLParser = self.etree.TreeBuilder - 43 return XMLParser(**kwargs) -
44 -
45 - def test_element(self): -
46 for i in range(10): - 47 e = self.etree.Element('foo') - 48 self.assertEqual(e.tag, 'foo') - 49 self.assertEqual(e.text, None) - 50 self.assertEqual(e.tail, None) -
51 -
52 - def test_simple(self): -
53 Element = self.etree.Element - 54 - 55 root = Element('root') - 56 root.append(Element('one')) - 57 root.append(Element('two')) - 58 root.append(Element('three')) - 59 self.assertEqual(3, len(root)) - 60 self.assertEqual('one', root[0].tag) - 61 self.assertEqual('two', root[1].tag) - 62 self.assertEqual('three', root[2].tag) - 63 self.assertRaises(IndexError, operator.getitem, root, 3) -
64 - 65 # test weird dictionary interaction leading to segfault previously -
67 root = self.etree.Element('root') - 68 self.assertEqual(root.tag, "root") - 69 add = self.etree.ElementTree(file=BytesIO('<foo>Foo</foo>')) - 70 self.assertEqual(add.getroot().tag, "foo") - 71 self.assertEqual(add.getroot().text, "Foo") - 72 root.append(self.etree.Element('baz')) - 73 self.assertEqual(root.tag, "root") - 74 self.assertEqual(root[0].tag, "baz") -
75 -
76 - def test_subelement(self): -
77 Element = self.etree.Element - 78 SubElement = self.etree.SubElement - 79 - 80 root = Element('root') - 81 SubElement(root, 'one') - 82 SubElement(root, 'two') - 83 SubElement(root, 'three') - 84 self.assertEqual(3, len(root)) - 85 self.assertEqual('one', root[0].tag) - 86 self.assertEqual('two', root[1].tag) - 87 self.assertEqual('three', root[2].tag) -
88 -
89 - def test_element_contains(self): -
90 Element = self.etree.Element - 91 SubElement = self.etree.SubElement - 92 - 93 root1 = Element('root') - 94 SubElement(root1, 'one') - 95 self.assertTrue(root1[0] in root1) - 96 - 97 root2 = Element('root') - 98 SubElement(root2, 'two') - 99 SubElement(root2, 'three') - 100 self.assertTrue(root2[0] in root2) - 101 self.assertTrue(root2[1] in root2) - 102 - 103 self.assertFalse(root1[0] in root2) - 104 self.assertFalse(root2[0] in root1) - 105 self.assertFalse(None in root2) -
106 -
108 ElementTree = self.etree.ElementTree - 109 - 110 f = BytesIO('<doc>Test<one>One</one></doc>') - 111 doc = ElementTree(file=f) - 112 root = doc.getroot() - 113 self.assertEqual(1, len(root)) - 114 self.assertEqual('one', root[0].tag) - 115 self.assertRaises(IndexError, operator.getitem, root, 1) -
116 -
118 ElementTree = self.etree.ElementTree - 119 - 120 f = BytesIO('<doc><one>One</one><two>Two</two>hm<three>Three</three></doc>') - 121 doc = ElementTree(file=f) - 122 root = doc.getroot() - 123 self.assertEqual(3, len(root)) - 124 self.assertEqual('one', root[0].tag) - 125 self.assertEqual('two', root[1].tag) - 126 self.assertEqual('three', root[2].tag) -
127 -
129 ElementTree = self.etree.ElementTree - 130 - 131 f = BytesIO('<doc>Test</doc>') - 132 doc = ElementTree(file=f) - 133 root = doc.getroot() - 134 self.assertEqual(0, len(root)) -
135 -
137 Element = self.etree.Element - 138 SubElement = self.etree.SubElement - 139 a = Element('a') - 140 b = SubElement(a, 'b') - 141 c = SubElement(a, 'c') - 142 d = SubElement(a, 'd') - 143 self.assertEqual(d, a[-1]) - 144 self.assertEqual(c, a[-2]) - 145 self.assertEqual(b, a[-3]) - 146 self.assertRaises(IndexError, operator.getitem, a, -4) - 147 a[-1] = e = Element('e') - 148 self.assertEqual(e, a[-1]) - 149 del a[-1] - 150 self.assertEqual(2, len(a)) -
151 -
152 - def test_elementtree(self): -
153 ElementTree = self.etree.ElementTree - 154 - 155 f = BytesIO('<doc><one>One</one><two>Two</two></doc>') - 156 doc = ElementTree(file=f) - 157 root = doc.getroot() - 158 self.assertEqual(2, len(root)) - 159 self.assertEqual('one', root[0].tag) - 160 self.assertEqual('two', root[1].tag) -
161 -
162 - def test_text(self): -
163 ElementTree = self.etree.ElementTree - 164 - 165 f = BytesIO('<doc>This is a text</doc>') - 166 doc = ElementTree(file=f) - 167 root = doc.getroot() - 168 self.assertEqual('This is a text', root.text) -
169 -
170 - def test_text_empty(self): -
171 ElementTree = self.etree.ElementTree - 172 - 173 f = BytesIO('<doc></doc>') - 174 doc = ElementTree(file=f) - 175 root = doc.getroot() - 176 self.assertEqual(None, root.text) -
177 -
178 - def test_text_other(self): -
179 ElementTree = self.etree.ElementTree - 180 - 181 f = BytesIO('<doc><one>One</one></doc>') - 182 doc = ElementTree(file=f) - 183 root = doc.getroot() - 184 self.assertEqual(None, root.text) - 185 self.assertEqual('One', root[0].text) -
186 -
187 - def test_text_escape_in(self): -
188 ElementTree = self.etree.ElementTree - 189 - 190 f = BytesIO('<doc>This is &gt; than a text</doc>') - 191 doc = ElementTree(file=f) - 192 root = doc.getroot() - 193 self.assertEqual('This is > than a text', root.text) -
194 -
195 - def test_text_escape_out(self): -
196 Element = self.etree.Element - 197 - 198 a = Element("a") - 199 a.text = "<>&" - 200 self.assertXML(_bytes('<a>&lt;&gt;&amp;</a>'), - 201 a) -
202 -
203 - def test_text_escape_tostring(self): -
204 tostring = self.etree.tostring - 205 Element = self.etree.Element - 206 - 207 a = Element("a") - 208 a.text = "<>&" - 209 self.assertEqual(_bytes('<a>&lt;&gt;&amp;</a>'), - 210 tostring(a)) -
211 -
212 - def test_text_str_subclass(self): -
213 Element = self.etree.Element - 214 - 215 class strTest(str): - 216 pass -
217 - 218 a = Element("a") - 219 a.text = strTest("text") - 220 self.assertXML(_bytes('<a>text</a>'), - 221 a) -
222 -
223 - def test_tail(self): -
224 ElementTree = self.etree.ElementTree - 225 - 226 f = BytesIO('<doc>This is <i>mixed</i> content.</doc>') - 227 doc = ElementTree(file=f) - 228 root = doc.getroot() - 229 self.assertEqual(1, len(root)) - 230 self.assertEqual('This is ', root.text) - 231 self.assertEqual(None, root.tail) - 232 self.assertEqual('mixed', root[0].text) - 233 self.assertEqual(' content.', root[0].tail) -
234 -
235 - def test_tail_str_subclass(self): -
236 Element = self.etree.Element - 237 SubElement = self.etree.SubElement - 238 - 239 class strTest(str): - 240 pass -
241 - 242 a = Element("a") - 243 SubElement(a, "t").tail = strTest("tail") - 244 self.assertXML(_bytes('<a><t></t>tail</a>'), - 245 a) - 246 -
247 - def _test_del_tail(self): -
248 # this is discouraged for ET compat, should not be tested... - 249 XML = self.etree.XML - 250 - 251 root = XML(_bytes('<doc>This is <i>mixed</i> content.</doc>')) - 252 self.assertEqual(1, len(root)) - 253 self.assertEqual('This is ', root.text) - 254 self.assertEqual(None, root.tail) - 255 self.assertEqual('mixed', root[0].text) - 256 self.assertEqual(' content.', root[0].tail) - 257 - 258 del root[0].tail - 259 - 260 self.assertEqual(1, len(root)) - 261 self.assertEqual('This is ', root.text) - 262 self.assertEqual(None, root.tail) - 263 self.assertEqual('mixed', root[0].text) - 264 self.assertEqual(None, root[0].tail) - 265 - 266 root[0].tail = "TAIL" - 267 - 268 self.assertEqual(1, len(root)) - 269 self.assertEqual('This is ', root.text) - 270 self.assertEqual(None, root.tail) - 271 self.assertEqual('mixed', root[0].text) - 272 self.assertEqual('TAIL', root[0].tail) -
273 -
274 - def test_ElementTree(self): -
275 Element = self.etree.Element - 276 ElementTree = self.etree.ElementTree - 277 - 278 el = Element('hoi') - 279 doc = ElementTree(el) - 280 root = doc.getroot() - 281 self.assertEqual(None, root.text) - 282 self.assertEqual('hoi', root.tag) -
283 -
284 - def test_attrib(self): -
285 ElementTree = self.etree.ElementTree - 286 - 287 f = BytesIO('<doc one="One" two="Two"/>') - 288 doc = ElementTree(file=f) - 289 root = doc.getroot() - 290 self.assertEqual('One', root.attrib['one']) - 291 self.assertEqual('Two', root.attrib['two']) - 292 self.assertRaises(KeyError, operator.getitem, root.attrib, 'three') -
293 -
294 - def test_attrib_get(self): -
295 ElementTree = self.etree.ElementTree - 296 - 297 f = BytesIO('<doc one="One" two="Two"/>') - 298 doc = ElementTree(file=f) - 299 root = doc.getroot() - 300 self.assertEqual('One', root.attrib.get('one')) - 301 self.assertEqual('Two', root.attrib.get('two')) - 302 self.assertEqual(None, root.attrib.get('three')) - 303 self.assertEqual('foo', root.attrib.get('three', 'foo')) -
304 -
305 - def test_attrib_dict(self): -
306 ElementTree = self.etree.ElementTree - 307 - 308 f = BytesIO('<doc one="One" two="Two"/>') - 309 doc = ElementTree(file=f) - 310 root = doc.getroot() - 311 attrib = dict(root.attrib) - 312 self.assertEqual('One', attrib['one']) - 313 self.assertEqual('Two', attrib['two']) - 314 self.assertRaises(KeyError, operator.getitem, attrib, 'three') -
315 -
316 - def test_attrib_copy(self): -
317 ElementTree = self.etree.ElementTree - 318 - 319 f = BytesIO('<doc one="One" two="Two"/>') - 320 doc = ElementTree(file=f) - 321 root = doc.getroot() - 322 attrib = copy.copy(root.attrib) - 323 self.assertEqual('One', attrib['one']) - 324 self.assertEqual('Two', attrib['two']) - 325 self.assertRaises(KeyError, operator.getitem, attrib, 'three') -
326 -
327 - def test_attrib_deepcopy(self): -
328 ElementTree = self.etree.ElementTree - 329 - 330 f = BytesIO('<doc one="One" two="Two"/>') - 331 doc = ElementTree(file=f) - 332 root = doc.getroot() - 333 attrib = copy.deepcopy(root.attrib) - 334 self.assertEqual('One', attrib['one']) - 335 self.assertEqual('Two', attrib['two']) - 336 self.assertRaises(KeyError, operator.getitem, attrib, 'three') -
337 -
338 - def test_attributes_get(self): -
339 ElementTree = self.etree.ElementTree - 340 - 341 f = BytesIO('<doc one="One" two="Two"/>') - 342 doc = ElementTree(file=f) - 343 root = doc.getroot() - 344 self.assertEqual('One', root.get('one')) - 345 self.assertEqual('Two', root.get('two')) - 346 self.assertEqual(None, root.get('three')) - 347 self.assertEqual('foo', root.get('three', 'foo')) -
348 -
349 - def test_attrib_clear(self): -
350 XML = self.etree.XML - 351 - 352 root = XML(_bytes('<doc one="One" two="Two"/>')) - 353 self.assertEqual('One', root.get('one')) - 354 self.assertEqual('Two', root.get('two')) - 355 root.attrib.clear() - 356 self.assertEqual(None, root.get('one')) - 357 self.assertEqual(None, root.get('two')) -
358 -
359 - def test_attrib_set_clear(self): -
360 Element = self.etree.Element - 361 - 362 root = Element("root", one="One") - 363 root.set("two", "Two") - 364 self.assertEqual('One', root.get('one')) - 365 self.assertEqual('Two', root.get('two')) - 366 root.attrib.clear() - 367 self.assertEqual(None, root.get('one')) - 368 self.assertEqual(None, root.get('two')) -
369 -
370 - def test_attrib_ns_clear(self): -
371 Element = self.etree.Element - 372 SubElement = self.etree.SubElement - 373 - 374 attribNS = '{http://foo/bar}x' - 375 - 376 parent = Element('parent') - 377 parent.set(attribNS, 'a') - 378 child = SubElement(parent, 'child') - 379 child.set(attribNS, 'b') - 380 - 381 self.assertEqual('a', parent.get(attribNS)) - 382 self.assertEqual('b', child.get(attribNS)) - 383 - 384 parent.clear() - 385 self.assertEqual(None, parent.get(attribNS)) - 386 self.assertEqual('b', child.get(attribNS)) -
387 -
388 - def test_attrib_pop(self): -
389 ElementTree = self.etree.ElementTree - 390 - 391 f = BytesIO('<doc one="One" two="Two"/>') - 392 doc = ElementTree(file=f) - 393 root = doc.getroot() - 394 self.assertEqual('One', root.attrib['one']) - 395 self.assertEqual('Two', root.attrib['two']) - 396 - 397 self.assertEqual('One', root.attrib.pop('one')) - 398 - 399 self.assertEqual(None, root.attrib.get('one')) - 400 self.assertEqual('Two', root.attrib['two']) -
401 -
402 - def test_attrib_pop_unknown(self): -
403 root = self.etree.XML(_bytes('<doc one="One" two="Two"/>')) - 404 self.assertRaises(KeyError, root.attrib.pop, 'NONE') - 405 - 406 self.assertEqual('One', root.attrib['one']) - 407 self.assertEqual('Two', root.attrib['two']) -
408 -
409 - def test_attrib_pop_default(self): -
410 root = self.etree.XML(_bytes('<doc one="One" two="Two"/>')) - 411 self.assertEqual('Three', root.attrib.pop('three', 'Three')) -
412 -
414 root = self.etree.XML(_bytes('<doc/>')) - 415 self.assertEqual('Three', root.attrib.pop('three', 'Three')) -
416 -
418 root = self.etree.XML(_bytes('<doc one="One" two="Two"/>')) - 419 self.assertRaises(TypeError, root.attrib.pop, 'One', None, None) -
420 -
421 - def test_attribute_update_dict(self): -
422 XML = self.etree.XML - 423 - 424 root = XML(_bytes('<doc alpha="Alpha" beta="Beta"/>')) - 425 items = list(root.attrib.items()) - 426 items.sort() - 427 self.assertEqual( - 428 [('alpha', 'Alpha'), ('beta', 'Beta')], - 429 items) - 430 - 431 root.attrib.update({'alpha' : 'test', 'gamma' : 'Gamma'}) - 432 - 433 items = list(root.attrib.items()) - 434 items.sort() - 435 self.assertEqual( - 436 [('alpha', 'test'), ('beta', 'Beta'), ('gamma', 'Gamma')], - 437 items) -
438 -
440 XML = self.etree.XML - 441 - 442 root = XML(_bytes('<doc alpha="Alpha" beta="Beta"/>')) - 443 items = list(root.attrib.items()) - 444 items.sort() - 445 self.assertEqual( - 446 [('alpha', 'Alpha'), ('beta', 'Beta')], - 447 items) - 448 - 449 root.attrib.update({'alpha' : 'test', 'gamma' : 'Gamma'}.items()) - 450 - 451 items = list(root.attrib.items()) - 452 items.sort() - 453 self.assertEqual( - 454 [('alpha', 'test'), ('beta', 'Beta'), ('gamma', 'Gamma')], - 455 items) -
456 -
457 - def test_attribute_update_iter(self): -
458 XML = self.etree.XML - 459 - 460 root = XML(_bytes('<doc alpha="Alpha" beta="Beta"/>')) - 461 items = list(root.attrib.items()) - 462 items.sort() - 463 self.assertEqual( - 464 [('alpha', 'Alpha'), ('beta', 'Beta')], - 465 items) - 466 - 467 root.attrib.update(iter({'alpha' : 'test', 'gamma' : 'Gamma'}.items())) - 468 - 469 items = list(root.attrib.items()) - 470 items.sort() - 471 self.assertEqual( - 472 [('alpha', 'test'), ('beta', 'Beta'), ('gamma', 'Gamma')], - 473 items) -
474 -
476 XML = self.etree.XML - 477 - 478 root = XML(_bytes('<doc alpha="Alpha" beta="Beta"/>')) - 479 items = list(root.attrib.items()) - 480 items.sort() - 481 self.assertEqual( - 482 [('alpha', 'Alpha'), ('beta', 'Beta')], - 483 items) - 484 - 485 other = XML(_bytes('<doc alpha="test" gamma="Gamma"/>')) - 486 root.attrib.update(other.attrib) - 487 - 488 items = list(root.attrib.items()) - 489 items.sort() - 490 self.assertEqual( - 491 [('alpha', 'test'), ('beta', 'Beta'), ('gamma', 'Gamma')], - 492 items) -
493 -
494 - def test_attribute_keys(self): -
495 XML = self.etree.XML - 496 - 497 root = XML(_bytes('<doc alpha="Alpha" beta="Beta" gamma="Gamma"/>')) - 498 keys = list(root.attrib.keys()) - 499 keys.sort() - 500 self.assertEqual(['alpha', 'beta', 'gamma'], keys) -
501 -
502 - def test_attribute_keys2(self): -
503 XML = self.etree.XML - 504 - 505 root = XML(_bytes('<doc alpha="Alpha" beta="Beta" gamma="Gamma"/>')) - 506 keys = list(root.keys()) - 507 keys.sort() - 508 self.assertEqual(['alpha', 'beta', 'gamma'], keys) -
509 -
510 - def test_attribute_items2(self): -
511 XML = self.etree.XML - 512 - 513 root = XML(_bytes('<doc alpha="Alpha" beta="Beta" gamma="Gamma"/>')) - 514 items = list(root.items()) - 515 items.sort() - 516 self.assertEqual( - 517 [('alpha','Alpha'), ('beta','Beta'), ('gamma','Gamma')], - 518 items) -
519 -
520 - def test_attribute_keys_ns(self): -
521 XML = self.etree.XML - 522 - 523 root = XML(_bytes('<foo bar="Bar" xmlns:ns="http://ns.codespeak.net/test" ns:baz="Baz" />')) - 524 keys = list(root.keys()) - 525 keys.sort() - 526 self.assertEqual(['bar', '{http://ns.codespeak.net/test}baz'], - 527 keys) -
528 -
529 - def test_attribute_values(self): -
530 XML = self.etree.XML - 531 - 532 root = XML(_bytes('<doc alpha="Alpha" beta="Beta" gamma="Gamma"/>')) - 533 values = list(root.attrib.values()) - 534 values.sort() - 535 self.assertEqual(['Alpha', 'Beta', 'Gamma'], values) -
536 -
537 - def test_attribute_values_ns(self): -
538 XML = self.etree.XML - 539 - 540 root = XML(_bytes('<foo bar="Bar" xmlns:ns="http://ns.codespeak.net/test" ns:baz="Baz" />')) - 541 values = list(root.attrib.values()) - 542 values.sort() - 543 self.assertEqual( - 544 ['Bar', 'Baz'], values) -
545 -
546 - def test_attribute_items(self): -
547 XML = self.etree.XML - 548 - 549 root = XML(_bytes('<doc alpha="Alpha" beta="Beta" gamma="Gamma"/>')) - 550 items = list(root.attrib.items()) - 551 items.sort() - 552 self.assertEqual([ - 553 ('alpha', 'Alpha'), - 554 ('beta', 'Beta'), - 555 ('gamma', 'Gamma'), - 556 ], - 557 items) -
558 -
559 - def test_attribute_items_ns(self): -
560 XML = self.etree.XML - 561 - 562 root = XML(_bytes('<foo bar="Bar" xmlns:ns="http://ns.codespeak.net/test" ns:baz="Baz" />')) - 563 items = list(root.attrib.items()) - 564 items.sort() - 565 self.assertEqual( - 566 [('bar', 'Bar'), ('{http://ns.codespeak.net/test}baz', 'Baz')], - 567 items) -
568 -
569 - def test_attribute_str(self): -
570 XML = self.etree.XML - 571 - 572 expected = "{'{http://ns.codespeak.net/test}baz': 'Baz', 'bar': 'Bar'}" - 573 alternative = "{'bar': 'Bar', '{http://ns.codespeak.net/test}baz': 'Baz'}" - 574 - 575 root = XML(_bytes('<foo bar="Bar" xmlns:ns="http://ns.codespeak.net/test" ns:baz="Baz" />')) - 576 try: - 577 self.assertEqual(expected, str(root.attrib)) - 578 except AssertionError: - 579 self.assertEqual(alternative, str(root.attrib)) -
580 -
581 - def test_attribute_contains(self): -
582 XML = self.etree.XML - 583 - 584 root = XML(_bytes('<foo bar="Bar" xmlns:ns="http://ns.codespeak.net/test" ns:baz="Baz" />')) - 585 self.assertEqual( - 586 True, 'bar' in root.attrib) - 587 self.assertEqual( - 588 False, 'baz' in root.attrib) - 589 self.assertEqual( - 590 False, 'hah' in root.attrib) - 591 self.assertEqual( - 592 True, - 593 '{http://ns.codespeak.net/test}baz' in root.attrib) -
594 -
595 - def test_attribute_set(self): -
596 Element = self.etree.Element - 597 - 598 root = Element("root") - 599 root.set("attr", "TEST") - 600 self.assertEqual("TEST", root.get("attr")) -
601 -
602 - def test_attrib_as_attrib(self): -
603 Element = self.etree.Element - 604 - 605 root = Element("root") - 606 root.set("attr", "TEST") - 607 self.assertEqual("TEST", root.attrib["attr"]) - 608 - 609 root2 = Element("root2", root.attrib) - 610 self.assertEqual("TEST", root2.attrib["attr"]) -
611 -
612 - def test_attribute_iterator(self): -
613 XML = self.etree.XML - 614 - 615 root = XML(_bytes('<doc alpha="Alpha" beta="Beta" gamma="Gamma" />')) - 616 result = [] - 617 for key in root.attrib: - 618 result.append(key) - 619 result.sort() - 620 self.assertEqual(['alpha', 'beta', 'gamma'], result) -
621 -
622 - def test_attribute_manipulation(self): -
623 Element = self.etree.Element - 624 - 625 a = Element('a') - 626 a.attrib['foo'] = 'Foo' - 627 a.attrib['bar'] = 'Bar' - 628 self.assertEqual('Foo', a.attrib['foo']) - 629 del a.attrib['foo'] - 630 self.assertRaises(KeyError, operator.getitem, a.attrib, 'foo') -
631 -
632 - def test_del_attribute_ns(self): -
633 Element = self.etree.Element - 634 - 635 a = Element('a') - 636 a.attrib['{http://a/}foo'] = 'Foo' - 637 a.attrib['{http://a/}bar'] = 'Bar' - 638 self.assertEqual(None, a.get('foo')) - 639 self.assertEqual('Foo', a.get('{http://a/}foo')) - 640 self.assertEqual('Foo', a.attrib['{http://a/}foo']) - 641 - 642 self.assertRaises(KeyError, operator.delitem, a.attrib, 'foo') - 643 self.assertEqual('Foo', a.attrib['{http://a/}foo']) - 644 - 645 del a.attrib['{http://a/}foo'] - 646 self.assertRaises(KeyError, operator.getitem, a.attrib, 'foo') -
647 -
649 XML = self.etree.XML - 650 - 651 a = XML(_bytes('<a xmlns:nsa="http://a/" nsa:foo="FooNS" foo="Foo" />')) - 652 - 653 self.assertEqual('Foo', a.attrib['foo']) - 654 self.assertEqual('FooNS', a.attrib['{http://a/}foo']) - 655 - 656 del a.attrib['foo'] - 657 self.assertEqual('FooNS', a.attrib['{http://a/}foo']) - 658 self.assertRaises(KeyError, operator.getitem, a.attrib, 'foo') - 659 self.assertRaises(KeyError, operator.delitem, a.attrib, 'foo') - 660 - 661 del a.attrib['{http://a/}foo'] - 662 self.assertRaises(KeyError, operator.getitem, a.attrib, '{http://a/}foo') - 663 self.assertRaises(KeyError, operator.getitem, a.attrib, 'foo') - 664 - 665 a = XML(_bytes('<a xmlns:nsa="http://a/" foo="Foo" nsa:foo="FooNS" />')) - 666 - 667 self.assertEqual('Foo', a.attrib['foo']) - 668 self.assertEqual('FooNS', a.attrib['{http://a/}foo']) - 669 - 670 del a.attrib['foo'] - 671 self.assertEqual('FooNS', a.attrib['{http://a/}foo']) - 672 self.assertRaises(KeyError, operator.getitem, a.attrib, 'foo') - 673 - 674 del a.attrib['{http://a/}foo'] - 675 self.assertRaises(KeyError, operator.getitem, a.attrib, '{http://a/}foo') - 676 self.assertRaises(KeyError, operator.getitem, a.attrib, 'foo') -
677 -
678 - def test_XML(self): -
679 XML = self.etree.XML - 680 - 681 root = XML(_bytes('<doc>This is a text.</doc>')) - 682 self.assertEqual(0, len(root)) - 683 self.assertEqual('This is a text.', root.text) -
684 -
685 - def test_XMLID(self): -
686 XMLID = self.etree.XMLID - 687 XML = self.etree.XML - 688 xml_text = _bytes(''' - 689 <document> - 690 <h1 id="chapter1">...</h1> - 691 <p id="note1" class="note">...</p> - 692 <p>Regular paragraph.</p> - 693 <p xml:id="xmlid">XML:ID paragraph.</p> - 694 <p id="warn1" class="warning">...</p> - 695 </document> - 696 ''') - 697 - 698 root, dic = XMLID(xml_text) - 699 root2 = XML(xml_text) - 700 self.assertEqual(self._writeElement(root), - 701 self._writeElement(root2)) - 702 expected = { - 703 "chapter1" : root[0], - 704 "note1" : root[1], - 705 "warn1" : root[4] - 706 } - 707 self.assertEqual(dic, expected) -
708 -
709 - def test_fromstring(self): -
710 fromstring = self.etree.fromstring - 711 - 712 root = fromstring('<doc>This is a text.</doc>') - 713 self.assertEqual(0, len(root)) - 714 self.assertEqual('This is a text.', root.text) -
715 - 716 required_versions_ET['test_fromstringlist'] = (1,3) -
717 - def test_fromstringlist(self): -
718 fromstringlist = self.etree.fromstringlist - 719 - 720 root = fromstringlist(["<do", "c>T", "hi", "s is", - 721 " a text.<", "/doc", ">"]) - 722 self.assertEqual(0, len(root)) - 723 self.assertEqual('This is a text.', root.text) -
724 - 725 required_versions_ET['test_fromstringlist_characters'] = (1,3) -
727 fromstringlist = self.etree.fromstringlist - 728 - 729 root = fromstringlist(list('<doc>This is a text.</doc>')) - 730 self.assertEqual(0, len(root)) - 731 self.assertEqual('This is a text.', root.text) -
732 - 733 required_versions_ET['test_fromstringlist_single'] = (1,3) -
734 - def test_fromstringlist_single(self): -
735 fromstringlist = self.etree.fromstringlist - 736 - 737 root = fromstringlist(['<doc>This is a text.</doc>']) - 738 self.assertEqual(0, len(root)) - 739 self.assertEqual('This is a text.', root.text) -
740 -
741 - def test_iselement(self): -
742 iselement = self.etree.iselement - 743 Element = self.etree.Element - 744 ElementTree = self.etree.ElementTree - 745 XML = self.etree.XML - 746 Comment = self.etree.Comment - 747 ProcessingInstruction = self.etree.ProcessingInstruction - 748 - 749 el = Element('hoi') - 750 self.assertTrue(iselement(el)) - 751 - 752 el2 = XML(_bytes('<foo/>')) - 753 self.assertTrue(iselement(el2)) - 754 - 755 tree = ElementTree(element=Element('dag')) - 756 self.assertTrue(not iselement(tree)) - 757 self.assertTrue(iselement(tree.getroot())) - 758 - 759 c = Comment('test') - 760 self.assertTrue(iselement(c)) - 761 - 762 p = ProcessingInstruction("test", "some text") - 763 self.assertTrue(iselement(p)) -
764 -
765 - def test_iteration(self): -
766 XML = self.etree.XML - 767 - 768 root = XML(_bytes('<doc><one/><two>Two</two>Hm<three/></doc>')) - 769 result = [] - 770 for el in root: - 771 result.append(el.tag) - 772 self.assertEqual(['one', 'two', 'three'], result) -
773 -
774 - def test_iteration_empty(self): -
775 XML = self.etree.XML - 776 - 777 root = XML(_bytes('<doc></doc>')) - 778 result = [] - 779 for el in root: - 780 result.append(el.tag) - 781 self.assertEqual([], result) -
782 -
783 - def test_iteration_text_only(self): -
784 XML = self.etree.XML - 785 - 786 root = XML(_bytes('<doc>Text</doc>')) - 787 result = [] - 788 for el in root: - 789 result.append(el.tag) - 790 self.assertEqual([], result) -
791 -
792 - def test_iteration_crash(self): -
793 # this would cause a crash in the past - 794 fromstring = self.etree.fromstring - 795 root = etree.fromstring('<html><p></p>x</html>') - 796 for elem in root: - 797 elem.tail = '' -
798 -
799 - def test_iteration_reversed(self): -
800 XML = self.etree.XML - 801 root = XML(_bytes('<doc><one/><two>Two</two>Hm<three/></doc>')) - 802 result = [] - 803 for el in reversed(root): - 804 result.append(el.tag) - 805 self.assertEqual(['three', 'two', 'one'], result) -
806 -
807 - def test_iteration_subelement(self): -
808 XML = self.etree.XML - 809 - 810 root = XML(_bytes('<doc><one/><two>Two</two>Hm<three/></doc>')) - 811 result = [] - 812 add = True - 813 for el in root: - 814 result.append(el.tag) - 815 if add: - 816 self.etree.SubElement(root, 'four') - 817 add = False - 818 self.assertEqual(['one', 'two', 'three', 'four'], result) -
819 -
820 - def test_iteration_del_child(self): -
821 XML = self.etree.XML - 822 - 823 root = XML(_bytes('<doc><one/><two>Two</two>Hm<three/></doc>')) - 824 result = [] - 825 for el in root: - 826 result.append(el.tag) - 827 del root[-1] - 828 self.assertEqual(['one', 'two'], result) -
829 -
830 - def test_iteration_double(self): -
831 XML = self.etree.XML - 832 - 833 root = XML(_bytes('<doc><one/><two/></doc>')) - 834 result = [] - 835 for el0 in root: - 836 result.append(el0.tag) - 837 for el1 in root: - 838 result.append(el1.tag) - 839 self.assertEqual(['one','one', 'two', 'two', 'one', 'two'], result) -
840 - 841 required_versions_ET['test_itertext'] = (1,3) -
842 - def test_itertext(self): -
843 # ET 1.3+ - 844 XML = self.etree.XML - 845 root = XML(_bytes("<root>RTEXT<a></a>ATAIL<b/><c>CTEXT</c>CTAIL</root>")) - 846 - 847 text = list(root.itertext()) - 848 self.assertEqual(["RTEXT", "ATAIL", "CTEXT", "CTAIL"], - 849 text) -
850 - 851 required_versions_ET['test_itertext_child'] = (1,3) -
852 - def test_itertext_child(self): -
853 # ET 1.3+ - 854 XML = self.etree.XML - 855 root = XML(_bytes("<root>RTEXT<a></a>ATAIL<b/><c>CTEXT</c>CTAIL</root>")) - 856 - 857 text = list(root[2].itertext()) - 858 self.assertEqual(["CTEXT"], - 859 text) -
860 -
861 - def test_findall(self): -
862 XML = self.etree.XML - 863 root = XML(_bytes('<a><b><c/></b><b/><c><b/></c></a>')) - 864 self.assertEqual(len(list(root.findall("c"))), 1) - 865 self.assertEqual(len(list(root.findall(".//c"))), 2) - 866 self.assertEqual(len(list(root.findall(".//b"))), 3) - 867 self.assertEqual(len(list(root.findall(".//b"))[0]), 1) - 868 self.assertEqual(len(list(root.findall(".//b"))[1]), 0) - 869 self.assertEqual(len(list(root.findall(".//b"))[2]), 0) -
870 -
871 - def test_findall_ns(self): -
872 XML = self.etree.XML - 873 root = XML(_bytes('<a xmlns:x="X" xmlns:y="Y"><x:b><c/></x:b><b/><c><x:b/><b/></c><b/></a>')) - 874 self.assertEqual(len(list(root.findall(".//{X}b"))), 2) - 875 self.assertEqual(len(list(root.findall(".//b"))), 3) - 876 self.assertEqual(len(list(root.findall("b"))), 2) -
877 -
879 Element = self.etree.Element - 880 - 881 el = Element('tag', foo='Foo', bar='Bar') - 882 self.assertEqual('Foo', el.attrib['foo']) - 883 self.assertEqual('Bar', el.attrib['bar']) -
884 -
886 Element = self.etree.Element - 887 - 888 el = Element('tag', {'foo': 'Foo', 'bar': 'Bar'}) - 889 self.assertEqual('Foo', el.attrib['foo']) - 890 self.assertEqual('Bar', el.attrib['bar']) -
891 -
893 Element = self.etree.Element - 894 - 895 el = Element('tag', {'foo': 'Foo', 'bar': 'Bar'}, baz='Baz') - 896 self.assertEqual('Foo', el.attrib['foo']) - 897 self.assertEqual('Bar', el.attrib['bar']) - 898 self.assertEqual('Baz', el.attrib['baz']) -
899 -
901 Element = self.etree.Element - 902 - 903 el = Element('tag', {'foo': 'Foo', 'bar': 'Bar'}, bar='Baz') - 904 self.assertEqual('Foo', el.attrib['foo']) - 905 self.assertEqual('Baz', el.attrib['bar']) -
906 -
908 Element = self.etree.Element - 909 - 910 el = Element('tag', {'{ns1}foo':'Foo', '{ns2}bar':'Bar'}) - 911 self.assertEqual('Foo', el.attrib['{ns1}foo']) - 912 self.assertEqual('Bar', el.attrib['{ns2}bar']) -
913 -
915 Element = self.etree.Element - 916 SubElement = self.etree.SubElement - 917 - 918 el = Element('tag') - 919 SubElement(el, 'foo', {'foo':'Foo'}, baz="Baz") - 920 self.assertEqual("Baz", el[0].attrib['baz']) - 921 self.assertEqual('Foo', el[0].attrib['foo']) -
922 -
924 Element = self.etree.Element - 925 SubElement = self.etree.SubElement - 926 - 927 el = Element('tag') - 928 SubElement(el, 'foo', {'{ns1}foo':'Foo', '{ns2}bar':'Bar'}) - 929 self.assertEqual('Foo', el[0].attrib['{ns1}foo']) - 930 self.assertEqual('Bar', el[0].attrib['{ns2}bar']) -
931 -
932 - def test_write(self): -
933 ElementTree = self.etree.ElementTree - 934 XML = self.etree.XML - 935 - 936 for i in range(10): - 937 f = BytesIO() - 938 root = XML(_bytes('<doc%s>This is a test.</doc%s>' % (i, i))) - 939 tree = ElementTree(element=root) - 940 tree.write(f) - 941 data = f.getvalue() - 942 self.assertEqual( - 943 _bytes('<doc%s>This is a test.</doc%s>' % (i, i)), - 944 canonicalize(data)) -
945 - 946 required_versions_ET['test_write_method_html'] = (1,3) -
947 - def test_write_method_html(self): -
948 ElementTree = self.etree.ElementTree - 949 Element = self.etree.Element - 950 SubElement = self.etree.SubElement - 951 - 952 html = Element('html') - 953 body = SubElement(html, 'body') - 954 p = SubElement(body, 'p') - 955 p.text = "html" - 956 SubElement(p, 'br').tail = "test" - 957 - 958 tree = ElementTree(element=html) - 959 f = BytesIO() - 960 tree.write(f, method="html") - 961 data = f.getvalue().replace(_bytes('\n'),_bytes('')) - 962 - 963 self.assertEqual(_bytes('<html><body><p>html<br>test</p></body></html>'), - 964 data) -
965 - 966 required_versions_ET['test_write_method_text'] = (1,3) -
967 - def test_write_method_text(self): -
968 ElementTree = self.etree.ElementTree - 969 Element = self.etree.Element - 970 SubElement = self.etree.SubElement - 971 - 972 a = Element('a') - 973 a.text = "A" - 974 a.tail = "tail" - 975 b = SubElement(a, 'b') - 976 b.text = "B" - 977 b.tail = "TAIL" - 978 c = SubElement(a, 'c') - 979 c.text = "C" - 980 - 981 tree = ElementTree(element=a) - 982 f = BytesIO() - 983 tree.write(f, method="text") - 984 data = f.getvalue() - 985 - 986 self.assertEqual(_bytes('ABTAILCtail'), - 987 data) -
988 -
989 - def test_write_fail(self): -
990 ElementTree = self.etree.ElementTree - 991 XML = self.etree.XML - 992 - 993 tree = ElementTree( XML(_bytes('<doc>This is a test.</doc>')) ) - 994 self.assertRaises(IOError, tree.write, - 995 "definitely////\\-\\nonexisting\\-\\////FILE") -
996 - 997 # this could trigger a crash, apparently because the document - 998 # reference was prematurely garbage collected -
999 - def test_crash(self): -
1000 Element = self.etree.Element -1001 -1002 element = Element('tag') -1003 for i in range(10): -1004 element.attrib['key'] = 'value' -1005 value = element.attrib['key'] -1006 self.assertEqual(value, 'value') -
1007 -1008 # from doctest; for some reason this caused crashes too -
1010 Element = self.etree.Element -1011 ElementTree = self.etree.ElementTree -1012 -1013 f = BytesIO() -1014 for i in range(10): -1015 element = Element('tag%s' % i) -1016 self._check_element(element) -1017 tree = ElementTree(element) -1018 tree.write(f) -1019 self._check_element_tree(tree) -
1020 -
1021 - def test_subelement_reference(self): -
1022 Element = self.etree.Element -1023 SubElement = self.etree.SubElement -1024 -1025 el = Element('foo') -1026 el2 = SubElement(el, 'bar') -1027 el3 = SubElement(el2, 'baz') -1028 -1029 al = Element('foo2') -1030 al2 = SubElement(al, 'bar2') -1031 al3 = SubElement(al2, 'baz2') -1032 -1033 # now move al2 into el -1034 el.append(al2) -1035 -1036 # now change al3 directly -1037 al3.text = 'baz2-modified' -1038 -1039 # it should have changed through this route too -1040 self.assertEqual( -1041 'baz2-modified', -1042 el[1][0].text) -
1043 -
1044 - def test_set_text(self): -
1045 Element = self.etree.Element -1046 SubElement = self.etree.SubElement -1047 -1048 a = Element('a') -1049 b = SubElement(a, 'b') -1050 a.text = 'hoi' -1051 self.assertEqual( -1052 'hoi', -1053 a.text) -1054 self.assertEqual( -1055 'b', -1056 a[0].tag) -
1057 -
1058 - def test_set_text2(self): -
1059 Element = self.etree.Element -1060 SubElement = self.etree.SubElement -1061 -1062 a = Element('a') -1063 a.text = 'hoi' -1064 b = SubElement(a ,'b') -1065 self.assertEqual( -1066 'hoi', -1067 a.text) -1068 self.assertEqual( -1069 'b', -1070 a[0].tag) -
1071 -
1072 - def test_set_text_none(self): -
1073 Element = self.etree.Element -1074 -1075 a = Element('a') -1076 -1077 a.text = 'foo' -1078 a.text = None -1079 -1080 self.assertEqual( -1081 None, -1082 a.text) -1083 self.assertXML(_bytes('<a></a>'), a) -
1084 -
1085 - def test_set_text_empty(self): -
1086 Element = self.etree.Element -1087 -1088 a = Element('a') -1089 self.assertEqual(None, a.text) -1090 -1091 a.text = '' -1092 self.assertEqual('', a.text) -1093 self.assertXML(_bytes('<a></a>'), a) -
1094 -
1095 - def test_tail1(self): -
1096 Element = self.etree.Element -1097 SubElement = self.etree.SubElement -1098 -1099 a = Element('a') -1100 a.tail = 'dag' -1101 self.assertEqual('dag', -1102 a.tail) -1103 b = SubElement(a, 'b') -1104 b.tail = 'hoi' -1105 self.assertEqual('hoi', -1106 b.tail) -1107 self.assertEqual('dag', -1108 a.tail) -
1109 -
1110 - def test_tail_append(self): -
1111 Element = self.etree.Element -1112 -1113 a = Element('a') -1114 b = Element('b') -1115 b.tail = 'b_tail' -1116 a.append(b) -1117 self.assertEqual('b_tail', -1118 b.tail) -
1119 -
1120 - def test_tail_set_twice(self): -
1121 Element = self.etree.Element -1122 SubElement = self.etree.SubElement -1123 -1124 a = Element('a') -1125 b = SubElement(a, 'b') -1126 b.tail = 'foo' -1127 b.tail = 'bar' -1128 self.assertEqual('bar', -1129 b.tail) -1130 self.assertXML(_bytes('<a><b></b>bar</a>'), a) -
1131 -
1132 - def test_tail_set_none(self): -
1133 Element = self.etree.Element -1134 a = Element('a') -1135 a.tail = 'foo' -1136 a.tail = None -1137 self.assertEqual( -1138 None, -1139 a.tail) -1140 self.assertXML(_bytes('<a></a>'), a) -
1141 -1142 required_versions_ET['test_extend'] = (1,3) -
1143 - def test_extend(self): -
1144 root = self.etree.Element('foo') -1145 for i in range(3): -1146 element = self.etree.SubElement(root, 'a%s' % i) -1147 element.text = "text%d" % i -1148 element.tail = "tail%d" % i -1149 -1150 elements = [] -1151 for i in range(3): -1152 new_element = self.etree.Element("test%s" % i) -1153 new_element.text = "TEXT%s" % i -1154 new_element.tail = "TAIL%s" % i -1155 elements.append(new_element) -1156 -1157 root.extend(elements) -1158 -1159 self.assertEqual( -1160 ["a0", "a1", "a2", "test0", "test1", "test2"], -1161 [ el.tag for el in root ]) -1162 self.assertEqual( -1163 ["text0", "text1", "text2", "TEXT0", "TEXT1", "TEXT2"], -1164 [ el.text for el in root ]) -1165 self.assertEqual( -1166 ["tail0", "tail1", "tail2", "TAIL0", "TAIL1", "TAIL2"], -1167 [ el.tail for el in root ]) -
1168 -
1169 - def test_comment(self): -
1170 Element = self.etree.Element -1171 SubElement = self.etree.SubElement -1172 Comment = self.etree.Comment -1173 -1174 a = Element('a') -1175 a.append(Comment('foo')) -1176 self.assertEqual(a[0].tag, Comment) -1177 self.assertEqual(a[0].text, 'foo') -
1178 -1179 # ElementTree < 1.3 adds whitespace around comments -1180 required_versions_ET['test_comment_text'] = (1,3) -
1181 - def test_comment_text(self): -
1182 Element = self.etree.Element -1183 SubElement = self.etree.SubElement -1184 Comment = self.etree.Comment -1185 tostring = self.etree.tostring -1186 -1187 a = Element('a') -1188 a.append(Comment('foo')) -1189 self.assertEqual(a[0].text, 'foo') -1190 -1191 self.assertEqual( -1192 _bytes('<a><!--foo--></a>'), -1193 tostring(a)) -1194 -1195 a[0].text = "TEST" -1196 self.assertEqual(a[0].text, 'TEST') -1197 -1198 self.assertEqual( -1199 _bytes('<a><!--TEST--></a>'), -1200 tostring(a)) -
1201 -1202 # ElementTree < 1.3 adds whitespace around comments -1203 required_versions_ET['test_comment_whitespace'] = (1,3) -
1204 - def test_comment_whitespace(self): -
1205 Element = self.etree.Element -1206 SubElement = self.etree.SubElement -1207 Comment = self.etree.Comment -1208 tostring = self.etree.tostring -1209 -1210 a = Element('a') -1211 a.append(Comment(' foo ')) -1212 self.assertEqual(a[0].text, ' foo ') -1213 self.assertEqual( -1214 _bytes('<a><!-- foo --></a>'), -1215 tostring(a)) -
1216 -
1217 - def test_comment_nonsense(self): -
1218 Comment = self.etree.Comment -1219 c = Comment('foo') -1220 self.assertEqual({}, c.attrib) -1221 self.assertEqual([], list(c.keys())) -1222 self.assertEqual([], list(c.items())) -1223 self.assertEqual(None, c.get('hoi')) -1224 self.assertEqual(0, len(c)) -1225 # should not iterate -1226 for i in c: -1227 pass -
1228 -
1229 - def test_pi(self): -
1230 # lxml.etree separates target and text -1231 Element = self.etree.Element -1232 SubElement = self.etree.SubElement -1233 ProcessingInstruction = self.etree.ProcessingInstruction -1234 -1235 a = Element('a') -1236 a.append(ProcessingInstruction('foo', 'some more text')) -1237 self.assertEqual(a[0].tag, ProcessingInstruction) -1238 self.assertXML(_bytes("<a><?foo some more text?></a>"), -1239 a) -
1240 -
1241 - def test_processinginstruction(self): -
1242 # lxml.etree separates target and text -1243 Element = self.etree.Element -1244 SubElement = self.etree.SubElement -1245 ProcessingInstruction = self.etree.PI -1246 -1247 a = Element('a') -1248 a.append(ProcessingInstruction('foo', 'some more text')) -1249 self.assertEqual(a[0].tag, ProcessingInstruction) -1250 self.assertXML(_bytes("<a><?foo some more text?></a>"), -1251 a) -
1252 -
1253 - def test_pi_nonsense(self): -
1254 ProcessingInstruction = self.etree.ProcessingInstruction -1255 pi = ProcessingInstruction('foo') -1256 self.assertEqual({}, pi.attrib) -1257 self.assertEqual([], list(pi.keys())) -1258 self.assertEqual([], list(pi.items())) -1259 self.assertEqual(None, pi.get('hoi')) -1260 self.assertEqual(0, len(pi)) -1261 # should not iterate -1262 for i in pi: -1263 pass -
1264 -
1265 - def test_setitem(self): -
1266 Element = self.etree.Element -1267 SubElement = self.etree.SubElement -1268 -1269 a = Element('a') -1270 b = SubElement(a, 'b') -1271 c = Element('c') -1272 a[0] = c -1273 self.assertEqual( -1274 c, -1275 a[0]) -1276 self.assertXML(_bytes('<a><c></c></a>'), -1277 a) -1278 self.assertXML(_bytes('<b></b>'), -1279 b) -
1280 -
1281 - def test_setitem2(self): -
1282 Element = self.etree.Element -1283 SubElement = self.etree.SubElement -1284 -1285 a = Element('a') -1286 for i in range(5): -1287 b = SubElement(a, 'b%s' % i) -1288 c = SubElement(b, 'c') -1289 for i in range(5): -1290 d = Element('d') -1291 e = SubElement(d, 'e') -1292 a[i] = d -1293 self.assertXML( -1294 _bytes('<a><d><e></e></d><d><e></e></d><d><e></e></d><d><e></e></d><d><e></e></d></a>'), -1295 a) -1296 self.assertXML(_bytes('<c></c>'), -1297 c) -
1298 -
1299 - def test_setitem_replace(self): -
1300 Element = self.etree.Element -1301 SubElement = self.etree.SubElement -1302 -1303 a = Element('a') -1304 SubElement(a, 'b') -1305 d = Element('d') -1306 a[0] = d -1307 self.assertXML(_bytes('<a><d></d></a>'), a) -
1308 -
1309 - def test_setitem_indexerror(self): -
1310 Element = self.etree.Element -1311 SubElement = self.etree.SubElement -1312 -1313 a = Element('a') -1314 b = SubElement(a, 'b') -1315 -1316 self.assertRaises(IndexError, operator.setitem, a, 1, Element('c')) -
1317 -
1318 - def test_setitem_tail(self): -
1319 Element = self.etree.Element -1320 SubElement = self.etree.SubElement -1321 -1322 a = Element('a') -1323 b = SubElement(a, 'b') -1324 b.tail = 'B2' -1325 c = Element('c') -1326 c.tail = 'C2' -1327 -1328 a[0] = c -1329 self.assertXML( -1330 _bytes('<a><c></c>C2</a>'), -1331 a) -
1332 -
1333 - def test_tag_write(self): -
1334 Element = self.etree.Element -1335 SubElement = self.etree.SubElement -1336 -1337 a = Element('a') -1338 b = SubElement(a, 'b') -1339 -1340 a.tag = 'c' -1341 -1342 self.assertEqual( -1343 'c', -1344 a.tag) -1345 -1346 self.assertXML( -1347 _bytes('<c><b></b></c>'), -1348 a) -
1349 -
1350 - def test_tag_reset_ns(self): -
1351 Element = self.etree.Element -1352 SubElement = self.etree.SubElement -1353 tostring = self.etree.tostring -1354 -1355 a = Element('{a}a') -1356 b1 = SubElement(a, '{a}b') -1357 b2 = SubElement(a, '{b}b') -1358 -1359 self.assertEqual('{a}b', b1.tag) -1360 -1361 b1.tag = 'c' -1362 -1363 # can't use C14N here! -1364 self.assertEqual('c', b1.tag) -1365 self.assertEqual(_bytes('<c'), tostring(b1)[:2]) -1366 self.assertTrue(_bytes('<c') in tostring(a)) -
1367 -
1368 - def test_tag_reset_root_ns(self): -
1369 Element = self.etree.Element -1370 SubElement = self.etree.SubElement -1371 tostring = self.etree.tostring -1372 -1373 a = Element('{a}a') -1374 b1 = SubElement(a, '{a}b') -1375 b2 = SubElement(a, '{b}b') -1376 -1377 a.tag = 'c' -1378 -1379 self.assertEqual( -1380 'c', -1381 a.tag) -1382 -1383 # can't use C14N here! -1384 self.assertEqual('c', a.tag) -1385 self.assertEqual(_bytes('<c'), tostring(a)[:2]) -
1386 -
1387 - def test_tag_str_subclass(self): -
1388 Element = self.etree.Element -1389 -1390 class strTest(str): -1391 pass -
1392 -1393 a = Element("a") -1394 a.tag = strTest("TAG") -1395 self.assertXML(_bytes('<TAG></TAG>'), -1396 a) -1397 -
1398 - def test_delitem(self): -
1399 Element = self.etree.Element -1400 SubElement = self.etree.SubElement -1401 -1402 a = Element('a') -1403 b = SubElement(a, 'b') -1404 c = SubElement(a, 'c') -1405 d = SubElement(a, 'd') -1406 -1407 del a[1] -1408 self.assertXML( -1409 _bytes('<a><b></b><d></d></a>'), -1410 a) -1411 -1412 del a[0] -1413 self.assertXML( -1414 _bytes('<a><d></d></a>'), -1415 a) -1416 -1417 del a[0] -1418 self.assertXML( -1419 _bytes('<a></a>'), -1420 a) -1421 # move deleted element into other tree afterwards -1422 other = Element('other') -1423 other.append(c) -1424 self.assertXML( -1425 _bytes('<other><c></c></other>'), -1426 other) -
1427 -
1428 - def test_del_insert(self): -
1429 Element = self.etree.Element -1430 SubElement = self.etree.SubElement -1431 -1432 a = Element('a') -1433 b = SubElement(a, 'b') -1434 bs = SubElement(b, 'bs') -1435 c = SubElement(a, 'c') -1436 cs = SubElement(c, 'cs') -1437 -1438 el = a[0] -1439 self.assertXML( -1440 _bytes('<a><b><bs></bs></b><c><cs></cs></c></a>'), -1441 a) -1442 self.assertXML(_bytes('<b><bs></bs></b>'), b) -1443 self.assertXML(_bytes('<c><cs></cs></c>'), c) -1444 -1445 del a[0] -1446 self.assertXML( -1447 _bytes('<a><c><cs></cs></c></a>'), -1448 a) -1449 self.assertXML(_bytes('<b><bs></bs></b>'), b) -1450 self.assertXML(_bytes('<c><cs></cs></c>'), c) -1451 -1452 a.insert(0, el) -1453 self.assertXML( -1454 _bytes('<a><b><bs></bs></b><c><cs></cs></c></a>'), -1455 a) -1456 self.assertXML(_bytes('<b><bs></bs></b>'), b) -1457 self.assertXML(_bytes('<c><cs></cs></c>'), c) -
1458 -
1459 - def test_del_setitem(self): -
1460 Element = self.etree.Element -1461 SubElement = self.etree.SubElement -1462 -1463 a = Element('a') -1464 b = SubElement(a, 'b') -1465 bs = SubElement(b, 'bs') -1466 c = SubElement(a, 'c') -1467 cs = SubElement(c, 'cs') -1468 -1469 el = a[0] -1470 del a[0] -1471 a[0] = el -1472 self.assertXML( -1473 _bytes('<a><b><bs></bs></b></a>'), -1474 a) -1475 self.assertXML(_bytes('<b><bs></bs></b>'), b) -1476 self.assertXML(_bytes('<c><cs></cs></c>'), c) -
1477 -
1478 - def test_del_setslice(self): -
1479 Element = self.etree.Element -1480 SubElement = self.etree.SubElement -1481 -1482 a = Element('a') -1483 b = SubElement(a, 'b') -1484 bs = SubElement(b, 'bs') -1485 c = SubElement(a, 'c') -1486 cs = SubElement(c, 'cs') -1487 -1488 el = a[0] -1489 del a[0] -1490 a[0:0] = [el] -1491 self.assertXML( -1492 _bytes('<a><b><bs></bs></b><c><cs></cs></c></a>'), -1493 a) -1494 self.assertXML(_bytes('<b><bs></bs></b>'), b) -1495 self.assertXML(_bytes('<c><cs></cs></c>'), c) -
1496 -
1497 - def test_replace_slice_tail(self): -
1498 XML = self.etree.XML -1499 a = XML(_bytes('<a><b></b>B2<c></c>C2</a>')) -1500 b, c = a -1501 -1502 a[:] = [] -1503 -1504 self.assertEqual("B2", b.tail) -1505 self.assertEqual("C2", c.tail) -
1506 -
1508 XML = self.etree.XML -1509 root = XML(_bytes( -1510 '<foo><bar xmlns:baz="http://huhu"><puh><baz:bump1 /><baz:bump2 /></puh></bar></foo>')) -1511 root[:] = root.findall('.//puh') # delete bar from hierarchy -1512 -1513 # previously, this lost a namespace declaration on bump2 -1514 result = self.etree.tostring(root) -1515 foo = self.etree.fromstring(result) -1516 -1517 self.assertEqual('puh', foo[0].tag) -1518 self.assertEqual('{http://huhu}bump1', foo[0][0].tag) -1519 self.assertEqual('{http://huhu}bump2', foo[0][1].tag) -
1520 -
1521 - def test_delitem_tail(self): -
1522 ElementTree = self.etree.ElementTree -1523 f = BytesIO('<a><b></b>B2<c></c>C2</a>') -1524 doc = ElementTree(file=f) -1525 a = doc.getroot() -1526 del a[0] -1527 self.assertXML( -1528 _bytes('<a><c></c>C2</a>'), -1529 a) -
1530 -
1531 - def test_clear(self): -
1532 Element = self.etree.Element -1533 -1534 a = Element('a') -1535 a.text = 'foo' -1536 a.tail = 'bar' -1537 a.set('hoi', 'dag') -1538 a.clear() -1539 self.assertEqual(None, a.text) -1540 self.assertEqual(None, a.tail) -1541 self.assertEqual(None, a.get('hoi')) -1542 self.assertEqual('a', a.tag) -
1543 -
1544 - def test_clear_sub(self): -
1545 Element = self.etree.Element -1546 SubElement = self.etree.SubElement -1547 -1548 a = Element('a') -1549 a.text = 'foo' -1550 a.tail = 'bar' -1551 a.set('hoi', 'dag') -1552 b = SubElement(a, 'b') -1553 c = SubElement(b, 'c') -1554 a.clear() -1555 self.assertEqual(None, a.text) -1556 self.assertEqual(None, a.tail) -1557 self.assertEqual(None, a.get('hoi')) -1558 self.assertEqual('a', a.tag) -1559 self.assertEqual(0, len(a)) -1560 self.assertXML(_bytes('<a></a>'), -1561 a) -1562 self.assertXML(_bytes('<b><c></c></b>'), -1563 b) -
1564 -
1565 - def test_clear_tail(self): -
1566 ElementTree = self.etree.ElementTree -1567 f = BytesIO('<a><b></b>B2<c></c>C2</a>') -1568 doc = ElementTree(file=f) -1569 a = doc.getroot() -1570 a.clear() -1571 self.assertXML( -1572 _bytes('<a></a>'), -1573 a) -
1574 -
1575 - def test_insert(self): -
1576 Element = self.etree.Element -1577 SubElement = self.etree.SubElement -1578 -1579 a = Element('a') -1580 b = SubElement(a, 'b') -1581 c = SubElement(a, 'c') -1582 d = Element('d') -1583 a.insert(0, d) -1584 -1585 self.assertEqual( -1586 d, -1587 a[0]) -1588 -1589 self.assertXML( -1590 _bytes('<a><d></d><b></b><c></c></a>'), -1591 a) -1592 -1593 e = Element('e') -1594 a.insert(2, e) -1595 self.assertEqual( -1596 e, -1597 a[2]) -1598 self.assertXML( -1599 _bytes('<a><d></d><b></b><e></e><c></c></a>'), -1600 a) -
1601 -
1602 - def test_insert_beyond_index(self): -
1603 Element = self.etree.Element -1604 SubElement = self.etree.SubElement -1605 -1606 a = Element('a') -1607 b = SubElement(a, 'b') -1608 c = Element('c') -1609 -1610 a.insert(2, c) -1611 self.assertEqual( -1612 c, -1613 a[1]) -1614 self.assertXML( -1615 _bytes('<a><b></b><c></c></a>'), -1616 a) -
1617 -
1618 - def test_insert_negative(self): -
1619 Element = self.etree.Element -1620 SubElement = self.etree.SubElement -1621 -1622 a = Element('a') -1623 b = SubElement(a, 'b') -1624 c = SubElement(a, 'c') -1625 -1626 d = Element('d') -1627 a.insert(-1, d) -1628 self.assertEqual( -1629 d, -1630 a[-2]) -1631 self.assertXML( -1632 _bytes('<a><b></b><d></d><c></c></a>'), -1633 a) -
1634 -
1635 - def test_insert_tail(self): -
1636 Element = self.etree.Element -1637 SubElement = self.etree.SubElement -1638 -1639 a = Element('a') -1640 b = SubElement(a, 'b') -1641 -1642 c = Element('c') -1643 c.tail = 'C2' -1644 -1645 a.insert(0, c) -1646 self.assertXML( -1647 _bytes('<a><c></c>C2<b></b></a>'), -1648 a) -
1649 -
1650 - def test_remove(self): -
1651 Element = self.etree.Element -1652 SubElement = self.etree.SubElement -1653 -1654 a = Element('a') -1655 b = SubElement(a, 'b') -1656 c = SubElement(a, 'c') -1657 -1658 a.remove(b) -1659 self.assertEqual( -1660 c, -1661 a[0]) -1662 self.assertXML( -1663 _bytes('<a><c></c></a>'), -1664 a) -
1665 -
1666 - def test_remove_ns(self): -
1667 Element = self.etree.Element -1668 SubElement = self.etree.SubElement -1669 -1670 a = Element('{http://test}a') -1671 b = SubElement(a, '{http://test}b') -1672 c = SubElement(a, '{http://test}c') -1673 -1674 a.remove(b) -1675 self.assertXML( -1676 _bytes('<ns0:a xmlns:ns0="http://test"><ns0:c></ns0:c></ns0:a>'), -1677 a) -1678 self.assertXML( -1679 _bytes('<ns0:b xmlns:ns0="http://test"></ns0:b>'), -1680 b) -
1681 -
1682 - def test_remove_nonexisting(self): -
1683 Element = self.etree.Element -1684 SubElement = self.etree.SubElement -1685 -1686 a = Element('a') -1687 b = SubElement(a, 'b') -1688 c = SubElement(a, 'c') -1689 d = Element('d') -1690 self.assertRaises( -1691 ValueError, a.remove, d) -
1692 -
1693 - def test_remove_tail(self): -
1694 Element = self.etree.Element -1695 SubElement = self.etree.SubElement -1696 -1697 a = Element('a') -1698 b = SubElement(a, 'b') -1699 b.tail = 'b2' -1700 a.remove(b) -1701 self.assertXML( -1702 _bytes('<a></a>'), -1703 a) -1704 self.assertEqual('b2', b.tail) -
1705 -
1706 - def _test_getchildren(self): -
1707 Element = self.etree.Element -1708 SubElement = self.etree.SubElement -1709 -1710 a = Element('a') -1711 b = SubElement(a, 'b') -1712 c = SubElement(a, 'c') -1713 d = SubElement(b, 'd') -1714 e = SubElement(c, 'e') -1715 self.assertXML( -1716 _bytes('<a><b><d></d></b><c><e></e></c></a>'), -1717 a) -1718 self.assertEqual( -1719 [b, c], -1720 a.getchildren()) -1721 self.assertEqual( -1722 [d], -1723 b.getchildren()) -1724 self.assertEqual( -1725 [], -1726 d.getchildren()) -
1727 -
1728 - def test_makeelement(self): -
1729 Element = self.etree.Element -1730 -1731 a = Element('a') -1732 b = a.makeelement('c', {'hoi':'dag'}) -1733 self.assertXML( -1734 _bytes('<c hoi="dag"></c>'), -1735 b) -
1736 -1737 required_versions_ET['test_iter'] = (1,3) -
1738 - def test_iter(self): -
1739 Element = self.etree.Element -1740 SubElement = self.etree.SubElement -1741 -1742 a = Element('a') -1743 b = SubElement(a, 'b') -1744 c = SubElement(a, 'c') -1745 d = SubElement(b, 'd') -1746 e = SubElement(c, 'e') -1747 -1748 self.assertEqual( -1749 [a, b, d, c, e], -1750 list(a.iter())) -1751 self.assertEqual( -1752 [d], -1753 list(d.iter())) -
1754 -
1755 - def test_getiterator(self): -
1756 Element = self.etree.Element -1757 SubElement = self.etree.SubElement -1758 -1759 a = Element('a') -1760 b = SubElement(a, 'b') -1761 c = SubElement(a, 'c') -1762 d = SubElement(b, 'd') -1763 e = SubElement(c, 'e') -1764 -1765 self.assertEqual( -1766 [a, b, d, c, e], -1767 list(a.getiterator())) -1768 self.assertEqual( -1769 [d], -1770 list(d.getiterator())) -
1771 -
1772 - def test_getiterator_empty(self): -
1773 Element = self.etree.Element -1774 SubElement = self.etree.SubElement -1775 -1776 a = Element('a') -1777 b = SubElement(a, 'b') -1778 c = SubElement(a, 'c') -1779 d = SubElement(b, 'd') -1780 e = SubElement(c, 'e') -1781 -1782 self.assertEqual( -1783 [], -1784 list(a.getiterator('none'))) -1785 self.assertEqual( -1786 [], -1787 list(e.getiterator('none'))) -1788 self.assertEqual( -1789 [e], -1790 list(e.getiterator())) -
1791 -
1792 - def test_getiterator_filter(self): -
1793 Element = self.etree.Element -1794 SubElement = self.etree.SubElement -1795 -1796 a = Element('a') -1797 b = SubElement(a, 'b') -1798 c = SubElement(a, 'c') -1799 d = SubElement(b, 'd') -1800 e = SubElement(c, 'e') -1801 -1802 self.assertEqual( -1803 [a], -1804 list(a.getiterator('a'))) -1805 a2 = SubElement(e, 'a') -1806 self.assertEqual( -1807 [a, a2], -1808 list(a.getiterator('a'))) -1809 self.assertEqual( -1810 [a2], -1811 list(c.getiterator('a'))) -
1812 -
1813 - def test_getiterator_filter_all(self): -
1814 Element = self.etree.Element -1815 SubElement = self.etree.SubElement -1816 -1817 a = Element('a') -1818 b = SubElement(a, 'b') -1819 c = SubElement(a, 'c') -1820 d = SubElement(b, 'd') -1821 e = SubElement(c, 'e') -1822 -1823 self.assertEqual( -1824 [a, b, d, c, e], -1825 list(a.getiterator('*'))) -
1826 -
1828 Element = self.etree.Element -1829 Comment = self.etree.Comment -1830 SubElement = self.etree.SubElement -1831 -1832 a = Element('a') -1833 b = SubElement(a, 'b') -1834 comment_b = Comment("TEST-b") -1835 b.append(comment_b) -1836 -1837 self.assertEqual( -1838 [comment_b], -1839 list(a.getiterator(Comment))) -1840 -1841 comment_a = Comment("TEST-a") -1842 a.append(comment_a) -1843 -1844 self.assertEqual( -1845 [comment_b, comment_a], -1846 list(a.getiterator(Comment))) -1847 -1848 self.assertEqual( -1849 [comment_b], -1850 list(b.getiterator(Comment))) -
1851 -
1852 - def test_getiterator_filter_pi(self): -
1853 Element = self.etree.Element -1854 PI = self.etree.ProcessingInstruction -1855 SubElement = self.etree.SubElement -1856 -1857 a = Element('a') -1858 b = SubElement(a, 'b') -1859 pi_b = PI("TEST-b") -1860 b.append(pi_b) -1861 -1862 self.assertEqual( -1863 [pi_b], -1864 list(a.getiterator(PI))) -1865 -1866 pi_a = PI("TEST-a") -1867 a.append(pi_a) -1868 -1869 self.assertEqual( -1870 [pi_b, pi_a], -1871 list(a.getiterator(PI))) -1872 -1873 self.assertEqual( -1874 [pi_b], -1875 list(b.getiterator(PI))) -
1876 -
1877 - def test_getiterator_with_text(self): -
1878 Element = self.etree.Element -1879 SubElement = self.etree.SubElement -1880 -1881 a = Element('a') -1882 a.text = 'a' -1883 b = SubElement(a, 'b') -1884 b.text = 'b' -1885 b.tail = 'b1' -1886 c = SubElement(a, 'c') -1887 c.text = 'c' -1888 c.tail = 'c1' -1889 d = SubElement(b, 'd') -1890 c.text = 'd' -1891 c.tail = 'd1' -1892 e = SubElement(c, 'e') -1893 e.text = 'e' -1894 e.tail = 'e1' -1895 -1896 self.assertEqual( -1897 [a, b, d, c, e], -1898 list(a.getiterator())) -
1899 #self.assertEqual( -1900 # [d], -1901 # list(d.getiterator())) -1902 -
1904 Element = self.etree.Element -1905 SubElement = self.etree.SubElement -1906 -1907 a = Element('a') -1908 a.text = 'a' -1909 b = SubElement(a, 'b') -1910 b.text = 'b' -1911 b.tail = 'b1' -1912 c = SubElement(a, 'c') -1913 c.text = 'c' -1914 c.tail = 'c1' -1915 d = SubElement(b, 'd') -1916 c.text = 'd' -1917 c.tail = 'd1' -1918 e = SubElement(c, 'e') -1919 e.text = 'e' -1920 e.tail = 'e1' -1921 -1922 self.assertEqual( -1923 [a], -1924 list(a.getiterator('a'))) -1925 a2 = SubElement(e, 'a') -1926 self.assertEqual( -1927 [a, a2], -1928 list(a.getiterator('a'))) -1929 self.assertEqual( -1930 [a2], -1931 list(e.getiterator('a'))) -
1932 -
1933 - def test_getslice(self): -
1934 Element = self.etree.Element -1935 SubElement = self.etree.SubElement -1936 -1937 a = Element('a') -1938 b = SubElement(a, 'b') -1939 c = SubElement(a, 'c') -1940 d = SubElement(a, 'd') -1941 -1942 self.assertEqual( -1943 [b, c], -1944 a[0:2]) -1945 self.assertEqual( -1946 [b, c, d], -1947 a[:]) -1948 self.assertEqual( -1949 [b, c, d], -1950 a[:10]) -1951 self.assertEqual( -1952 [b], -1953 a[0:1]) -1954 self.assertEqual( -1955 [], -1956 a[10:12]) -
1957 -
1958 - def test_getslice_negative(self): -
1959 Element = self.etree.Element -1960 SubElement = self.etree.SubElement -1961 -1962 a = Element('a') -1963 b = SubElement(a, 'b') -1964 c = SubElement(a, 'c') -1965 d = SubElement(a, 'd') -1966 -1967 self.assertEqual( -1968 [d], -1969 a[-1:]) -1970 self.assertEqual( -1971 [c, d], -1972 a[-2:]) -1973 self.assertEqual( -1974 [c], -1975 a[-2:-1]) -1976 self.assertEqual( -1977 [b, c], -1978 a[-3:-1]) -1979 self.assertEqual( -1980 [b, c], -1981 a[-3:2]) -
1982 -
1983 - def test_getslice_step(self): -
1984 Element = self.etree.Element -1985 SubElement = self.etree.SubElement -1986 -1987 a = Element('a') -1988 b = SubElement(a, 'b') -1989 c = SubElement(a, 'c') -1990 d = SubElement(a, 'd') -1991 e = SubElement(a, 'e') -1992 -1993 self.assertEqual( -1994 [e,d,c,b], -1995 a[::-1]) -1996 self.assertEqual( -1997 [b,d], -1998 a[::2]) -1999 self.assertEqual( -2000 [e,c], -2001 a[::-2]) -2002 self.assertEqual( -2003 [d,c], -2004 a[-2:0:-1]) -2005 self.assertEqual( -2006 [e], -2007 a[:1:-2]) -
2008 -
2009 - def test_getslice_text(self): -
2010 ElementTree = self.etree.ElementTree -2011 -2012 f = BytesIO('<a><b>B</b>B1<c>C</c>C1</a>') -2013 doc = ElementTree(file=f) -2014 a = doc.getroot() -2015 b = a[0] -2016 c = a[1] -2017 self.assertEqual( -2018 [b, c], -2019 a[:]) -2020 self.assertEqual( -2021 [b], -2022 a[0:1]) -2023 self.assertEqual( -2024 [c], -2025 a[1:]) -
2026 -
2028 Element = self.etree.Element -2029 Comment = self.etree.Comment -2030 SubElement = self.etree.SubElement -2031 -2032 a = Element('a') -2033 b = SubElement(a, 'b') -2034 foo = Comment('foo') -2035 a.append(foo) -2036 c = SubElement(a, 'c') -2037 self.assertEqual( -2038 [b, foo, c], -2039 a[:]) -2040 self.assertEqual( -2041 foo, -2042 a[1]) -2043 a[1] = new = Element('new') -2044 self.assertEqual( -2045 new, -2046 a[1]) -2047 self.assertXML( -2048 _bytes('<a><b></b><new></new><c></c></a>'), -2049 a) -
2050 -
2051 - def test_delslice(self): -
2052 Element = self.etree.Element -2053 SubElement = self.etree.SubElement -2054 -2055 a = Element('a') -2056 b = SubElement(a, 'b') -2057 c = SubElement(a, 'c') -2058 d = SubElement(a, 'd') -2059 e = SubElement(a, 'e') -2060 -2061 del a[1:3] -2062 self.assertEqual( -2063 [b, e], -2064 list(a)) -
2065 -
2066 - def test_delslice_negative1(self): -
2067 Element = self.etree.Element -2068 SubElement = self.etree.SubElement -2069 -2070 a = Element('a') -2071 b = SubElement(a, 'b') -2072 c = SubElement(a, 'c') -2073 d = SubElement(a, 'd') -2074 e = SubElement(a, 'e') -2075 -2076 del a[1:-1] -2077 self.assertEqual( -2078 [b, e], -2079 list(a)) -
2080 -
2081 - def test_delslice_negative2(self): -
2082 Element = self.etree.Element -2083 SubElement = self.etree.SubElement -2084 -2085 a = Element('a') -2086 b = SubElement(a, 'b') -2087 c = SubElement(a, 'c') -2088 d = SubElement(a, 'd') -2089 e = SubElement(a, 'e') -2090 -2091 del a[-3:-1] -2092 self.assertEqual( -2093 [b, e], -2094 list(a)) -
2095 -
2096 - def test_delslice_step(self): -
2097 Element = self.etree.Element -2098 SubElement = self.etree.SubElement -2099 -2100 a = Element('a') -2101 b = SubElement(a, 'b') -2102 c = SubElement(a, 'c') -2103 d = SubElement(a, 'd') -2104 e = SubElement(a, 'e') -2105 -2106 del a[1::2] -2107 self.assertEqual( -2108 [b, d], -2109 list(a)) -
2110 -
2111 - def test_delslice_step_negative(self): -
2112 Element = self.etree.Element -2113 SubElement = self.etree.SubElement -2114 -2115 a = Element('a') -2116 b = SubElement(a, 'b') -2117 c = SubElement(a, 'c') -2118 d = SubElement(a, 'd') -2119 e = SubElement(a, 'e') -2120 -2121 del a[::-1] -2122 self.assertEqual( -2123 [], -2124 list(a)) -
2125 -
2127 Element = self.etree.Element -2128 SubElement = self.etree.SubElement -2129 -2130 a = Element('a') -2131 b = SubElement(a, 'b') -2132 c = SubElement(a, 'c') -2133 d = SubElement(a, 'd') -2134 e = SubElement(a, 'e') -2135 -2136 del a[::-2] -2137 self.assertEqual( -2138 [b, d], -2139 list(a)) -
2140 -
2141 - def test_delslice_child_tail(self): -
2142 ElementTree = self.etree.ElementTree -2143 f = BytesIO('<a><b></b>B2<c></c>C2<d></d>D2<e></e>E2</a>') -2144 doc = ElementTree(file=f) -2145 a = doc.getroot() -2146 del a[1:3] -2147 self.assertXML( -2148 _bytes('<a><b></b>B2<e></e>E2</a>'), -2149 a) -
2150 -
2151 - def test_delslice_tail(self): -
2152 XML = self.etree.XML -2153 a = XML(_bytes('<a><b></b>B2<c></c>C2</a>')) -2154 b, c = a -2155 -2156 del a[:] -2157 -2158 self.assertEqual("B2", b.tail) -2159 self.assertEqual("C2", c.tail) -
2160 -
2161 - def test_delslice_memory(self): -
2162 # this could trigger a crash -2163 Element = self.etree.Element -2164 SubElement = self.etree.SubElement -2165 a = Element('a') -2166 b = SubElement(a, 'b') -2167 c = SubElement(b, 'c') -2168 del b # no more reference to b -2169 del a[:] -2170 self.assertEqual('c', c.tag) -
2171 -
2172 - def test_setslice(self): -
2173 Element = self.etree.Element -2174 SubElement = self.etree.SubElement -2175 -2176 a = Element('a') -2177 b = SubElement(a, 'b') -2178 c = SubElement(a, 'c') -2179 d = SubElement(a, 'd') -2180 -2181 e = Element('e') -2182 f = Element('f') -2183 g = Element('g') -2184 -2185 s = [e, f, g] -2186 a[1:2] = s -2187 self.assertEqual( -2188 [b, e, f, g, d], -2189 list(a)) -
2190 -
2191 - def test_setslice_all(self): -
2192 Element = self.etree.Element -2193 SubElement = self.etree.SubElement -2194 -2195 a = Element('a') -2196 b = SubElement(a, 'b') -2197 c = SubElement(a, 'c') -2198 -2199 e = Element('e') -2200 f = Element('f') -2201 g = Element('g') -2202 -2203 s = [e, f, g] -2204 a[:] = s -2205 self.assertEqual( -2206 [e, f, g], -2207 list(a)) -
2208 -
2209 - def test_setslice_all_empty(self): -
2210 Element = self.etree.Element -2211 SubElement = self.etree.SubElement -2212 -2213 a = Element('a') -2214 -2215 e = Element('e') -2216 f = Element('f') -2217 g = Element('g') -2218 -2219 s = [e, f, g] -2220 a[:] = s -2221 self.assertEqual( -2222 [e, f, g], -2223 list(a)) -
2224 -
2225 - def test_setslice_all_replace(self): -
2226 Element = self.etree.Element -2227 SubElement = self.etree.SubElement -2228 -2229 a = Element('a') -2230 b = SubElement(a, 'b') -2231 c = SubElement(a, 'c') -2232 d = SubElement(a, 'd') -2233 -2234 s = [b, c, d] -2235 a[:] = s -2236 self.assertEqual( -2237 [b, c, d], -2238 list(a)) -
2239 -
2241 Element = self.etree.Element -2242 SubElement = self.etree.SubElement -2243 -2244 a = Element('a') -2245 b = SubElement(a, 'b') -2246 c = SubElement(a, 'c') -2247 d = SubElement(a, 'd') -2248 -2249 s = [d, c, b] -2250 a[:] = s -2251 self.assertEqual( -2252 [d, c, b], -2253 list(a)) -
2254 -
2256 Element = self.etree.Element -2257 SubElement = self.etree.SubElement -2258 -2259 a = Element('{ns}a') -2260 b = SubElement(a, '{ns}b', {'{ns1}a1': 'test'}) -2261 c = SubElement(a, '{ns}c', {'{ns2}a2': 'test'}) -2262 d = SubElement(a, '{ns}d', {'{ns3}a3': 'test'}) -2263 -2264 s = [d, c, b] -2265 a[:] = s -2266 self.assertEqual( -2267 [d, c, b], -2268 list(a)) -2269 self.assertEqual( -2270 ['{ns}d', '{ns}c', '{ns}b'], -2271 [ child.tag for child in a ]) -2272 -2273 self.assertEqual( -2274 [['{ns3}a3'], ['{ns2}a2'], ['{ns1}a1']], -2275 [ list(child.attrib.keys()) for child in a ]) -
2276 -
2278 Element = self.etree.Element -2279 SubElement = self.etree.SubElement -2280 -2281 a = Element('{ns}a') -2282 b = SubElement(a, '{ns1}b', {'{ns}a1': 'test'}) -2283 c = SubElement(a, '{ns2}c', {'{ns}a2': 'test'}) -2284 d = SubElement(a, '{ns3}d', {'{ns}a3': 'test'}) -2285 -2286 s = [d, c, b] -2287 a[:] = s -2288 self.assertEqual( -2289 [d, c, b], -2290 list(a)) -2291 self.assertEqual( -2292 ['{ns3}d', '{ns2}c', '{ns1}b'], -2293 [ child.tag for child in a ]) -2294 -2295 self.assertEqual( -2296 [['{ns}a3'], ['{ns}a2'], ['{ns}a1']], -2297 [ list(child.attrib.keys()) for child in a ]) -
2298 -
2299 - def test_setslice_end(self): -
2300 Element = self.etree.Element -2301 SubElement = self.etree.SubElement -2302 -2303 a = Element('a') -2304 b = SubElement(a, 'b') -2305 c = SubElement(a, 'c') -2306 -2307 e = Element('e') -2308 f = Element('f') -2309 g = Element('g') -2310 h = Element('h') -2311 -2312 s = [e, f] -2313 a[99:] = s -2314 self.assertEqual( -2315 [b, c, e, f], -2316 list(a)) -2317 -2318 s = [g, h] -2319 a[:0] = s -2320 self.assertEqual( -2321 [g, h, b, c, e, f], -2322 list(a)) -
2323 -
2324 - def test_setslice_end_exact(self): -
2325 Element = self.etree.Element -2326 SubElement = self.etree.SubElement -2327 -2328 a = Element('a') -2329 b = SubElement(a, 'b') -2330 c = SubElement(a, 'c') -2331 d = SubElement(a, 'd') -2332 -2333 e = Element('e') -2334 f = Element('f') -2335 g = Element('g') -2336 -2337 s = [e, f, g] -2338 a[3:] = s -2339 self.assertEqual( -2340 [b, c, d, e, f, g], -2341 list(a)) -
2342 -
2343 - def test_setslice_single(self): -
2344 Element = self.etree.Element -2345 SubElement = self.etree.SubElement -2346 -2347 a = Element('a') -2348 b = SubElement(a, 'b') -2349 c = SubElement(a, 'c') -2350 -2351 e = Element('e') -2352 f = Element('f') -2353 -2354 s = [e] -2355 a[0:1] = s -2356 self.assertEqual( -2357 [e, c], -2358 list(a)) -2359 -2360 s = [f] -2361 a[1:2] = s -2362 self.assertEqual( -2363 [e, f], -2364 list(a)) -
2365 -
2366 - def test_setslice_tail(self): -
2367 ElementTree = self.etree.ElementTree -2368 Element = self.etree.Element -2369 f = BytesIO('<a><b></b>B2<c></c>C2<d></d>D2<e></e>E2</a>') -2370 doc = ElementTree(file=f) -2371 a = doc.getroot() -2372 x = Element('x') -2373 y = Element('y') -2374 z = Element('z') -2375 x.tail = 'X2' -2376 y.tail = 'Y2' -2377 z.tail = 'Z2' -2378 a[1:3] = [x, y, z] -2379 self.assertXML( -2380 _bytes('<a><b></b>B2<x></x>X2<y></y>Y2<z></z>Z2<e></e>E2</a>'), -2381 a) -
2382 -
2383 - def test_setslice_negative(self): -
2384 Element = self.etree.Element -2385 SubElement = self.etree.SubElement -2386 -2387 a = Element('a') -2388 b = SubElement(a, 'b') -2389 c = SubElement(a, 'c') -2390 d = SubElement(a, 'd') -2391 -2392 x = Element('x') -2393 y = Element('y') -2394 -2395 a[1:-1] = [x, y] -2396 self.assertEqual( -2397 [b, x, y, d], -2398 list(a)) -
2399 -
2400 - def test_setslice_negative2(self): -
2401 Element = self.etree.Element -2402 SubElement = self.etree.SubElement -2403 -2404 a = Element('a') -2405 b = SubElement(a, 'b') -2406 c = SubElement(a, 'c') -2407 d = SubElement(a, 'd') -2408 -2409 x = Element('x') -2410 y = Element('y') -2411 -2412 a[1:-2] = [x, y] -2413 self.assertEqual( -2414 [b, x, y, c, d], -2415 list(a)) -
2416 -
2417 - def test_setslice_empty(self): -
2418 Element = self.etree.Element -2419 -2420 a = Element('a') -2421 -2422 b = Element('b') -2423 c = Element('c') -2424 -2425 a[:] = [b, c] -2426 self.assertEqual( -2427 [b, c], -2428 list(a)) -
2429 -
2430 - def test_tail_elementtree_root(self): -
2431 Element = self.etree.Element -2432 ElementTree = self.etree.ElementTree -2433 -2434 a = Element('a') -2435 a.tail = 'A2' -2436 t = ElementTree(element=a) -2437 self.assertEqual('A2', -2438 a.tail) -
2439 -
2441 Element = self.etree.Element -2442 SubElement = self.etree.SubElement -2443 ElementTree = self.etree.ElementTree -2444 -2445 a = Element('a') -2446 b = SubElement(a, 'b') -2447 c = SubElement(a, 'c') -2448 d = SubElement(b, 'd') -2449 e = SubElement(c, 'e') -2450 t = ElementTree(element=a) -2451 -2452 self.assertEqual( -2453 [a, b, d, c, e], -2454 list(t.getiterator())) -
2455 -
2457 Element = self.etree.Element -2458 SubElement = self.etree.SubElement -2459 ElementTree = self.etree.ElementTree -2460 a = Element('a') -2461 b = SubElement(a, 'b') -2462 c = SubElement(a, 'c') -2463 d = SubElement(b, 'd') -2464 e = SubElement(c, 'e') -2465 t = ElementTree(element=a) -2466 -2467 self.assertEqual( -2468 [a], -2469 list(t.getiterator('a'))) -2470 a2 = SubElement(e, 'a') -2471 self.assertEqual( -2472 [a, a2], -2473 list(t.getiterator('a'))) -
2474 -
2475 - def test_ns_access(self): -
2476 ElementTree = self.etree.ElementTree -2477 ns = 'http://xml.infrae.com/1' -2478 f = BytesIO('<x:a xmlns:x="%s"><x:b></x:b></x:a>' % ns) -2479 t = ElementTree(file=f) -2480 a = t.getroot() -2481 self.assertEqual('{%s}a' % ns, -2482 a.tag) -2483 self.assertEqual('{%s}b' % ns, -2484 a[0].tag) -
2485 -
2486 - def test_ns_access2(self): -
2487 ElementTree = self.etree.ElementTree -2488 ns = 'http://xml.infrae.com/1' -2489 ns2 = 'http://xml.infrae.com/2' -2490 f = BytesIO('<x:a xmlns:x="%s" xmlns:y="%s"><x:b></x:b><y:b></y:b></x:a>' % (ns, ns2)) -2491 t = ElementTree(file=f) -2492 a = t.getroot() -2493 self.assertEqual('{%s}a' % ns, -2494 a.tag) -2495 self.assertEqual('{%s}b' % ns, -2496 a[0].tag) -2497 self.assertEqual('{%s}b' % ns2, -2498 a[1].tag) -
2499 -
2500 - def test_ns_setting(self): -
2501 Element = self.etree.Element -2502 SubElement = self.etree.SubElement -2503 ns = 'http://xml.infrae.com/1' -2504 ns2 = 'http://xml.infrae.com/2' -2505 a = Element('{%s}a' % ns) -2506 b = SubElement(a, '{%s}b' % ns2) -2507 c = SubElement(a, '{%s}c' % ns) -2508 self.assertEqual('{%s}a' % ns, -2509 a.tag) -2510 self.assertEqual('{%s}b' % ns2, -2511 b.tag) -2512 self.assertEqual('{%s}c' % ns, -2513 c.tag) -2514 self.assertEqual('{%s}a' % ns, -2515 a.tag) -2516 self.assertEqual('{%s}b' % ns2, -2517 b.tag) -2518 self.assertEqual('{%s}c' % ns, -2519 c.tag) -
2520 -
2521 - def test_ns_tag_parse(self): -
2522 Element = self.etree.Element -2523 SubElement = self.etree.SubElement -2524 ElementTree = self.etree.ElementTree -2525 -2526 ns = 'http://xml.infrae.com/1' -2527 ns2 = 'http://xml.infrae.com/2' -2528 f = BytesIO('<a xmlns="%s" xmlns:x="%s"><x:b></x:b><b></b></a>' % (ns, ns2)) -2529 t = ElementTree(file=f) -2530 -2531 a = t.getroot() -2532 self.assertEqual('{%s}a' % ns, -2533 a.tag) -2534 self.assertEqual('{%s}b' % ns2, -2535 a[0].tag) -2536 self.assertEqual('{%s}b' % ns, -2537 a[1].tag) -
2538 -
2539 - def test_ns_attr(self): -
2540 Element = self.etree.Element -2541 ns = 'http://xml.infrae.com/1' -2542 ns2 = 'http://xml.infrae.com/2' -2543 a = Element('a') -2544 a.set('{%s}foo' % ns, 'Foo') -2545 a.set('{%s}bar' % ns2, 'Bar') -2546 self.assertEqual( -2547 'Foo', -2548 a.get('{%s}foo' % ns)) -2549 self.assertEqual( -2550 'Bar', -2551 a.get('{%s}bar' % ns2)) -2552 try: -2553 self.assertXML( -2554 _bytes('<a xmlns:ns0="%s" xmlns:ns1="%s" ns0:foo="Foo" ns1:bar="Bar"></a>' % (ns, ns2)), -2555 a) -2556 except AssertionError: -2557 self.assertXML( -2558 _bytes('<a xmlns:ns0="%s" xmlns:ns1="%s" ns1:foo="Foo" ns0:bar="Bar"></a>' % (ns2, ns)), -2559 a) -
2560 -
2561 - def test_ns_move(self): -
2562 Element = self.etree.Element -2563 one = self.etree.fromstring( -2564 _bytes('<foo><bar xmlns:ns="http://a.b.c"><ns:baz/></bar></foo>')) -2565 baz = one[0][0] -2566 -2567 two = Element('root') -2568 two.append(baz) -2569 # removing the originating document could cause a crash/error before -2570 # as namespace is not moved along with it -2571 del one, baz -2572 self.assertEqual('{http://a.b.c}baz', two[0].tag) -
2573 -
2574 - def test_ns_decl_tostring(self): -
2575 tostring = self.etree.tostring -2576 root = self.etree.XML( -2577 _bytes('<foo><bar xmlns:ns="http://a.b.c"><ns:baz/></bar></foo>')) -2578 baz = root[0][0] -2579 -2580 nsdecl = re.findall(_bytes("xmlns(?::[a-z0-9]+)?=[\"']([^\"']+)[\"']"), -2581 tostring(baz)) -2582 self.assertEqual([_bytes("http://a.b.c")], nsdecl) -
2583 -
2585 tostring = self.etree.tostring -2586 root = self.etree.XML( -2587 _bytes('<foo><bar xmlns="http://a.b.c"><baz/></bar></foo>')) -2588 baz = root[0][0] -2589 -2590 nsdecl = re.findall(_bytes("xmlns(?::[a-z0-9]+)?=[\"']([^\"']+)[\"']"), -2591 tostring(baz)) -2592 self.assertEqual([_bytes("http://a.b.c")], nsdecl) -
2593 -
2594 - def test_ns_decl_tostring_root(self): -
2595 tostring = self.etree.tostring -2596 root = self.etree.XML( -2597 _bytes('<foo xmlns:ns="http://a.b.c"><bar><ns:baz/></bar></foo>')) -2598 baz = root[0][0] -2599 -2600 nsdecl = re.findall(_bytes("xmlns(?::[a-z0-9]+)?=[\"']([^\"']+)[\"']"), -2601 tostring(baz)) -2602 -2603 self.assertEqual([_bytes("http://a.b.c")], nsdecl) -
2604 -
2606 Element = self.etree.Element -2607 SubElement = self.etree.SubElement -2608 -2609 root = Element("foo") -2610 bar = SubElement(root, "{http://a.b.c}bar") -2611 baz = SubElement(bar, "{http://a.b.c}baz") -2612 -2613 nsdecl = re.findall(_bytes("xmlns(?::[a-z0-9]+)?=[\"']([^\"']+)[\"']"), -2614 self.etree.tostring(baz)) -2615 -2616 self.assertEqual([_bytes("http://a.b.c")], nsdecl) -
2617 -
2618 - def test_attribute_xmlns_move(self): -
2619 Element = self.etree.Element -2620 -2621 root = Element('element') -2622 -2623 subelement = Element('subelement', -2624 {"{http://www.w3.org/XML/1998/namespace}id": "foo"}) -2625 self.assertEqual(1, len(subelement.attrib)) -2626 self.assertEqual( -2627 "foo", -2628 subelement.get("{http://www.w3.org/XML/1998/namespace}id")) -2629 -2630 root.append(subelement) -2631 self.assertEqual(1, len(subelement.attrib)) -2632 self.assertEqual( -2633 list({"{http://www.w3.org/XML/1998/namespace}id" : "foo"}.items()), -2634 list(subelement.attrib.items())) -2635 self.assertEqual( -2636 "foo", -2637 subelement.get("{http://www.w3.org/XML/1998/namespace}id")) -
2638 -
2640 parse = self.etree.parse -2641 tostring = self.etree.tostring -2642 -2643 ns_href = "http://a.b.c" -2644 one = parse( -2645 BytesIO('<foo><bar xmlns:ns="%s"><ns:baz/></bar></foo>' % ns_href)) -2646 baz = one.getroot()[0][0] -2647 -2648 parsed = parse(BytesIO( tostring(baz) )).getroot() -2649 self.assertEqual('{%s}baz' % ns_href, parsed.tag) -
2650 -
2652 fromstring = self.etree.fromstring -2653 tostring = self.etree.tostring -2654 -2655 ns_href = "http://a.b.c" -2656 xml = _bytes('<root xmlns="%s" xmlns:x="%s"><el x:a="test" /></root>' % ( -2657 ns_href,ns_href)) -2658 root = fromstring(xml) -2659 self.assertEqual('test', root[0].get('{%s}a' % ns_href)) -2660 -2661 xml2 = tostring(root) -2662 self.assertTrue(_bytes(':a=') in xml2, xml2) -2663 -2664 root2 = fromstring(xml2) -2665 self.assertEqual('test', root2[0].get('{%s}a' % ns_href)) -
2666 -
2668 fromstring = self.etree.fromstring -2669 tostring = self.etree.tostring -2670 -2671 ns_href = "http://a.b.c" -2672 xml = _bytes('<root xmlns="%s" xmlns:x="%s"><el x:a="test" /></root>' % ( -2673 ns_href,ns_href)) -2674 root = fromstring(xml) -2675 self.assertEqual('test', root[0].get('{%s}a' % ns_href)) -2676 -2677 root[0].set('{%s}a' % ns_href, 'TEST') -2678 -2679 xml2 = tostring(root) -2680 self.assertTrue(_bytes(':a=') in xml2, xml2) -2681 -2682 root2 = fromstring(xml2) -2683 self.assertEqual('TEST', root2[0].get('{%s}a' % ns_href)) -
2684 -2685 required_versions_ET['test_register_namespace'] = (1,3) -
2686 - def test_register_namespace(self): -
2687 # ET 1.3+ -2688 Element = self.etree.Element -2689 prefix = 'TESTPREFIX' -2690 namespace = 'http://seriously.unknown/namespace/URI' -2691 -2692 el = Element('{%s}test' % namespace) -2693 self.assertEqual(_bytes('<ns0:test xmlns:ns0="%s"></ns0:test>' % namespace), -2694 self._writeElement(el)) -2695 -2696 self.etree.register_namespace(prefix, namespace) -2697 el = Element('{%s}test' % namespace) -2698 self.assertEqual(_bytes('<%s:test xmlns:%s="%s"></%s:test>' % ( -2699 prefix, prefix, namespace, prefix)), -2700 self._writeElement(el)) -2701 -2702 self.assertRaises(ValueError, self.etree.register_namespace, 'ns25', namespace) -
2703 -
2704 - def test_tostring(self): -
2705 tostring = self.etree.tostring -2706 Element = self.etree.Element -2707 SubElement = self.etree.SubElement -2708 -2709 a = Element('a') -2710 b = SubElement(a, 'b') -2711 c = SubElement(a, 'c') -2712 -2713 self.assertEqual(_bytes('<a><b></b><c></c></a>'), -2714 canonicalize(tostring(a))) -
2715 -
2716 - def test_tostring_element(self): -
2717 tostring = self.etree.tostring -2718 Element = self.etree.Element -2719 SubElement = self.etree.SubElement -2720 -2721 a = Element('a') -2722 b = SubElement(a, 'b') -2723 c = SubElement(a, 'c') -2724 d = SubElement(c, 'd') -2725 self.assertEqual(_bytes('<b></b>'), -2726 canonicalize(tostring(b))) -2727 self.assertEqual(_bytes('<c><d></d></c>'), -2728 canonicalize(tostring(c))) -
2729 -
2730 - def test_tostring_element_tail(self): -
2731 tostring = self.etree.tostring -2732 Element = self.etree.Element -2733 SubElement = self.etree.SubElement -2734 -2735 a = Element('a') -2736 b = SubElement(a, 'b') -2737 c = SubElement(a, 'c') -2738 d = SubElement(c, 'd') -2739 b.tail = 'Foo' -2740 -2741 self.assertTrue(tostring(b) == _bytes('<b/>Foo') or -2742 tostring(b) == _bytes('<b />Foo')) -
2743 -2744 required_versions_ET['test_tostring_method_html'] = (1,3) -
2745 - def test_tostring_method_html(self): -
2746 tostring = self.etree.tostring -2747 Element = self.etree.Element -2748 SubElement = self.etree.SubElement -2749 -2750 html = Element('html') -2751 body = SubElement(html, 'body') -2752 p = SubElement(body, 'p') -2753 p.text = "html" -2754 SubElement(p, 'br').tail = "test" -2755 -2756 self.assertEqual(_bytes('<html><body><p>html<br>test</p></body></html>'), -2757 tostring(html, method="html")) -
2758 -2759 required_versions_ET['test_tostring_method_text'] = (1,3) -
2760 - def test_tostring_method_text(self): -
2761 tostring = self.etree.tostring -2762 Element = self.etree.Element -2763 SubElement = self.etree.SubElement -2764 -2765 a = Element('a') -2766 a.text = "A" -2767 a.tail = "tail" -2768 b = SubElement(a, 'b') -2769 b.text = "B" -2770 b.tail = "TAIL" -2771 c = SubElement(a, 'c') -2772 c.text = "C" -2773 -2774 self.assertEqual(_bytes('ABTAILCtail'), -2775 tostring(a, method="text")) -
2776 -
2777 - def test_iterparse(self): -
2778 iterparse = self.etree.iterparse -2779 f = BytesIO('<a><b></b><c/></a>') -2780 -2781 iterator = iterparse(f) -2782 self.assertEqual(None, -2783 iterator.root) -2784 events = list(iterator) -2785 root = iterator.root -2786 self.assertEqual( -2787 [('end', root[0]), ('end', root[1]), ('end', root)], -2788 events) -
2789 -
2790 - def test_iterparse_incomplete(self): -
2791 iterparse = self.etree.iterparse -2792 f = BytesIO('<a><b></b><c/></a>') -2793 -2794 iterator = iterparse(f) -2795 self.assertEqual(None, -2796 iterator.root) -2797 event, element = next(iter(iterator)) -2798 self.assertEqual('end', event) -2799 self.assertEqual('b', element.tag) -
2800 -
2801 - def test_iterparse_file(self): -
2802 iterparse = self.etree.iterparse -2803 iterator = iterparse(fileInTestDir("test.xml")) -2804 self.assertEqual(None, -2805 iterator.root) -2806 events = list(iterator) -2807 root = iterator.root -2808 self.assertEqual( -2809 [('end', root[0]), ('end', root)], -2810 events) -
2811 -
2812 - def test_iterparse_start(self): -
2813 iterparse = self.etree.iterparse -2814 f = BytesIO('<a><b></b><c/></a>') -2815 -2816 iterator = iterparse(f, events=('start',)) -2817 events = list(iterator) -2818 root = iterator.root -2819 self.assertEqual( -2820 [('start', root), ('start', root[0]), ('start', root[1])], -2821 events) -
2822 -
2823 - def test_iterparse_start_end(self): -
2824 iterparse = self.etree.iterparse -2825 f = BytesIO('<a><b></b><c/></a>') -2826 -2827 iterator = iterparse(f, events=('start','end')) -2828 events = list(iterator) -2829 root = iterator.root -2830 self.assertEqual( -2831 [('start', root), ('start', root[0]), ('end', root[0]), -2832 ('start', root[1]), ('end', root[1]), ('end', root)], -2833 events) -
2834 -
2835 - def test_iterparse_clear(self): -
2836 iterparse = self.etree.iterparse -2837 f = BytesIO('<a><b></b><c/></a>') -2838 -2839 iterator = iterparse(f) -2840 for event, elem in iterator: -2841 elem.clear() -2842 -2843 root = iterator.root -2844 self.assertEqual(0, -2845 len(root)) -
2846 -
2847 - def test_iterparse_large(self): -
2848 iterparse = self.etree.iterparse -2849 CHILD_COUNT = 12345 -2850 f = BytesIO('<a>%s</a>' % ('<b>test</b>'*CHILD_COUNT)) -2851 -2852 i = 0 -2853 for key in iterparse(f): -2854 event, element = key -2855 i += 1 -2856 self.assertEqual(i, CHILD_COUNT + 1) -
2857 -
2858 - def test_iterparse_attrib_ns(self): -
2859 iterparse = self.etree.iterparse -2860 f = BytesIO('<a xmlns="http://ns1/"><b><c xmlns="http://ns2/"/></b></a>') -2861 -2862 attr_name = '{http://testns/}bla' -2863 events = [] -2864 iterator = iterparse(f, events=('start','end','start-ns','end-ns')) -2865 for event, elem in iterator: -2866 events.append(event) -2867 if event == 'start': -2868 if elem.tag != '{http://ns1/}a': -2869 elem.set(attr_name, 'value') -2870 -2871 self.assertEqual( -2872 ['start-ns', 'start', 'start', 'start-ns', 'start', -2873 'end', 'end-ns', 'end', 'end', 'end-ns'], -2874 events) -2875 -2876 root = iterator.root -2877 self.assertEqual( -2878 None, -2879 root.get(attr_name)) -2880 self.assertEqual( -2881 'value', -2882 root[0].get(attr_name)) -
2883 -
2884 - def test_iterparse_getiterator(self): -
2885 iterparse = self.etree.iterparse -2886 f = BytesIO('<a><b><d/></b><c/></a>') -2887 -2888 counts = [] -2889 for event, elem in iterparse(f): -2890 counts.append(len(list(elem.getiterator()))) -2891 self.assertEqual( -2892 [1,2,1,4], -2893 counts) -
2894 -
2896 iterparse = self.etree.iterparse -2897 f = BytesIO('<a><b><d/></b><c/></a>') -2898 -2899 for event, node in etree.iterparse(f): pass -2900 -2901 root = etree.Element('new_root', {}) -2902 root[:] = node[:] -2903 -2904 self.assertEqual( -2905 ['b', 'c'], -2906 [ el.tag for el in root ]) -
2907 -
2908 - def test_iterparse_cdata(self): -
2909 tostring = self.etree.tostring -2910 f = BytesIO('<root><![CDATA[test]]></root>') -2911 context = self.etree.iterparse(f) -2912 content = [ el.text for event,el in context ] -2913 -2914 self.assertEqual(['test'], content) -2915 self.assertEqual(_bytes('<root>test</root>'), -2916 tostring(context.root)) -
2917 -
2918 - def test_parse_file(self): -
2919 parse = self.etree.parse -2920 # from file -2921 tree = parse(fileInTestDir('test.xml')) -2922 self.assertXML( -2923 _bytes('<a><b></b></a>'), -2924 tree.getroot()) -
2925 -
2926 - def test_parse_file_nonexistent(self): -
2927 parse = self.etree.parse -2928 self.assertRaises(IOError, parse, fileInTestDir('notthere.xml')) -
2929 -
2930 - def test_parse_error_none(self): -
2931 parse = self.etree.parse -2932 self.assertRaises(TypeError, parse, None) -
2933 -2934 required_versions_ET['test_parse_error'] = (1,3) -
2935 - def test_parse_error(self): -
2936 # ET < 1.3 raises ExpatError -2937 parse = self.etree.parse -2938 f = BytesIO('<a><b></c></b></a>') -2939 self.assertRaises(SyntaxError, parse, f) -2940 f.close() -
2941 -2942 required_versions_ET['test_parse_error_from_file'] = (1,3) -
2943 - def test_parse_error_from_file(self): -
2944 parse = self.etree.parse -2945 # from file -2946 f = open(fileInTestDir('test_broken.xml'), 'rb') -2947 self.assertRaises(SyntaxError, parse, f) -2948 f.close() -
2949 -
2950 - def test_parse_file_object(self): -
2951 parse = self.etree.parse -2952 # from file object -2953 f = open(fileInTestDir('test.xml'), 'rb') -2954 tree = parse(f) -2955 f.close() -2956 self.assertXML( -2957 _bytes('<a><b></b></a>'), -2958 tree.getroot()) -
2959 -
2960 - def test_parse_stringio(self): -
2961 parse = self.etree.parse -2962 f = BytesIO('<a><b></b></a>') -2963 tree = parse(f) -2964 f.close() -2965 self.assertXML( -2966 _bytes('<a><b></b></a>'), -2967 tree.getroot() -2968 ) -
2969 -
2970 - def test_parse_cdata(self): -
2971 tostring = self.etree.tostring -2972 root = self.etree.XML(_bytes('<root><![CDATA[test]]></root>')) -2973 -2974 self.assertEqual('test', root.text) -2975 self.assertEqual(_bytes('<root>test</root>'), -2976 tostring(root)) -
2977 -
2978 - def test_parse_with_encoding(self): -
2979 # this can fail in libxml2 <= 2.6.22 -2980 parse = self.etree.parse -2981 tree = parse(BytesIO('<?xml version="1.0" encoding="ascii"?><html/>')) -2982 self.assertXML(_bytes('<html></html>'), -2983 tree.getroot()) -
2984 -
2985 - def test_encoding(self): -
2986 Element = self.etree.Element -2987 -2988 a = Element('a') -2989 a.text = _str('Søk på nettet') -2990 self.assertXML( -2991 _str('<a>Søk på nettet</a>').encode('UTF-8'), -2992 a, 'utf-8') -
2993 -
2994 - def test_encoding_exact(self): -
2995 ElementTree = self.etree.ElementTree -2996 Element = self.etree.Element -2997 -2998 a = Element('a') -2999 a.text = _str('Søk på nettet') -3000 -3001 f = BytesIO() -3002 tree = ElementTree(element=a) -3003 tree.write(f, encoding='utf-8') -3004 self.assertEqual(_str('<a>Søk på nettet</a>').encode('UTF-8'), -3005 f.getvalue().replace(_bytes('\n'),_bytes(''))) -
3006 -
3007 - def test_parse_file_encoding(self): -
3008 parse = self.etree.parse -3009 # from file -3010 tree = parse(fileInTestDir('test-string.xml')) -3011 self.assertXML( -3012 _str('<a>Søk på nettet</a>').encode('UTF-8'), -3013 tree.getroot(), 'UTF-8') -
3014 -
3016 parse = self.etree.parse -3017 # from file object -3018 f = open(fileInTestDir('test-string.xml'), 'rb') -3019 tree = parse(f) -3020 f.close() -3021 self.assertXML( -3022 _str('<a>Søk på nettet</a>').encode('UTF-8'), -3023 tree.getroot(), 'UTF-8') -
3024 -
3025 - def test_encoding_8bit_latin1(self): -
3026 ElementTree = self.etree.ElementTree -3027 Element = self.etree.Element -3028 -3029 a = Element('a') -3030 a.text = _str('Søk på nettet') -3031 -3032 f = BytesIO() -3033 tree = ElementTree(element=a) -3034 tree.write(f, encoding='iso-8859-1') -3035 result = f.getvalue() -3036 declaration = _bytes("<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>") -3037 self.assertEncodingDeclaration(result, _bytes('iso-8859-1')) -3038 result = result.split(_bytes('?>'), 1)[-1].replace(_bytes('\n'),_bytes('')) -3039 self.assertEqual(_str('<a>Søk på nettet</a>').encode('iso-8859-1'), -3040 result) -
3041 -3042 required_versions_ET['test_parse_encoding_8bit_explicit'] = (1,3) -
3044 XMLParser = self.XMLParser -3045 -3046 text = _str('Søk på nettet') -3047 xml_latin1 = (_str('<a>%s</a>') % text).encode('iso-8859-1') -3048 -3049 self.assertRaises(self.etree.ParseError, -3050 self.etree.parse, -3051 BytesIO(xml_latin1)) -3052 -3053 tree = self.etree.parse(BytesIO(xml_latin1), -3054 XMLParser(encoding="iso-8859-1")) -3055 a = tree.getroot() -3056 self.assertEqual(a.text, text) -
3057 -3058 required_versions_ET['test_parse_encoding_8bit_override'] = (1,3) -
3060 XMLParser = self.XMLParser -3061 -3062 text = _str('Søk på nettet') -3063 wrong_declaration = _str("<?xml version='1.0' encoding='UTF-8'?>") -3064 xml_latin1 = (_str('%s<a>%s</a>') % (wrong_declaration, text) -3065 ).encode('iso-8859-1') -3066 -3067 self.assertRaises(self.etree.ParseError, -3068 self.etree.parse, -3069 BytesIO(xml_latin1)) -3070 -3071 tree = self.etree.parse(BytesIO(xml_latin1), -3072 XMLParser(encoding="iso-8859-1")) -3073 a = tree.getroot() -3074 self.assertEqual(a.text, text) -
3075 -
3077 # raise error on wrong encoding declaration in unicode strings -3078 XML = self.etree.XML -3079 test_utf = (_str('<?xml version="1.0" encoding="iso-8859-1"?>') + -3080 _str('<a>Søk på nettet</a>')) -3081 self.assertRaises(SyntaxError, XML, test_utf) -
3082 -
3084 ElementTree = self.etree.ElementTree -3085 Element = self.etree.Element -3086 -3087 a = Element('a') -3088 a.text = _str('Søk på nettet') -3089 -3090 f = BytesIO() -3091 tree = ElementTree(element=a) -3092 tree.write(f) -3093 data = f.getvalue().replace(_bytes('\n'),_bytes('')) -3094 self.assertEqual( -3095 _str('<a>Søk på nettet</a>').encode('ASCII', 'xmlcharrefreplace'), -3096 data) -
3097 -
3098 - def test_encoding_tostring(self): -
3099 Element = self.etree.Element -3100 tostring = self.etree.tostring -3101 -3102 a = Element('a') -3103 a.text = _str('Søk på nettet') -3104 self.assertEqual(_str('<a>Søk på nettet</a>').encode('UTF-8'), -3105 tostring(a, encoding='utf-8')) -
3106 -
3108 Element = self.etree.Element -3109 tostring = self.etree.tostring -3110 -3111 a = Element('a') -3112 a.text = _str('Søk på nettet') -3113 self.assertRaises(LookupError, tostring, a, -3114 encoding='Invalid Encoding') -
3115 -
3116 - def test_encoding_tostring_sub(self): -
3117 Element = self.etree.Element -3118 SubElement = self.etree.SubElement -3119 tostring = self.etree.tostring -3120 -3121 a = Element('a') -3122 b = SubElement(a, 'b') -3123 b.text = _str('Søk på nettet') -3124 self.assertEqual(_str('<b>Søk på nettet</b>').encode('UTF-8'), -3125 tostring(b, encoding='utf-8')) -
3126 -
3128 Element = self.etree.Element -3129 SubElement = self.etree.SubElement -3130 tostring = self.etree.tostring -3131 -3132 a = Element('a') -3133 b = SubElement(a, 'b') -3134 b.text = _str('Søk på nettet') -3135 b.tail = _str('Søk') -3136 self.assertEqual(_str('<b>Søk på nettet</b>Søk').encode('UTF-8'), -3137 tostring(b, encoding='utf-8')) -
3138 -
3140 Element = self.etree.Element -3141 SubElement = self.etree.SubElement -3142 tostring = self.etree.tostring -3143 -3144 a = Element('a') -3145 a.text = _str('Søk på nettet') -3146 -3147 expected = _bytes('<a>S&#248;k p&#229; nettet</a>') -3148 self.assertEqual( -3149 expected, -3150 tostring(a)) -
3151 -
3153 Element = self.etree.Element -3154 SubElement = self.etree.SubElement -3155 tostring = self.etree.tostring -3156 -3157 a = Element('a') -3158 b = SubElement(a, 'b') -3159 b.text = _str('Søk på nettet') -3160 -3161 expected = _bytes('<b>S&#248;k p&#229; nettet</b>') -3162 self.assertEqual( -3163 expected, -3164 tostring(b)) -
3165 -
3166 - def test_encoding_8bit_xml(self): -
3167 utext = _str('Søk på nettet') -3168 uxml = _str('<p>%s</p>') % utext -3169 prologue = _bytes('<?xml version="1.0" encoding="iso-8859-1" ?>') -3170 isoxml = prologue + uxml.encode('iso-8859-1') -3171 tree = self.etree.XML(isoxml) -3172 self.assertEqual(utext, tree.text) -
3173 -
3174 - def test_encoding_utf8_bom(self): -
3175 utext = _str('Søk på nettet') -3176 uxml = (_str('<?xml version="1.0" encoding="UTF-8"?>') + -3177 _str('<p>%s</p>') % utext) -3178 bom = _bytes('\\xEF\\xBB\\xBF').decode("unicode_escape").encode("latin1") -3179 xml = bom + uxml.encode("utf-8") -3180 tree = etree.XML(xml) -3181 self.assertEqual(utext, tree.text) -
3182 -
3184 utext = _str('Søk på nettet') -3185 uxml = _str('<p>%s</p>') % utext -3186 prologue = _bytes('<?xml version="1.0" encoding="iso-8859-1" ?>') -3187 isoxml = prologue + uxml.encode('iso-8859-1') -3188 el = self.etree.parse(BytesIO(isoxml)).getroot() -3189 self.assertEqual(utext, el.text) -
3190 -
3191 - def test_deepcopy_elementtree(self): -
3192 Element = self.etree.Element -3193 ElementTree = self.etree.ElementTree -3194 -3195 a = Element('a') -3196 a.text = "Foo" -3197 atree = ElementTree(a) -3198 -3199 btree = copy.deepcopy(atree) -3200 self.assertEqual("Foo", atree.getroot().text) -3201 self.assertEqual("Foo", btree.getroot().text) -3202 self.assertFalse(btree is atree) -3203 self.assertFalse(btree.getroot() is atree.getroot()) -
3204 -
3205 - def test_deepcopy(self): -
3206 Element = self.etree.Element -3207 -3208 a = Element('a') -3209 a.text = 'Foo' -3210 -3211 b = copy.deepcopy(a) -3212 self.assertEqual('Foo', b.text) -3213 -3214 b.text = 'Bar' -3215 self.assertEqual('Bar', b.text) -3216 self.assertEqual('Foo', a.text) -3217 -3218 del a -3219 self.assertEqual('Bar', b.text) -
3220 -
3221 - def test_deepcopy_tail(self): -
3222 Element = self.etree.Element -3223 -3224 a = Element('a') -3225 a.tail = 'Foo' -3226 -3227 b = copy.deepcopy(a) -3228 self.assertEqual('Foo', b.tail) -3229 -3230 b.tail = 'Bar' -3231 self.assertEqual('Bar', b.tail) -3232 self.assertEqual('Foo', a.tail) -3233 -3234 del a -3235 self.assertEqual('Bar', b.tail) -
3236 -
3237 - def test_deepcopy_subelement(self): -
3238 Element = self.etree.Element -3239 SubElement = self.etree.SubElement -3240 -3241 root = Element('root') -3242 a = SubElement(root, 'a') -3243 a.text = 'FooText' -3244 a.tail = 'FooTail' -3245 -3246 b = copy.deepcopy(a) -3247 self.assertEqual('FooText', b.text) -3248 self.assertEqual('FooTail', b.tail) -3249 -3250 b.text = 'BarText' -3251 b.tail = 'BarTail' -3252 self.assertEqual('BarTail', b.tail) -3253 self.assertEqual('FooTail', a.tail) -3254 self.assertEqual('BarText', b.text) -3255 self.assertEqual('FooText', a.text) -3256 -3257 del a -3258 self.assertEqual('BarTail', b.tail) -3259 self.assertEqual('BarText', b.text) -
3260 -
3261 - def test_deepcopy_namespaces(self): -
3262 root = self.etree.XML(_bytes('''<doc xmlns="dns" xmlns:t="tns"> -3263 <parent><node t:foo="bar" /></parent> -3264 </doc>''')) -3265 self.assertEqual( -3266 root[0][0].get('{tns}foo'), -3267 copy.deepcopy(root[0])[0].get('{tns}foo') ) -3268 self.assertEqual( -3269 root[0][0].get('{tns}foo'), -3270 copy.deepcopy(root[0][0]).get('{tns}foo') ) -
3271 -
3272 - def test_deepcopy_append(self): -
3273 # previously caused a crash -3274 Element = self.etree.Element -3275 tostring = self.etree.tostring -3276 -3277 a = Element('a') -3278 b = copy.deepcopy(a) -3279 a.append( Element('C') ) -3280 b.append( Element('X') ) -3281 -3282 self.assertEqual(_bytes('<a><C/></a>'), -3283 tostring(a).replace(_bytes(' '), _bytes(''))) -3284 self.assertEqual(_bytes('<a><X/></a>'), -3285 tostring(b).replace(_bytes(' '), _bytes(''))) -
3286 -
3287 - def test_deepcopy_comment(self): -
3288 # previously caused a crash -3289 # not supported by ET < 1.3! -3290 Comment = self.etree.Comment -3291 -3292 a = Comment("ONE") -3293 b = copy.deepcopy(a) -3294 b.text = "ANOTHER" -3295 -3296 self.assertEqual('ONE', a.text) -3297 self.assertEqual('ANOTHER', b.text) -
3298 -
3299 - def test_shallowcopy(self): -
3300 Element = self.etree.Element -3301 -3302 a = Element('a') -3303 a.text = 'Foo' -3304 -3305 b = copy.copy(a) -3306 self.assertEqual('Foo', b.text) -3307 -3308 b.text = 'Bar' -3309 self.assertEqual('Bar', b.text) -3310 self.assertEqual('Foo', a.text) -
3311 # XXX ElementTree will share nodes, but lxml.etree won't.. -3312 -
3314 Element = self.etree.Element -3315 ElementTree = self.etree.ElementTree -3316 -3317 a = Element('a') -3318 a.text = 'Foo' -3319 atree = ElementTree(a) -3320 -3321 btree = copy.copy(atree) -3322 self.assertFalse(btree is atree) -3323 self.assertTrue(btree.getroot() is atree.getroot()) -3324 self.assertEqual('Foo', atree.getroot().text) -
3325 -
3326 - def _test_element_boolean(self): -
3327 # deprecated as of ET 1.3/lxml 2.0 -3328 etree = self.etree -3329 e = etree.Element('foo') -3330 self.assertEqual(False, bool(e)) -3331 etree.SubElement(e, 'bar') -3332 self.assertEqual(True, bool(e)) -3333 e = etree.Element('foo') -3334 e.text = 'hey' -3335 self.assertEqual(False, bool(e)) -3336 e = etree.Element('foo') -3337 e.tail = 'bar' -3338 self.assertEqual(False, bool(e)) -3339 e = etree.Element('foo') -3340 e.set('bar', 'Bar') -3341 self.assertEqual(False, bool(e)) -
3342 -
3343 - def test_multiple_elementrees(self): -
3344 etree = self.etree -3345 -3346 a = etree.Element('a') -3347 b = etree.SubElement(a, 'b') -3348 -3349 t = etree.ElementTree(a) -3350 self.assertEqual(self._rootstring(t), _bytes('<a><b/></a>')) -3351 -3352 t1 = etree.ElementTree(a) -3353 self.assertEqual(self._rootstring(t1), _bytes('<a><b/></a>')) -3354 self.assertEqual(self._rootstring(t), _bytes('<a><b/></a>')) -3355 -3356 t2 = etree.ElementTree(b) -3357 self.assertEqual(self._rootstring(t2), _bytes('<b/>')) -3358 self.assertEqual(self._rootstring(t1), _bytes('<a><b/></a>')) -3359 self.assertEqual(self._rootstring(t), _bytes('<a><b/></a>')) -
3360 -
3361 - def test_qname(self): -
3362 etree = self.etree -3363 qname = etree.QName('myns', 'a') -3364 a1 = etree.Element(qname) -3365 a2 = etree.SubElement(a1, qname) -3366 self.assertEqual(a1.tag, "{myns}a") -3367 self.assertEqual(a2.tag, "{myns}a") -
3368 -
3369 - def test_qname_cmp(self): -
3370 etree = self.etree -3371 qname1 = etree.QName('myns', 'a') -3372 qname2 = etree.QName('myns', 'a') -3373 self.assertEqual(qname1, "{myns}a") -3374 self.assertEqual("{myns}a", qname2) -3375 self.assertEqual(qname1, qname1) -3376 self.assertEqual(qname1, qname2) -
3377 -
3378 - def test_qname_attribute_getset(self): -
3379 etree = self.etree -3380 qname = etree.QName('myns', 'a') -3381 -3382 a = etree.Element(qname) -3383 a.set(qname, "value") -3384 -3385 self.assertEqual(a.get(qname), "value") -3386 self.assertEqual(a.get("{myns}a"), "value") -
3387 -
3388 - def test_qname_attrib(self): -
3389 etree = self.etree -3390 qname = etree.QName('myns', 'a') -3391 -3392 a = etree.Element(qname) -3393 a.attrib[qname] = "value" -3394 -3395 self.assertEqual(a.attrib[qname], "value") -3396 self.assertEqual(a.attrib.get(qname), "value") -3397 -3398 self.assertEqual(a.attrib["{myns}a"], "value") -3399 self.assertEqual(a.attrib.get("{myns}a"), "value") -
3400 -
3402 etree = self.etree -3403 qname = etree.QName('http://myns', 'a') -3404 a = etree.Element(qname) -3405 a.set(qname, qname) -3406 -3407 self.assertXML( -3408 _bytes('<ns0:a xmlns:ns0="http://myns" ns0:a="ns0:a"></ns0:a>'), -3409 a) -
3410 -
3412 etree = self.etree -3413 qname = etree.QName('http://myns', 'a') -3414 a = etree.Element('a') -3415 a.set('a', qname) -3416 -3417 self.assertXML( -3418 _bytes('<a xmlns:ns0="http://myns" a="ns0:a"></a>'), -3419 a) -
3420 -
3421 - def test_qname_attrib_resolve(self): -
3422 etree = self.etree -3423 qname = etree.QName('http://myns', 'a') -3424 a = etree.Element(qname) -3425 a.attrib[qname] = qname -3426 -3427 self.assertXML( -3428 _bytes('<ns0:a xmlns:ns0="http://myns" ns0:a="ns0:a"></ns0:a>'), -3429 a) -
3430 -
3431 - def test_parser_version(self): -
3432 etree = self.etree -3433 parser = etree.XMLParser() -3434 if hasattr(parser, "version"): -3435 # ElementTree 1.3+, cET -3436 self.assertTrue(re.match("[^ ]+ [0-9.]+", parser.version)) -
3437 -3438 # feed parser interface -3439 -
3440 - def test_feed_parser_bytes(self): -
3441 parser = self.XMLParser() -3442 -3443 parser.feed(_bytes('<?xml version=')) -3444 parser.feed(_bytes('"1.0"?><ro')) -3445 parser.feed(_bytes('ot><')) -3446 parser.feed(_bytes('a test="works"/')) -3447 parser.feed(_bytes('></root')) -3448 parser.feed(_bytes('>')) -3449 -3450 root = parser.close() -3451 -3452 self.assertEqual(root.tag, "root") -3453 self.assertEqual(root[0].tag, "a") -3454 self.assertEqual(root[0].get("test"), "works") -
3455 -
3456 - def test_feed_parser_unicode(self): -
3457 parser = self.XMLParser() -3458 -3459 parser.feed(_str('<ro')) -3460 parser.feed(_str('ot><')) -3461 parser.feed(_str('a test="works"/')) -3462 parser.feed(_str('></root')) -3463 parser.feed(_str('>')) -3464 -3465 root = parser.close() -3466 -3467 self.assertEqual(root.tag, "root") -3468 self.assertEqual(root[0].tag, "a") -3469 self.assertEqual(root[0].get("test"), "works") -
3470 -3471 required_versions_ET['test_feed_parser_error_close_empty'] = (1,3) -
3473 ParseError = self.etree.ParseError -3474 parser = self.XMLParser() -3475 self.assertRaises(ParseError, parser.close) -
3476 -3477 required_versions_ET['test_feed_parser_error_close_incomplete'] = (1,3) -
3479 ParseError = self.etree.ParseError -3480 parser = self.XMLParser() -3481 -3482 parser.feed('<?xml version=') -3483 parser.feed('"1.0"?><ro') -3484 -3485 self.assertRaises(ParseError, parser.close) -
3486 -3487 required_versions_ET['test_feed_parser_error_broken'] = (1,3) -
3489 ParseError = self.etree.ParseError -3490 parser = self.XMLParser() -3491 -3492 parser.feed('<?xml version=') -3493 parser.feed('"1.0"?><ro') -3494 try: -3495 parser.feed('<><><><><><><') -3496 except ParseError: -3497 # can raise, but not required before close() -3498 pass -3499 -3500 self.assertRaises(ParseError, parser.close) -
3501 -3502 required_versions_ET['test_feed_parser_error_position'] = (1,3) -
3504 ParseError = self.etree.ParseError -3505 parser = self.XMLParser() -3506 try: -3507 parser.close() -3508 except ParseError: -3509 e = sys.exc_info()[1] -3510 self.assertNotEqual(None, e.code) -3511 self.assertNotEqual(0, e.code) -3512 self.assertTrue(isinstance(e.position, tuple)) -3513 self.assertTrue(e.position >= (0, 0)) -
3514 -3515 # parser target interface -3516 -3517 required_versions_ET['test_parser_target_property'] = (1,3) -
3518 - def test_parser_target_property(self): -
3519 class Target(object): -3520 pass -
3521 -3522 target = Target() -3523 parser = self.XMLParser(target=target) -3524 -3525 self.assertEqual(target, parser.target) -3526 -
3527 - def test_parser_target_tag(self): -
3528 assertEqual = self.assertEqual -3529 assertFalse = self.assertFalse -3530 -3531 events = [] -3532 class Target(object): -3533 def start(self, tag, attrib): -3534 events.append("start") -3535 assertFalse(attrib) -3536 assertEqual("TAG", tag) -
3537 def end(self, tag): -3538 events.append("end") -3539 assertEqual("TAG", tag) -3540 def close(self): -3541 return "DONE" -3542 -3543 parser = self.XMLParser(target=Target()) -3544 -3545 parser.feed("<TAG/>") -3546 done = parser.close() -3547 -3548 self.assertEqual("DONE", done) -3549 self.assertEqual(["start", "end"], events) -3550 -
3552 assertEqual = self.assertEqual -3553 -3554 events = [] -3555 class Target(object): -3556 def start(self, tag, attrib): -3557 events.append("start") -3558 assertEqual("TAG", tag) -3559 raise ValueError("TEST") -
3560 def end(self, tag): -3561 events.append("end") -3562 assertEqual("TAG", tag) -3563 def close(self): -3564 return "DONE" -3565 -3566 parser = self.XMLParser(target=Target()) -3567 -3568 try: -3569 parser.feed("<TAG/>") -3570 except ValueError: -3571 self.assertTrue('TEST' in str(sys.exc_info()[1])) -3572 else: -3573 self.assertTrue(False) -3574 if 'lxml' in self.etree.__name__: -3575 self.assertEqual(["start"], events) -3576 else: -3577 # cElementTree calls end() as well -3578 self.assertTrue("start" in events) -3579 -
3581 assertEqual = self.assertEqual -3582 -3583 events = [] -3584 class Target(object): -3585 def start(self, tag, attrib): -3586 events.append("start") -3587 assertEqual("TAG", tag) -
3588 def end(self, tag): -3589 events.append("end") -3590 assertEqual("TAG", tag) -3591 raise ValueError("TEST") -3592 def close(self): -3593 return "DONE" -3594 -3595 parser = self.XMLParser(target=Target()) -3596 -3597 try: -3598 parser.feed("<TAG/>") -3599 except ValueError: -3600 self.assertTrue('TEST' in str(sys.exc_info()[1])) -3601 else: -3602 self.assertTrue(False) -3603 self.assertEqual(["start", "end"], events) -3604 -
3606 assertEqual = self.assertEqual -3607 -3608 events = [] -3609 class Target(object): -3610 def start(self, tag, attrib): -3611 events.append("start") -3612 assertEqual("TAG", tag) -
3613 def end(self, tag): -3614 events.append("end") -3615 assertEqual("TAG", tag) -3616 def close(self): -3617 raise ValueError("TEST") -3618 -3619 parser = self.XMLParser(target=Target()) -3620 -3621 try: -3622 parser.feed("<TAG/>") -3623 parser.close() -3624 except ValueError: -3625 self.assertTrue('TEST' in str(sys.exc_info()[1])) -3626 else: -3627 self.assertTrue(False) -3628 self.assertEqual(["start", "end"], events) -3629 -
3631 assertEqual = self.assertEqual -3632 -3633 events = [] -3634 class Target(object): -3635 def start(self, tag, attrib): -3636 events.append("start") -3637 assertEqual("TAG", tag) -3638 raise IndexError("TEST-IE") -
3639 def end(self, tag): -3640 events.append("end") -3641 assertEqual("TAG", tag) -3642 def close(self): -3643 raise ValueError("TEST-VE") -3644 -3645 parser = self.XMLParser(target=Target()) -3646 -3647 try: -3648 parser.feed("<TAG/>") -3649 parser.close() -3650 except IndexError: -3651 if 'lxml' in self.etree.__name__: -3652 # we try not to swallow the initial exception in Py2 -3653 self.assertTrue(sys.version_info[0] < 3) -3654 self.assertTrue('TEST-IE' in str(sys.exc_info()[1])) -3655 except ValueError: -3656 if 'lxml' in self.etree.__name__: -3657 self.assertTrue(sys.version_info[0] >= 3) -3658 self.assertTrue('TEST-VE' in str(sys.exc_info()[1])) -3659 else: -3660 self.assertTrue(False) -3661 -3662 if 'lxml' in self.etree.__name__: -3663 self.assertEqual(["start"], events) -3664 else: -3665 # cElementTree calls end() as well -3666 self.assertTrue("start" in events) -3667 -
3669 assertEqual = self.assertEqual -3670 assertFalse = self.assertFalse -3671 Element = self.etree.Element -3672 -3673 events = [] -3674 class Target(object): -3675 def start(self, tag, attrib): -3676 events.append("start") -3677 assertFalse(attrib) -3678 assertEqual("TAG", tag) -
3679 def end(self, tag): -3680 events.append("end") -3681 assertEqual("TAG", tag) -3682 def close(self): -3683 return Element("DONE") -3684 -3685 parser = self.XMLParser(target=Target()) -3686 tree = self.etree.ElementTree() -3687 tree.parse(BytesIO("<TAG/>"), parser=parser) -3688 -3689 self.assertEqual("DONE", tree.getroot().tag) -3690 self.assertEqual(["start", "end"], events) -3691 -
3692 - def test_parser_target_attrib(self): -
3693 assertEqual = self.assertEqual -3694 -3695 events = [] -3696 class Target(object): -3697 def start(self, tag, attrib): -3698 events.append("start-" + tag) -3699 for name, value in attrib.items(): -3700 assertEqual(tag + name, value) -
3701 def end(self, tag): -3702 events.append("end-" + tag) -3703 def close(self): -3704 return "DONE" -3705 -3706 parser = self.XMLParser(target=Target()) -3707 -3708 parser.feed('<root a="roota" b="rootb"><sub c="subc"/></root>') -3709 done = parser.close() -3710 -3711 self.assertEqual("DONE", done) -3712 self.assertEqual(["start-root", "start-sub", "end-sub", "end-root"], -3713 events) -3714 -
3715 - def test_parser_target_data(self): -
3716 events = [] -3717 class Target(object): -3718 def start(self, tag, attrib): -3719 events.append("start-" + tag) -
3720 def end(self, tag): -3721 events.append("end-" + tag) -3722 def data(self, data): -3723 events.append("data-" + data) -3724 def close(self): -3725 return "DONE" -3726 -3727 parser = self.XMLParser(target=Target()) -3728 -3729 parser.feed('<root>A<sub/>B</root>') -3730 done = parser.close() -3731 -3732 self.assertEqual("DONE", done) -3733 self.assertEqual(["start-root", "data-A", "start-sub", -3734 "end-sub", "data-B", "end-root"], -3735 events) -3736 -
3737 - def test_parser_target_entity(self): -
3738 events = [] -3739 class Target(object): -3740 def __init__(self): -3741 self._data = [] -
3742 def _flush_data(self): -3743 if self._data: -3744 events.append("data-" + ''.join(self._data)) -3745 del self._data[:] -3746 def start(self, tag, attrib): -3747 self._flush_data() -3748 events.append("start-" + tag) -3749 def end(self, tag): -3750 self._flush_data() -3751 events.append("end-" + tag) -3752 def data(self, data): -3753 self._data.append(data) -3754 def close(self): -3755 self._flush_data() -3756 return "DONE" -3757 -3758 parser = self.XMLParser(target=Target()) -3759 -3760 dtd = ''' -3761 <!DOCTYPE root [ -3762 <!ELEMENT root (sub*)> -3763 <!ELEMENT sub (#PCDATA)> -3764 <!ENTITY ent "an entity"> -3765 ]> -3766 ''' -3767 parser.feed(dtd+'<root><sub/><sub>this is &ent;</sub><sub/></root>') -3768 done = parser.close() -3769 -3770 self.assertEqual("DONE", done) -3771 self.assertEqual(["start-root", "start-sub", "end-sub", "start-sub", -3772 "data-this is an entity", -3773 "end-sub", "start-sub", "end-sub", "end-root"], -3774 events) -3775 -3776 required_versions_ET['test_parser_target_entity_unknown'] = (1,3) -
3778 events = [] -3779 class Target(object): -3780 def __init__(self): -3781 self._data = [] -
3782 def _flush_data(self): -3783 if self._data: -3784 events.append("data-" + ''.join(self._data)) -3785 del self._data[:] -3786 def start(self, tag, attrib): -3787 self._flush_data() -3788 events.append("start-" + tag) -3789 def end(self, tag): -3790 self._flush_data() -3791 events.append("end-" + tag) -3792 def data(self, data): -3793 self._data.append(data) -3794 def close(self): -3795 self._flush_data() -3796 return "DONE" -3797 -3798 parser = self.XMLParser(target=Target()) -3799 -3800 def feed(): -3801 parser.feed('<root><sub/><sub>some &ent;</sub><sub/></root>') -3802 parser.close() -3803 -3804 self.assertRaises(self.etree.ParseError, feed) -3805 -
3806 - def test_treebuilder(self): -
3807 builder = self.etree.TreeBuilder() -3808 el = builder.start("root", {'a':'A', 'b':'B'}) -3809 self.assertEqual("root", el.tag) -3810 self.assertEqual({'a':'A', 'b':'B'}, el.attrib) -3811 builder.data("ROOTTEXT") -3812 el = builder.start("child", {'x':'X', 'y':'Y'}) -3813 self.assertEqual("child", el.tag) -3814 self.assertEqual({'x':'X', 'y':'Y'}, el.attrib) -3815 builder.data("CHILDTEXT") -3816 el = builder.end("child") -3817 self.assertEqual("child", el.tag) -3818 self.assertEqual({'x':'X', 'y':'Y'}, el.attrib) -3819 self.assertEqual("CHILDTEXT", el.text) -3820 self.assertEqual(None, el.tail) -3821 builder.data("CHILDTAIL") -3822 root = builder.end("root") -3823 -3824 self.assertEqual("root", root.tag) -3825 self.assertEqual("ROOTTEXT", root.text) -3826 self.assertEqual("CHILDTEXT", root[0].text) -3827 self.assertEqual("CHILDTAIL", root[0].tail) -
3828 -
3829 - def test_treebuilder_target(self): -
3830 parser = self.XMLParser(target=self.etree.TreeBuilder()) -3831 parser.feed('<root>ROOTTEXT<child>CHILDTEXT</child>CHILDTAIL</root>') -3832 root = parser.close() -3833 -3834 self.assertEqual("root", root.tag) -3835 self.assertEqual("ROOTTEXT", root.text) -3836 self.assertEqual("CHILDTEXT", root[0].text) -3837 self.assertEqual("CHILDTAIL", root[0].tail) -
3838 -3839 # helper methods -3840 -
3841 - def _writeElement(self, element, encoding='us-ascii'): -
3842 """Write out element for comparison. -3843 """ -3844 data = self.etree.tostring(element, encoding=encoding) -3845 return canonicalize(data) -
3846 -
3847 - def _writeElementFile(self, element, encoding='us-ascii'): -
3848 """Write out element for comparison, using real file. -3849 """ -3850 ElementTree = self.etree.ElementTree -3851 handle, filename = tempfile.mkstemp() -3852 try: -3853 f = open(filename, 'wb') -3854 tree = ElementTree(element=element) -3855 tree.write(f, encoding=encoding) -3856 f.close() -3857 f = open(filename, 'rb') -3858 data = f.read() -3859 f.close() -3860 finally: -3861 os.close(handle) -3862 os.remove(filename) -3863 return canonicalize(data) -
3864 -
3865 - def assertXML(self, expected, element, encoding='us-ascii'): -
3866 """Writes element out and checks whether it is expected. -3867 -3868 Does this two ways; once using BytesIO, once using a real file. -3869 """ -3870 if isinstance(expected, unicode): -3871 expected = expected.encode(encoding) -3872 self.assertEqual(expected, self._writeElement(element, encoding)) -3873 self.assertEqual(expected, self._writeElementFile(element, encoding)) -
3874 -
3875 - def assertEncodingDeclaration(self, result, encoding): -
3876 "Checks if the result XML byte string specifies the encoding." -3877 enc_re = r"<\?xml[^>]+ encoding=[\"']([^\"']+)[\"']" -3878 if isinstance(result, str): -3879 has_encoding = re.compile(enc_re).match -3880 else: -3881 has_encoding = re.compile(_bytes(enc_re)).match -3882 self.assertTrue(has_encoding(result)) -3883 result_encoding = has_encoding(result).group(1) -3884 self.assertEqual(result_encoding.upper(), encoding.upper()) -
3885 -
3886 - def _rootstring(self, tree): -
3887 return self.etree.tostring(tree.getroot()).replace( -3888 _bytes(' '), _bytes('')).replace(_bytes('\n'), _bytes('')) -
3889 -
3890 - def _check_element_tree(self, tree): -
3891 self._check_element(tree.getroot()) -
3892 -
3893 - def _check_element(self, element): -
3894 self.assertTrue(hasattr(element, 'tag')) -3895 self.assertTrue(hasattr(element, 'attrib')) -3896 self.assertTrue(hasattr(element, 'text')) -3897 self.assertTrue(hasattr(element, 'tail')) -3898 self._check_string(element.tag) -3899 self._check_mapping(element.attrib) -3900 if element.text != None: -3901 self._check_string(element.text) -3902 if element.tail != None: -3903 self._check_string(element.tail) -
3904 -
3905 - def _check_string(self, string): -
3906 len(string) -3907 for char in string: -3908 self.assertEqual(1, len(char)) -3909 new_string = string + "" -3910 new_string = string + " " -3911 string[:0] -
3912 -
3913 - def _check_mapping(self, mapping): -
3914 len(mapping) -3915 keys = mapping.keys() -3916 values = mapping.values() -3917 items = mapping.items() -3918 for key in keys: -3919 item = mapping[key] -3920 mapping["key"] = "value" -3921 self.assertEqual("value", mapping["key"]) -
3922 -
3923 -3924 -class _XMLPullParserTest(unittest.TestCase): -
3925 etree = None -3926 -
3927 - def _feed(self, parser, data, chunk_size=None): -
3928 if chunk_size is None: -3929 parser.feed(data) -3930 else: -3931 for i in range(0, len(data), chunk_size): -3932 parser.feed(data[i:i+chunk_size]) -
3933 -
3934 - def _close_and_return_root(self, parser): -
3935 if 'ElementTree' in self.etree.__name__: -3936 # ElementTree's API is a bit unwieldy in Py3.4 -3937 root = parser._close_and_return_root() -3938 else: -3939 root = parser.close() -3940 return root -
3941 -
3942 - def assert_event_tags(self, parser, expected): -
3943 events = parser.read_events() -3944 self.assertEqual([(action, elem.tag) for action, elem in events], -3945 expected) -
3946 -
3947 - def test_simple_xml(self): -
3948 for chunk_size in (None, 1, 5): -3949 #with self.subTest(chunk_size=chunk_size): -3950 parser = self.etree.XMLPullParser() -3951 self.assert_event_tags(parser, []) -3952 self._feed(parser, "<!-- comment -->\n", chunk_size) -3953 self.assert_event_tags(parser, []) -3954 self._feed(parser, -3955 "<root>\n <element key='value'>text</element", -3956 chunk_size) -3957 self.assert_event_tags(parser, []) -3958 self._feed(parser, ">\n", chunk_size) -3959 self.assert_event_tags(parser, [('end', 'element')]) -3960 self._feed(parser, "<element>text</element>tail\n", chunk_size) -3961 self._feed(parser, "<empty-element/>\n", chunk_size) -3962 self.assert_event_tags(parser, [ -3963 ('end', 'element'), -3964 ('end', 'empty-element'), -3965 ]) -3966 self._feed(parser, "</root>\n", chunk_size) -3967 self.assert_event_tags(parser, [('end', 'root')]) -3968 root = self._close_and_return_root(parser) -3969 self.assertEqual(root.tag, 'root') -
3970 -
3971 - def test_feed_while_iterating(self): -
3972 parser = self.etree.XMLPullParser() -3973 it = parser.read_events() -3974 self._feed(parser, "<root>\n <element key='value'>text</element>\n") -3975 action, elem = next(it) -3976 self.assertEqual((action, elem.tag), ('end', 'element')) -3977 self._feed(parser, "</root>\n") -3978 action, elem = next(it) -3979 self.assertEqual((action, elem.tag), ('end', 'root')) -3980 try: -3981 next(it) -3982 except StopIteration: -3983 self.assertTrue(True) -3984 else: -3985 self.assertTrue(False) -
3986 -
3987 - def test_simple_xml_with_ns(self): -
3988 parser = self.etree.XMLPullParser() -3989 self.assert_event_tags(parser, []) -3990 self._feed(parser, "<!-- comment -->\n") -3991 self.assert_event_tags(parser, []) -3992 self._feed(parser, "<root xmlns='namespace'>\n") -3993 self.assert_event_tags(parser, []) -3994 self._feed(parser, "<element key='value'>text</element") -3995 self.assert_event_tags(parser, []) -3996 self._feed(parser, ">\n") -3997 self.assert_event_tags(parser, [('end', '{namespace}element')]) -3998 self._feed(parser, "<element>text</element>tail\n") -3999 self._feed(parser, "<empty-element/>\n") -4000 self.assert_event_tags(parser, [ -4001 ('end', '{namespace}element'), -4002 ('end', '{namespace}empty-element'), -4003 ]) -4004 self._feed(parser, "</root>\n") -4005 self.assert_event_tags(parser, [('end', '{namespace}root')]) -4006 root = self._close_and_return_root(parser) -4007 self.assertEqual(root.tag, '{namespace}root') -
4008 -
4009 - def test_ns_events(self): -
4010 parser = self.etree.XMLPullParser(events=('start-ns', 'end-ns')) -4011 self._feed(parser, "<!-- comment -->\n") -4012 self._feed(parser, "<root xmlns='namespace'>\n") -4013 self.assertEqual( -4014 list(parser.read_events()), -4015 [('start-ns', ('', 'namespace'))]) -4016 self._feed(parser, "<element key='value'>text</element") -4017 self._feed(parser, ">\n") -4018 self._feed(parser, "<element>text</element>tail\n") -4019 self._feed(parser, "<empty-element/>\n") -4020 self._feed(parser, "</root>\n") -4021 self.assertEqual(list(parser.read_events()), [('end-ns', None)]) -4022 parser.close() -
4023 -
4024 - def test_events(self): -
4025 parser = self.etree.XMLPullParser(events=()) -4026 self._feed(parser, "<root/>\n") -4027 self.assert_event_tags(parser, []) -4028 -4029 parser = self.etree.XMLPullParser(events=('start', 'end')) -4030 self._feed(parser, "<!-- comment -->\n") -4031 self.assert_event_tags(parser, []) -4032 self._feed(parser, "<root>\n") -4033 self.assert_event_tags(parser, [('start', 'root')]) -4034 self._feed(parser, "<element key='value'>text</element") -4035 self.assert_event_tags(parser, [('start', 'element')]) -4036 self._feed(parser, ">\n") -4037 self.assert_event_tags(parser, [('end', 'element')]) -4038 self._feed(parser, -4039 "<element xmlns='foo'>text<empty-element/></element>tail\n") -4040 self.assert_event_tags(parser, [ -4041 ('start', '{foo}element'), -4042 ('start', '{foo}empty-element'), -4043 ('end', '{foo}empty-element'), -4044 ('end', '{foo}element'), -4045 ]) -4046 self._feed(parser, "</root>") -4047 root = self._close_and_return_root(parser) -4048 self.assert_event_tags(parser, [('end', 'root')]) -4049 self.assertEqual(root.tag, 'root') -4050 -4051 parser = self.etree.XMLPullParser(events=('start',)) -4052 self._feed(parser, "<!-- comment -->\n") -4053 self.assert_event_tags(parser, []) -4054 self._feed(parser, "<root>\n") -4055 self.assert_event_tags(parser, [('start', 'root')]) -4056 self._feed(parser, "<element key='value'>text</element") -4057 self.assert_event_tags(parser, [('start', 'element')]) -4058 self._feed(parser, ">\n") -4059 self.assert_event_tags(parser, []) -4060 self._feed(parser, -4061 "<element xmlns='foo'>text<empty-element/></element>tail\n") -4062 self.assert_event_tags(parser, [ -4063 ('start', '{foo}element'), -4064 ('start', '{foo}empty-element'), -4065 ]) -4066 self._feed(parser, "</root>") -4067 root = self._close_and_return_root(parser) -4068 self.assertEqual(root.tag, 'root') -
4069 -
4070 - def test_events_sequence(self): -
4071 # Test that events can be some sequence that's not just a tuple or list -4072 eventset = set(['end', 'start']) -4073 parser = self.etree.XMLPullParser(events=eventset) -4074 self._feed(parser, "<foo>bar</foo>") -4075 self.assert_event_tags(parser, [('start', 'foo'), ('end', 'foo')]) -4076 -4077 class DummyIter: -4078 def __init__(self): -4079 self.events = iter(['start', 'end', 'start-ns']) -
4080 def __iter__(self): -4081 return self -
4082 def __next__(self): -4083 return next(self.events) -4084 next = __next__ -4085 -4086 parser = self.etree.XMLPullParser(events=DummyIter()) -4087 self._feed(parser, "<foo>bar</foo>") -4088 self.assert_event_tags(parser, [('start', 'foo'), ('end', 'foo')]) -4089 -
4090 - def test_unknown_event(self): -
4091 try: -4092 self.etree.XMLPullParser(events=('start', 'end', 'bogus')) -4093 except ValueError: -4094 self.assertTrue(True) -4095 else: -4096 self.assertTrue(False) -
4097 -4098 -4099 if etree: -
4100 - class ETreeTestCase(_ETreeTestCaseBase): -
4101 etree = etree -
4102 -
4103 - class ETreePullTestCase(_XMLPullParserTest): -
4104 etree = etree -
4105 -4106 -4107 if ElementTree: -
4108 - class ElementTreeTestCase(_ETreeTestCaseBase): -
4109 etree = ElementTree -4110 -4111 @classmethod -
4112 - def setUpClass(cls): -
4113 import warnings -4114 # ElementTree warns about getiterator() in recent Pythons -4115 warnings.filterwarnings( -4116 'ignore', -4117 r'This method will be removed.*\.iter\(\).*instead', -4118 PendingDeprecationWarning) -
4119 -4120 filter_by_version( -4121 ElementTreeTestCase, -4122 ElementTreeTestCase.required_versions_ET, ET_VERSION) -4123 -4124 if hasattr(ElementTree, 'XMLPullParser'): -
4125 - class ElementTreePullTestCase(_XMLPullParserTest): -
4127 else: -4128 ElementTreePullTestCase = None -4129 -4130 -4131 if cElementTree: -
4132 - class CElementTreeTestCase(_ETreeTestCaseBase): -
4134 -4135 filter_by_version( -4136 CElementTreeTestCase, -4137 CElementTreeTestCase.required_versions_cET, CET_VERSION) -
4138 -4139 -4140 -def test_suite(): -
4141 suite = unittest.TestSuite() -4142 if etree: -4143 suite.addTests([unittest.makeSuite(ETreeTestCase)]) -4144 suite.addTests([unittest.makeSuite(ETreePullTestCase)]) -4145 if ElementTree: -4146 suite.addTests([unittest.makeSuite(ElementTreeTestCase)]) -4147 if ElementTreePullTestCase: -4148 suite.addTests([unittest.makeSuite(ElementTreePullTestCase)]) -4149 if cElementTree: -4150 suite.addTests([unittest.makeSuite(CElementTreeTestCase)]) -4151 return suite -
4152 -4153 if __name__ == '__main__': -4154 print('to test use test.py %s' % __file__) -4155 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementtree.CElementTreeTestCase-class.html b/doc/html/api/lxml.tests.test_elementtree.CElementTreeTestCase-class.html deleted file mode 100644 index badd47fa..00000000 --- a/doc/html/api/lxml.tests.test_elementtree.CElementTreeTestCase-class.html +++ /dev/null @@ -1,639 +0,0 @@ - - - - - lxml.tests.test_elementtree.CElementTreeTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementtree :: - Class CElementTreeTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class CElementTreeTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-               _ETreeTestCaseBase --+
-                                    |
-                                   CElementTreeTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from _ETreeTestCaseBase: - XMLParser, - assertEncodingDeclaration, - assertXML, - test_ElementTree, - test_XML, - test_XMLID, - test_attrib, - test_attrib_as_attrib, - test_attrib_clear, - test_attrib_copy, - test_attrib_deepcopy, - test_attrib_dict, - test_attrib_get, - test_attrib_ns_clear, - test_attrib_pop, - test_attrib_pop_default, - test_attrib_pop_empty_default, - test_attrib_pop_invalid_args, - test_attrib_pop_unknown, - test_attrib_set_clear, - test_attribute_contains, - test_attribute_items, - test_attribute_items2, - test_attribute_items_ns, - test_attribute_iterator, - test_attribute_keys, - test_attribute_keys2, - test_attribute_keys_ns, - test_attribute_manipulation, - test_attribute_namespace_roundtrip, - test_attribute_namespace_roundtrip_replaced, - test_attribute_set, - test_attribute_str, - test_attribute_update_attrib, - test_attribute_update_dict, - test_attribute_update_iter, - test_attribute_update_sequence, - test_attribute_values, - test_attribute_values_ns, - test_attribute_xmlns_move, - test_attributes_get, - test_clear, - test_clear_sub, - test_clear_tail, - test_comment, - test_comment_getitem_getslice, - test_comment_nonsense, - test_comment_text, - test_comment_whitespace, - test_crash, - test_deepcopy, - test_deepcopy_append, - test_deepcopy_comment, - test_deepcopy_elementtree, - test_deepcopy_namespaces, - test_deepcopy_subelement, - test_deepcopy_tail, - test_del_attribute_ns, - test_del_attribute_ns_parsed, - test_del_insert, - test_del_setitem, - test_del_setslice, - test_delitem, - test_delitem_tail, - test_delslice, - test_delslice_child_tail, - test_delslice_memory, - test_delslice_negative1, - test_delslice_negative2, - test_delslice_step, - test_delslice_step_negative, - test_delslice_step_negative2, - test_delslice_tail, - test_element, - test_element_contains, - test_element_indexing_negative, - test_element_indexing_only_text, - test_element_indexing_with_text, - test_element_indexing_with_text2, - test_element_with_attributes, - test_element_with_attributes_extra, - test_element_with_attributes_extra_duplicate, - test_element_with_attributes_keywords, - test_element_with_attributes_ns, - test_elementtree, - test_elementtree_getiterator, - test_elementtree_getiterator_filter, - test_elementtree_parser_target, - test_encoding, - test_encoding_8bit_latin1, - test_encoding_8bit_parse_stringio, - test_encoding_8bit_xml, - test_encoding_exact, - test_encoding_sub_tostring_default_encoding, - test_encoding_tostring, - test_encoding_tostring_default_encoding, - test_encoding_tostring_sub, - test_encoding_tostring_sub_tail, - test_encoding_tostring_unknown, - test_encoding_utf8_bom, - test_encoding_write_default_encoding, - test_extend, - test_feed_parser_bytes, - test_feed_parser_error_broken, - test_feed_parser_error_close_empty, - test_feed_parser_error_close_incomplete, - test_feed_parser_error_position, - test_feed_parser_unicode, - test_findall, - test_findall_ns, - test_fromstring, - test_fromstringlist, - test_fromstringlist_characters, - test_fromstringlist_single, - test_getiterator, - test_getiterator_empty, - test_getiterator_filter, - test_getiterator_filter_all, - test_getiterator_filter_comment, - test_getiterator_filter_pi, - test_getiterator_filter_with_text, - test_getiterator_with_text, - test_getslice, - test_getslice_negative, - test_getslice_step, - test_getslice_text, - test_insert, - test_insert_beyond_index, - test_insert_negative, - test_insert_tail, - test_iselement, - test_iter, - test_iteration, - test_iteration_crash, - test_iteration_del_child, - test_iteration_double, - test_iteration_empty, - test_iteration_reversed, - test_iteration_subelement, - test_iteration_text_only, - test_iterparse, - test_iterparse_attrib_ns, - test_iterparse_cdata, - test_iterparse_clear, - test_iterparse_file, - test_iterparse_getiterator, - test_iterparse_incomplete, - test_iterparse_large, - test_iterparse_move_elements, - test_iterparse_start, - test_iterparse_start_end, - test_itertext, - test_itertext_child, - test_makeelement, - test_merge_namespaced_subtree_as_slice, - test_multiple_elementrees, - test_namespaces_after_serialize, - test_ns_access, - test_ns_access2, - test_ns_attr, - test_ns_decl_tostring, - test_ns_decl_tostring_default, - test_ns_decl_tostring_element, - test_ns_decl_tostring_root, - test_ns_move, - test_ns_setting, - test_ns_tag_parse, - test_parse_cdata, - test_parse_encoding_8bit_explicit, - test_parse_encoding_8bit_override, - test_parse_error, - test_parse_error_from_file, - test_parse_error_none, - test_parse_file, - test_parse_file_encoding, - test_parse_file_nonexistent, - test_parse_file_object, - test_parse_file_object_encoding, - test_parse_stringio, - test_parse_with_encoding, - test_parser_target_attrib, - test_parser_target_data, - test_parser_target_entity, - test_parser_target_entity_unknown, - test_parser_target_error_in_close, - test_parser_target_error_in_end, - test_parser_target_error_in_start, - test_parser_target_error_in_start_and_close, - test_parser_target_property, - test_parser_target_tag, - test_parser_version, - test_pi, - test_pi_nonsense, - test_processinginstruction, - test_qname, - test_qname_attrib, - test_qname_attrib_resolve, - test_qname_attribute_getset, - test_qname_attribute_resolve, - test_qname_attribute_resolve_new, - test_qname_cmp, - test_register_namespace, - test_remove, - test_remove_nonexisting, - test_remove_ns, - test_remove_tail, - test_replace_slice_tail, - test_set_text, - test_set_text2, - test_set_text_empty, - test_set_text_none, - test_setitem, - test_setitem2, - test_setitem_indexerror, - test_setitem_replace, - test_setitem_tail, - test_setslice, - test_setslice_all, - test_setslice_all_empty, - test_setslice_all_replace, - test_setslice_all_replace_reversed, - test_setslice_all_replace_reversed_ns1, - test_setslice_all_replace_reversed_ns2, - test_setslice_empty, - test_setslice_end, - test_setslice_end_exact, - test_setslice_negative, - test_setslice_negative2, - test_setslice_single, - test_setslice_tail, - test_shallowcopy, - test_shallowcopy_elementtree, - test_simple, - test_subelement, - test_subelement_reference, - test_subelement_with_attributes, - test_subelement_with_attributes_ns, - test_tag_reset_ns, - test_tag_reset_root_ns, - test_tag_str_subclass, - test_tag_write, - test_tail, - test_tail1, - test_tail_append, - test_tail_elementtree_root, - test_tail_set_none, - test_tail_set_twice, - test_tail_str_subclass, - test_text, - test_text_empty, - test_text_escape_in, - test_text_escape_out, - test_text_escape_tostring, - test_text_other, - test_text_str_subclass, - test_tostring, - test_tostring_element, - test_tostring_element_tail, - test_tostring_method_html, - test_tostring_method_text, - test_treebuilder, - test_treebuilder_target, - test_weird_dict_interaction, - test_write, - test_write_ElementTreeDoctest, - test_write_fail, - test_write_method_html, - test_write_method_text -

- -

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree = None
- hash(x) -
-

Inherited from _ETreeTestCaseBase: - required_versions_ET, - required_versions_cET -

-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementtree.ETreePullTestCase-class.html b/doc/html/api/lxml.tests.test_elementtree.ETreePullTestCase-class.html deleted file mode 100644 index 9d193dd7..00000000 --- a/doc/html/api/lxml.tests.test_elementtree.ETreePullTestCase-class.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - lxml.tests.test_elementtree.ETreePullTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementtree :: - Class ETreePullTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreePullTestCase

source code

-
-            object --+        
-                     |        
-unittest.case.TestCase --+    
-                         |    
-        _XMLPullParserTest --+
-                             |
-                            ETreePullTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from _XMLPullParserTest: - assert_event_tags, - test_events, - test_events_sequence, - test_feed_while_iterating, - test_ns_events, - test_simple_xml, - test_simple_xml_with_ns, - test_unknown_event -

-

Inherited from _XMLPullParserTest (private): - _close_and_return_root, - _feed -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest, - tearDown -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementtree.ETreeTestCase-class.html b/doc/html/api/lxml.tests.test_elementtree.ETreeTestCase-class.html deleted file mode 100644 index ee70c40b..00000000 --- a/doc/html/api/lxml.tests.test_elementtree.ETreeTestCase-class.html +++ /dev/null @@ -1,673 +0,0 @@ - - - - - lxml.tests.test_elementtree.ETreeTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementtree :: - Class ETreeTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-               _ETreeTestCaseBase --+
-                                    |
-                                   ETreeTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from _ETreeTestCaseBase: - XMLParser, - assertEncodingDeclaration, - assertXML, - test_ElementTree, - test_XML, - test_XMLID, - test_attrib, - test_attrib_as_attrib, - test_attrib_clear, - test_attrib_copy, - test_attrib_deepcopy, - test_attrib_dict, - test_attrib_get, - test_attrib_ns_clear, - test_attrib_pop, - test_attrib_pop_default, - test_attrib_pop_empty_default, - test_attrib_pop_invalid_args, - test_attrib_pop_unknown, - test_attrib_set_clear, - test_attribute_contains, - test_attribute_items, - test_attribute_items2, - test_attribute_items_ns, - test_attribute_iterator, - test_attribute_keys, - test_attribute_keys2, - test_attribute_keys_ns, - test_attribute_manipulation, - test_attribute_namespace_roundtrip, - test_attribute_namespace_roundtrip_replaced, - test_attribute_set, - test_attribute_str, - test_attribute_update_attrib, - test_attribute_update_dict, - test_attribute_update_iter, - test_attribute_update_sequence, - test_attribute_values, - test_attribute_values_ns, - test_attribute_xmlns_move, - test_attributes_get, - test_clear, - test_clear_sub, - test_clear_tail, - test_comment, - test_comment_getitem_getslice, - test_comment_nonsense, - test_comment_text, - test_comment_whitespace, - test_crash, - test_deepcopy, - test_deepcopy_append, - test_deepcopy_comment, - test_deepcopy_elementtree, - test_deepcopy_namespaces, - test_deepcopy_subelement, - test_deepcopy_tail, - test_del_attribute_ns, - test_del_attribute_ns_parsed, - test_del_insert, - test_del_setitem, - test_del_setslice, - test_delitem, - test_delitem_tail, - test_delslice, - test_delslice_child_tail, - test_delslice_memory, - test_delslice_negative1, - test_delslice_negative2, - test_delslice_step, - test_delslice_step_negative, - test_delslice_step_negative2, - test_delslice_tail, - test_element, - test_element_contains, - test_element_indexing_negative, - test_element_indexing_only_text, - test_element_indexing_with_text, - test_element_indexing_with_text2, - test_element_with_attributes, - test_element_with_attributes_extra, - test_element_with_attributes_extra_duplicate, - test_element_with_attributes_keywords, - test_element_with_attributes_ns, - test_elementtree, - test_elementtree_getiterator, - test_elementtree_getiterator_filter, - test_elementtree_parser_target, - test_encoding, - test_encoding_8bit_latin1, - test_encoding_8bit_parse_stringio, - test_encoding_8bit_xml, - test_encoding_exact, - test_encoding_sub_tostring_default_encoding, - test_encoding_tostring, - test_encoding_tostring_default_encoding, - test_encoding_tostring_sub, - test_encoding_tostring_sub_tail, - test_encoding_tostring_unknown, - test_encoding_utf8_bom, - test_encoding_write_default_encoding, - test_extend, - test_feed_parser_bytes, - test_feed_parser_error_broken, - test_feed_parser_error_close_empty, - test_feed_parser_error_close_incomplete, - test_feed_parser_error_position, - test_feed_parser_unicode, - test_findall, - test_findall_ns, - test_fromstring, - test_fromstringlist, - test_fromstringlist_characters, - test_fromstringlist_single, - test_getiterator, - test_getiterator_empty, - test_getiterator_filter, - test_getiterator_filter_all, - test_getiterator_filter_comment, - test_getiterator_filter_pi, - test_getiterator_filter_with_text, - test_getiterator_with_text, - test_getslice, - test_getslice_negative, - test_getslice_step, - test_getslice_text, - test_insert, - test_insert_beyond_index, - test_insert_negative, - test_insert_tail, - test_iselement, - test_iter, - test_iteration, - test_iteration_crash, - test_iteration_del_child, - test_iteration_double, - test_iteration_empty, - test_iteration_reversed, - test_iteration_subelement, - test_iteration_text_only, - test_iterparse, - test_iterparse_attrib_ns, - test_iterparse_cdata, - test_iterparse_clear, - test_iterparse_file, - test_iterparse_getiterator, - test_iterparse_incomplete, - test_iterparse_large, - test_iterparse_move_elements, - test_iterparse_start, - test_iterparse_start_end, - test_itertext, - test_itertext_child, - test_makeelement, - test_merge_namespaced_subtree_as_slice, - test_multiple_elementrees, - test_namespaces_after_serialize, - test_ns_access, - test_ns_access2, - test_ns_attr, - test_ns_decl_tostring, - test_ns_decl_tostring_default, - test_ns_decl_tostring_element, - test_ns_decl_tostring_root, - test_ns_move, - test_ns_setting, - test_ns_tag_parse, - test_parse_cdata, - test_parse_encoding_8bit_explicit, - test_parse_encoding_8bit_override, - test_parse_error, - test_parse_error_from_file, - test_parse_error_none, - test_parse_file, - test_parse_file_encoding, - test_parse_file_nonexistent, - test_parse_file_object, - test_parse_file_object_encoding, - test_parse_stringio, - test_parse_with_encoding, - test_parser_target_attrib, - test_parser_target_data, - test_parser_target_entity, - test_parser_target_entity_unknown, - test_parser_target_error_in_close, - test_parser_target_error_in_end, - test_parser_target_error_in_start, - test_parser_target_error_in_start_and_close, - test_parser_target_property, - test_parser_target_tag, - test_parser_version, - test_pi, - test_pi_nonsense, - test_processinginstruction, - test_qname, - test_qname_attrib, - test_qname_attrib_resolve, - test_qname_attribute_getset, - test_qname_attribute_resolve, - test_qname_attribute_resolve_new, - test_qname_cmp, - test_register_namespace, - test_remove, - test_remove_nonexisting, - test_remove_ns, - test_remove_tail, - test_replace_slice_tail, - test_set_text, - test_set_text2, - test_set_text_empty, - test_set_text_none, - test_setitem, - test_setitem2, - test_setitem_indexerror, - test_setitem_replace, - test_setitem_tail, - test_setslice, - test_setslice_all, - test_setslice_all_empty, - test_setslice_all_replace, - test_setslice_all_replace_reversed, - test_setslice_all_replace_reversed_ns1, - test_setslice_all_replace_reversed_ns2, - test_setslice_empty, - test_setslice_end, - test_setslice_end_exact, - test_setslice_negative, - test_setslice_negative2, - test_setslice_single, - test_setslice_tail, - test_shallowcopy, - test_shallowcopy_elementtree, - test_simple, - test_subelement, - test_subelement_reference, - test_subelement_with_attributes, - test_subelement_with_attributes_ns, - test_tag_reset_ns, - test_tag_reset_root_ns, - test_tag_str_subclass, - test_tag_write, - test_tail, - test_tail1, - test_tail_append, - test_tail_elementtree_root, - test_tail_set_none, - test_tail_set_twice, - test_tail_str_subclass, - test_text, - test_text_empty, - test_text_escape_in, - test_text_escape_out, - test_text_escape_tostring, - test_text_other, - test_text_str_subclass, - test_tostring, - test_tostring_element, - test_tostring_element_tail, - test_tostring_method_html, - test_tostring_method_text, - test_treebuilder, - test_treebuilder_target, - test_weird_dict_interaction, - test_write, - test_write_ElementTreeDoctest, - test_write_fail, - test_write_method_html, - test_write_method_text -

- -

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from _ETreeTestCaseBase: - required_versions_ET, - required_versions_cET -

-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementtree.ElementTreeTestCase-class.html b/doc/html/api/lxml.tests.test_elementtree.ElementTreeTestCase-class.html deleted file mode 100644 index c3b94108..00000000 --- a/doc/html/api/lxml.tests.test_elementtree.ElementTreeTestCase-class.html +++ /dev/null @@ -1,732 +0,0 @@ - - - - - lxml.tests.test_elementtree.ElementTreeTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementtree :: - Class ElementTreeTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementTreeTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-               _ETreeTestCaseBase --+
-                                    |
-                                   ElementTreeTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from _ETreeTestCaseBase: - XMLParser, - assertEncodingDeclaration, - assertXML, - test_ElementTree, - test_XML, - test_XMLID, - test_attrib, - test_attrib_as_attrib, - test_attrib_clear, - test_attrib_copy, - test_attrib_deepcopy, - test_attrib_dict, - test_attrib_get, - test_attrib_ns_clear, - test_attrib_pop, - test_attrib_pop_default, - test_attrib_pop_empty_default, - test_attrib_pop_invalid_args, - test_attrib_pop_unknown, - test_attrib_set_clear, - test_attribute_contains, - test_attribute_items, - test_attribute_items2, - test_attribute_items_ns, - test_attribute_iterator, - test_attribute_keys, - test_attribute_keys2, - test_attribute_keys_ns, - test_attribute_manipulation, - test_attribute_namespace_roundtrip, - test_attribute_namespace_roundtrip_replaced, - test_attribute_set, - test_attribute_str, - test_attribute_update_attrib, - test_attribute_update_dict, - test_attribute_update_iter, - test_attribute_update_sequence, - test_attribute_values, - test_attribute_values_ns, - test_attribute_xmlns_move, - test_attributes_get, - test_clear, - test_clear_sub, - test_clear_tail, - test_comment, - test_comment_getitem_getslice, - test_comment_nonsense, - test_comment_text, - test_comment_whitespace, - test_crash, - test_deepcopy, - test_deepcopy_append, - test_deepcopy_comment, - test_deepcopy_elementtree, - test_deepcopy_namespaces, - test_deepcopy_subelement, - test_deepcopy_tail, - test_del_attribute_ns, - test_del_attribute_ns_parsed, - test_del_insert, - test_del_setitem, - test_del_setslice, - test_delitem, - test_delitem_tail, - test_delslice, - test_delslice_child_tail, - test_delslice_memory, - test_delslice_negative1, - test_delslice_negative2, - test_delslice_step, - test_delslice_step_negative, - test_delslice_step_negative2, - test_delslice_tail, - test_element, - test_element_contains, - test_element_indexing_negative, - test_element_indexing_only_text, - test_element_indexing_with_text, - test_element_indexing_with_text2, - test_element_with_attributes, - test_element_with_attributes_extra, - test_element_with_attributes_extra_duplicate, - test_element_with_attributes_keywords, - test_element_with_attributes_ns, - test_elementtree, - test_elementtree_getiterator, - test_elementtree_getiterator_filter, - test_elementtree_parser_target, - test_encoding, - test_encoding_8bit_latin1, - test_encoding_8bit_parse_stringio, - test_encoding_8bit_xml, - test_encoding_exact, - test_encoding_sub_tostring_default_encoding, - test_encoding_tostring, - test_encoding_tostring_default_encoding, - test_encoding_tostring_sub, - test_encoding_tostring_sub_tail, - test_encoding_tostring_unknown, - test_encoding_utf8_bom, - test_encoding_write_default_encoding, - test_extend, - test_feed_parser_bytes, - test_feed_parser_error_broken, - test_feed_parser_error_close_empty, - test_feed_parser_error_close_incomplete, - test_feed_parser_error_position, - test_feed_parser_unicode, - test_findall, - test_findall_ns, - test_fromstring, - test_fromstringlist, - test_fromstringlist_characters, - test_fromstringlist_single, - test_getiterator, - test_getiterator_empty, - test_getiterator_filter, - test_getiterator_filter_all, - test_getiterator_filter_comment, - test_getiterator_filter_pi, - test_getiterator_filter_with_text, - test_getiterator_with_text, - test_getslice, - test_getslice_negative, - test_getslice_step, - test_getslice_text, - test_insert, - test_insert_beyond_index, - test_insert_negative, - test_insert_tail, - test_iselement, - test_iter, - test_iteration, - test_iteration_crash, - test_iteration_del_child, - test_iteration_double, - test_iteration_empty, - test_iteration_reversed, - test_iteration_subelement, - test_iteration_text_only, - test_iterparse, - test_iterparse_attrib_ns, - test_iterparse_cdata, - test_iterparse_clear, - test_iterparse_file, - test_iterparse_getiterator, - test_iterparse_incomplete, - test_iterparse_large, - test_iterparse_move_elements, - test_iterparse_start, - test_iterparse_start_end, - test_itertext, - test_itertext_child, - test_makeelement, - test_merge_namespaced_subtree_as_slice, - test_multiple_elementrees, - test_namespaces_after_serialize, - test_ns_access, - test_ns_access2, - test_ns_attr, - test_ns_decl_tostring, - test_ns_decl_tostring_default, - test_ns_decl_tostring_element, - test_ns_decl_tostring_root, - test_ns_move, - test_ns_setting, - test_ns_tag_parse, - test_parse_cdata, - test_parse_encoding_8bit_explicit, - test_parse_encoding_8bit_override, - test_parse_error, - test_parse_error_from_file, - test_parse_error_none, - test_parse_file, - test_parse_file_encoding, - test_parse_file_nonexistent, - test_parse_file_object, - test_parse_file_object_encoding, - test_parse_stringio, - test_parse_with_encoding, - test_parser_target_attrib, - test_parser_target_data, - test_parser_target_entity, - test_parser_target_entity_unknown, - test_parser_target_error_in_close, - test_parser_target_error_in_end, - test_parser_target_error_in_start, - test_parser_target_error_in_start_and_close, - test_parser_target_property, - test_parser_target_tag, - test_parser_version, - test_pi, - test_pi_nonsense, - test_processinginstruction, - test_qname, - test_qname_attrib, - test_qname_attrib_resolve, - test_qname_attribute_getset, - test_qname_attribute_resolve, - test_qname_attribute_resolve_new, - test_qname_cmp, - test_register_namespace, - test_remove, - test_remove_nonexisting, - test_remove_ns, - test_remove_tail, - test_replace_slice_tail, - test_set_text, - test_set_text2, - test_set_text_empty, - test_set_text_none, - test_setitem, - test_setitem2, - test_setitem_indexerror, - test_setitem_replace, - test_setitem_tail, - test_setslice, - test_setslice_all, - test_setslice_all_empty, - test_setslice_all_replace, - test_setslice_all_replace_reversed, - test_setslice_all_replace_reversed_ns1, - test_setslice_all_replace_reversed_ns2, - test_setslice_empty, - test_setslice_end, - test_setslice_end_exact, - test_setslice_negative, - test_setslice_negative2, - test_setslice_single, - test_setslice_tail, - test_shallowcopy, - test_shallowcopy_elementtree, - test_simple, - test_subelement, - test_subelement_reference, - test_subelement_with_attributes, - test_subelement_with_attributes_ns, - test_tag_reset_ns, - test_tag_reset_root_ns, - test_tag_str_subclass, - test_tag_write, - test_tail, - test_tail1, - test_tail_append, - test_tail_elementtree_root, - test_tail_set_none, - test_tail_set_twice, - test_tail_str_subclass, - test_text, - test_text_empty, - test_text_escape_in, - test_text_escape_out, - test_text_escape_tostring, - test_text_other, - test_text_str_subclass, - test_tostring, - test_tostring_element, - test_tostring_element_tail, - test_tostring_method_html, - test_tostring_method_text, - test_treebuilder, - test_treebuilder_target, - test_weird_dict_interaction, - test_write, - test_write_ElementTreeDoctest, - test_write_fail, - test_write_method_html, - test_write_method_text -

- -

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-   - - - - - - -
setUpClass(cls)
- Hook method for setting up class fixture before running tests in the class.
- source code - -
- -
-

Inherited from unittest.case.TestCase: - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- hash(x) -
-

Inherited from _ETreeTestCaseBase: - required_versions_ET, - required_versions_cET -

-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUpClass(cls) -
Class Method -

-
source code  -
- - Hook method for setting up class fixture before running tests in the class. -
-
Overrides: - unittest.case.TestCase.setUpClass -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- hash(x) -
-
-
-
Value:
-
xml.etree.ElementTree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementtree._ETreeTestCaseBase-class.html b/doc/html/api/lxml.tests.test_elementtree._ETreeTestCaseBase-class.html deleted file mode 100644 index 6e8954d4..00000000 --- a/doc/html/api/lxml.tests.test_elementtree._ETreeTestCaseBase-class.html +++ /dev/null @@ -1,4971 +0,0 @@ - - - - - lxml.tests.test_elementtree._ETreeTestCaseBase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementtree :: - Class _ETreeTestCaseBase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _ETreeTestCaseBase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               _ETreeTestCaseBase
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
XMLParser(self, - **kwargs) - source code - -
- -
-   - - - - - - -
test_element(self) - source code - -
- -
-   - - - - - - -
test_simple(self) - source code - -
- -
-   - - - - - - -
test_weird_dict_interaction(self) - source code - -
- -
-   - - - - - - -
test_subelement(self) - source code - -
- -
-   - - - - - - -
test_element_contains(self) - source code - -
- -
-   - - - - - - -
test_element_indexing_with_text(self) - source code - -
- -
-   - - - - - - -
test_element_indexing_with_text2(self) - source code - -
- -
-   - - - - - - -
test_element_indexing_only_text(self) - source code - -
- -
-   - - - - - - -
test_element_indexing_negative(self) - source code - -
- -
-   - - - - - - -
test_elementtree(self) - source code - -
- -
-   - - - - - - -
test_text(self) - source code - -
- -
-   - - - - - - -
test_text_empty(self) - source code - -
- -
-   - - - - - - -
test_text_other(self) - source code - -
- -
-   - - - - - - -
test_text_escape_in(self) - source code - -
- -
-   - - - - - - -
test_text_escape_out(self) - source code - -
- -
-   - - - - - - -
test_text_escape_tostring(self) - source code - -
- -
-   - - - - - - -
test_text_str_subclass(self) - source code - -
- -
-   - - - - - - -
test_tail(self) - source code - -
- -
-   - - - - - - -
test_tail_str_subclass(self) - source code - -
- -
-   - - - - - - -
_test_del_tail(self) - source code - -
- -
-   - - - - - - -
test_ElementTree(self) - source code - -
- -
-   - - - - - - -
test_attrib(self) - source code - -
- -
-   - - - - - - -
test_attrib_get(self) - source code - -
- -
-   - - - - - - -
test_attrib_dict(self) - source code - -
- -
-   - - - - - - -
test_attrib_copy(self) - source code - -
- -
-   - - - - - - -
test_attrib_deepcopy(self) - source code - -
- -
-   - - - - - - -
test_attributes_get(self) - source code - -
- -
-   - - - - - - -
test_attrib_clear(self) - source code - -
- -
-   - - - - - - -
test_attrib_set_clear(self) - source code - -
- -
-   - - - - - - -
test_attrib_ns_clear(self) - source code - -
- -
-   - - - - - - -
test_attrib_pop(self) - source code - -
- -
-   - - - - - - -
test_attrib_pop_unknown(self) - source code - -
- -
-   - - - - - - -
test_attrib_pop_default(self) - source code - -
- -
-   - - - - - - -
test_attrib_pop_empty_default(self) - source code - -
- -
-   - - - - - - -
test_attrib_pop_invalid_args(self) - source code - -
- -
-   - - - - - - -
test_attribute_update_dict(self) - source code - -
- -
-   - - - - - - -
test_attribute_update_sequence(self) - source code - -
- -
-   - - - - - - -
test_attribute_update_iter(self) - source code - -
- -
-   - - - - - - -
test_attribute_update_attrib(self) - source code - -
- -
-   - - - - - - -
test_attribute_keys(self) - source code - -
- -
-   - - - - - - -
test_attribute_keys2(self) - source code - -
- -
-   - - - - - - -
test_attribute_items2(self) - source code - -
- -
-   - - - - - - -
test_attribute_keys_ns(self) - source code - -
- -
-   - - - - - - -
test_attribute_values(self) - source code - -
- -
-   - - - - - - -
test_attribute_values_ns(self) - source code - -
- -
-   - - - - - - -
test_attribute_items(self) - source code - -
- -
-   - - - - - - -
test_attribute_items_ns(self) - source code - -
- -
-   - - - - - - -
test_attribute_str(self) - source code - -
- -
-   - - - - - - -
test_attribute_contains(self) - source code - -
- -
-   - - - - - - -
test_attribute_set(self) - source code - -
- -
-   - - - - - - -
test_attrib_as_attrib(self) - source code - -
- -
-   - - - - - - -
test_attribute_iterator(self) - source code - -
- -
-   - - - - - - -
test_attribute_manipulation(self) - source code - -
- -
-   - - - - - - -
test_del_attribute_ns(self) - source code - -
- -
-   - - - - - - -
test_del_attribute_ns_parsed(self) - source code - -
- -
-   - - - - - - -
test_XML(self) - source code - -
- -
-   - - - - - - -
test_XMLID(self) - source code - -
- -
-   - - - - - - -
test_fromstring(self) - source code - -
- -
-   - - - - - - -
test_fromstringlist(self) - source code - -
- -
-   - - - - - - -
test_fromstringlist_characters(self) - source code - -
- -
-   - - - - - - -
test_fromstringlist_single(self) - source code - -
- -
-   - - - - - - -
test_iselement(self) - source code - -
- -
-   - - - - - - -
test_iteration(self) - source code - -
- -
-   - - - - - - -
test_iteration_empty(self) - source code - -
- -
-   - - - - - - -
test_iteration_text_only(self) - source code - -
- -
-   - - - - - - -
test_iteration_crash(self) - source code - -
- -
-   - - - - - - -
test_iteration_reversed(self) - source code - -
- -
-   - - - - - - -
test_iteration_subelement(self) - source code - -
- -
-   - - - - - - -
test_iteration_del_child(self) - source code - -
- -
-   - - - - - - -
test_iteration_double(self) - source code - -
- -
-   - - - - - - -
test_itertext(self) - source code - -
- -
-   - - - - - - -
test_itertext_child(self) - source code - -
- -
-   - - - - - - -
test_findall(self) - source code - -
- -
-   - - - - - - -
test_findall_ns(self) - source code - -
- -
-   - - - - - - -
test_element_with_attributes_keywords(self) - source code - -
- -
-   - - - - - - -
test_element_with_attributes(self) - source code - -
- -
-   - - - - - - -
test_element_with_attributes_extra(self) - source code - -
- -
-   - - - - - - -
test_element_with_attributes_extra_duplicate(self) - source code - -
- -
-   - - - - - - -
test_element_with_attributes_ns(self) - source code - -
- -
-   - - - - - - -
test_subelement_with_attributes(self) - source code - -
- -
-   - - - - - - -
test_subelement_with_attributes_ns(self) - source code - -
- -
-   - - - - - - -
test_write(self) - source code - -
- -
-   - - - - - - -
test_write_method_html(self) - source code - -
- -
-   - - - - - - -
test_write_method_text(self) - source code - -
- -
-   - - - - - - -
test_write_fail(self) - source code - -
- -
-   - - - - - - -
test_crash(self) - source code - -
- -
-   - - - - - - -
test_write_ElementTreeDoctest(self) - source code - -
- -
-   - - - - - - -
test_subelement_reference(self) - source code - -
- -
-   - - - - - - -
test_set_text(self) - source code - -
- -
-   - - - - - - -
test_set_text2(self) - source code - -
- -
-   - - - - - - -
test_set_text_none(self) - source code - -
- -
-   - - - - - - -
test_set_text_empty(self) - source code - -
- -
-   - - - - - - -
test_tail1(self) - source code - -
- -
-   - - - - - - -
test_tail_append(self) - source code - -
- -
-   - - - - - - -
test_tail_set_twice(self) - source code - -
- -
-   - - - - - - -
test_tail_set_none(self) - source code - -
- -
-   - - - - - - -
test_extend(self) - source code - -
- -
-   - - - - - - -
test_comment(self) - source code - -
- -
-   - - - - - - -
test_comment_text(self) - source code - -
- -
-   - - - - - - -
test_comment_whitespace(self) - source code - -
- -
-   - - - - - - -
test_comment_nonsense(self) - source code - -
- -
-   - - - - - - -
test_pi(self) - source code - -
- -
-   - - - - - - -
test_processinginstruction(self) - source code - -
- -
-   - - - - - - -
test_pi_nonsense(self) - source code - -
- -
-   - - - - - - -
test_setitem(self) - source code - -
- -
-   - - - - - - -
test_setitem2(self) - source code - -
- -
-   - - - - - - -
test_setitem_replace(self) - source code - -
- -
-   - - - - - - -
test_setitem_indexerror(self) - source code - -
- -
-   - - - - - - -
test_setitem_tail(self) - source code - -
- -
-   - - - - - - -
test_tag_write(self) - source code - -
- -
-   - - - - - - -
test_tag_reset_ns(self) - source code - -
- -
-   - - - - - - -
test_tag_reset_root_ns(self) - source code - -
- -
-   - - - - - - -
test_tag_str_subclass(self) - source code - -
- -
-   - - - - - - -
test_delitem(self) - source code - -
- -
-   - - - - - - -
test_del_insert(self) - source code - -
- -
-   - - - - - - -
test_del_setitem(self) - source code - -
- -
-   - - - - - - -
test_del_setslice(self) - source code - -
- -
-   - - - - - - -
test_replace_slice_tail(self) - source code - -
- -
-   - - - - - - -
test_merge_namespaced_subtree_as_slice(self) - source code - -
- -
-   - - - - - - -
test_delitem_tail(self) - source code - -
- -
-   - - - - - - -
test_clear(self) - source code - -
- -
-   - - - - - - -
test_clear_sub(self) - source code - -
- -
-   - - - - - - -
test_clear_tail(self) - source code - -
- -
-   - - - - - - -
test_insert(self) - source code - -
- -
-   - - - - - - -
test_insert_beyond_index(self) - source code - -
- -
-   - - - - - - -
test_insert_negative(self) - source code - -
- -
-   - - - - - - -
test_insert_tail(self) - source code - -
- -
-   - - - - - - -
test_remove(self) - source code - -
- -
-   - - - - - - -
test_remove_ns(self) - source code - -
- -
-   - - - - - - -
test_remove_nonexisting(self) - source code - -
- -
-   - - - - - - -
test_remove_tail(self) - source code - -
- -
-   - - - - - - -
_test_getchildren(self) - source code - -
- -
-   - - - - - - -
test_makeelement(self) - source code - -
- -
-   - - - - - - -
test_iter(self) - source code - -
- -
-   - - - - - - -
test_getiterator(self) - source code - -
- -
-   - - - - - - -
test_getiterator_empty(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_all(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_comment(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_pi(self) - source code - -
- -
-   - - - - - - -
test_getiterator_with_text(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_with_text(self) - source code - -
- -
-   - - - - - - -
test_getslice(self) - source code - -
- -
-   - - - - - - -
test_getslice_negative(self) - source code - -
- -
-   - - - - - - -
test_getslice_step(self) - source code - -
- -
-   - - - - - - -
test_getslice_text(self) - source code - -
- -
-   - - - - - - -
test_comment_getitem_getslice(self) - source code - -
- -
-   - - - - - - -
test_delslice(self) - source code - -
- -
-   - - - - - - -
test_delslice_negative1(self) - source code - -
- -
-   - - - - - - -
test_delslice_negative2(self) - source code - -
- -
-   - - - - - - -
test_delslice_step(self) - source code - -
- -
-   - - - - - - -
test_delslice_step_negative(self) - source code - -
- -
-   - - - - - - -
test_delslice_step_negative2(self) - source code - -
- -
-   - - - - - - -
test_delslice_child_tail(self) - source code - -
- -
-   - - - - - - -
test_delslice_tail(self) - source code - -
- -
-   - - - - - - -
test_delslice_memory(self) - source code - -
- -
-   - - - - - - -
test_setslice(self) - source code - -
- -
-   - - - - - - -
test_setslice_all(self) - source code - -
- -
-   - - - - - - -
test_setslice_all_empty(self) - source code - -
- -
-   - - - - - - -
test_setslice_all_replace(self) - source code - -
- -
-   - - - - - - -
test_setslice_all_replace_reversed(self) - source code - -
- -
-   - - - - - - -
test_setslice_all_replace_reversed_ns1(self) - source code - -
- -
-   - - - - - - -
test_setslice_all_replace_reversed_ns2(self) - source code - -
- -
-   - - - - - - -
test_setslice_end(self) - source code - -
- -
-   - - - - - - -
test_setslice_end_exact(self) - source code - -
- -
-   - - - - - - -
test_setslice_single(self) - source code - -
- -
-   - - - - - - -
test_setslice_tail(self) - source code - -
- -
-   - - - - - - -
test_setslice_negative(self) - source code - -
- -
-   - - - - - - -
test_setslice_negative2(self) - source code - -
- -
-   - - - - - - -
test_setslice_empty(self) - source code - -
- -
-   - - - - - - -
test_tail_elementtree_root(self) - source code - -
- -
-   - - - - - - -
test_elementtree_getiterator(self) - source code - -
- -
-   - - - - - - -
test_elementtree_getiterator_filter(self) - source code - -
- -
-   - - - - - - -
test_ns_access(self) - source code - -
- -
-   - - - - - - -
test_ns_access2(self) - source code - -
- -
-   - - - - - - -
test_ns_setting(self) - source code - -
- -
-   - - - - - - -
test_ns_tag_parse(self) - source code - -
- -
-   - - - - - - -
test_ns_attr(self) - source code - -
- -
-   - - - - - - -
test_ns_move(self) - source code - -
- -
-   - - - - - - -
test_ns_decl_tostring(self) - source code - -
- -
-   - - - - - - -
test_ns_decl_tostring_default(self) - source code - -
- -
-   - - - - - - -
test_ns_decl_tostring_root(self) - source code - -
- -
-   - - - - - - -
test_ns_decl_tostring_element(self) - source code - -
- -
-   - - - - - - -
test_attribute_xmlns_move(self) - source code - -
- -
-   - - - - - - -
test_namespaces_after_serialize(self) - source code - -
- -
-   - - - - - - -
test_attribute_namespace_roundtrip(self) - source code - -
- -
-   - - - - - - -
test_attribute_namespace_roundtrip_replaced(self) - source code - -
- -
-   - - - - - - -
test_register_namespace(self) - source code - -
- -
-   - - - - - - -
test_tostring(self) - source code - -
- -
-   - - - - - - -
test_tostring_element(self) - source code - -
- -
-   - - - - - - -
test_tostring_element_tail(self) - source code - -
- -
-   - - - - - - -
test_tostring_method_html(self) - source code - -
- -
-   - - - - - - -
test_tostring_method_text(self) - source code - -
- -
-   - - - - - - -
test_iterparse(self) - source code - -
- -
-   - - - - - - -
test_iterparse_incomplete(self) - source code - -
- -
-   - - - - - - -
test_iterparse_file(self) - source code - -
- -
-   - - - - - - -
test_iterparse_start(self) - source code - -
- -
-   - - - - - - -
test_iterparse_start_end(self) - source code - -
- -
-   - - - - - - -
test_iterparse_clear(self) - source code - -
- -
-   - - - - - - -
test_iterparse_large(self) - source code - -
- -
-   - - - - - - -
test_iterparse_attrib_ns(self) - source code - -
- -
-   - - - - - - -
test_iterparse_getiterator(self) - source code - -
- -
-   - - - - - - -
test_iterparse_move_elements(self) - source code - -
- -
-   - - - - - - -
test_iterparse_cdata(self) - source code - -
- -
-   - - - - - - -
test_parse_file(self) - source code - -
- -
-   - - - - - - -
test_parse_file_nonexistent(self) - source code - -
- -
-   - - - - - - -
test_parse_error_none(self) - source code - -
- -
-   - - - - - - -
test_parse_error(self) - source code - -
- -
-   - - - - - - -
test_parse_error_from_file(self) - source code - -
- -
-   - - - - - - -
test_parse_file_object(self) - source code - -
- -
-   - - - - - - -
test_parse_stringio(self) - source code - -
- -
-   - - - - - - -
test_parse_cdata(self) - source code - -
- -
-   - - - - - - -
test_parse_with_encoding(self) - source code - -
- -
-   - - - - - - -
test_encoding(self) - source code - -
- -
-   - - - - - - -
test_encoding_exact(self) - source code - -
- -
-   - - - - - - -
test_parse_file_encoding(self) - source code - -
- -
-   - - - - - - -
test_parse_file_object_encoding(self) - source code - -
- -
-   - - - - - - -
test_encoding_8bit_latin1(self) - source code - -
- -
-   - - - - - - -
test_parse_encoding_8bit_explicit(self) - source code - -
- -
-   - - - - - - -
test_parse_encoding_8bit_override(self) - source code - -
- -
-   - - - - - - -
_test_wrong_unicode_encoding(self) - source code - -
- -
-   - - - - - - -
test_encoding_write_default_encoding(self) - source code - -
- -
-   - - - - - - -
test_encoding_tostring(self) - source code - -
- -
-   - - - - - - -
test_encoding_tostring_unknown(self) - source code - -
- -
-   - - - - - - -
test_encoding_tostring_sub(self) - source code - -
- -
-   - - - - - - -
test_encoding_tostring_sub_tail(self) - source code - -
- -
-   - - - - - - -
test_encoding_tostring_default_encoding(self) - source code - -
- -
-   - - - - - - -
test_encoding_sub_tostring_default_encoding(self) - source code - -
- -
-   - - - - - - -
test_encoding_8bit_xml(self) - source code - -
- -
-   - - - - - - -
test_encoding_utf8_bom(self) - source code - -
- -
-   - - - - - - -
test_encoding_8bit_parse_stringio(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_elementtree(self) - source code - -
- -
-   - - - - - - -
test_deepcopy(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_tail(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_subelement(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_namespaces(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_append(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_comment(self) - source code - -
- -
-   - - - - - - -
test_shallowcopy(self) - source code - -
- -
-   - - - - - - -
test_shallowcopy_elementtree(self) - source code - -
- -
-   - - - - - - -
_test_element_boolean(self) - source code - -
- -
-   - - - - - - -
test_multiple_elementrees(self) - source code - -
- -
-   - - - - - - -
test_qname(self) - source code - -
- -
-   - - - - - - -
test_qname_cmp(self) - source code - -
- -
-   - - - - - - -
test_qname_attribute_getset(self) - source code - -
- -
-   - - - - - - -
test_qname_attrib(self) - source code - -
- -
-   - - - - - - -
test_qname_attribute_resolve(self) - source code - -
- -
-   - - - - - - -
test_qname_attribute_resolve_new(self) - source code - -
- -
-   - - - - - - -
test_qname_attrib_resolve(self) - source code - -
- -
-   - - - - - - -
test_parser_version(self) - source code - -
- -
-   - - - - - - -
test_feed_parser_bytes(self) - source code - -
- -
-   - - - - - - -
test_feed_parser_unicode(self) - source code - -
- -
-   - - - - - - -
test_feed_parser_error_close_empty(self) - source code - -
- -
-   - - - - - - -
test_feed_parser_error_close_incomplete(self) - source code - -
- -
-   - - - - - - -
test_feed_parser_error_broken(self) - source code - -
- -
-   - - - - - - -
test_feed_parser_error_position(self) - source code - -
- -
-   - - - - - - -
test_parser_target_property(self) - source code - -
- -
-   - - - - - - -
test_parser_target_tag(self) - source code - -
- -
-   - - - - - - -
test_parser_target_error_in_start(self) - source code - -
- -
-   - - - - - - -
test_parser_target_error_in_end(self) - source code - -
- -
-   - - - - - - -
test_parser_target_error_in_close(self) - source code - -
- -
-   - - - - - - -
test_parser_target_error_in_start_and_close(self) - source code - -
- -
-   - - - - - - -
test_elementtree_parser_target(self) - source code - -
- -
-   - - - - - - -
test_parser_target_attrib(self) - source code - -
- -
-   - - - - - - -
test_parser_target_data(self) - source code - -
- -
-   - - - - - - -
test_parser_target_entity(self) - source code - -
- -
-   - - - - - - -
test_parser_target_entity_unknown(self) - source code - -
- -
-   - - - - - - -
test_treebuilder(self) - source code - -
- -
-   - - - - - - -
test_treebuilder_target(self) - source code - -
- -
-   - - - - - - -
_writeElement(self, - element, - encoding='us-ascii')
- Write out element for comparison.
- source code - -
- -
-   - - - - - - -
_writeElementFile(self, - element, - encoding='us-ascii')
- Write out element for comparison, using real file.
- source code - -
- -
-   - - - - - - -
assertXML(self, - expected, - element, - encoding='us-ascii')
- Writes element out and checks whether it is expected.
- source code - -
- -
-   - - - - - - -
assertEncodingDeclaration(self, - result, - encoding)
- Checks if the result XML byte string specifies the encoding.
- source code - -
- -
-   - - - - - - -
_rootstring(self, - tree) - source code - -
- -
-   - - - - - - -
_check_element_tree(self, - tree) - source code - -
- -
-   - - - - - - -
_check_element(self, - element) - source code - -
- -
-   - - - - - - -
_check_string(self, - string) - source code - -
- -
-   - - - - - - -
_check_mapping(self, - mapping) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree = None
- hash(x) -
-   - - required_versions_ET = {'test_comment_text': (1, 3), 'test_com... -
-   - - required_versions_cET = {} -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

assertXML(self, - expected, - element, - encoding='us-ascii') -

-
source code  -
- -

Writes element out and checks whether it is expected.

-

Does this two ways; once using BytesIO, once using a real file.

-
-
-
-
- -
- -
- - -
-

_rootstring(self, - tree) -

-
source code  -
- - -
-
Overrides: - common_imports.HelperTestCase._rootstring -
-
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

required_versions_ET

- -
-
-
-
Value:
-
-{'test_comment_text': (1, 3),
- 'test_comment_whitespace': (1, 3),
- 'test_extend': (1, 3),
- 'test_feed_parser_error_broken': (1, 3),
- 'test_feed_parser_error_close_empty': (1, 3),
- 'test_feed_parser_error_close_incomplete': (1, 3),
- 'test_feed_parser_error_position': (1, 3),
- 'test_fromstringlist': (1, 3),
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_elementtree._XMLPullParserTest-class.html b/doc/html/api/lxml.tests.test_elementtree._XMLPullParserTest-class.html deleted file mode 100644 index f16e2677..00000000 --- a/doc/html/api/lxml.tests.test_elementtree._XMLPullParserTest-class.html +++ /dev/null @@ -1,517 +0,0 @@ - - - - - lxml.tests.test_elementtree._XMLPullParserTest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_elementtree :: - Class _XMLPullParserTest - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _XMLPullParserTest

source code

-
-            object --+    
-                     |    
-unittest.case.TestCase --+
-                         |
-                        _XMLPullParserTest
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
_feed(self, - parser, - data, - chunk_size=None) - source code - -
- -
-   - - - - - - -
_close_and_return_root(self, - parser) - source code - -
- -
-   - - - - - - -
assert_event_tags(self, - parser, - expected) - source code - -
- -
-   - - - - - - -
test_simple_xml(self) - source code - -
- -
-   - - - - - - -
test_feed_while_iterating(self) - source code - -
- -
-   - - - - - - -
test_simple_xml_with_ns(self) - source code - -
- -
-   - - - - - - -
test_ns_events(self) - source code - -
- -
-   - - - - - - -
test_events(self) - source code - -
- -
-   - - - - - - -
test_events_sequence(self) - source code - -
- -
-   - - - - - - -
test_unknown_event(self) - source code - -
- -
-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest, - tearDown -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree = None
- hash(x) -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_errors-module.html b/doc/html/api/lxml.tests.test_errors-module.html deleted file mode 100644 index 98c3b23e..00000000 --- a/doc/html/api/lxml.tests.test_errors-module.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - lxml.tests.test_errors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_errors - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_errors

source code

- - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ErrorTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_errors-pysrc.html b/doc/html/api/lxml.tests.test_errors-pysrc.html deleted file mode 100644 index f1353d62..00000000 --- a/doc/html/api/lxml.tests.test_errors-pysrc.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - lxml.tests.test_errors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_errors - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_errors

-
- 1  # -*- coding: utf-8 -*- 
- 2  import unittest, doctest 
- 3   
- 4  # These tests check that error handling in the Pyrex code is 
- 5  # complete. 
- 6  # It is likely that if there are errors, instead of failing the code 
- 7  # will simply crash. 
- 8   
- 9  import sys, gc, os.path 
-10  from lxml import etree 
-11   
-12  this_dir = os.path.dirname(__file__) 
-13  if this_dir not in sys.path: 
-14      sys.path.insert(0, this_dir) # needed for Py3 
-15   
-16  from common_imports import HelperTestCase 
-17   
-18   
-
19 -class ErrorTestCase(HelperTestCase): -
20 etree = etree -21 -
22 - def test_bad_element(self): -
23 # attrib argument of Element() should be a dictionary, so if -24 # we pass a string we should get an error. -25 self.assertRaises(TypeError, self.etree.Element, 'a', 'b') -
26 -
27 - def test_empty_parse(self): -
28 self.assertRaises(etree.XMLSyntaxError, etree.fromstring, '') -
29 -
31 # test if cyclic reference can crash etree -32 Element = self.etree.Element -33 -34 # must disable tracing as it could change the refcounts -35 trace_func = sys.gettrace() -36 try: -37 sys.settrace(None) -38 gc.collect() -39 -40 count = sys.getrefcount(None) -41 -42 l = [Element('name'), Element('name')] -43 l.append(l) -44 -45 del l -46 gc.collect() -47 -48 self.assertEqual(sys.getrefcount(None), count) -49 finally: -50 sys.settrace(trace_func) -
51 -
53 broken_xml_name = 'test_broken.xml' -54 broken_xml_path = os.path.join(this_dir, broken_xml_name) -55 fail_msg = 'test_broken.xml should raise an etree.XMLSyntaxError' -56 try: -57 etree.parse(broken_xml_path) -58 except etree.XMLSyntaxError as e: -59 # invariant -60 self.assertEqual(e.position, (e.lineno, e.offset + 1), 'position and lineno/offset out of sync') -61 # SyntaxError info derived from file & contents -62 self.assertTrue(e.filename.endswith(broken_xml_name), 'filename must be preserved') -63 self.assertEqual(e.lineno, 1) -64 self.assertEqual(e.offset, 10) -65 except Exception as e: -66 self.fail('{0}, not {1}'.format(fail_msg, type(e))) -67 else: -68 self.fail('test_broken.xml should raise an etree.XMLSyntaxError') -
69 -70 -
71 -def test_suite(): -
72 suite = unittest.TestSuite() -73 suite.addTests([unittest.makeSuite(ErrorTestCase)]) -74 return suite -
75 -76 if __name__ == '__main__': -77 print('to test use test.py %s' % __file__) -78 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_errors.ErrorTestCase-class.html b/doc/html/api/lxml.tests.test_errors.ErrorTestCase-class.html deleted file mode 100644 index 62e57dd5..00000000 --- a/doc/html/api/lxml.tests.test_errors.ErrorTestCase-class.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - - lxml.tests.test_errors.ErrorTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_errors :: - Class ErrorTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ErrorTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ErrorTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_bad_element(self) - source code - -
- -
-   - - - - - - -
test_empty_parse(self) - source code - -
- -
-   - - - - - - -
test_element_cyclic_gc_none(self) - source code - -
- -
-   - - - - - - -
test_xmlsyntaxerror_has_info(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree-module.html b/doc/html/api/lxml.tests.test_etree-module.html deleted file mode 100644 index 361f88ad..00000000 --- a/doc/html/api/lxml.tests.test_etree-module.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - - lxml.tests.test_etree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_etree

source code

-

Tests specific to the extended etree API

-

Tests that apply to the general ElementTree API should go into -test_elementtree

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ETreeOnlyTestCase
- Tests only for etree, not ElementTree -
-   - - _XIncludeTestCase -
-   - - ETreeXIncludeTestCase -
-   - - ElementIncludeTestCase -
-   - - ETreeC14NTestCase -
-   - - ETreeWriteTestCase -
-   - - ETreeErrorLogTest -
-   - - XMLPullParserTest -
- - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
tmpfile(*args, - **kwds) - source code - -
- -
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Function Details[hide private]
-
- -
- -
- - -
-

tmpfile(*args, - **kwds) -

-
source code  -
- - -
-
Decorators:
-
    -
  • @contextmanager
  • -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree-pysrc.html b/doc/html/api/lxml.tests.test_etree-pysrc.html deleted file mode 100644 index a6688c2e..00000000 --- a/doc/html/api/lxml.tests.test_etree-pysrc.html +++ /dev/null @@ -1,12582 +0,0 @@ - - - - - lxml.tests.test_etree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_etree

-
-   1  # -*- coding: utf-8 -*- 
-   2   
-   3  """ 
-   4  Tests specific to the extended etree API 
-   5   
-   6  Tests that apply to the general ElementTree API should go into 
-   7  test_elementtree 
-   8  """ 
-   9   
-  10  from __future__ import absolute_import 
-  11   
-  12  import os.path 
-  13  import unittest 
-  14  import copy 
-  15  import sys 
-  16  import re 
-  17  import gc 
-  18  import operator 
-  19  import tempfile 
-  20  import textwrap 
-  21  import zlib 
-  22  import gzip 
-  23  from contextlib import closing, contextmanager 
-  24   
-  25  from .common_imports import etree, StringIO, BytesIO, HelperTestCase 
-  26  from .common_imports import fileInTestDir, fileUrlInTestDir, read_file, path2url 
-  27  from .common_imports import SillyFileLike, LargeFileLikeUnicode, doctest, make_doctest 
-  28  from .common_imports import canonicalize, _str, _bytes 
-  29   
-  30  print("") 
-  31  print("TESTED VERSION: %s" % etree.__version__) 
-  32  print("    Python:           " + repr(sys.version_info)) 
-  33  print("    lxml.etree:       " + repr(etree.LXML_VERSION)) 
-  34  print("    libxml used:      " + repr(etree.LIBXML_VERSION)) 
-  35  print("    libxml compiled:  " + repr(etree.LIBXML_COMPILED_VERSION)) 
-  36  print("    libxslt used:     " + repr(etree.LIBXSLT_VERSION)) 
-  37  print("    libxslt compiled: " + repr(etree.LIBXSLT_COMPILED_VERSION)) 
-  38  print("") 
-  39   
-  40  try: 
-  41      _unicode = unicode 
-  42  except NameError: 
-  43      # Python 3 
-  44      _unicode = str 
-
45 - 46 - 47 @contextmanager - 48 -def tmpfile(): -
49 handle, filename = tempfile.mkstemp() - 50 try: - 51 yield filename - 52 finally: - 53 os.close(handle) - 54 os.remove(filename) -
55 -
56 - 57 -class ETreeOnlyTestCase(HelperTestCase): -
58 """Tests only for etree, not ElementTree""" - 59 etree = etree - 60 -
61 - def test_version(self): -
62 self.assertTrue(isinstance(etree.__version__, _unicode)) - 63 self.assertTrue(isinstance(etree.LXML_VERSION, tuple)) - 64 self.assertEqual(len(etree.LXML_VERSION), 4) - 65 self.assertTrue(isinstance(etree.LXML_VERSION[0], int)) - 66 self.assertTrue(isinstance(etree.LXML_VERSION[1], int)) - 67 self.assertTrue(isinstance(etree.LXML_VERSION[2], int)) - 68 self.assertTrue(isinstance(etree.LXML_VERSION[3], int)) - 69 self.assertTrue(etree.__version__.startswith( - 70 str(etree.LXML_VERSION[0]))) -
71 -
72 - def test_c_api(self): -
73 if hasattr(self.etree, '__pyx_capi__'): - 74 # newer Pyrex compatible C-API - 75 self.assertTrue(isinstance(self.etree.__pyx_capi__, dict)) - 76 self.assertTrue(len(self.etree.__pyx_capi__) > 0) - 77 else: - 78 # older C-API mechanism - 79 self.assertTrue(hasattr(self.etree, '_import_c_api')) -
80 -
81 - def test_include_paths(self): -
82 import lxml - 83 includes = lxml.get_include() - 84 self.assertTrue(includes) - 85 self.assertTrue(len(includes) >= 2) - 86 self.assertTrue(os.path.join(os.path.dirname(lxml.__file__), 'includes') in includes, - 87 includes) -
88 -
89 - def test_element_names(self): -
90 Element = self.etree.Element - 91 el = Element('name') - 92 self.assertEqual(el.tag, 'name') - 93 el = Element('{}name') - 94 self.assertEqual(el.tag, 'name') -
95 -
96 - def test_element_name_empty(self): -
97 Element = self.etree.Element - 98 el = Element('name') - 99 self.assertRaises(ValueError, Element, '{}') - 100 self.assertRaises(ValueError, setattr, el, 'tag', '{}') - 101 - 102 self.assertRaises(ValueError, Element, '{test}') - 103 self.assertRaises(ValueError, setattr, el, 'tag', '{test}') -
104 -
105 - def test_element_name_colon(self): -
106 Element = self.etree.Element - 107 self.assertRaises(ValueError, Element, 'p:name') - 108 self.assertRaises(ValueError, Element, '{test}p:name') - 109 - 110 el = Element('name') - 111 self.assertRaises(ValueError, setattr, el, 'tag', 'p:name') -
112 -
113 - def test_element_name_quote(self): -
114 Element = self.etree.Element - 115 self.assertRaises(ValueError, Element, "p'name") - 116 self.assertRaises(ValueError, Element, 'p"name') - 117 - 118 self.assertRaises(ValueError, Element, "{test}p'name") - 119 self.assertRaises(ValueError, Element, '{test}p"name') - 120 - 121 el = Element('name') - 122 self.assertRaises(ValueError, setattr, el, 'tag', "p'name") - 123 self.assertRaises(ValueError, setattr, el, 'tag', 'p"name') -
124 -
125 - def test_element_name_space(self): -
126 Element = self.etree.Element - 127 self.assertRaises(ValueError, Element, ' name ') - 128 self.assertRaises(ValueError, Element, 'na me') - 129 self.assertRaises(ValueError, Element, '{test} name') - 130 - 131 el = Element('name') - 132 self.assertRaises(ValueError, setattr, el, 'tag', ' name ') -
133 -
134 - def test_subelement_name_empty(self): -
135 Element = self.etree.Element - 136 SubElement = self.etree.SubElement - 137 - 138 el = Element('name') - 139 self.assertRaises(ValueError, SubElement, el, '{}') - 140 self.assertRaises(ValueError, SubElement, el, '{test}') -
141 -
142 - def test_subelement_name_colon(self): -
143 Element = self.etree.Element - 144 SubElement = self.etree.SubElement - 145 - 146 el = Element('name') - 147 self.assertRaises(ValueError, SubElement, el, 'p:name') - 148 self.assertRaises(ValueError, SubElement, el, '{test}p:name') -
149 -
150 - def test_subelement_name_quote(self): -
151 Element = self.etree.Element - 152 SubElement = self.etree.SubElement - 153 - 154 el = Element('name') - 155 self.assertRaises(ValueError, SubElement, el, "p'name") - 156 self.assertRaises(ValueError, SubElement, el, "{test}p'name") - 157 - 158 self.assertRaises(ValueError, SubElement, el, 'p"name') - 159 self.assertRaises(ValueError, SubElement, el, '{test}p"name') -
160 -
161 - def test_subelement_name_space(self): -
162 Element = self.etree.Element - 163 SubElement = self.etree.SubElement - 164 - 165 el = Element('name') - 166 self.assertRaises(ValueError, SubElement, el, ' name ') - 167 self.assertRaises(ValueError, SubElement, el, 'na me') - 168 self.assertRaises(ValueError, SubElement, el, '{test} name') -
169 -
171 Element = self.etree.Element - 172 SubElement = self.etree.SubElement - 173 - 174 el = Element('name') - 175 self.assertRaises(ValueError, SubElement, el, 'name', {'a b c' : 'abc'}) - 176 self.assertRaises(ValueError, SubElement, el, 'name', {'a' : 'a\0\n'}) - 177 self.assertEqual(0, len(el)) -
178 -
179 - def test_qname_empty(self): -
180 QName = self.etree.QName - 181 self.assertRaises(ValueError, QName, '') - 182 self.assertRaises(ValueError, QName, None) - 183 self.assertRaises(ValueError, QName, None, None) - 184 self.assertRaises(ValueError, QName, 'test', '') -
185 -
186 - def test_qname_none(self): -
187 QName = self.etree.QName - 188 q = QName(None, 'TAG') - 189 self.assertEqual('TAG', q) - 190 self.assertEqual('TAG', q.localname) - 191 self.assertEqual(None, q.namespace) -
192 -
193 - def test_qname_colon(self): -
194 QName = self.etree.QName - 195 self.assertRaises(ValueError, QName, 'p:name') - 196 self.assertRaises(ValueError, QName, 'test', 'p:name') -
197 -
198 - def test_qname_space(self): -
199 QName = self.etree.QName - 200 self.assertRaises(ValueError, QName, ' name ') - 201 self.assertRaises(ValueError, QName, 'na me') - 202 self.assertRaises(ValueError, QName, 'test', ' name') -
203 -
205 # ET doesn't have namespace/localname properties on QNames - 206 QName = self.etree.QName - 207 namespace, localname = 'http://myns', 'a' - 208 qname = QName(namespace, localname) - 209 self.assertEqual(namespace, qname.namespace) - 210 self.assertEqual(localname, qname.localname) -
211 -
212 - def test_qname_element(self): -
213 # ET doesn't have namespace/localname properties on QNames - 214 QName = self.etree.QName - 215 qname1 = QName('http://myns', 'a') - 216 a = self.etree.Element(qname1, nsmap={'p' : 'http://myns'}) - 217 - 218 qname2 = QName(a) - 219 self.assertEqual(a.tag, qname1.text) - 220 self.assertEqual(a.tag, qname1) - 221 self.assertEqual(qname1.text, qname2.text) - 222 self.assertEqual(qname1, qname2.text) - 223 self.assertEqual(qname1.text, qname2) - 224 self.assertEqual(qname1, qname2) -
225 -
226 - def test_qname_text_resolve(self): -
227 # ET doesn't resove QNames as text values - 228 etree = self.etree - 229 qname = etree.QName('http://myns', 'a') - 230 a = etree.Element(qname, nsmap={'p' : 'http://myns'}) - 231 a.text = qname - 232 - 233 self.assertEqual("p:a", a.text) -
234 -
235 - def test_nsmap_prefix_invalid(self): -
236 etree = self.etree - 237 self.assertRaises(ValueError, - 238 etree.Element, "root", nsmap={'"' : 'testns'}) - 239 self.assertRaises(ValueError, - 240 etree.Element, "root", nsmap={'&' : 'testns'}) - 241 self.assertRaises(ValueError, - 242 etree.Element, "root", nsmap={'a:b' : 'testns'}) -
243 -
244 - def test_attribute_has_key(self): -
245 # ET in Py 3.x has no "attrib.has_key()" method - 246 XML = self.etree.XML - 247 - 248 root = XML(_bytes('<foo bar="Bar" xmlns:ns="http://ns.codespeak.net/test" ns:baz="Baz" />')) - 249 self.assertEqual( - 250 True, root.attrib.has_key('bar')) - 251 self.assertEqual( - 252 False, root.attrib.has_key('baz')) - 253 self.assertEqual( - 254 False, root.attrib.has_key('hah')) - 255 self.assertEqual( - 256 True, - 257 root.attrib.has_key('{http://ns.codespeak.net/test}baz')) -
258 -
259 - def test_attribute_set(self): -
260 Element = self.etree.Element - 261 root = Element("root") - 262 root.set("attr", "TEST") - 263 self.assertEqual("TEST", root.get("attr")) -
264 -
266 # ElementTree accepts arbitrary attribute values - 267 # lxml.etree allows only strings - 268 Element = self.etree.Element - 269 - 270 root = Element("root") - 271 root.set("attr", "TEST") - 272 self.assertEqual("TEST", root.get("attr")) - 273 self.assertRaises(TypeError, root.set, "newattr", 5) -
274 -
275 - def test_attrib_and_keywords(self): -
276 Element = self.etree.Element - 277 - 278 root = Element("root") - 279 root.set("attr", "TEST") - 280 self.assertEqual("TEST", root.attrib["attr"]) - 281 - 282 root2 = Element("root2", root.attrib, attr2='TOAST') - 283 self.assertEqual("TEST", root2.attrib["attr"]) - 284 self.assertEqual("TOAST", root2.attrib["attr2"]) - 285 self.assertEqual(None, root.attrib.get("attr2")) -
286 -
287 - def test_attrib_order(self): -
288 Element = self.etree.Element - 289 - 290 keys = ["attr%d" % i for i in range(10)] - 291 values = ["TEST-%d" % i for i in range(10)] - 292 items = list(zip(keys, values)) - 293 - 294 root = Element("root") - 295 for key, value in items: - 296 root.set(key, value) - 297 self.assertEqual(keys, root.attrib.keys()) - 298 self.assertEqual(values, root.attrib.values()) - 299 - 300 root2 = Element("root2", root.attrib, - 301 attr_99='TOAST-1', attr_98='TOAST-2') - 302 self.assertEqual(['attr_98', 'attr_99'] + keys, - 303 root2.attrib.keys()) - 304 self.assertEqual(['TOAST-2', 'TOAST-1'] + values, - 305 root2.attrib.values()) - 306 - 307 self.assertEqual(keys, root.attrib.keys()) - 308 self.assertEqual(values, root.attrib.values()) -
309 -
310 - def test_attribute_set_invalid(self): -
311 # ElementTree accepts arbitrary attribute values - 312 # lxml.etree allows only strings, or None for (html5) boolean attributes - 313 Element = self.etree.Element - 314 root = Element("root") - 315 self.assertRaises(TypeError, root.set, "newattr", 5) - 316 self.assertRaises(TypeError, root.set, "newattr", object) - 317 self.assertRaises(TypeError, root.set, "newattr", None) - 318 self.assertRaises(TypeError, root.set, "newattr") -
319 -
320 - def test_strip_attributes(self): -
321 XML = self.etree.XML - 322 xml = _bytes('<test a="5" b="10" c="20"><x a="4" b="2"/></test>') - 323 - 324 root = XML(xml) - 325 self.etree.strip_attributes(root, 'a') - 326 self.assertEqual(_bytes('<test b="10" c="20"><x b="2"></x></test>'), - 327 self._writeElement(root)) - 328 - 329 root = XML(xml) - 330 self.etree.strip_attributes(root, 'b', 'c') - 331 self.assertEqual(_bytes('<test a="5"><x a="4"></x></test>'), - 332 self._writeElement(root)) -
333 -
334 - def test_strip_attributes_ns(self): -
335 XML = self.etree.XML - 336 xml = _bytes('<test xmlns:n="http://test/ns" a="6" b="10" c="20" n:a="5"><x a="4" n:b="2"/></test>') - 337 - 338 root = XML(xml) - 339 self.etree.strip_attributes(root, 'a') - 340 self.assertEqual( - 341 _bytes('<test xmlns:n="http://test/ns" b="10" c="20" n:a="5"><x n:b="2"></x></test>'), - 342 self._writeElement(root)) - 343 - 344 root = XML(xml) - 345 self.etree.strip_attributes(root, '{http://test/ns}a', 'c') - 346 self.assertEqual( - 347 _bytes('<test xmlns:n="http://test/ns" a="6" b="10"><x a="4" n:b="2"></x></test>'), - 348 self._writeElement(root)) - 349 - 350 root = XML(xml) - 351 self.etree.strip_attributes(root, '{http://test/ns}*') - 352 self.assertEqual( - 353 _bytes('<test xmlns:n="http://test/ns" a="6" b="10" c="20"><x a="4"></x></test>'), - 354 self._writeElement(root)) -
355 -
356 - def test_strip_elements(self): -
357 XML = self.etree.XML - 358 xml = _bytes('<test><a><b><c/></b></a><x><a><b/><c/></a></x></test>') - 359 - 360 root = XML(xml) - 361 self.etree.strip_elements(root, 'a') - 362 self.assertEqual(_bytes('<test><x></x></test>'), - 363 self._writeElement(root)) - 364 - 365 root = XML(xml) - 366 self.etree.strip_elements(root, 'b', 'c', 'X', 'Y', 'Z') - 367 self.assertEqual(_bytes('<test><a></a><x><a></a></x></test>'), - 368 self._writeElement(root)) - 369 - 370 root = XML(xml) - 371 self.etree.strip_elements(root, 'c') - 372 self.assertEqual(_bytes('<test><a><b></b></a><x><a><b></b></a></x></test>'), - 373 self._writeElement(root)) -
374 -
375 - def test_strip_elements_ns(self): -
376 XML = self.etree.XML - 377 xml = _bytes('<test>TEST<n:a xmlns:n="urn:a">A<b>B<c xmlns="urn:c"/>C</b>BT</n:a>AT<x>X<a>A<b xmlns="urn:a"/>BT<c xmlns="urn:x"/>CT</a>AT</x>XT</test>') - 378 - 379 root = XML(xml) - 380 self.etree.strip_elements(root, 'a') - 381 self.assertEqual(_bytes('<test>TEST<n:a xmlns:n="urn:a">A<b>B<c xmlns="urn:c"></c>C</b>BT</n:a>AT<x>X</x>XT</test>'), - 382 self._writeElement(root)) - 383 - 384 root = XML(xml) - 385 self.etree.strip_elements(root, '{urn:a}b', 'c') - 386 self.assertEqual(_bytes('<test>TEST<n:a xmlns:n="urn:a">A<b>B<c xmlns="urn:c"></c>C</b>BT</n:a>AT<x>X<a>A<c xmlns="urn:x"></c>CT</a>AT</x>XT</test>'), - 387 self._writeElement(root)) - 388 - 389 root = XML(xml) - 390 self.etree.strip_elements(root, '{urn:a}*', 'c') - 391 self.assertEqual(_bytes('<test>TEST<x>X<a>A<c xmlns="urn:x"></c>CT</a>AT</x>XT</test>'), - 392 self._writeElement(root)) - 393 - 394 root = XML(xml) - 395 self.etree.strip_elements(root, '{urn:a}*', 'c', with_tail=False) - 396 self.assertEqual(_bytes('<test>TESTAT<x>X<a>ABT<c xmlns="urn:x"></c>CT</a>AT</x>XT</test>'), - 397 self._writeElement(root)) -
398 -
399 - def test_strip_tags(self): -
400 XML = self.etree.XML - 401 xml = _bytes('<test>TEST<a>A<b>B<c/>CT</b>BT</a>AT<x>X<a>A<b/>BT<c/>CT</a>AT</x>XT</test>') - 402 - 403 root = XML(xml) - 404 self.etree.strip_tags(root, 'a') - 405 self.assertEqual(_bytes('<test>TESTA<b>B<c></c>CT</b>BTAT<x>XA<b></b>BT<c></c>CTAT</x>XT</test>'), - 406 self._writeElement(root)) - 407 - 408 root = XML(xml) - 409 self.etree.strip_tags(root, 'b', 'c', 'X', 'Y', 'Z') - 410 self.assertEqual(_bytes('<test>TEST<a>ABCTBT</a>AT<x>X<a>ABTCT</a>AT</x>XT</test>'), - 411 self._writeElement(root)) - 412 - 413 root = XML(xml) - 414 self.etree.strip_tags(root, 'c') - 415 self.assertEqual(_bytes('<test>TEST<a>A<b>BCT</b>BT</a>AT<x>X<a>A<b></b>BTCT</a>AT</x>XT</test>'), - 416 self._writeElement(root)) -
417 -
418 - def test_strip_tags_pi_comment(self): -
419 XML = self.etree.XML - 420 PI = self.etree.ProcessingInstruction - 421 Comment = self.etree.Comment - 422 xml = _bytes('<!--comment1-->\n<?PI1?>\n<test>TEST<!--comment2-->XT<?PI2?></test>\n<!--comment3-->\n<?PI1?>') - 423 - 424 root = XML(xml) - 425 self.etree.strip_tags(root, PI) - 426 self.assertEqual(_bytes('<!--comment1-->\n<?PI1?>\n<test>TEST<!--comment2-->XT</test>\n<!--comment3-->\n<?PI1?>'), - 427 self._writeElement(root)) - 428 - 429 root = XML(xml) - 430 self.etree.strip_tags(root, Comment) - 431 self.assertEqual(_bytes('<!--comment1-->\n<?PI1?>\n<test>TESTXT<?PI2?></test>\n<!--comment3-->\n<?PI1?>'), - 432 self._writeElement(root)) - 433 - 434 root = XML(xml) - 435 self.etree.strip_tags(root, PI, Comment) - 436 self.assertEqual(_bytes('<!--comment1-->\n<?PI1?>\n<test>TESTXT</test>\n<!--comment3-->\n<?PI1?>'), - 437 self._writeElement(root)) - 438 - 439 root = XML(xml) - 440 self.etree.strip_tags(root, Comment, PI) - 441 self.assertEqual(_bytes('<!--comment1-->\n<?PI1?>\n<test>TESTXT</test>\n<!--comment3-->\n<?PI1?>'), - 442 self._writeElement(root)) -
443 -
445 XML = self.etree.XML - 446 ElementTree = self.etree.ElementTree - 447 PI = self.etree.ProcessingInstruction - 448 Comment = self.etree.Comment - 449 xml = _bytes('<!--comment1-->\n<?PI1?>\n<test>TEST<!--comment2-->XT<?PI2?></test>\n<!--comment3-->\n<?PI1?>') - 450 - 451 root = XML(xml) - 452 self.etree.strip_tags(ElementTree(root), PI) - 453 self.assertEqual(_bytes('<!--comment1-->\n<test>TEST<!--comment2-->XT</test>\n<!--comment3-->'), - 454 self._writeElement(root)) - 455 - 456 root = XML(xml) - 457 self.etree.strip_tags(ElementTree(root), Comment) - 458 self.assertEqual(_bytes('<?PI1?>\n<test>TESTXT<?PI2?></test>\n<?PI1?>'), - 459 self._writeElement(root)) - 460 - 461 root = XML(xml) - 462 self.etree.strip_tags(ElementTree(root), PI, Comment) - 463 self.assertEqual(_bytes('<test>TESTXT</test>'), - 464 self._writeElement(root)) - 465 - 466 root = XML(xml) - 467 self.etree.strip_tags(ElementTree(root), Comment, PI) - 468 self.assertEqual(_bytes('<test>TESTXT</test>'), - 469 self._writeElement(root)) -
470 -
471 - def test_strip_tags_doc_style(self): -
472 XML = self.etree.XML - 473 xml = _bytes(''' - 474 <div> - 475 <div> - 476 I like <strong>sheep</strong>. - 477 <br/> - 478 I like lots of <strong>sheep</strong>. - 479 <br/> - 480 Click <a href="http://www.sheep.com">here</a> - 481 for <a href="http://www.sheep.com">those</a> sheep. - 482 <br/> - 483 </div> - 484 </div> - 485 '''.strip()) - 486 - 487 root = XML(xml) - 488 self.etree.strip_tags(root, 'a') - 489 self.assertEqual(re.sub(_bytes('</?a[^>]*>'), _bytes(''), xml).replace(_bytes('<br/>'), _bytes('<br></br>')), - 490 self._writeElement(root)) - 491 - 492 root = XML(xml) - 493 self.etree.strip_tags(root, 'a', 'br') - 494 self.assertEqual(re.sub(_bytes('</?a[^>]*>'), _bytes(''), - 495 re.sub(_bytes('<br[^>]*>'), _bytes(''), xml)), - 496 self._writeElement(root)) -
497 -
498 - def test_strip_tags_ns(self): -
499 XML = self.etree.XML - 500 xml = _bytes('<test>TEST<n:a xmlns:n="urn:a">A<b>B<c xmlns="urn:c"/>CT</b>BT</n:a>AT<x>X<a>A<b xmlns="urn:a"/>BT<c xmlns="urn:x"/>CT</a>AT</x>XT</test>') - 501 - 502 root = XML(xml) - 503 self.etree.strip_tags(root, 'a') - 504 self.assertEqual(_bytes('<test>TEST<n:a xmlns:n="urn:a">A<b>B<c xmlns="urn:c"></c>CT</b>BT</n:a>AT<x>XA<b xmlns="urn:a"></b>BT<c xmlns="urn:x"></c>CTAT</x>XT</test>'), - 505 self._writeElement(root)) - 506 - 507 root = XML(xml) - 508 self.etree.strip_tags(root, '{urn:a}b', 'c') - 509 self.assertEqual(_bytes('<test>TEST<n:a xmlns:n="urn:a">A<b>B<c xmlns="urn:c"></c>CT</b>BT</n:a>AT<x>X<a>ABT<c xmlns="urn:x"></c>CT</a>AT</x>XT</test>'), - 510 self._writeElement(root)) - 511 - 512 root = XML(xml) - 513 self.etree.strip_tags(root, '{urn:a}*', 'c') - 514 self.assertEqual(_bytes('<test>TESTA<b>B<c xmlns="urn:c"></c>CT</b>BTAT<x>X<a>ABT<c xmlns="urn:x"></c>CT</a>AT</x>XT</test>'), - 515 self._writeElement(root)) -
516 -
517 - def test_strip_tags_and_remove(self): -
518 # previously crashed - 519 HTML = self.etree.HTML - 520 root = HTML(_bytes('<div><h1>title</h1> <b>foo</b> <p>boo</p></div>'))[0][0] - 521 self.assertEqual(_bytes('<div><h1>title</h1> <b>foo</b> <p>boo</p></div>'), - 522 self.etree.tostring(root)) - 523 self.etree.strip_tags(root, 'b') - 524 self.assertEqual(_bytes('<div><h1>title</h1> foo <p>boo</p></div>'), - 525 self.etree.tostring(root)) - 526 root.remove(root[0]) - 527 self.assertEqual(_bytes('<div><p>boo</p></div>'), - 528 self.etree.tostring(root)) -
529 -
530 - def test_pi(self): -
531 # lxml.etree separates target and text - 532 Element = self.etree.Element - 533 SubElement = self.etree.SubElement - 534 ProcessingInstruction = self.etree.ProcessingInstruction - 535 - 536 a = Element('a') - 537 a.append(ProcessingInstruction('foo', 'some more text')) - 538 self.assertEqual(a[0].target, 'foo') - 539 self.assertEqual(a[0].text, 'some more text') -
540 -
541 - def test_pi_parse(self): -
542 XML = self.etree.XML - 543 root = XML(_bytes("<test><?mypi my test ?></test>")) - 544 self.assertEqual(root[0].target, "mypi") - 545 self.assertEqual(root[0].text, "my test ") -
546 -
548 XML = self.etree.XML - 549 root = XML(_bytes("<test><?mypi my='1' test=\" abc \" quotes=\"' '\" only names ?></test>")) - 550 self.assertEqual(root[0].target, "mypi") - 551 self.assertEqual(root[0].get('my'), "1") - 552 self.assertEqual(root[0].get('test'), " abc ") - 553 self.assertEqual(root[0].get('quotes'), "' '") - 554 self.assertEqual(root[0].get('only'), None) - 555 self.assertEqual(root[0].get('names'), None) - 556 self.assertEqual(root[0].get('nope'), None) -
557 -
559 XML = self.etree.XML - 560 root = XML(_bytes("<test><?mypi my='1' test=\" abc \" quotes=\"' '\" only names ?></test>")) - 561 self.assertEqual(root[0].target, "mypi") - 562 self.assertEqual(root[0].attrib['my'], "1") - 563 self.assertEqual(root[0].attrib['test'], " abc ") - 564 self.assertEqual(root[0].attrib['quotes'], "' '") - 565 self.assertRaises(KeyError, root[0].attrib.__getitem__, 'only') - 566 self.assertRaises(KeyError, root[0].attrib.__getitem__, 'names') - 567 self.assertRaises(KeyError, root[0].attrib.__getitem__, 'nope') -
568 -
569 - def test_deepcopy_pi(self): -
570 # previously caused a crash - 571 ProcessingInstruction = self.etree.ProcessingInstruction - 572 - 573 a = ProcessingInstruction("PI", "ONE") - 574 b = copy.deepcopy(a) - 575 b.text = "ANOTHER" - 576 - 577 self.assertEqual('ONE', a.text) - 578 self.assertEqual('ANOTHER', b.text) -
579 -
581 XML = self.etree.XML - 582 tostring = self.etree.tostring - 583 root = XML(_bytes("<?mypi my test ?><test/><!--comment -->")) - 584 tree1 = self.etree.ElementTree(root) - 585 self.assertEqual(_bytes("<?mypi my test ?><test/><!--comment -->"), - 586 tostring(tree1)) - 587 - 588 tree2 = copy.deepcopy(tree1) - 589 self.assertEqual(_bytes("<?mypi my test ?><test/><!--comment -->"), - 590 tostring(tree2)) - 591 - 592 root2 = copy.deepcopy(tree1.getroot()) - 593 self.assertEqual(_bytes("<test/>"), - 594 tostring(root2)) -
595 -
597 XML = self.etree.XML - 598 tostring = self.etree.tostring - 599 xml = _bytes('<!DOCTYPE test [\n<!ENTITY entity "tasty">\n]>\n<test/>') - 600 root = XML(xml) - 601 tree1 = self.etree.ElementTree(root) - 602 self.assertEqual(xml, tostring(tree1)) - 603 - 604 tree2 = copy.deepcopy(tree1) - 605 self.assertEqual(xml, tostring(tree2)) - 606 - 607 root2 = copy.deepcopy(tree1.getroot()) - 608 self.assertEqual(_bytes("<test/>"), - 609 tostring(root2)) -
610 -
611 - def test_deepcopy_pi_dtd(self): -
612 XML = self.etree.XML - 613 tostring = self.etree.tostring - 614 xml = _bytes('<!-- comment --><!DOCTYPE test [\n<!ENTITY entity "tasty">\n]>\n<test/>') - 615 root = XML(xml) - 616 tree1 = self.etree.ElementTree(root) - 617 self.assertEqual(xml, tostring(tree1)) - 618 - 619 tree2 = copy.deepcopy(tree1) - 620 self.assertEqual(xml, tostring(tree2)) -
621 -
622 - def test_parse_remove_comments(self): -
623 fromstring = self.etree.fromstring - 624 tostring = self.etree.tostring - 625 XMLParser = self.etree.XMLParser - 626 - 627 xml = _bytes('<a><!--A--><b><!-- B --><c/></b><!--C--></a>') - 628 parser = XMLParser(remove_comments=True) - 629 root = fromstring(xml, parser) - 630 self.assertEqual( - 631 _bytes('<a><b><c/></b></a>'), - 632 tostring(root)) -
633 -
634 - def test_parse_remove_pis(self): -
635 parse = self.etree.parse - 636 tostring = self.etree.tostring - 637 XMLParser = self.etree.XMLParser - 638 - 639 xml = _bytes('<?test?><a><?A?><b><?B?><c/></b><?C?></a><?tail?>') - 640 - 641 f = BytesIO(xml) - 642 tree = parse(f) - 643 self.assertEqual( - 644 xml, - 645 tostring(tree)) - 646 - 647 parser = XMLParser(remove_pis=True) - 648 tree = parse(f, parser) - 649 self.assertEqual( - 650 _bytes('<a><b><c/></b></a>'), - 651 tostring(tree)) -
652 -
654 # ET raises IOError only - 655 parse = self.etree.parse - 656 self.assertRaises(TypeError, parse, 'notthere.xml', object()) -
657 -
659 # ET removes comments - 660 iterparse = self.etree.iterparse - 661 tostring = self.etree.tostring - 662 - 663 f = BytesIO('<a><!--A--><b><!-- B --><c/></b><!--C--></a>') - 664 events = list(iterparse(f)) - 665 root = events[-1][1] - 666 self.assertEqual(3, len(events)) - 667 self.assertEqual( - 668 _bytes('<a><!--A--><b><!-- B --><c/></b><!--C--></a>'), - 669 tostring(root)) -
670 -
671 - def test_iterparse_comments(self): -
672 # ET removes comments - 673 iterparse = self.etree.iterparse - 674 tostring = self.etree.tostring - 675 - 676 def name(event, el): - 677 if event == 'comment': - 678 return el.text - 679 else: - 680 return el.tag -
681 - 682 f = BytesIO('<a><!--A--><b><!-- B --><c/></b><!--C--></a>') - 683 events = list(iterparse(f, events=('end', 'comment'))) - 684 root = events[-1][1] - 685 self.assertEqual(6, len(events)) - 686 self.assertEqual(['A', ' B ', 'c', 'b', 'C', 'a'], - 687 [ name(*item) for item in events ]) - 688 self.assertEqual( - 689 _bytes('<a><!--A--><b><!-- B --><c/></b><!--C--></a>'), - 690 tostring(root)) -
691 -
692 - def test_iterparse_pis(self): -
693 # ET removes pis - 694 iterparse = self.etree.iterparse - 695 tostring = self.etree.tostring - 696 ElementTree = self.etree.ElementTree - 697 - 698 def name(event, el): - 699 if event == 'pi': - 700 return (el.target, el.text) - 701 else: - 702 return el.tag -
703 - 704 f = BytesIO('<?pia a?><a><?pib b?><b><?pic c?><c/></b><?pid d?></a><?pie e?>') - 705 events = list(iterparse(f, events=('end', 'pi'))) - 706 root = events[-2][1] - 707 self.assertEqual(8, len(events)) - 708 self.assertEqual([('pia','a'), ('pib','b'), ('pic','c'), 'c', 'b', - 709 ('pid','d'), 'a', ('pie','e')], - 710 [ name(*item) for item in events ]) - 711 self.assertEqual( - 712 _bytes('<?pia a?><a><?pib b?><b><?pic c?><c/></b><?pid d?></a><?pie e?>'), - 713 tostring(ElementTree(root))) - 714 -
716 iterparse = self.etree.iterparse - 717 tostring = self.etree.tostring - 718 - 719 f = BytesIO('<a><!--A--><b><!-- B --><c/></b><!--C--></a>') - 720 events = list(iterparse(f, remove_comments=True, - 721 events=('end', 'comment'))) - 722 root = events[-1][1] - 723 self.assertEqual(3, len(events)) - 724 self.assertEqual(['c', 'b', 'a'], - 725 [ el.tag for (event, el) in events ]) - 726 self.assertEqual( - 727 _bytes('<a><b><c/></b></a>'), - 728 tostring(root)) -
729 -
730 - def test_iterparse_broken(self): -
731 iterparse = self.etree.iterparse - 732 f = BytesIO('<a><b><c/></a>') - 733 # ET raises ExpatError, lxml raises XMLSyntaxError - 734 self.assertRaises(self.etree.XMLSyntaxError, list, iterparse(f)) -
735 -
737 iterparse = self.etree.iterparse - 738 f = BytesIO('<a><b><c/></a>') - 739 it = iterparse(f, events=('start', 'end'), recover=True) - 740 events = [(ev, el.tag) for ev, el in it] - 741 root = it.root - 742 self.assertTrue(root is not None) - 743 - 744 self.assertEqual(1, events.count(('start', 'a'))) - 745 self.assertEqual(1, events.count(('end', 'a'))) - 746 - 747 self.assertEqual(1, events.count(('start', 'b'))) - 748 self.assertEqual(1, events.count(('end', 'b'))) - 749 - 750 self.assertEqual(1, events.count(('start', 'c'))) - 751 self.assertEqual(1, events.count(('end', 'c'))) -
752 -
754 iterparse = self.etree.iterparse - 755 f = BytesIO('<a><b><c/></d><b><c/></a></b>') - 756 it = iterparse(f, events=('start', 'end'), recover=True) - 757 events = [(ev, el.tag) for ev, el in it] - 758 root = it.root - 759 self.assertTrue(root is not None) - 760 - 761 self.assertEqual(1, events.count(('start', 'a'))) - 762 self.assertEqual(1, events.count(('end', 'a'))) - 763 - 764 self.assertEqual(2, events.count(('start', 'b'))) - 765 self.assertEqual(2, events.count(('end', 'b'))) - 766 - 767 self.assertEqual(2, events.count(('start', 'c'))) - 768 self.assertEqual(2, events.count(('end', 'c'))) -
769 -
770 - def test_iterparse_strip(self): -
771 iterparse = self.etree.iterparse - 772 f = BytesIO(""" - 773 <a> \n \n <b> b test </b> \n - 774 - 775 \n\t <c> \n </c> </a> \n """) - 776 iterator = iterparse(f, remove_blank_text=True) - 777 text = [ (element.text, element.tail) - 778 for event, element in iterator ] - 779 self.assertEqual( - 780 [(" b test ", None), (" \n ", None), (None, None)], - 781 text) -
782 -
783 - def test_iterparse_tag(self): -
784 iterparse = self.etree.iterparse - 785 f = BytesIO('<a><b><d/></b><c/></a>') - 786 - 787 iterator = iterparse(f, tag="b", events=('start', 'end')) - 788 events = list(iterator) - 789 root = iterator.root - 790 self.assertEqual( - 791 [('start', root[0]), ('end', root[0])], - 792 events) -
793 -
794 - def test_iterparse_tag_all(self): -
795 iterparse = self.etree.iterparse - 796 f = BytesIO('<a><b><d/></b><c/></a>') - 797 - 798 iterator = iterparse(f, tag="*", events=('start', 'end')) - 799 events = list(iterator) - 800 self.assertEqual( - 801 8, - 802 len(events)) -
803 -
804 - def test_iterparse_tag_ns(self): -
805 iterparse = self.etree.iterparse - 806 f = BytesIO('<a xmlns="urn:test:1"><b><d/></b><c/></a>') - 807 - 808 iterator = iterparse(f, tag="{urn:test:1}b", events=('start', 'end')) - 809 events = list(iterator) - 810 root = iterator.root - 811 self.assertEqual( - 812 [('start', root[0]), ('end', root[0])], - 813 events) -
814 -
815 - def test_iterparse_tag_ns_empty(self): -
816 iterparse = self.etree.iterparse - 817 f = BytesIO('<a><b><d/></b><c/></a>') - 818 iterator = iterparse(f, tag="{}b", events=('start', 'end')) - 819 events = list(iterator) - 820 root = iterator.root - 821 self.assertEqual( - 822 [('start', root[0]), ('end', root[0])], - 823 events) - 824 - 825 f = BytesIO('<a xmlns="urn:test:1"><b><d/></b><c/></a>') - 826 iterator = iterparse(f, tag="{}b", events=('start', 'end')) - 827 events = list(iterator) - 828 root = iterator.root - 829 self.assertEqual([], events) -
830 -
831 - def test_iterparse_tag_ns_all(self): -
832 iterparse = self.etree.iterparse - 833 f = BytesIO('<a xmlns="urn:test:1"><b><d/></b><c/></a>') - 834 iterator = iterparse(f, tag="{urn:test:1}*", events=('start', 'end')) - 835 events = list(iterator) - 836 self.assertEqual(8, len(events)) -
837 -
839 iterparse = self.etree.iterparse - 840 f = BytesIO('<a xmlns="urn:test:1"><b><d/></b><c/></a>') - 841 iterator = iterparse(f, tag="{}*", events=('start', 'end')) - 842 events = list(iterator) - 843 self.assertEqual([], events) - 844 - 845 f = BytesIO('<a><b><d/></b><c/></a>') - 846 iterator = iterparse(f, tag="{}*", events=('start', 'end')) - 847 events = list(iterator) - 848 self.assertEqual(8, len(events)) -
849 -
851 text = _str('Søk på nettet') - 852 wrong_declaration = "<?xml version='1.0' encoding='UTF-8'?>" - 853 xml_latin1 = (_str('%s<a>%s</a>') % (wrong_declaration, text) - 854 ).encode('iso-8859-1') - 855 - 856 self.assertRaises(self.etree.ParseError, - 857 list, self.etree.iterparse(BytesIO(xml_latin1))) -
858 -
860 text = _str('Søk på nettet', encoding="UTF-8") - 861 wrong_declaration = "<?xml version='1.0' encoding='UTF-8'?>" - 862 xml_latin1 = (_str('%s<a>%s</a>') % (wrong_declaration, text) - 863 ).encode('iso-8859-1') - 864 - 865 iterator = self.etree.iterparse(BytesIO(xml_latin1), - 866 encoding="iso-8859-1") - 867 self.assertEqual(1, len(list(iterator))) - 868 - 869 a = iterator.root - 870 self.assertEqual(a.text, text) -
871 -
872 - def test_iterparse_keep_cdata(self): -
873 tostring = self.etree.tostring - 874 f = BytesIO('<root><![CDATA[test]]></root>') - 875 context = self.etree.iterparse(f, strip_cdata=False) - 876 content = [ el.text for event,el in context ] - 877 - 878 self.assertEqual(['test'], content) - 879 self.assertEqual(_bytes('<root><![CDATA[test]]></root>'), - 880 tostring(context.root)) -
881 -
883 self.assertRaises( - 884 LookupError, self.etree.XMLParser, encoding="hopefully unknown") -
885 -
886 - def test_parser_encoding(self): -
887 self.etree.XMLParser(encoding="ascii") - 888 self.etree.XMLParser(encoding="utf-8") - 889 self.etree.XMLParser(encoding="iso-8859-1") -
890 -
891 - def test_feed_parser_recover(self): -
892 parser = self.etree.XMLParser(recover=True) - 893 - 894 parser.feed('<?xml version=') - 895 parser.feed('"1.0"?><ro') - 896 parser.feed('ot><') - 897 parser.feed('a test="works"') - 898 parser.feed('><othertag/></root') # <a> not closed! - 899 parser.feed('>') - 900 - 901 root = parser.close() - 902 - 903 self.assertEqual(root.tag, "root") - 904 self.assertEqual(len(root), 1) - 905 self.assertEqual(root[0].tag, "a") - 906 self.assertEqual(root[0].get("test"), "works") - 907 self.assertEqual(len(root[0]), 1) - 908 self.assertEqual(root[0][0].tag, "othertag") -
909 # FIXME: would be nice to get some errors logged ... - 910 #self.assertTrue(len(parser.error_log) > 0, "error log is empty") - 911 -
913 # test that recover mode plays nicely with the no-id-dict setup - 914 parser = self.etree.XMLParser(recover=True, collect_ids=False) - 915 - 916 parser.feed('<?xml version=') - 917 parser.feed('"1.0"?><ro') - 918 parser.feed('ot xml:id="123"><') - 919 parser.feed('a test="works" xml:id=') - 920 parser.feed('"321"><othertag/></root') # <a> not closed! - 921 parser.feed('>') - 922 - 923 root = parser.close() - 924 - 925 self.assertEqual(root.tag, "root") - 926 self.assertEqual(len(root), 1) - 927 self.assertEqual(root[0].tag, "a") - 928 self.assertEqual(root[0].get("test"), "works") - 929 self.assertEqual(root[0].attrib, { - 930 'test': 'works', - 931 '{http://www.w3.org/XML/1998/namespace}id': '321'}) - 932 self.assertEqual(len(root[0]), 1) - 933 self.assertEqual(root[0][0].tag, "othertag") -
934 # FIXME: would be nice to get some errors logged ... - 935 #self.assertTrue(len(parser.error_log) > 0, "error log is empty") - 936 -
938 assertEqual = self.assertEqual - 939 assertFalse = self.assertFalse - 940 - 941 events = [] - 942 class Target(object): - 943 def start(self, tag, attrib): - 944 events.append("start") - 945 assertFalse(attrib) - 946 assertEqual("TAG", tag) -
947 def end(self, tag): - 948 events.append("end") - 949 assertEqual("TAG", tag) - 950 def close(self): - 951 return "DONE" # no Element! - 952 - 953 parser = self.etree.XMLParser(target=Target()) - 954 tree = self.etree.ElementTree() - 955 - 956 self.assertRaises(TypeError, - 957 tree.parse, BytesIO("<TAG/>"), parser=parser) - 958 self.assertEqual(["start", "end"], events) - 959 -
961 # ET doesn't call .close() on errors - 962 events = [] - 963 class Target(object): - 964 def start(self, tag, attrib): - 965 events.append("start-" + tag) -
966 def end(self, tag): - 967 events.append("end-" + tag) - 968 if tag == 'a': - 969 raise ValueError("dead and gone") - 970 def data(self, data): - 971 events.append("data-" + data) - 972 def close(self): - 973 events.append("close") - 974 return "DONE" - 975 - 976 parser = self.etree.XMLParser(target=Target()) - 977 - 978 try: - 979 parser.feed(_bytes('<root>A<a>ca</a>B</root>')) - 980 done = parser.close() - 981 self.fail("error expected, but parsing succeeded") - 982 except ValueError: - 983 done = 'value error received as expected' - 984 - 985 self.assertEqual(["start-root", "data-A", "start-a", - 986 "data-ca", "end-a", "close"], - 987 events) - 988 -
990 # ET doesn't call .close() on errors - 991 events = [] - 992 class Target(object): - 993 def start(self, tag, attrib): - 994 events.append("start-" + tag) -
995 def end(self, tag): - 996 events.append("end-" + tag) - 997 if tag == 'a': - 998 raise ValueError("dead and gone") - 999 def data(self, data): -1000 events.append("data-" + data) -1001 def close(self): -1002 events.append("close") -1003 return "DONE" -1004 -1005 parser = self.etree.XMLParser(target=Target()) -1006 -1007 try: -1008 done = self.etree.fromstring(_bytes('<root>A<a>ca</a>B</root>'), -1009 parser=parser) -1010 self.fail("error expected, but parsing succeeded") -1011 except ValueError: -1012 done = 'value error received as expected' -1013 -1014 self.assertEqual(["start-root", "data-A", "start-a", -1015 "data-ca", "end-a", "close"], -1016 events) -1017 -
1019 # test that target parsing works nicely with the no-id-hash setup -1020 events = [] -1021 class Target(object): -1022 def start(self, tag, attrib): -1023 events.append("start-" + tag) -
1024 def end(self, tag): -1025 events.append("end-" + tag) -1026 def data(self, data): -1027 events.append("data-" + data) -1028 def comment(self, text): -1029 events.append("comment-" + text) -1030 def close(self): -1031 return "DONE" -1032 -1033 parser = self.etree.XMLParser(target=Target(), collect_ids=False) -1034 -1035 parser.feed(_bytes('<!--a--><root xml:id="123">A<!--b-->')) -1036 parser.feed(_bytes('<sub xml:id="321"/>B</root>')) -1037 done = parser.close() -1038 -1039 self.assertEqual("DONE", done) -1040 self.assertEqual(["comment-a", "start-root", "data-A", "comment-b", -1041 "start-sub", "end-sub", "data-B", "end-root"], -1042 events) -1043 -
1044 - def test_parser_target_comment(self): -
1045 events = [] -1046 class Target(object): -1047 def start(self, tag, attrib): -1048 events.append("start-" + tag) -
1049 def end(self, tag): -1050 events.append("end-" + tag) -1051 def data(self, data): -1052 events.append("data-" + data) -1053 def comment(self, text): -1054 events.append("comment-" + text) -1055 def close(self): -1056 return "DONE" -1057 -1058 parser = self.etree.XMLParser(target=Target()) -1059 -1060 parser.feed(_bytes('<!--a--><root>A<!--b--><sub/><!--c-->B</root><!--d-->')) -1061 done = parser.close() -1062 -1063 self.assertEqual("DONE", done) -1064 self.assertEqual(["comment-a", "start-root", "data-A", "comment-b", -1065 "start-sub", "end-sub", "comment-c", "data-B", -1066 "end-root", "comment-d"], -1067 events) -1068 -
1069 - def test_parser_target_pi(self): -
1070 events = [] -1071 class Target(object): -1072 def start(self, tag, attrib): -1073 events.append("start-" + tag) -
1074 def end(self, tag): -1075 events.append("end-" + tag) -1076 def data(self, data): -1077 events.append("data-" + data) -1078 def pi(self, target, data): -1079 events.append("pi-" + target + "-" + data) -1080 def close(self): -1081 return "DONE" -1082 -1083 parser = self.etree.XMLParser(target=Target()) -1084 -1085 parser.feed(_bytes('<?test a?><root>A<?test b?>B</root><?test c?>')) -1086 done = parser.close() -1087 -1088 self.assertEqual("DONE", done) -1089 self.assertEqual(["pi-test-a", "start-root", "data-A", "pi-test-b", -1090 "data-B", "end-root", "pi-test-c"], -1091 events) -1092 -
1093 - def test_parser_target_cdata(self): -
1094 events = [] -1095 class Target(object): -1096 def start(self, tag, attrib): -1097 events.append("start-" + tag) -
1098 def end(self, tag): -1099 events.append("end-" + tag) -1100 def data(self, data): -1101 events.append("data-" + data) -1102 def close(self): -1103 return "DONE" -1104 -1105 parser = self.etree.XMLParser(target=Target(), -1106 strip_cdata=False) -1107 -1108 parser.feed(_bytes('<root>A<a><![CDATA[ca]]></a>B</root>')) -1109 done = parser.close() -1110 -1111 self.assertEqual("DONE", done) -1112 self.assertEqual(["start-root", "data-A", "start-a", -1113 "data-ca", "end-a", "data-B", "end-root"], -1114 events) -1115 -
1116 - def test_parser_target_recover(self): -
1117 events = [] -1118 class Target(object): -1119 def start(self, tag, attrib): -1120 events.append("start-" + tag) -
1121 def end(self, tag): -1122 events.append("end-" + tag) -1123 def data(self, data): -1124 events.append("data-" + data) -1125 def close(self): -1126 events.append("close") -1127 return "DONE" -1128 -1129 parser = self.etree.XMLParser(target=Target(), -1130 recover=True) -1131 -1132 parser.feed(_bytes('<root>A<a>ca</a>B</not-root>')) -1133 done = parser.close() -1134 -1135 self.assertEqual("DONE", done) -1136 self.assertEqual(["start-root", "data-A", "start-a", -1137 "data-ca", "end-a", "data-B", -1138 "end-root", "close"], -1139 events) -1140 -
1141 - def test_iterwalk_tag(self): -
1142 iterwalk = self.etree.iterwalk -1143 root = self.etree.XML(_bytes('<a><b><d/></b><c/></a>')) -1144 -1145 iterator = iterwalk(root, tag="b", events=('start', 'end')) -1146 events = list(iterator) -1147 self.assertEqual( -1148 [('start', root[0]), ('end', root[0])], -1149 events) -
1150 -
1151 - def test_iterwalk_tag_all(self): -
1152 iterwalk = self.etree.iterwalk -1153 root = self.etree.XML(_bytes('<a><b><d/></b><c/></a>')) -1154 -1155 iterator = iterwalk(root, tag="*", events=('start', 'end')) -1156 events = list(iterator) -1157 self.assertEqual( -1158 8, -1159 len(events)) -
1160 -
1161 - def test_iterwalk(self): -
1162 iterwalk = self.etree.iterwalk -1163 root = self.etree.XML(_bytes('<a><b></b><c/></a>')) -1164 -1165 events = list(iterwalk(root)) -1166 self.assertEqual( -1167 [('end', root[0]), ('end', root[1]), ('end', root)], -1168 events) -
1169 -
1170 - def test_iterwalk_start(self): -
1171 iterwalk = self.etree.iterwalk -1172 root = self.etree.XML(_bytes('<a><b></b><c/></a>')) -1173 -1174 iterator = iterwalk(root, events=('start',)) -1175 events = list(iterator) -1176 self.assertEqual( -1177 [('start', root), ('start', root[0]), ('start', root[1])], -1178 events) -
1179 -
1180 - def test_iterwalk_start_end(self): -
1181 iterwalk = self.etree.iterwalk -1182 root = self.etree.XML(_bytes('<a><b></b><c/></a>')) -1183 -1184 iterator = iterwalk(root, events=('start','end')) -1185 events = list(iterator) -1186 self.assertEqual( -1187 [('start', root), ('start', root[0]), ('end', root[0]), -1188 ('start', root[1]), ('end', root[1]), ('end', root)], -1189 events) -
1190 -
1191 - def test_iterwalk_start_tags(self): -
1192 iterwalk = self.etree.iterwalk -1193 root = self.etree.XML(_bytes('<a><b></b><c/><b><d/></b></a>')) -1194 -1195 iterator = iterwalk(root, events=('start',), tag='b') -1196 events = list(iterator) -1197 self.assertEqual( -1198 [('start', root[0]), ('start', root[2])], -1199 events) -
1200 -
1202 iterwalk = self.etree.iterwalk -1203 root = self.etree.XML(_bytes('<a><b></b><c/><b><d/></b></a>')) -1204 -1205 iterator = iterwalk(root, events=('start', 'end'), tag='b') -1206 events = list(iterator) -1207 self.assertEqual( -1208 [('start', root[0]), ('end', root[0]), ('start', root[2]), ('end', root[2])], -1209 events) -
1210 -
1212 iterwalk = self.etree.iterwalk -1213 root = self.etree.XML(_bytes('<a><b></b><c/><b><d/></b></a>')) -1214 -1215 iterator = iterwalk(root, events=('start', 'end'), tag=('b', 'a')) -1216 events = list(iterator) -1217 self.assertEqual( -1218 [('start', root), -1219 ('start', root[0]), ('end', root[0]), -1220 ('start', root[2]), ('end', root[2]), -1221 ('end', root), -1222 ], -1223 events) -
1224 -
1225 - def test_iterwalk_clear(self): -
1226 iterwalk = self.etree.iterwalk -1227 root = self.etree.XML(_bytes('<a><b></b><c/></a>')) -1228 -1229 iterator = iterwalk(root) -1230 for event, elem in iterator: -1231 elem.clear() -1232 -1233 self.assertEqual(0, -1234 len(root)) -
1235 -
1236 - def test_iterwalk_attrib_ns(self): -
1237 iterwalk = self.etree.iterwalk -1238 root = self.etree.XML(_bytes('<a xmlns="ns1"><b><c xmlns="ns2"/></b></a>')) -1239 -1240 attr_name = '{testns}bla' -1241 events = [] -1242 iterator = iterwalk(root, events=('start','end','start-ns','end-ns')) -1243 for event, elem in iterator: -1244 events.append(event) -1245 if event == 'start': -1246 if elem.tag != '{ns1}a': -1247 elem.set(attr_name, 'value') -1248 -1249 self.assertEqual( -1250 ['start-ns', 'start', 'start', 'start-ns', 'start', -1251 'end', 'end-ns', 'end', 'end', 'end-ns'], -1252 events) -1253 -1254 self.assertEqual( -1255 None, -1256 root.get(attr_name)) -1257 self.assertEqual( -1258 'value', -1259 root[0].get(attr_name)) -
1260 -
1261 - def test_iterwalk_end_skip(self): -
1262 iterwalk = self.etree.iterwalk -1263 root = self.etree.XML(_bytes('<a><b><c/></b><d><e/></d></a>')) -1264 -1265 iterator = iterwalk(root) -1266 tags = [] -1267 for event, elem in iterator: -1268 tags.append(elem.tag) -1269 # requesting a skip after an 'end' event should never have an effect -1270 iterator.skip_subtree() -1271 -1272 self.assertEqual(['c', 'b', 'e', 'd', 'a'], tags) -
1273 -
1275 iterwalk = self.etree.iterwalk -1276 root = self.etree.XML(_bytes('<a><b><c/></b><d><e/></d></a>')) -1277 -1278 iterator = iterwalk(root, events=('start', 'end')) -1279 tags = [] -1280 for event, elem in iterator: -1281 tags.append((event, elem.tag)) -1282 if elem.tag in ('b', 'e'): -1283 # skipping should only have an effect on 'start', not on 'end' -1284 iterator.skip_subtree() -1285 -1286 self.assertEqual( -1287 [('start', 'a'), -1288 ('start', 'b'), ('end', 'b'), # ignored child 'c' -1289 ('start', 'd'), -1290 ('start', 'e'), ('end', 'e'), -1291 ('end', 'd'), -1292 ('end', 'a')], -1293 tags) -
1294 -
1295 - def test_iterwalk_ns_skip(self): -
1296 iterwalk = self.etree.iterwalk -1297 root = self.etree.XML(_bytes( -1298 '<a xmlns="ns1"><b xmlns="nsb"><c xmlns="ns2"/></b><d xmlns="ns2"><e/></d></a>')) -1299 -1300 events = [] -1301 iterator = iterwalk(root, events=('start','start-ns','end-ns')) -1302 for event, elem in iterator: -1303 if event in ('start-ns', 'end-ns'): -1304 events.append((event, elem)) -1305 if event == 'start-ns' and elem == ('', 'nsb'): -1306 events.append('skip') -1307 iterator.skip_subtree() -1308 else: -1309 events.append((event, elem.tag)) -1310 -1311 self.assertEqual( -1312 [('start-ns', ('', 'ns1')), -1313 ('start', '{ns1}a'), -1314 ('start-ns', ('', 'nsb')), -1315 'skip', -1316 ('start', '{nsb}b'), -1317 ('end-ns', None), -1318 ('start-ns', ('', 'ns2')), -1319 ('start', '{ns2}d'), -1320 ('start', '{ns2}e'), -1321 ('end-ns', None), -1322 ('end-ns', None) -1323 ], -1324 events) -
1325 -
1326 - def test_iterwalk_getiterator(self): -
1327 iterwalk = self.etree.iterwalk -1328 root = self.etree.XML(_bytes('<a><b><d/></b><c/></a>')) -1329 -1330 counts = [] -1331 for event, elem in iterwalk(root): -1332 counts.append(len(list(elem.getiterator()))) -1333 self.assertEqual( -1334 [1,2,1,4], -1335 counts) -
1336 -
1337 - def test_resolve_string_dtd(self): -
1338 parse = self.etree.parse -1339 parser = self.etree.XMLParser(dtd_validation=True) -1340 assertEqual = self.assertEqual -1341 test_url = _str("__nosuch.dtd") -1342 -1343 class MyResolver(self.etree.Resolver): -1344 def resolve(self, url, id, context): -1345 assertEqual(url, test_url) -1346 return self.resolve_string( -1347 _str('''<!ENTITY myentity "%s"> -1348 <!ELEMENT doc ANY>''') % url, context) -
1349 -1350 parser.resolvers.add(MyResolver()) -1351 -1352 xml = _str('<!DOCTYPE doc SYSTEM "%s"><doc>&myentity;</doc>') % test_url -1353 tree = parse(StringIO(xml), parser) -1354 root = tree.getroot() -1355 self.assertEqual(root.text, test_url) -1356 -
1357 - def test_resolve_bytes_dtd(self): -
1358 parse = self.etree.parse -1359 parser = self.etree.XMLParser(dtd_validation=True) -1360 assertEqual = self.assertEqual -1361 test_url = _str("__nosuch.dtd") -1362 -1363 class MyResolver(self.etree.Resolver): -1364 def resolve(self, url, id, context): -1365 assertEqual(url, test_url) -1366 return self.resolve_string( -1367 (_str('''<!ENTITY myentity "%s"> -1368 <!ELEMENT doc ANY>''') % url).encode('utf-8'), -1369 context) -
1370 -1371 parser.resolvers.add(MyResolver()) -1372 -1373 xml = _str('<!DOCTYPE doc SYSTEM "%s"><doc>&myentity;</doc>') % test_url -1374 tree = parse(StringIO(xml), parser) -1375 root = tree.getroot() -1376 self.assertEqual(root.text, test_url) -1377 -
1378 - def test_resolve_filelike_dtd(self): -
1379 parse = self.etree.parse -1380 parser = self.etree.XMLParser(dtd_validation=True) -1381 assertEqual = self.assertEqual -1382 test_url = _str("__nosuch.dtd") -1383 -1384 class MyResolver(self.etree.Resolver): -1385 def resolve(self, url, id, context): -1386 assertEqual(url, test_url) -1387 return self.resolve_file( -1388 SillyFileLike( -1389 _str('''<!ENTITY myentity "%s"> -1390 <!ELEMENT doc ANY>''') % url), context) -
1391 -1392 parser.resolvers.add(MyResolver()) -1393 -1394 xml = _str('<!DOCTYPE doc SYSTEM "%s"><doc>&myentity;</doc>') % test_url -1395 tree = parse(StringIO(xml), parser) -1396 root = tree.getroot() -1397 self.assertEqual(root.text, test_url) -1398 -
1399 - def test_resolve_filename_dtd(self): -
1400 parse = self.etree.parse -1401 parser = self.etree.XMLParser(attribute_defaults=True) -1402 assertEqual = self.assertEqual -1403 test_url = _str("__nosuch.dtd") -1404 -1405 class MyResolver(self.etree.Resolver): -1406 def resolve(self, url, id, context): -1407 assertEqual(url, test_url) -1408 return self.resolve_filename( -1409 fileInTestDir('test.dtd'), context) -
1410 -1411 parser.resolvers.add(MyResolver()) -1412 -1413 xml = _str('<!DOCTYPE a SYSTEM "%s"><a><b/></a>') % test_url -1414 tree = parse(StringIO(xml), parser) -1415 root = tree.getroot() -1416 self.assertEqual( -1417 root.attrib, {'default': 'valueA'}) -1418 self.assertEqual( -1419 root[0].attrib, {'default': 'valueB'}) -1420 -
1422 parse = self.etree.parse -1423 parser = self.etree.XMLParser(attribute_defaults=True) -1424 assertEqual = self.assertEqual -1425 test_url = _str("__nosuch.dtd") -1426 -1427 class MyResolver(self.etree.Resolver): -1428 def resolve(self, url, id, context): -1429 expected = fileUrlInTestDir(test_url) -1430 url = url.replace('file://', 'file:') # depends on libxml2 version -1431 expected = expected.replace('file://', 'file:') -1432 assertEqual(url, expected) -1433 return self.resolve_filename( -1434 fileUrlInTestDir('test.dtd'), context) -
1435 -1436 parser.resolvers.add(MyResolver()) -1437 -1438 xml = _str('<!DOCTYPE a SYSTEM "%s"><a><b/></a>') % test_url -1439 tree = parse(StringIO(xml), parser, -1440 base_url=fileUrlInTestDir('__test.xml')) -1441 root = tree.getroot() -1442 self.assertEqual( -1443 root.attrib, {'default': 'valueA'}) -1444 self.assertEqual( -1445 root[0].attrib, {'default': 'valueB'}) -1446 -
1447 - def test_resolve_file_dtd(self): -
1448 parse = self.etree.parse -1449 parser = self.etree.XMLParser(attribute_defaults=True) -1450 assertEqual = self.assertEqual -1451 test_url = _str("__nosuch.dtd") -1452 -1453 class MyResolver(self.etree.Resolver): -1454 def resolve(self, url, id, context): -1455 assertEqual(url, test_url) -1456 return self.resolve_file( -1457 open(fileInTestDir('test.dtd'), 'rb'), context) -
1458 -1459 parser.resolvers.add(MyResolver()) -1460 -1461 xml = _str('<!DOCTYPE a SYSTEM "%s"><a><b/></a>') % test_url -1462 tree = parse(StringIO(xml), parser) -1463 root = tree.getroot() -1464 self.assertEqual( -1465 root.attrib, {'default': 'valueA'}) -1466 self.assertEqual( -1467 root[0].attrib, {'default': 'valueB'}) -1468 -
1469 - def test_resolve_empty(self): -
1470 parse = self.etree.parse -1471 parser = self.etree.XMLParser(load_dtd=True) -1472 assertEqual = self.assertEqual -1473 test_url = _str("__nosuch.dtd") -1474 -1475 class check(object): -1476 resolved = False -
1477 -1478 class MyResolver(self.etree.Resolver): -1479 def resolve(self, url, id, context): -1480 assertEqual(url, test_url) -1481 check.resolved = True -1482 return self.resolve_empty(context) -1483 -1484 parser.resolvers.add(MyResolver()) -1485 -1486 xml = _str('<!DOCTYPE doc SYSTEM "%s"><doc>&myentity;</doc>') % test_url -1487 self.assertRaises(etree.XMLSyntaxError, parse, StringIO(xml), parser) -1488 self.assertTrue(check.resolved) -1489 -
1490 - def test_resolve_error(self): -
1491 parse = self.etree.parse -1492 parser = self.etree.XMLParser(dtd_validation=True) -1493 -1494 class _LocalException(Exception): -1495 pass -
1496 -1497 class MyResolver(self.etree.Resolver): -1498 def resolve(self, url, id, context): -1499 raise _LocalException -1500 -1501 parser.resolvers.add(MyResolver()) -1502 -1503 xml = '<!DOCTYPE doc SYSTEM "test"><doc>&myentity;</doc>' -1504 self.assertRaises(_LocalException, parse, BytesIO(xml), parser) -1505 -1506 if etree.LIBXML_VERSION > (2,6,20): -
1507 - def test_entity_parse(self): -
1508 parse = self.etree.parse -1509 tostring = self.etree.tostring -1510 parser = self.etree.XMLParser(resolve_entities=False) -1511 Entity = self.etree.Entity -1512 -1513 xml = _bytes('<!DOCTYPE doc SYSTEM "test"><doc>&myentity;</doc>') -1514 tree = parse(BytesIO(xml), parser) -1515 root = tree.getroot() -1516 self.assertEqual(root[0].tag, Entity) -1517 self.assertEqual(root[0].text, "&myentity;") -1518 self.assertEqual(root[0].tail, None) -1519 self.assertEqual(root[0].name, "myentity") -1520 -1521 self.assertEqual(_bytes('<doc>&myentity;</doc>'), -1522 tostring(root)) -
1523 -
1524 - def test_entity_restructure(self): -
1525 xml = _bytes('''<!DOCTYPE root [ <!ENTITY nbsp "&#160;"> ]> -1526 <root> -1527 <child1/> -1528 <child2/> -1529 <child3>&nbsp;</child3> -1530 </root>''') -1531 -1532 parser = self.etree.XMLParser(resolve_entities=False) -1533 root = etree.fromstring(xml, parser) -1534 self.assertEqual([ el.tag for el in root ], -1535 ['child1', 'child2', 'child3']) -1536 -1537 root[0] = root[-1] -1538 self.assertEqual([ el.tag for el in root ], -1539 ['child3', 'child2']) -1540 self.assertEqual(root[0][0].text, '&nbsp;') -1541 self.assertEqual(root[0][0].name, 'nbsp') -
1542 -
1543 - def test_entity_append(self): -
1544 Entity = self.etree.Entity -1545 Element = self.etree.Element -1546 tostring = self.etree.tostring -1547 -1548 root = Element("root") -1549 root.append( Entity("test") ) -1550 -1551 self.assertEqual(root[0].tag, Entity) -1552 self.assertEqual(root[0].text, "&test;") -1553 self.assertEqual(root[0].tail, None) -1554 self.assertEqual(root[0].name, "test") -1555 -1556 self.assertEqual(_bytes('<root>&test;</root>'), -1557 tostring(root)) -
1558 -
1559 - def test_entity_values(self): -
1560 Entity = self.etree.Entity -1561 self.assertEqual(Entity("test").text, '&test;') -1562 self.assertEqual(Entity("#17683").text, '&#17683;') -1563 self.assertEqual(Entity("#x1768").text, '&#x1768;') -1564 self.assertEqual(Entity("#x98AF").text, '&#x98AF;') -
1565 -
1566 - def test_entity_error(self): -
1567 Entity = self.etree.Entity -1568 self.assertRaises(ValueError, Entity, 'a b c') -1569 self.assertRaises(ValueError, Entity, 'a,b') -1570 self.assertRaises(ValueError, Entity, 'a\0b') -1571 self.assertRaises(ValueError, Entity, '#abc') -1572 self.assertRaises(ValueError, Entity, '#xxyz') -
1573 -
1574 - def test_cdata(self): -
1575 CDATA = self.etree.CDATA -1576 Element = self.etree.Element -1577 tostring = self.etree.tostring -1578 -1579 root = Element("root") -1580 root.text = CDATA('test') -1581 -1582 self.assertEqual('test', -1583 root.text) -1584 self.assertEqual(_bytes('<root><![CDATA[test]]></root>'), -1585 tostring(root)) -
1586 -
1587 - def test_cdata_tail(self): -
1588 CDATA = self.etree.CDATA -1589 Element = self.etree.Element -1590 SubElement = self.etree.SubElement -1591 tostring = self.etree.tostring -1592 -1593 root = Element("root") -1594 child = SubElement(root, 'child') -1595 child.tail = CDATA('test') -1596 -1597 self.assertEqual('test', child.tail) -1598 self.assertEqual(_bytes('<root><child/><![CDATA[test]]></root>'), -1599 tostring(root)) -1600 -1601 root = Element("root") -1602 root.tail = CDATA('test') -1603 -1604 self.assertEqual('test', root.tail) -1605 self.assertEqual(_bytes('<root/><![CDATA[test]]>'), -1606 tostring(root)) -
1607 -
1608 - def test_cdata_type(self): -
1609 CDATA = self.etree.CDATA -1610 Element = self.etree.Element -1611 root = Element("root") -1612 -1613 root.text = CDATA("test") -1614 self.assertEqual('test', root.text) -1615 -1616 root.text = CDATA(_str("test")) -1617 self.assertEqual('test', root.text) -1618 -1619 self.assertRaises(TypeError, CDATA, 1) -
1620 -
1621 - def test_cdata_errors(self): -
1622 CDATA = self.etree.CDATA -1623 Element = self.etree.Element -1624 -1625 root = Element("root") -1626 cdata = CDATA('test') -1627 -1628 self.assertRaises(TypeError, -1629 root.set, 'attr', cdata) -1630 self.assertRaises(TypeError, -1631 operator.setitem, root.attrib, 'attr', cdata) -
1632 -
1633 - def test_cdata_parser(self): -
1634 tostring = self.etree.tostring -1635 parser = self.etree.XMLParser(strip_cdata=False) -1636 root = self.etree.XML(_bytes('<root><![CDATA[test]]></root>'), parser) -1637 -1638 self.assertEqual('test', root.text) -1639 self.assertEqual(_bytes('<root><![CDATA[test]]></root>'), -1640 tostring(root)) -
1641 -
1642 - def test_cdata_xpath(self): -
1643 tostring = self.etree.tostring -1644 parser = self.etree.XMLParser(strip_cdata=False) -1645 root = self.etree.XML(_bytes('<root><![CDATA[test]]></root>'), parser) -1646 self.assertEqual(_bytes('<root><![CDATA[test]]></root>'), -1647 tostring(root)) -1648 -1649 self.assertEqual(['test'], root.xpath('//text()')) -
1650 -1651 # TypeError in etree, AssertionError in ElementTree; -
1652 - def test_setitem_assert(self): -
1653 Element = self.etree.Element -1654 SubElement = self.etree.SubElement -1655 -1656 a = Element('a') -1657 b = SubElement(a, 'b') -1658 -1659 self.assertRaises(TypeError, -1660 a.__setitem__, 0, 'foo') -
1661 -
1662 - def test_append_error(self): -
1663 Element = self.etree.Element -1664 root = Element('root') -1665 # raises AssertionError in ElementTree -1666 self.assertRaises(TypeError, root.append, None) -1667 self.assertRaises(TypeError, root.extend, [None]) -1668 self.assertRaises(TypeError, root.extend, [Element('one'), None]) -1669 self.assertEqual('one', root[0].tag) -
1670 -
1671 - def test_append_recursive_error(self): -
1672 Element = self.etree.Element -1673 SubElement = self.etree.SubElement -1674 root = Element('root') -1675 self.assertRaises(ValueError, root.append, root) -1676 child = SubElement(root, 'child') -1677 self.assertRaises(ValueError, child.append, root) -1678 child2 = SubElement(child, 'child2') -1679 self.assertRaises(ValueError, child2.append, root) -1680 self.assertRaises(ValueError, child2.append, child) -1681 self.assertEqual('child2', root[0][0].tag) -
1682 -
1683 - def test_addnext(self): -
1684 Element = self.etree.Element -1685 SubElement = self.etree.SubElement -1686 root = Element('root') -1687 SubElement(root, 'a') -1688 SubElement(root, 'b') -1689 -1690 self.assertEqual(['a', 'b'], -1691 [c.tag for c in root]) -1692 root[1].addnext(root[0]) -1693 self.assertEqual(['b', 'a'], -1694 [c.tag for c in root]) -
1695 -
1696 - def test_addprevious(self): -
1697 Element = self.etree.Element -1698 SubElement = self.etree.SubElement -1699 root = Element('root') -1700 SubElement(root, 'a') -1701 SubElement(root, 'b') -1702 -1703 self.assertEqual(['a', 'b'], -1704 [c.tag for c in root]) -1705 root[0].addprevious(root[1]) -1706 self.assertEqual(['b', 'a'], -1707 [c.tag for c in root]) -
1708 -
1709 - def test_addnext_cycle(self): -
1710 Element = self.etree.Element -1711 SubElement = self.etree.SubElement -1712 root = Element('root') -1713 a = SubElement(root, 'a') -1714 b = SubElement(a, 'b') -1715 # appending parent as sibling is forbidden -1716 self.assertRaises(ValueError, b.addnext, a) -1717 self.assertEqual(['a'], [c.tag for c in root]) -1718 self.assertEqual(['b'], [c.tag for c in a]) -
1719 -
1720 - def test_addprevious_cycle(self): -
1721 Element = self.etree.Element -1722 SubElement = self.etree.SubElement -1723 root = Element('root') -1724 a = SubElement(root, 'a') -1725 b = SubElement(a, 'b') -1726 # appending parent as sibling is forbidden -1727 self.assertRaises(ValueError, b.addprevious, a) -1728 self.assertEqual(['a'], [c.tag for c in root]) -1729 self.assertEqual(['b'], [c.tag for c in a]) -
1730 -
1731 - def test_addnext_cycle_long(self): -
1732 Element = self.etree.Element -1733 SubElement = self.etree.SubElement -1734 root = Element('root') -1735 a = SubElement(root, 'a') -1736 b = SubElement(a, 'b') -1737 c = SubElement(b, 'c') -1738 # appending parent as sibling is forbidden -1739 self.assertRaises(ValueError, c.addnext, a) -
1740 -
1741 - def test_addprevious_cycle_long(self): -
1742 Element = self.etree.Element -1743 SubElement = self.etree.SubElement -1744 root = Element('root') -1745 a = SubElement(root, 'a') -1746 b = SubElement(a, 'b') -1747 c = SubElement(b, 'c') -1748 # appending parent as sibling is forbidden -1749 self.assertRaises(ValueError, c.addprevious, a) -
1750 -
1751 - def test_addprevious_noops(self): -
1752 Element = self.etree.Element -1753 SubElement = self.etree.SubElement -1754 root = Element('root') -1755 a = SubElement(root, 'a') -1756 b = SubElement(root, 'b') -1757 a.addprevious(a) -1758 self.assertEqual('a', root[0].tag) -1759 self.assertEqual('b', root[1].tag) -1760 b.addprevious(b) -1761 self.assertEqual('a', root[0].tag) -1762 self.assertEqual('b', root[1].tag) -1763 b.addprevious(a) -1764 self.assertEqual('a', root[0].tag) -1765 self.assertEqual('b', root[1].tag) -
1766 -
1767 - def test_addnext_noops(self): -
1768 Element = self.etree.Element -1769 SubElement = self.etree.SubElement -1770 root = Element('root') -1771 a = SubElement(root, 'a') -1772 b = SubElement(root, 'b') -1773 a.addnext(a) -1774 self.assertEqual('a', root[0].tag) -1775 self.assertEqual('b', root[1].tag) -1776 b.addnext(b) -1777 self.assertEqual('a', root[0].tag) -1778 self.assertEqual('b', root[1].tag) -1779 a.addnext(b) -1780 self.assertEqual('a', root[0].tag) -1781 self.assertEqual('b', root[1].tag) -
1782 -
1783 - def test_addnext_root(self): -
1784 Element = self.etree.Element -1785 a = Element('a') -1786 b = Element('b') -1787 self.assertRaises(TypeError, a.addnext, b) -
1788 -
1789 - def test_addprevious_pi(self): -
1790 Element = self.etree.Element -1791 SubElement = self.etree.SubElement -1792 PI = self.etree.PI -1793 root = Element('root') -1794 SubElement(root, 'a') -1795 pi = PI('TARGET', 'TEXT') -1796 pi.tail = "TAIL" -1797 -1798 self.assertEqual(_bytes('<root><a></a></root>'), -1799 self._writeElement(root)) -1800 root[0].addprevious(pi) -1801 self.assertEqual(_bytes('<root><?TARGET TEXT?>TAIL<a></a></root>'), -1802 self._writeElement(root)) -
1803 -
1804 - def test_addprevious_root_pi(self): -
1805 Element = self.etree.Element -1806 PI = self.etree.PI -1807 root = Element('root') -1808 pi = PI('TARGET', 'TEXT') -1809 pi.tail = "TAIL" -1810 -1811 self.assertEqual(_bytes('<root></root>'), -1812 self._writeElement(root)) -1813 root.addprevious(pi) -1814 self.assertEqual(_bytes('<?TARGET TEXT?>\n<root></root>'), -1815 self._writeElement(root)) -
1816 -
1817 - def test_addnext_pi(self): -
1818 Element = self.etree.Element -1819 SubElement = self.etree.SubElement -1820 PI = self.etree.PI -1821 root = Element('root') -1822 SubElement(root, 'a') -1823 pi = PI('TARGET', 'TEXT') -1824 pi.tail = "TAIL" -1825 -1826 self.assertEqual(_bytes('<root><a></a></root>'), -1827 self._writeElement(root)) -1828 root[0].addnext(pi) -1829 self.assertEqual(_bytes('<root><a></a><?TARGET TEXT?>TAIL</root>'), -1830 self._writeElement(root)) -
1831 -
1832 - def test_addnext_root_pi(self): -
1833 Element = self.etree.Element -1834 PI = self.etree.PI -1835 root = Element('root') -1836 pi = PI('TARGET', 'TEXT') -1837 pi.tail = "TAIL" -1838 -1839 self.assertEqual(_bytes('<root></root>'), -1840 self._writeElement(root)) -1841 root.addnext(pi) -1842 self.assertEqual(_bytes('<root></root>\n<?TARGET TEXT?>'), -1843 self._writeElement(root)) -
1844 -
1845 - def test_addnext_comment(self): -
1846 Element = self.etree.Element -1847 SubElement = self.etree.SubElement -1848 Comment = self.etree.Comment -1849 root = Element('root') -1850 SubElement(root, 'a') -1851 comment = Comment('TEXT ') -1852 comment.tail = "TAIL" -1853 -1854 self.assertEqual(_bytes('<root><a></a></root>'), -1855 self._writeElement(root)) -1856 root[0].addnext(comment) -1857 self.assertEqual(_bytes('<root><a></a><!--TEXT -->TAIL</root>'), -1858 self._writeElement(root)) -
1859 -
1860 - def test_addnext_root_comment(self): -
1861 Element = self.etree.Element -1862 Comment = self.etree.Comment -1863 root = Element('root') -1864 comment = Comment('TEXT ') -1865 comment.tail = "TAIL" -1866 -1867 self.assertEqual(_bytes('<root></root>'), -1868 self._writeElement(root)) -1869 root.addnext(comment) -1870 self.assertEqual(_bytes('<root></root>\n<!--TEXT -->'), -1871 self._writeElement(root)) -
1872 -
1873 - def test_addprevious_comment(self): -
1874 Element = self.etree.Element -1875 SubElement = self.etree.SubElement -1876 Comment = self.etree.Comment -1877 root = Element('root') -1878 SubElement(root, 'a') -1879 comment = Comment('TEXT ') -1880 comment.tail = "TAIL" -1881 -1882 self.assertEqual(_bytes('<root><a></a></root>'), -1883 self._writeElement(root)) -1884 root[0].addprevious(comment) -1885 self.assertEqual(_bytes('<root><!--TEXT -->TAIL<a></a></root>'), -1886 self._writeElement(root)) -
1887 -
1889 Element = self.etree.Element -1890 Comment = self.etree.Comment -1891 root = Element('root') -1892 comment = Comment('TEXT ') -1893 comment.tail = "TAIL" -1894 -1895 self.assertEqual(_bytes('<root></root>'), -1896 self._writeElement(root)) -1897 root.addprevious(comment) -1898 self.assertEqual(_bytes('<!--TEXT -->\n<root></root>'), -1899 self._writeElement(root)) -
1900 -1901 # ET's Elements have items() and key(), but not values() -
1902 - def test_attribute_values(self): -
1903 XML = self.etree.XML -1904 -1905 root = XML(_bytes('<doc alpha="Alpha" beta="Beta" gamma="Gamma"/>')) -1906 values = root.values() -1907 values.sort() -1908 self.assertEqual(['Alpha', 'Beta', 'Gamma'], values) -
1909 -1910 # gives error in ElementTree -
1911 - def test_comment_empty(self): -
1912 Element = self.etree.Element -1913 Comment = self.etree.Comment -1914 -1915 a = Element('a') -1916 a.append(Comment()) -1917 self.assertEqual( -1918 _bytes('<a><!----></a>'), -1919 self._writeElement(a)) -
1920 -1921 # ElementTree ignores comments -
1922 - def test_comment_parse_empty(self): -
1923 ElementTree = self.etree.ElementTree -1924 tostring = self.etree.tostring -1925 -1926 xml = _bytes('<a><b/><!----><c/></a>') -1927 f = BytesIO(xml) -1928 doc = ElementTree(file=f) -1929 a = doc.getroot() -1930 self.assertEqual( -1931 '', -1932 a[1].text) -1933 self.assertEqual( -1934 xml, -1935 tostring(a)) -
1936 -1937 # ElementTree ignores comments -
1938 - def test_comment_no_proxy_yet(self): -
1939 ElementTree = self.etree.ElementTree -1940 -1941 f = BytesIO('<a><b></b><!-- hoi --><c></c></a>') -1942 doc = ElementTree(file=f) -1943 a = doc.getroot() -1944 self.assertEqual( -1945 ' hoi ', -1946 a[1].text) -
1947 -1948 # does not raise an exception in ElementTree -
1949 - def test_comment_immutable(self): -
1950 Element = self.etree.Element -1951 Comment = self.etree.Comment -1952 -1953 c = Comment() -1954 el = Element('myel') -1955 -1956 self.assertRaises(TypeError, c.append, el) -1957 self.assertRaises(TypeError, c.insert, 0, el) -1958 self.assertRaises(TypeError, c.set, "myattr", "test") -
1959 -
1961 c = self.etree.Comment() -1962 self.assertEqual(0, len(c.attrib)) -1963 -1964 self.assertFalse(c.attrib.__contains__('nope')) -1965 self.assertFalse('nope' in c.attrib) -1966 self.assertFalse('nope' in c.attrib.keys()) -1967 self.assertFalse('nope' in c.attrib.values()) -1968 self.assertFalse(('nope', 'huhu') in c.attrib.items()) -1969 -1970 self.assertEqual([], list(c.attrib)) -1971 self.assertEqual([], list(c.attrib.keys())) -1972 self.assertEqual([], list(c.attrib.items())) -1973 self.assertEqual([], list(c.attrib.values())) -1974 self.assertEqual([], list(c.attrib.iterkeys())) -1975 self.assertEqual([], list(c.attrib.iteritems())) -1976 self.assertEqual([], list(c.attrib.itervalues())) -1977 -1978 self.assertEqual('HUHU', c.attrib.pop('nope', 'HUHU')) -1979 self.assertRaises(KeyError, c.attrib.pop, 'nope') -1980 -1981 self.assertRaises(KeyError, c.attrib.__getitem__, 'only') -1982 self.assertRaises(KeyError, c.attrib.__getitem__, 'names') -1983 self.assertRaises(KeyError, c.attrib.__getitem__, 'nope') -1984 self.assertRaises(KeyError, c.attrib.__setitem__, 'nope', 'yep') -1985 self.assertRaises(KeyError, c.attrib.__delitem__, 'nope') -
1986 -1987 # test passing 'None' to dump() -
1988 - def test_dump_none(self): -
1989 self.assertRaises(TypeError, self.etree.dump, None) -
1990 -
1991 - def test_prefix(self): -
1992 ElementTree = self.etree.ElementTree -1993 -1994 f = BytesIO('<a xmlns:foo="http://www.infrae.com/ns/1"><foo:b/></a>') -1995 doc = ElementTree(file=f) -1996 a = doc.getroot() -1997 self.assertEqual( -1998 None, -1999 a.prefix) -2000 self.assertEqual( -2001 'foo', -2002 a[0].prefix) -
2003 -
2004 - def test_prefix_default_ns(self): -
2005 ElementTree = self.etree.ElementTree -2006 -2007 f = BytesIO('<a xmlns="http://www.infrae.com/ns/1"><b/></a>') -2008 doc = ElementTree(file=f) -2009 a = doc.getroot() -2010 self.assertEqual( -2011 None, -2012 a.prefix) -2013 self.assertEqual( -2014 None, -2015 a[0].prefix) -
2016 -
2017 - def test_getparent(self): -
2018 Element = self.etree.Element -2019 SubElement = self.etree.SubElement -2020 -2021 a = Element('a') -2022 b = SubElement(a, 'b') -2023 c = SubElement(a, 'c') -2024 d = SubElement(b, 'd') -2025 self.assertEqual( -2026 None, -2027 a.getparent()) -2028 self.assertEqual( -2029 a, -2030 b.getparent()) -2031 self.assertEqual( -2032 b.getparent(), -2033 c.getparent()) -2034 self.assertEqual( -2035 b, -2036 d.getparent()) -
2037 -
2038 - def test_iterchildren(self): -
2039 XML = self.etree.XML -2040 -2041 root = XML(_bytes('<doc><one/><two>Two</two>Hm<three/></doc>')) -2042 result = [] -2043 for el in root.iterchildren(): -2044 result.append(el.tag) -2045 self.assertEqual(['one', 'two', 'three'], result) -
2046 -
2047 - def test_iterchildren_reversed(self): -
2048 XML = self.etree.XML -2049 -2050 root = XML(_bytes('<doc><one/><two>Two</two>Hm<three/></doc>')) -2051 result = [] -2052 for el in root.iterchildren(reversed=True): -2053 result.append(el.tag) -2054 self.assertEqual(['three', 'two', 'one'], result) -
2055 -
2056 - def test_iterchildren_tag(self): -
2057 XML = self.etree.XML -2058 -2059 root = XML(_bytes('<doc><one/><two>Two</two>Hm<two>Bla</two></doc>')) -2060 result = [] -2061 for el in root.iterchildren(tag='two'): -2062 result.append(el.text) -2063 self.assertEqual(['Two', 'Bla'], result) -
2064 -
2066 XML = self.etree.XML -2067 -2068 root = XML(_bytes('<doc><one/><two>Two</two>Hm<two>Bla</two></doc>')) -2069 result = [] -2070 for el in root.iterchildren('two'): -2071 result.append(el.text) -2072 self.assertEqual(['Two', 'Bla'], result) -
2073 -
2075 XML = self.etree.XML -2076 -2077 root = XML(_bytes('<doc><one/><two>Two</two>Hm<two>Bla</two></doc>')) -2078 result = [] -2079 for el in root.iterchildren(reversed=True, tag='two'): -2080 result.append(el.text) -2081 self.assertEqual(['Bla', 'Two'], result) -
2082 -
2084 XML = self.etree.XML -2085 -2086 root = XML(_bytes('<doc><one/><two>Two</two>Hm<two>Bla</two><three/></doc>')) -2087 result = [] -2088 for el in root.iterchildren(tag=['two', 'three']): -2089 result.append(el.text) -2090 self.assertEqual(['Two', 'Bla', None], result) -
2091 -
2093 XML = self.etree.XML -2094 -2095 root = XML(_bytes('<doc><one/><two>Two</two>Hm<two>Bla</two><three/></doc>')) -2096 result = [] -2097 for el in root.iterchildren('two', 'three'): -2098 result.append(el.text) -2099 self.assertEqual(['Two', 'Bla', None], result) -
2100 -
2102 XML = self.etree.XML -2103 -2104 root = XML(_bytes('<doc><one/><two>Two</two>Hm<two>Bla</two><three/></doc>')) -2105 result = [] -2106 for el in root.iterchildren(reversed=True, tag=['two', 'three']): -2107 result.append(el.text) -2108 self.assertEqual([None, 'Bla', 'Two'], result) -
2109 -
2110 - def test_iterancestors(self): -
2111 Element = self.etree.Element -2112 SubElement = self.etree.SubElement -2113 -2114 a = Element('a') -2115 b = SubElement(a, 'b') -2116 c = SubElement(a, 'c') -2117 d = SubElement(b, 'd') -2118 self.assertEqual( -2119 [], -2120 list(a.iterancestors())) -2121 self.assertEqual( -2122 [a], -2123 list(b.iterancestors())) -2124 self.assertEqual( -2125 [a], -2126 list(c.iterancestors())) -2127 self.assertEqual( -2128 [b, a], -2129 list(d.iterancestors())) -
2130 -
2131 - def test_iterancestors_tag(self): -
2132 Element = self.etree.Element -2133 SubElement = self.etree.SubElement -2134 -2135 a = Element('a') -2136 b = SubElement(a, 'b') -2137 c = SubElement(a, 'c') -2138 d = SubElement(b, 'd') -2139 self.assertEqual( -2140 [a], -2141 list(d.iterancestors('a'))) -2142 self.assertEqual( -2143 [a], -2144 list(d.iterancestors(tag='a'))) -2145 -2146 self.assertEqual( -2147 [b, a], -2148 list(d.iterancestors('*'))) -2149 self.assertEqual( -2150 [b, a], -2151 list(d.iterancestors(tag='*'))) -
2152 -
2154 Element = self.etree.Element -2155 SubElement = self.etree.SubElement -2156 -2157 a = Element('a') -2158 b = SubElement(a, 'b') -2159 c = SubElement(a, 'c') -2160 d = SubElement(b, 'd') -2161 self.assertEqual( -2162 [b, a], -2163 list(d.iterancestors(tag=('a', 'b')))) -2164 self.assertEqual( -2165 [b, a], -2166 list(d.iterancestors('a', 'b'))) -2167 -2168 self.assertEqual( -2169 [], -2170 list(d.iterancestors(tag=('w', 'x', 'y', 'z')))) -2171 self.assertEqual( -2172 [], -2173 list(d.iterancestors('w', 'x', 'y', 'z'))) -2174 -2175 self.assertEqual( -2176 [], -2177 list(d.iterancestors(tag=('d', 'x')))) -2178 self.assertEqual( -2179 [], -2180 list(d.iterancestors('d', 'x'))) -2181 -2182 self.assertEqual( -2183 [b, a], -2184 list(d.iterancestors(tag=('b', '*')))) -2185 self.assertEqual( -2186 [b, a], -2187 list(d.iterancestors('b', '*'))) -2188 -2189 self.assertEqual( -2190 [b], -2191 list(d.iterancestors(tag=('b', 'c')))) -2192 self.assertEqual( -2193 [b], -2194 list(d.iterancestors('b', 'c'))) -
2195 -
2196 - def test_iterdescendants(self): -
2197 Element = self.etree.Element -2198 SubElement = self.etree.SubElement -2199 -2200 a = Element('a') -2201 b = SubElement(a, 'b') -2202 c = SubElement(a, 'c') -2203 d = SubElement(b, 'd') -2204 e = SubElement(c, 'e') -2205 -2206 self.assertEqual( -2207 [b, d, c, e], -2208 list(a.iterdescendants())) -2209 self.assertEqual( -2210 [], -2211 list(d.iterdescendants())) -
2212 -
2213 - def test_iterdescendants_tag(self): -
2214 Element = self.etree.Element -2215 SubElement = self.etree.SubElement -2216 -2217 a = Element('a') -2218 b = SubElement(a, 'b') -2219 c = SubElement(a, 'c') -2220 d = SubElement(b, 'd') -2221 e = SubElement(c, 'e') -2222 -2223 self.assertEqual( -2224 [], -2225 list(a.iterdescendants('a'))) -2226 self.assertEqual( -2227 [], -2228 list(a.iterdescendants(tag='a'))) -2229 -2230 a2 = SubElement(e, 'a') -2231 self.assertEqual( -2232 [a2], -2233 list(a.iterdescendants('a'))) -2234 -2235 self.assertEqual( -2236 [a2], -2237 list(c.iterdescendants('a'))) -2238 self.assertEqual( -2239 [a2], -2240 list(c.iterdescendants(tag='a'))) -
2241 -
2243 Element = self.etree.Element -2244 SubElement = self.etree.SubElement -2245 -2246 a = Element('a') -2247 b = SubElement(a, 'b') -2248 c = SubElement(a, 'c') -2249 d = SubElement(b, 'd') -2250 e = SubElement(c, 'e') -2251 -2252 self.assertEqual( -2253 [b, e], -2254 list(a.iterdescendants(tag=('a', 'b', 'e')))) -2255 self.assertEqual( -2256 [b, e], -2257 list(a.iterdescendants('a', 'b', 'e'))) -2258 -2259 a2 = SubElement(e, 'a') -2260 self.assertEqual( -2261 [b, a2], -2262 list(a.iterdescendants(tag=('a', 'b')))) -2263 self.assertEqual( -2264 [b, a2], -2265 list(a.iterdescendants('a', 'b'))) -2266 -2267 self.assertEqual( -2268 [], -2269 list(c.iterdescendants(tag=('x', 'y', 'z')))) -2270 self.assertEqual( -2271 [], -2272 list(c.iterdescendants('x', 'y', 'z'))) -2273 -2274 self.assertEqual( -2275 [b, d, c, e, a2], -2276 list(a.iterdescendants(tag=('x', 'y', 'z', '*')))) -2277 self.assertEqual( -2278 [b, d, c, e, a2], -2279 list(a.iterdescendants('x', 'y', 'z', '*'))) -
2280 -
2281 - def test_getroottree(self): -
2282 Element = self.etree.Element -2283 SubElement = self.etree.SubElement -2284 -2285 a = Element('a') -2286 b = SubElement(a, 'b') -2287 c = SubElement(a, 'c') -2288 d = SubElement(b, 'd') -2289 self.assertEqual( -2290 a, -2291 a.getroottree().getroot()) -2292 self.assertEqual( -2293 a, -2294 b.getroottree().getroot()) -2295 self.assertEqual( -2296 a, -2297 d.getroottree().getroot()) -
2298 -
2299 - def test_getnext(self): -
2300 Element = self.etree.Element -2301 SubElement = self.etree.SubElement -2302 -2303 a = Element('a') -2304 b = SubElement(a, 'b') -2305 c = SubElement(a, 'c') -2306 self.assertEqual( -2307 None, -2308 a.getnext()) -2309 self.assertEqual( -2310 c, -2311 b.getnext()) -2312 self.assertEqual( -2313 None, -2314 c.getnext()) -
2315 -
2316 - def test_getprevious(self): -
2317 Element = self.etree.Element -2318 SubElement = self.etree.SubElement -2319 -2320 a = Element('a') -2321 b = SubElement(a, 'b') -2322 c = SubElement(a, 'c') -2323 d = SubElement(b, 'd') -2324 self.assertEqual( -2325 None, -2326 a.getprevious()) -2327 self.assertEqual( -2328 b, -2329 c.getprevious()) -2330 self.assertEqual( -2331 None, -2332 b.getprevious()) -
2333 -
2334 - def test_itersiblings(self): -
2335 Element = self.etree.Element -2336 SubElement = self.etree.SubElement -2337 -2338 a = Element('a') -2339 b = SubElement(a, 'b') -2340 c = SubElement(a, 'c') -2341 d = SubElement(b, 'd') -2342 self.assertEqual( -2343 [], -2344 list(a.itersiblings())) -2345 self.assertEqual( -2346 [c], -2347 list(b.itersiblings())) -2348 self.assertEqual( -2349 [], -2350 list(c.itersiblings())) -2351 self.assertEqual( -2352 [b], -2353 list(c.itersiblings(preceding=True))) -2354 self.assertEqual( -2355 [], -2356 list(b.itersiblings(preceding=True))) -
2357 -
2358 - def test_itersiblings_tag(self): -
2359 Element = self.etree.Element -2360 SubElement = self.etree.SubElement -2361 -2362 a = Element('a') -2363 b = SubElement(a, 'b') -2364 c = SubElement(a, 'c') -2365 d = SubElement(b, 'd') -2366 self.assertEqual( -2367 [], -2368 list(a.itersiblings(tag='XXX'))) -2369 self.assertEqual( -2370 [c], -2371 list(b.itersiblings(tag='c'))) -2372 self.assertEqual( -2373 [c], -2374 list(b.itersiblings(tag='*'))) -2375 self.assertEqual( -2376 [b], -2377 list(c.itersiblings(preceding=True, tag='b'))) -2378 self.assertEqual( -2379 [], -2380 list(c.itersiblings(preceding=True, tag='c'))) -
2381 -
2383 Element = self.etree.Element -2384 SubElement = self.etree.SubElement -2385 -2386 a = Element('a') -2387 b = SubElement(a, 'b') -2388 c = SubElement(a, 'c') -2389 d = SubElement(b, 'd') -2390 e = SubElement(a, 'e') -2391 self.assertEqual( -2392 [], -2393 list(a.itersiblings(tag=('XXX', 'YYY')))) -2394 self.assertEqual( -2395 [c, e], -2396 list(b.itersiblings(tag=('c', 'd', 'e')))) -2397 self.assertEqual( -2398 [b], -2399 list(c.itersiblings(preceding=True, tag=('b', 'b', 'c', 'd')))) -2400 self.assertEqual( -2401 [c, b], -2402 list(e.itersiblings(preceding=True, tag=('c', '*')))) -
2403 -
2404 - def test_parseid(self): -
2405 parseid = self.etree.parseid -2406 XML = self.etree.XML -2407 xml_text = _bytes(''' -2408 <!DOCTYPE document [ -2409 <!ELEMENT document (h1,p)*> -2410 <!ELEMENT h1 (#PCDATA)> -2411 <!ATTLIST h1 myid ID #REQUIRED> -2412 <!ELEMENT p (#PCDATA)> -2413 <!ATTLIST p someid ID #REQUIRED> -2414 ]> -2415 <document> -2416 <h1 myid="chapter1">...</h1> -2417 <p id="note1" class="note">...</p> -2418 <p>Regular paragraph.</p> -2419 <p xml:id="xmlid">XML:ID paragraph.</p> -2420 <p someid="warn1" class="warning">...</p> -2421 </document> -2422 ''') -2423 -2424 tree, dic = parseid(BytesIO(xml_text)) -2425 root = tree.getroot() -2426 root2 = XML(xml_text) -2427 self.assertEqual(self._writeElement(root), -2428 self._writeElement(root2)) -2429 expected = { -2430 "chapter1" : root[0], -2431 "xmlid" : root[3], -2432 "warn1" : root[4] -2433 } -2434 self.assertTrue("chapter1" in dic) -2435 self.assertTrue("warn1" in dic) -2436 self.assertTrue("xmlid" in dic) -2437 self._checkIDDict(dic, expected) -
2438 -
2439 - def test_XMLDTDID(self): -
2440 XMLDTDID = self.etree.XMLDTDID -2441 XML = self.etree.XML -2442 xml_text = _bytes(''' -2443 <!DOCTYPE document [ -2444 <!ELEMENT document (h1,p)*> -2445 <!ELEMENT h1 (#PCDATA)> -2446 <!ATTLIST h1 myid ID #REQUIRED> -2447 <!ELEMENT p (#PCDATA)> -2448 <!ATTLIST p someid ID #REQUIRED> -2449 ]> -2450 <document> -2451 <h1 myid="chapter1">...</h1> -2452 <p id="note1" class="note">...</p> -2453 <p>Regular paragraph.</p> -2454 <p xml:id="xmlid">XML:ID paragraph.</p> -2455 <p someid="warn1" class="warning">...</p> -2456 </document> -2457 ''') -2458 -2459 root, dic = XMLDTDID(xml_text) -2460 root2 = XML(xml_text) -2461 self.assertEqual(self._writeElement(root), -2462 self._writeElement(root2)) -2463 expected = { -2464 "chapter1" : root[0], -2465 "xmlid" : root[3], -2466 "warn1" : root[4] -2467 } -2468 self.assertTrue("chapter1" in dic) -2469 self.assertTrue("warn1" in dic) -2470 self.assertTrue("xmlid" in dic) -2471 self._checkIDDict(dic, expected) -
2472 -
2473 - def test_XMLDTDID_empty(self): -
2474 XMLDTDID = self.etree.XMLDTDID -2475 XML = self.etree.XML -2476 xml_text = _bytes(''' -2477 <document> -2478 <h1 myid="chapter1">...</h1> -2479 <p id="note1" class="note">...</p> -2480 <p>Regular paragraph.</p> -2481 <p someid="warn1" class="warning">...</p> -2482 </document> -2483 ''') -2484 -2485 root, dic = XMLDTDID(xml_text) -2486 root2 = XML(xml_text) -2487 self.assertEqual(self._writeElement(root), -2488 self._writeElement(root2)) -2489 expected = {} -2490 self._checkIDDict(dic, expected) -
2491 -
2492 - def test_XMLDTDID_no_id_dict(self): -
2493 XMLDTDID = self.etree.XMLDTDID -2494 XML = self.etree.XML -2495 xml_text = _bytes(''' -2496 <!DOCTYPE document [ -2497 <!ELEMENT document (h1,p)*> -2498 <!ELEMENT h1 (#PCDATA)> -2499 <!ATTLIST h1 myid ID #REQUIRED> -2500 <!ELEMENT p (#PCDATA)> -2501 <!ATTLIST p someid ID #REQUIRED> -2502 ]> -2503 <document> -2504 <h1 myid="chapter1">...</h1> -2505 <p id="note1" class="note">...</p> -2506 <p>Regular paragraph.</p> -2507 <p xml:id="xmlid">XML:ID paragraph.</p> -2508 <p someid="warn1" class="warning">...</p> -2509 </document> -2510 ''') -2511 -2512 parser = etree.XMLParser(collect_ids=False) -2513 root, dic = XMLDTDID(xml_text, parser=parser) -2514 root2 = XML(xml_text) -2515 self.assertEqual(self._writeElement(root), -2516 self._writeElement(root2)) -2517 self.assertFalse(dic) -2518 self._checkIDDict(dic, {}) -
2519 -
2520 - def _checkIDDict(self, dic, expected): -
2521 self.assertEqual(len(dic), -2522 len(expected)) -2523 self.assertEqual(sorted(dic.items()), -2524 sorted(expected.items())) -2525 if sys.version_info < (3,): -2526 self.assertEqual(sorted(dic.iteritems()), -2527 sorted(expected.iteritems())) -2528 self.assertEqual(sorted(dic.keys()), -2529 sorted(expected.keys())) -2530 if sys.version_info < (3,): -2531 self.assertEqual(sorted(dic.iterkeys()), -2532 sorted(expected.iterkeys())) -2533 if sys.version_info < (3,): -2534 self.assertEqual(sorted(dic.values()), -2535 sorted(expected.values())) -2536 self.assertEqual(sorted(dic.itervalues()), -2537 sorted(expected.itervalues())) -
2538 -
2539 - def test_namespaces(self): -
2540 etree = self.etree -2541 -2542 r = {'foo': 'http://ns.infrae.com/foo'} -2543 e = etree.Element('{http://ns.infrae.com/foo}bar', nsmap=r) -2544 self.assertEqual( -2545 'foo', -2546 e.prefix) -2547 self.assertEqual( -2548 _bytes('<foo:bar xmlns:foo="http://ns.infrae.com/foo"></foo:bar>'), -2549 self._writeElement(e)) -
2550 -
2551 - def test_namespaces_default(self): -
2552 etree = self.etree -2553 -2554 r = {None: 'http://ns.infrae.com/foo'} -2555 e = etree.Element('{http://ns.infrae.com/foo}bar', nsmap=r) -2556 self.assertEqual( -2557 None, -2558 e.prefix) -2559 self.assertEqual( -2560 '{http://ns.infrae.com/foo}bar', -2561 e.tag) -2562 self.assertEqual( -2563 _bytes('<bar xmlns="http://ns.infrae.com/foo"></bar>'), -2564 self._writeElement(e)) -
2565 -
2567 etree = self.etree -2568 -2569 r = {None: 'http://ns.infrae.com/foo', 'p': 'http://test/'} -2570 e = etree.Element('{http://ns.infrae.com/foo}bar', nsmap=r) -2571 self.assertEqual(None, e.prefix) -2572 self.assertEqual('{http://ns.infrae.com/foo}bar', e.tag) -2573 self.assertEqual( -2574 _bytes('<bar xmlns="http://ns.infrae.com/foo" xmlns:p="http://test/"></bar>'), -2575 self._writeElement(e)) -
2576 -
2578 etree = self.etree -2579 -2580 r = {None: 'http://ns.infrae.com/foo', -2581 'hoi': 'http://ns.infrae.com/hoi'} -2582 e = etree.Element('{http://ns.infrae.com/foo}bar', nsmap=r) -2583 e.set('{http://ns.infrae.com/hoi}test', 'value') -2584 self.assertEqual( -2585 _bytes('<bar xmlns="http://ns.infrae.com/foo" xmlns:hoi="http://ns.infrae.com/hoi" hoi:test="value"></bar>'), -2586 self._writeElement(e)) -
2587 -
2589 etree = self.etree -2590 -2591 root = etree.Element('{http://test/ns}root', -2592 nsmap={None: 'http://test/ns'}) -2593 sub = etree.Element('{http://test/ns}sub', -2594 nsmap={'test': 'http://test/ns'}) -2595 -2596 sub.attrib['{http://test/ns}attr'] = 'value' -2597 self.assertEqual(sub.attrib['{http://test/ns}attr'], 'value') -2598 self.assertEqual( -2599 _bytes('<test:sub xmlns:test="http://test/ns" test:attr="value"/>'), -2600 etree.tostring(sub)) -2601 -2602 root.append(sub) -2603 self.assertEqual( -2604 _bytes('<root xmlns="http://test/ns">' -2605 '<sub xmlns:test="http://test/ns" test:attr="value"/>' -2606 '</root>'), -2607 etree.tostring(root)) -
2608 -
2610 etree = self.etree -2611 -2612 root = etree.Element('root') -2613 sub = etree.Element('{http://test/ns}sub', -2614 nsmap={'test': 'http://test/ns'}) -2615 -2616 sub.attrib['{http://test/ns}attr'] = 'value' -2617 self.assertEqual(sub.attrib['{http://test/ns}attr'], 'value') -2618 self.assertEqual( -2619 _bytes('<test:sub xmlns:test="http://test/ns" test:attr="value"/>'), -2620 etree.tostring(sub)) -2621 -2622 root.append(sub) -2623 self.assertEqual( -2624 _bytes('<root>' -2625 '<test:sub xmlns:test="http://test/ns" test:attr="value"/>' -2626 '</root>'), -2627 etree.tostring(root)) -
2628 -
2630 etree = self.etree -2631 -2632 root = etree.Element('root') -2633 sub = etree.Element('{http://test/ns}sub', -2634 nsmap={None: 'http://test/ns'}) -2635 -2636 sub.attrib['{http://test/ns}attr'] = 'value' -2637 self.assertEqual(sub.attrib['{http://test/ns}attr'], 'value') -2638 self.assertEqual( -2639 _bytes('<sub xmlns="http://test/ns" ' -2640 'xmlns:ns0="http://test/ns" ns0:attr="value"/>'), -2641 etree.tostring(sub)) -2642 -2643 root.append(sub) -2644 self.assertEqual( -2645 _bytes('<root>' -2646 '<sub xmlns="http://test/ns"' -2647 ' xmlns:ns0="http://test/ns" ns0:attr="value"/>' -2648 '</root>'), -2649 etree.tostring(root)) -
2650 -
2652 etree = self.etree -2653 -2654 root = etree.Element('{http://test/ns}root', -2655 nsmap={'test': 'http://test/ns', -2656 None: 'http://test/ns'}) -2657 sub = etree.Element('{http://test/ns}sub', -2658 nsmap={None: 'http://test/ns'}) -2659 -2660 sub.attrib['{http://test/ns}attr'] = 'value' -2661 self.assertEqual(sub.attrib['{http://test/ns}attr'], 'value') -2662 self.assertEqual( -2663 _bytes('<sub xmlns="http://test/ns" ' -2664 'xmlns:ns0="http://test/ns" ns0:attr="value"/>'), -2665 etree.tostring(sub)) -2666 -2667 root.append(sub) -2668 self.assertEqual( -2669 _bytes('<test:root xmlns:test="http://test/ns" xmlns="http://test/ns">' -2670 '<test:sub test:attr="value"/>' -2671 '</test:root>'), -2672 etree.tostring(root)) -
2673 -
2674 - def test_namespaces_elementtree(self): -
2675 etree = self.etree -2676 r = {None: 'http://ns.infrae.com/foo', -2677 'hoi': 'http://ns.infrae.com/hoi'} -2678 e = etree.Element('{http://ns.infrae.com/foo}z', nsmap=r) -2679 tree = etree.ElementTree(element=e) -2680 etree.SubElement(e, '{http://ns.infrae.com/hoi}x') -2681 self.assertEqual( -2682 _bytes('<z xmlns="http://ns.infrae.com/foo" xmlns:hoi="http://ns.infrae.com/hoi"><hoi:x></hoi:x></z>'), -2683 self._writeElement(e)) -
2684 -
2686 etree = self.etree -2687 -2688 r = {None: 'http://ns.infrae.com/foo'} -2689 e1 = etree.Element('{http://ns.infrae.com/foo}bar', nsmap=r) -2690 e2 = etree.Element('{http://ns.infrae.com/foo}bar', nsmap=r) -2691 -2692 e1.append(e2) -2693 -2694 self.assertEqual( -2695 None, -2696 e1.prefix) -2697 self.assertEqual( -2698 None, -2699 e1[0].prefix) -2700 self.assertEqual( -2701 '{http://ns.infrae.com/foo}bar', -2702 e1.tag) -2703 self.assertEqual( -2704 '{http://ns.infrae.com/foo}bar', -2705 e1[0].tag) -
2706 -
2708 etree = self.etree -2709 -2710 r = {None: 'http://ns.infrae.com/BAR'} -2711 e1 = etree.Element('{http://ns.infrae.com/BAR}bar', nsmap=r) -2712 e2 = etree.Element('{http://ns.infrae.com/foo}bar', nsmap=r) -2713 -2714 e1.append(e2) -2715 -2716 self.assertEqual( -2717 None, -2718 e1.prefix) -2719 self.assertNotEqual( -2720 None, -2721 e2.prefix) -2722 self.assertEqual( -2723 '{http://ns.infrae.com/BAR}bar', -2724 e1.tag) -2725 self.assertEqual( -2726 '{http://ns.infrae.com/foo}bar', -2727 e2.tag) -
2728 -
2730 ns_href = "http://a.b.c" -2731 one = self.etree.fromstring( -2732 _bytes('<foo><bar xmlns:ns="%s"><ns:baz/></bar></foo>' % ns_href)) -2733 baz = one[0][0] -2734 -2735 two = self.etree.fromstring( -2736 _bytes('<root xmlns:ns="%s"/>' % ns_href)) -2737 two.append(baz) -2738 del one # make sure the source document is deallocated -2739 -2740 self.assertEqual('{%s}baz' % ns_href, baz.tag) -2741 self.assertEqual( -2742 _bytes('<root xmlns:ns="%s"><ns:baz/></root>' % ns_href), -2743 self.etree.tostring(two)) -
2744 -
2745 - def test_namespace_cleanup(self): -
2746 xml = _bytes( -2747 '<foo xmlns="F" xmlns:x="x">' -2748 '<bar xmlns:ns="NS" xmlns:b="b" xmlns="B">' -2749 '<ns:baz/>' -2750 '</bar></foo>' -2751 ) -2752 root = self.etree.fromstring(xml) -2753 self.assertEqual(xml, self.etree.tostring(root)) -2754 self.etree.cleanup_namespaces(root) -2755 self.assertEqual( -2756 _bytes('<foo xmlns="F"><bar xmlns:ns="NS" xmlns="B"><ns:baz/></bar></foo>'), -2757 self.etree.tostring(root)) -
2758 -
2760 xml = _bytes( -2761 '<foo xmlns="F" xmlns:x="X" xmlns:a="A">' -2762 '<bar xmlns:ns="NS" xmlns:b="b" xmlns="B">' -2763 '<ns:baz a:test="attr"/>' -2764 '</bar></foo>' -2765 ) -2766 root = self.etree.fromstring(xml) -2767 self.assertEqual(xml, self.etree.tostring(root)) -2768 self.etree.cleanup_namespaces(root) -2769 self.assertEqual( -2770 _bytes('<foo xmlns="F" xmlns:a="A">' -2771 '<bar xmlns:ns="NS" xmlns="B">' -2772 '<ns:baz a:test="attr"/>' -2773 '</bar></foo>'), -2774 self.etree.tostring(root)) -
2775 -
2776 - def test_namespace_cleanup_many(self): -
2777 xml = ('<n12:foo ' + -2778 ' '.join('xmlns:n{n}="NS{n}"'.format(n=i) for i in range(100)) + -2779 '><n68:a/></n12:foo>').encode('utf8') -2780 root = self.etree.fromstring(xml) -2781 self.assertEqual(xml, self.etree.tostring(root)) -2782 self.etree.cleanup_namespaces(root) -2783 self.assertEqual( -2784 b'<n12:foo xmlns:n12="NS12" xmlns:n68="NS68"><n68:a/></n12:foo>', -2785 self.etree.tostring(root)) -
2786 -
2787 - def test_namespace_cleanup_deep(self): -
2788 xml = ('<root>' + -2789 ''.join('<a xmlns:n{n}="NS{n}">'.format(n=i) for i in range(100)) + -2790 '<n64:x/>' + '</a>'*100 + '</root>').encode('utf8') -2791 root = self.etree.fromstring(xml) -2792 self.assertEqual(xml, self.etree.tostring(root)) -2793 self.etree.cleanup_namespaces(root) -2794 self.assertEqual( -2795 b'<root>' + b'<a>'*64 + b'<a xmlns:n64="NS64">' + b'<a>'*35 + -2796 b'<n64:x/>' + b'</a>'*100 + b'</root>', -2797 self.etree.tostring(root)) -
2798 -
2800 xml = ('<root>' + -2801 ''.join('<a xmlns:n{n}="NS{n}">'.format(n=i) for i in range(100)) + -2802 '<n64:x xmlns:a="A" a:attr="X"/>' + -2803 '</a>'*100 + -2804 '</root>').encode('utf8') -2805 root = self.etree.fromstring(xml) -2806 self.assertEqual(xml, self.etree.tostring(root)) -2807 self.etree.cleanup_namespaces(root, top_nsmap={'n64': 'NS64'}) -2808 self.assertEqual( -2809 b'<root xmlns:n64="NS64">' + b'<a>'*100 + -2810 b'<n64:x xmlns:a="A" a:attr="X"/>' + b'</a>'*100 + b'</root>', -2811 self.etree.tostring(root)) -
2812 -
2814 xml = ('<root xmlns:n64="NS64" xmlns:foo="FOO" xmlns:unused1="UNUSED" xmlns:no="NO">' -2815 '<a xmlns:unused2="UNUSED"><n64:x xmlns:a="A" a:attr="X"/></a>' -2816 '<foo>foo:bar</foo>' -2817 '</root>').encode('utf8') -2818 root = self.etree.fromstring(xml) -2819 self.assertEqual(xml, self.etree.tostring(root)) -2820 self.etree.cleanup_namespaces(root, keep_ns_prefixes=['foo']) -2821 self.assertEqual( -2822 b'<root xmlns:n64="NS64" xmlns:foo="FOO">' -2823 b'<a><n64:x xmlns:a="A" a:attr="X"/></a>' -2824 b'<foo>foo:bar</foo>' -2825 b'</root>', -2826 self.etree.tostring(root)) -
2827 -
2829 xml = ('<root xmlns:n64="NS64" xmlns:unused1="UNUSED" xmlns:no="NO">' -2830 '<sub xmlns:foo="FOO">' -2831 '<a xmlns:unused2="UNUSED"><n64:x xmlns:a="A" a:attr="X"/></a>' -2832 '<foo>foo:bar</foo>' -2833 '</sub>' -2834 '</root>').encode('utf8') -2835 root = self.etree.fromstring(xml) -2836 self.assertEqual(xml, self.etree.tostring(root)) -2837 self.etree.cleanup_namespaces( -2838 root, -2839 top_nsmap={'foo': 'FOO', 'unused1': 'UNUSED'}, -2840 keep_ns_prefixes=['foo']) -2841 self.assertEqual( -2842 b'<root xmlns:n64="NS64" xmlns:foo="FOO">' -2843 b'<sub>' -2844 b'<a><n64:x xmlns:a="A" a:attr="X"/></a>' -2845 b'<foo>foo:bar</foo>' -2846 b'</sub>' -2847 b'</root>', -2848 self.etree.tostring(root)) -
2849 -
2850 - def test_element_nsmap(self): -
2851 etree = self.etree -2852 -2853 r = {None: 'http://ns.infrae.com/foo', -2854 'hoi': 'http://ns.infrae.com/hoi'} -2855 e = etree.Element('{http://ns.infrae.com/foo}bar', nsmap=r) -2856 self.assertEqual( -2857 r, -2858 e.nsmap) -
2859 -
2860 - def test_subelement_nsmap(self): -
2861 etree = self.etree -2862 -2863 re = {None: 'http://ns.infrae.com/foo', -2864 'hoi': 'http://ns.infrae.com/hoi'} -2865 e = etree.Element('{http://ns.infrae.com/foo}bar', nsmap=re) -2866 -2867 rs = {None: 'http://ns.infrae.com/honk', -2868 'top': 'http://ns.infrae.com/top'} -2869 s = etree.SubElement(e, '{http://ns.infrae.com/honk}bar', nsmap=rs) -2870 -2871 r = re.copy() -2872 r.update(rs) -2873 self.assertEqual(re, e.nsmap) -2874 self.assertEqual(r, s.nsmap) -
2875 -
2876 - def test_html_prefix_nsmap(self): -
2877 etree = self.etree -2878 el = etree.HTML('<hha:page-description>aa</hha:page-description>').find('.//page-description') -2879 self.assertEqual({'hha': None}, el.nsmap) -
2880 -
2882 Element = self.etree.Element -2883 SubElement = self.etree.SubElement -2884 -2885 a = Element('a') -2886 b = SubElement(a, 'b') -2887 c = SubElement(a, 'c') -2888 d = SubElement(b, 'd') -2889 e = SubElement(c, 'e') -2890 f = SubElement(c, 'f') -2891 -2892 self.assertEqual( -2893 [a, b], -2894 list(a.getiterator('a', 'b'))) -2895 self.assertEqual( -2896 [], -2897 list(a.getiterator('x', 'y'))) -2898 self.assertEqual( -2899 [a, f], -2900 list(a.getiterator('f', 'a'))) -2901 self.assertEqual( -2902 [c, e, f], -2903 list(c.getiterator('c', '*', 'a'))) -2904 self.assertEqual( -2905 [], -2906 list(a.getiterator( (), () ))) -
2907 -
2909 Element = self.etree.Element -2910 SubElement = self.etree.SubElement -2911 -2912 a = Element('a') -2913 b = SubElement(a, 'b') -2914 c = SubElement(a, 'c') -2915 d = SubElement(b, 'd') -2916 e = SubElement(c, 'e') -2917 f = SubElement(c, 'f') -2918 -2919 self.assertEqual( -2920 [a, b], -2921 list(a.getiterator( ('a', 'b') ))) -2922 self.assertEqual( -2923 [], -2924 list(a.getiterator( ('x', 'y') ))) -2925 self.assertEqual( -2926 [a, f], -2927 list(a.getiterator( ('f', 'a') ))) -2928 self.assertEqual( -2929 [c, e, f], -2930 list(c.getiterator( ('c', '*', 'a') ))) -2931 self.assertEqual( -2932 [], -2933 list(a.getiterator( () ))) -
2934 -
2936 Element = self.etree.Element -2937 SubElement = self.etree.SubElement -2938 -2939 a = Element('{a}a') -2940 b = SubElement(a, '{a}b') -2941 c = SubElement(a, '{a}c') -2942 d = SubElement(b, '{b}d') -2943 e = SubElement(c, '{a}e') -2944 f = SubElement(c, '{b}f') -2945 g = SubElement(c, 'g') -2946 -2947 self.assertEqual( -2948 [a], -2949 list(a.getiterator('{a}a'))) -2950 self.assertEqual( -2951 [], -2952 list(a.getiterator('{b}a'))) -2953 self.assertEqual( -2954 [], -2955 list(a.getiterator('a'))) -2956 self.assertEqual( -2957 [a,b,d,c,e,f,g], -2958 list(a.getiterator('*'))) -2959 self.assertEqual( -2960 [f], -2961 list(c.getiterator('{b}*'))) -2962 self.assertEqual( -2963 [d, f], -2964 list(a.getiterator('{b}*'))) -2965 self.assertEqual( -2966 [g], -2967 list(a.getiterator('g'))) -2968 self.assertEqual( -2969 [g], -2970 list(a.getiterator('{}g'))) -2971 self.assertEqual( -2972 [g], -2973 list(a.getiterator('{}*'))) -
2974 -
2976 Element = self.etree.Element -2977 SubElement = self.etree.SubElement -2978 -2979 a = Element('{a}a') -2980 b = SubElement(a, '{nsA}b') -2981 c = SubElement(b, '{nsB}b') -2982 d = SubElement(a, 'b') -2983 e = SubElement(a, '{nsA}e') -2984 f = SubElement(e, '{nsB}e') -2985 g = SubElement(e, 'e') -2986 -2987 self.assertEqual( -2988 [b, c, d], -2989 list(a.getiterator('{*}b'))) -2990 self.assertEqual( -2991 [e, f, g], -2992 list(a.getiterator('{*}e'))) -2993 self.assertEqual( -2994 [a, b, c, d, e, f, g], -2995 list(a.getiterator('{*}*'))) -
2996 -
2998 Element = self.etree.Element -2999 Entity = self.etree.Entity -3000 SubElement = self.etree.SubElement -3001 -3002 a = Element('a') -3003 b = SubElement(a, 'b') -3004 entity_b = Entity("TEST-b") -3005 b.append(entity_b) -3006 -3007 self.assertEqual( -3008 [entity_b], -3009 list(a.getiterator(Entity))) -3010 -3011 entity_a = Entity("TEST-a") -3012 a.append(entity_a) -3013 -3014 self.assertEqual( -3015 [entity_b, entity_a], -3016 list(a.getiterator(Entity))) -3017 -3018 self.assertEqual( -3019 [entity_b], -3020 list(b.getiterator(Entity))) -
3021 -
3023 Element = self.etree.Element -3024 Comment = self.etree.Comment -3025 PI = self.etree.PI -3026 SubElement = self.etree.SubElement -3027 -3028 a = Element('a') -3029 b = SubElement(a, 'b') -3030 a.append(Comment("test")) -3031 a.append(PI("pi", "content")) -3032 c = SubElement(a, 'c') -3033 -3034 self.assertEqual( -3035 [a, b, c], -3036 list(a.getiterator(Element))) -
3037 -
3039 # ElementTree iterates over everything here -3040 Element = self.etree.Element -3041 Comment = self.etree.Comment -3042 PI = self.etree.PI -3043 SubElement = self.etree.SubElement -3044 -3045 a = Element('a') -3046 b = SubElement(a, 'b') -3047 a.append(Comment("test")) -3048 a.append(PI("pi", "content")) -3049 c = SubElement(a, 'c') -3050 -3051 self.assertEqual( -3052 [a, b, c], -3053 list(a.getiterator('*'))) -
3054 -
3056 a = etree.Element("a") -3057 b = etree.SubElement(a, "b") -3058 c = etree.SubElement(a, "c") -3059 d1 = etree.SubElement(c, "d") -3060 d2 = etree.SubElement(c, "d") -3061 c.text = d1.text = 'TEXT' -3062 -3063 tree = etree.ElementTree(a) -3064 self.assertEqual('.', tree.getelementpath(a)) -3065 self.assertEqual('c/d[1]', tree.getelementpath(d1)) -3066 self.assertEqual('c/d[2]', tree.getelementpath(d2)) -3067 -3068 self.assertEqual(d1, tree.find(tree.getelementpath(d1))) -3069 self.assertEqual(d2, tree.find(tree.getelementpath(d2))) -3070 -3071 tree = etree.ElementTree(c) -3072 self.assertEqual('.', tree.getelementpath(c)) -3073 self.assertEqual('d[2]', tree.getelementpath(d2)) -3074 self.assertEqual(d2, tree.find(tree.getelementpath(d2))) -3075 -3076 tree = etree.ElementTree(b) # not a parent of a/c/d1/d2 -3077 self.assertEqual('.', tree.getelementpath(b)) -3078 self.assertRaises(ValueError, tree.getelementpath, a) -3079 self.assertRaises(ValueError, tree.getelementpath, c) -3080 self.assertRaises(ValueError, tree.getelementpath, d2) -
3081 -
3083 a = etree.Element("{http://ns1/}a") -3084 b = etree.SubElement(a, "{http://ns1/}b") -3085 c = etree.SubElement(a, "{http://ns1/}c") -3086 d1 = etree.SubElement(c, "{http://ns1/}d") -3087 d2 = etree.SubElement(c, "{http://ns2/}d") -3088 d3 = etree.SubElement(c, "{http://ns1/}d") -3089 -3090 tree = etree.ElementTree(a) -3091 self.assertEqual('.', tree.getelementpath(a)) -3092 self.assertEqual('{http://ns1/}c/{http://ns1/}d[1]', -3093 tree.getelementpath(d1)) -3094 self.assertEqual('{http://ns1/}c/{http://ns2/}d', -3095 tree.getelementpath(d2)) -3096 self.assertEqual('{http://ns1/}c/{http://ns1/}d[2]', -3097 tree.getelementpath(d3)) -3098 -3099 self.assertEqual(a, tree.find(tree.getelementpath(a))) -3100 self.assertEqual(b, tree.find(tree.getelementpath(b))) -3101 self.assertEqual(c, tree.find(tree.getelementpath(c))) -3102 self.assertEqual(d1, tree.find(tree.getelementpath(d1))) -3103 self.assertEqual(d2, tree.find(tree.getelementpath(d2))) -3104 self.assertEqual(d3, tree.find(tree.getelementpath(d3))) -3105 -3106 tree = etree.ElementTree(c) -3107 self.assertEqual('{http://ns1/}d[1]', tree.getelementpath(d1)) -3108 self.assertEqual('{http://ns2/}d', tree.getelementpath(d2)) -3109 self.assertEqual('{http://ns1/}d[2]', tree.getelementpath(d3)) -3110 self.assertEqual(d1, tree.find(tree.getelementpath(d1))) -3111 self.assertEqual(d2, tree.find(tree.getelementpath(d2))) -3112 self.assertEqual(d3, tree.find(tree.getelementpath(d3))) -3113 -3114 tree = etree.ElementTree(b) # not a parent of d1/d2 -3115 self.assertRaises(ValueError, tree.getelementpath, d1) -3116 self.assertRaises(ValueError, tree.getelementpath, d2) -
3117 -
3118 - def test_elementtree_find_qname(self): -
3119 XML = self.etree.XML -3120 ElementTree = self.etree.ElementTree -3121 QName = self.etree.QName -3122 tree = ElementTree(XML(_bytes('<a><b><c/></b><b/><c><b/></c></a>'))) -3123 self.assertEqual(tree.find(QName("c")), tree.getroot()[2]) -
3124 -
3126 XML = self.etree.XML -3127 ElementTree = self.etree.ElementTree -3128 QName = self.etree.QName -3129 tree = ElementTree(XML(_bytes('<a><b><c/></b><b/><c><b/></c></a>'))) -3130 self.assertEqual(len(list(tree.findall(QName("c")))), 1) -
3131 -
3133 XML = self.etree.XML -3134 ElementTree = self.etree.ElementTree -3135 QName = self.etree.QName -3136 tree = ElementTree(XML( -3137 _bytes('<a xmlns:x="X" xmlns:y="Y"><x:b><c/></x:b><b/><c><x:b/><b/></c><b/></a>'))) -3138 self.assertEqual(len(list(tree.findall(QName("b")))), 2) -3139 self.assertEqual(len(list(tree.findall(QName("X", "b")))), 1) -
3140 -
3141 - def test_findall_ns(self): -
3142 XML = self.etree.XML -3143 root = XML(_bytes('<a xmlns:x="X" xmlns:y="Y"><x:b><c/></x:b><b/><c><x:b/><b/></c><b/></a>')) -3144 self.assertEqual(len(root.findall(".//{X}b")), 2) -3145 self.assertEqual(len(root.findall(".//{X}*")), 2) -3146 self.assertEqual(len(root.findall(".//b")), 3) -
3147 -
3149 XML = self.etree.XML -3150 root = XML(_bytes('<a xmlns:x="X" xmlns:y="Y"><x:b><c/></x:b><b/><c><x:b/><b/></c><y:b/></a>')) -3151 nsmap = {'xx': 'X'} -3152 self.assertEqual(len(root.findall(".//xx:b", namespaces=nsmap)), 2) -3153 self.assertEqual(len(root.findall(".//xx:*", namespaces=nsmap)), 2) -3154 self.assertEqual(len(root.findall(".//b", namespaces=nsmap)), 2) -3155 nsmap = {'xx': 'Y'} -3156 self.assertEqual(len(root.findall(".//xx:b", namespaces=nsmap)), 1) -3157 self.assertEqual(len(root.findall(".//xx:*", namespaces=nsmap)), 1) -3158 self.assertEqual(len(root.findall(".//b", namespaces=nsmap)), 2) -
3159 -
3160 - def test_findall_empty_prefix(self): -
3161 XML = self.etree.XML -3162 root = XML(_bytes('<a xmlns:x="X" xmlns:y="Y"><x:b><c/></x:b><b/><c><x:b/><b/></c><y:b/></a>')) -3163 nsmap = {'xx': 'X'} -3164 self.assertEqual(len(root.findall(".//xx:b", namespaces=nsmap)), 2) -3165 nsmap = {'xx': 'X', None: 'Y'} -3166 self.assertEqual(len(root.findall(".//b", namespaces=nsmap)), 1) -3167 nsmap = {'xx': 'X', '': 'Y'} -3168 self.assertRaises(ValueError, root.findall, ".//xx:b", namespaces=nsmap) -
3169 -
3170 - def test_findall_syntax_error(self): -
3171 XML = self.etree.XML -3172 root = XML(_bytes('<a><b><c/></b><b/><c><b/><b/></c><b/></a>')) -3173 self.assertRaises(SyntaxError, root.findall, '') -3174 self.assertRaises(SyntaxError, root.findall, '//') # absolute path on Element -3175 self.assertRaises(SyntaxError, root.findall, './//') -
3176 -
3177 - def test_index(self): -
3178 etree = self.etree -3179 e = etree.Element('foo') -3180 for i in range(10): -3181 etree.SubElement(e, 'a%s' % i) -3182 for i in range(10): -3183 self.assertEqual( -3184 i, -3185 e.index(e[i])) -3186 self.assertEqual( -3187 3, e.index(e[3], 3)) -3188 self.assertRaises( -3189 ValueError, e.index, e[3], 4) -3190 self.assertRaises( -3191 ValueError, e.index, e[3], 0, 2) -3192 self.assertRaises( -3193 ValueError, e.index, e[8], 0, -3) -3194 self.assertRaises( -3195 ValueError, e.index, e[8], -5, -3) -3196 self.assertEqual( -3197 8, e.index(e[8], 0, -1)) -3198 self.assertEqual( -3199 8, e.index(e[8], -12, -1)) -3200 self.assertEqual( -3201 0, e.index(e[0], -12, -1)) -
3202 -
3203 - def test_replace(self): -
3204 etree = self.etree -3205 e = etree.Element('foo') -3206 for i in range(10): -3207 el = etree.SubElement(e, 'a%s' % i) -3208 el.text = "text%d" % i -3209 el.tail = "tail%d" % i -3210 -3211 child0 = e[0] -3212 child1 = e[1] -3213 child2 = e[2] -3214 -3215 e.replace(e[0], e[1]) -3216 self.assertEqual( -3217 9, len(e)) -3218 self.assertEqual( -3219 child1, e[0]) -3220 self.assertEqual( -3221 child1.text, "text1") -3222 self.assertEqual( -3223 child1.tail, "tail1") -3224 self.assertEqual( -3225 child0.tail, "tail0") -3226 self.assertEqual( -3227 child2, e[1]) -3228 -3229 e.replace(e[-1], e[0]) -3230 self.assertEqual( -3231 child1, e[-1]) -3232 self.assertEqual( -3233 child1.text, "text1") -3234 self.assertEqual( -3235 child1.tail, "tail1") -3236 self.assertEqual( -3237 child2, e[0]) -
3238 -
3239 - def test_replace_new(self): -
3240 etree = self.etree -3241 e = etree.Element('foo') -3242 for i in range(10): -3243 etree.SubElement(e, 'a%s' % i) -3244 -3245 new_element = etree.Element("test") -3246 new_element.text = "TESTTEXT" -3247 new_element.tail = "TESTTAIL" -3248 child1 = e[1] -3249 e.replace(e[0], new_element) -3250 self.assertEqual( -3251 new_element, e[0]) -3252 self.assertEqual( -3253 "TESTTEXT", -3254 e[0].text) -3255 self.assertEqual( -3256 "TESTTAIL", -3257 e[0].tail) -3258 self.assertEqual( -3259 child1, e[1]) -
3260 -
3262 Element = self.etree.Element -3263 SubElement = self.etree.SubElement -3264 -3265 a = Element('a') -3266 -3267 e = Element('e') -3268 f = Element('f') -3269 g = Element('g') -3270 -3271 s = [e, f, g] -3272 a[::-1] = s -3273 self.assertEqual( -3274 [g, f, e], -3275 list(a)) -
3276 -
3277 - def test_setslice_step(self): -
3278 Element = self.etree.Element -3279 SubElement = self.etree.SubElement -3280 -3281 a = Element('a') -3282 b = SubElement(a, 'b') -3283 c = SubElement(a, 'c') -3284 d = SubElement(a, 'd') -3285 e = SubElement(a, 'e') -3286 -3287 x = Element('x') -3288 y = Element('y') -3289 -3290 a[1::2] = [x, y] -3291 self.assertEqual( -3292 [b, x, d, y], -3293 list(a)) -
3294 -
3295 - def test_setslice_step_negative(self): -
3296 Element = self.etree.Element -3297 SubElement = self.etree.SubElement -3298 -3299 a = Element('a') -3300 b = SubElement(a, 'b') -3301 c = SubElement(a, 'c') -3302 d = SubElement(a, 'd') -3303 e = SubElement(a, 'e') -3304 -3305 x = Element('x') -3306 y = Element('y') -3307 -3308 a[1::-1] = [x, y] -3309 self.assertEqual( -3310 [y, x, d, e], -3311 list(a)) -
3312 -
3314 Element = self.etree.Element -3315 SubElement = self.etree.SubElement -3316 -3317 a = Element('a') -3318 b = SubElement(a, 'b') -3319 c = SubElement(a, 'c') -3320 d = SubElement(a, 'd') -3321 e = SubElement(a, 'e') -3322 -3323 x = Element('x') -3324 y = Element('y') -3325 -3326 a[::-2] = [x, y] -3327 self.assertEqual( -3328 [b, y, d, x], -3329 list(a)) -
3330 -
3331 - def test_setslice_step_overrun(self): -
3332 Element = self.etree.Element -3333 SubElement = self.etree.SubElement -3334 try: -3335 slice -3336 except NameError: -3337 print("slice() not found") -3338 return -3339 -3340 a = Element('a') -3341 b = SubElement(a, 'b') -3342 c = SubElement(a, 'c') -3343 d = SubElement(a, 'd') -3344 e = SubElement(a, 'e') -3345 -3346 x = Element('x') -3347 y = Element('y') -3348 z = Element('z') -3349 -3350 self.assertRaises( -3351 ValueError, -3352 operator.setitem, a, slice(1,None,2), [x, y, z]) -3353 -3354 self.assertEqual( -3355 [b, c, d, e], -3356 list(a)) -
3357 -
3358 - def test_sourceline_XML(self): -
3359 XML = self.etree.XML -3360 root = XML(_bytes('''<?xml version="1.0"?> -3361 <root><test> -3362 -3363 <bla/></test> -3364 </root> -3365 ''')) -3366 -3367 self.assertEqual( -3368 [2, 2, 4], -3369 [ el.sourceline for el in root.getiterator() ]) -
3370 -
3371 - def test_large_sourceline_XML(self): -
3372 XML = self.etree.XML -3373 root = XML(_bytes( -3374 '<?xml version="1.0"?>\n' -3375 '<root>' + '\n' * 65536 + -3376 '<p>' + '\n' * 65536 + '</p>\n' + -3377 '<br/>\n' -3378 '</root>')) -3379 -3380 if self.etree.LIBXML_VERSION >= (2, 9): -3381 expected = [2, 131074, 131076] -3382 else: -3383 expected = [2, 65535, 65535] -3384 -3385 self.assertEqual(expected, [el.sourceline for el in root.iter()]) -
3386 -
3387 - def test_sourceline_parse(self): -
3388 parse = self.etree.parse -3389 tree = parse(fileInTestDir('include/test_xinclude.xml')) -3390 -3391 self.assertEqual( -3392 [1, 2, 3], -3393 [ el.sourceline for el in tree.getiterator() ]) -
3394 -
3396 iterparse = self.etree.iterparse -3397 lines = [ el.sourceline for (event, el) in -3398 iterparse(fileInTestDir('include/test_xinclude.xml')) ] -3399 -3400 self.assertEqual( -3401 [2, 3, 1], -3402 lines) -
3403 -
3405 iterparse = self.etree.iterparse -3406 lines = [ el.sourceline for (event, el) in -3407 iterparse(fileInTestDir('include/test_xinclude.xml'), -3408 events=("start",)) ] -3409 -3410 self.assertEqual( -3411 [1, 2, 3], -3412 lines) -
3413 -
3414 - def test_sourceline_element(self): -
3415 Element = self.etree.Element -3416 SubElement = self.etree.SubElement -3417 el = Element("test") -3418 self.assertEqual(None, el.sourceline) -3419 -3420 child = SubElement(el, "test") -3421 self.assertEqual(None, el.sourceline) -3422 self.assertEqual(None, child.sourceline) -
3423 -
3424 - def test_XML_base_url_docinfo(self): -
3425 etree = self.etree -3426 root = etree.XML(_bytes("<root/>"), base_url="http://no/such/url") -3427 docinfo = root.getroottree().docinfo -3428 self.assertEqual(docinfo.URL, "http://no/such/url") -
3429 -
3431 etree = self.etree -3432 root = etree.XML(_bytes("<root/>"), base_url="http://no/such/url") -3433 docinfo = root.getroottree().docinfo -3434 self.assertEqual(docinfo.URL, "http://no/such/url") -3435 docinfo.URL = "https://secret/url" -3436 self.assertEqual(docinfo.URL, "https://secret/url") -
3437 -
3439 etree = self.etree -3440 tree = etree.parse(BytesIO("<root/>"), base_url="http://no/such/url") -3441 docinfo = tree.docinfo -3442 self.assertEqual(docinfo.URL, "http://no/such/url") -
3443 -
3444 - def test_parse_base_url_docinfo(self): -
3445 etree = self.etree -3446 tree = etree.parse(fileInTestDir('include/test_xinclude.xml'), -3447 base_url="http://no/such/url") -3448 docinfo = tree.docinfo -3449 self.assertEqual(docinfo.URL, "http://no/such/url") -
3450 -
3451 - def test_HTML_base_url_docinfo(self): -
3452 etree = self.etree -3453 root = etree.HTML(_bytes("<html/>"), base_url="http://no/such/url") -3454 docinfo = root.getroottree().docinfo -3455 self.assertEqual(docinfo.URL, "http://no/such/url") -
3456 -
3457 - def test_docinfo_public(self): -
3458 etree = self.etree -3459 xml_header = '<?xml version="1.0" encoding="ascii"?>' -3460 pub_id = "-//W3C//DTD XHTML 1.0 Transitional//EN" -3461 sys_id = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" -3462 doctype_string = '<!DOCTYPE html PUBLIC "%s" "%s">' % (pub_id, sys_id) -3463 -3464 xml = _bytes(xml_header + doctype_string + '<html><body></body></html>') -3465 -3466 tree = etree.parse(BytesIO(xml)) -3467 docinfo = tree.docinfo -3468 self.assertEqual(docinfo.encoding, "ascii") -3469 self.assertEqual(docinfo.xml_version, "1.0") -3470 self.assertEqual(docinfo.public_id, pub_id) -3471 self.assertEqual(docinfo.system_url, sys_id) -3472 self.assertEqual(docinfo.root_name, 'html') -3473 self.assertEqual(docinfo.doctype, doctype_string) -
3474 -
3475 - def test_docinfo_system(self): -
3476 etree = self.etree -3477 xml_header = '<?xml version="1.0" encoding="UTF-8"?>' -3478 sys_id = "some.dtd" -3479 doctype_string = '<!DOCTYPE html SYSTEM "%s">' % sys_id -3480 xml = _bytes(xml_header + doctype_string + '<html><body></body></html>') -3481 -3482 tree = etree.parse(BytesIO(xml)) -3483 docinfo = tree.docinfo -3484 self.assertEqual(docinfo.encoding, "UTF-8") -3485 self.assertEqual(docinfo.xml_version, "1.0") -3486 self.assertEqual(docinfo.public_id, None) -3487 self.assertEqual(docinfo.system_url, sys_id) -3488 self.assertEqual(docinfo.root_name, 'html') -3489 self.assertEqual(docinfo.doctype, doctype_string) -
3490 -
3491 - def test_docinfo_empty(self): -
3492 etree = self.etree -3493 xml = _bytes('<html><body></body></html>') -3494 tree = etree.parse(BytesIO(xml)) -3495 docinfo = tree.docinfo -3496 self.assertEqual(docinfo.encoding, "UTF-8") -3497 self.assertEqual(docinfo.xml_version, "1.0") -3498 self.assertEqual(docinfo.public_id, None) -3499 self.assertEqual(docinfo.system_url, None) -3500 self.assertEqual(docinfo.root_name, 'html') -3501 self.assertEqual(docinfo.doctype, '') -
3502 -
3503 - def test_docinfo_name_only(self): -
3504 etree = self.etree -3505 xml = _bytes('<!DOCTYPE root><root></root>') -3506 tree = etree.parse(BytesIO(xml)) -3507 docinfo = tree.docinfo -3508 self.assertEqual(docinfo.encoding, "UTF-8") -3509 self.assertEqual(docinfo.xml_version, "1.0") -3510 self.assertEqual(docinfo.public_id, None) -3511 self.assertEqual(docinfo.system_url, None) -3512 self.assertEqual(docinfo.root_name, 'root') -3513 self.assertEqual(docinfo.doctype, '<!DOCTYPE root>') -
3514 -
3516 etree = self.etree -3517 xml = _bytes('<!DOCTYPE root>\n<root/>') -3518 tree = etree.parse(BytesIO(xml)) -3519 self.assertEqual(xml, etree.tostring(tree)) -
3520 -
3522 etree = self.etree -3523 pub_id = "-//W3C//DTD XHTML 1.0 Transitional//EN" -3524 sys_id = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" -3525 doctype_string = _bytes('<!DOCTYPE html PUBLIC "%s" "%s">' % (pub_id, sys_id)) -3526 -3527 xml = _bytes('<!DOCTYPE root>\n<root/>') -3528 tree = etree.parse(BytesIO(xml)) -3529 self.assertEqual(xml.replace(_bytes('<!DOCTYPE root>'), doctype_string), -3530 etree.tostring(tree, doctype=doctype_string)) -
3531 -
3532 - def test_xml_base(self): -
3533 etree = self.etree -3534 root = etree.XML(_bytes("<root/>"), base_url="http://no/such/url") -3535 self.assertEqual(root.base, "http://no/such/url") -3536 self.assertEqual( -3537 root.get('{http://www.w3.org/XML/1998/namespace}base'), None) -3538 root.base = "https://secret/url" -3539 self.assertEqual(root.base, "https://secret/url") -3540 self.assertEqual( -3541 root.get('{http://www.w3.org/XML/1998/namespace}base'), -3542 "https://secret/url") -
3543 -
3544 - def test_xml_base_attribute(self): -
3545 etree = self.etree -3546 root = etree.XML(_bytes("<root/>"), base_url="http://no/such/url") -3547 self.assertEqual(root.base, "http://no/such/url") -3548 self.assertEqual( -3549 root.get('{http://www.w3.org/XML/1998/namespace}base'), None) -3550 root.set('{http://www.w3.org/XML/1998/namespace}base', -3551 "https://secret/url") -3552 self.assertEqual(root.base, "https://secret/url") -3553 self.assertEqual( -3554 root.get('{http://www.w3.org/XML/1998/namespace}base'), -3555 "https://secret/url") -
3556 -
3557 - def test_html_base(self): -
3558 etree = self.etree -3559 root = etree.HTML(_bytes("<html><body></body></html>"), -3560 base_url="http://no/such/url") -3561 self.assertEqual(root.base, "http://no/such/url") -
3562 -
3563 - def test_html_base_tag(self): -
3564 etree = self.etree -3565 root = etree.HTML(_bytes('<html><head><base href="http://no/such/url"></head></html>')) -3566 self.assertEqual(root.base, "http://no/such/url") -
3567 -
3569 # parse from a file object that returns unicode strings -3570 f = LargeFileLikeUnicode() -3571 tree = self.etree.parse(f) -3572 root = tree.getroot() -3573 self.assertTrue(root.tag.endswith('root')) -
3574 -
3575 - def test_dtd_io(self): -
3576 # check that DTDs that go in also go back out -3577 xml = _bytes('''\ -3578 <!DOCTYPE test SYSTEM "test.dtd" [ -3579 <!ENTITY entity "tasty"> -3580 <!ELEMENT test (a)> -3581 <!ELEMENT a (#PCDATA)> -3582 ]> -3583 <test><a>test-test</a></test>\ -3584 ''') -3585 tree = self.etree.parse(BytesIO(xml)) -3586 self.assertEqual(self.etree.tostring(tree).replace(_bytes(" "), _bytes("")), -3587 xml.replace(_bytes(" "), _bytes(""))) -
3588 -
3589 - def test_byte_zero(self): -
3590 Element = self.etree.Element -3591 -3592 a = Element('a') -3593 self.assertRaises(ValueError, setattr, a, "text", 'ha\0ho') -3594 self.assertRaises(ValueError, setattr, a, "tail", 'ha\0ho') -3595 -3596 self.assertRaises(ValueError, Element, 'ha\0ho') -
3597 -
3598 - def test_unicode_byte_zero(self): -
3599 Element = self.etree.Element -3600 -3601 a = Element('a') -3602 self.assertRaises(ValueError, setattr, a, "text", -3603 _str('ha\0ho')) -3604 self.assertRaises(ValueError, setattr, a, "tail", -3605 _str('ha\0ho')) -3606 -3607 self.assertRaises(ValueError, Element, -3608 _str('ha\0ho')) -
3609 -
3610 - def test_byte_invalid(self): -
3611 Element = self.etree.Element -3612 -3613 a = Element('a') -3614 self.assertRaises(ValueError, setattr, a, "text", 'ha\x07ho') -3615 self.assertRaises(ValueError, setattr, a, "text", 'ha\x02ho') -3616 -3617 self.assertRaises(ValueError, setattr, a, "tail", 'ha\x07ho') -3618 self.assertRaises(ValueError, setattr, a, "tail", 'ha\x02ho') -3619 -3620 self.assertRaises(ValueError, Element, 'ha\x07ho') -3621 self.assertRaises(ValueError, Element, 'ha\x02ho') -
3622 -
3623 - def test_unicode_byte_invalid(self): -
3624 Element = self.etree.Element -3625 -3626 a = Element('a') -3627 self.assertRaises(ValueError, setattr, a, "text", -3628 _str('ha\x07ho')) -3629 self.assertRaises(ValueError, setattr, a, "text", -3630 _str('ha\x02ho')) -3631 -3632 self.assertRaises(ValueError, setattr, a, "tail", -3633 _str('ha\x07ho')) -3634 self.assertRaises(ValueError, setattr, a, "tail", -3635 _str('ha\x02ho')) -3636 -3637 self.assertRaises(ValueError, Element, -3638 _str('ha\x07ho')) -3639 self.assertRaises(ValueError, Element, -3640 _str('ha\x02ho')) -
3641 -
3643 Element = self.etree.Element -3644 -3645 a = Element('a') -3646 self.assertRaises(ValueError, setattr, a, "text", -3647 _str('ha\u1234\x07ho')) -3648 self.assertRaises(ValueError, setattr, a, "text", -3649 _str('ha\u1234\x02ho')) -3650 -3651 self.assertRaises(ValueError, setattr, a, "tail", -3652 _str('ha\u1234\x07ho')) -3653 self.assertRaises(ValueError, setattr, a, "tail", -3654 _str('ha\u1234\x02ho')) -3655 -3656 self.assertRaises(ValueError, Element, -3657 _str('ha\u1234\x07ho')) -3658 self.assertRaises(ValueError, Element, -3659 _str('ha\u1234\x02ho')) -
3660 -
3662 # ElementTree fails to serialize this -3663 tostring = self.etree.tostring -3664 Element = self.etree.Element -3665 SubElement = self.etree.SubElement -3666 -3667 a = Element('a') -3668 b = SubElement(a, 'b') -3669 c = SubElement(a, 'c') -3670 -3671 result = tostring(a, encoding='UTF-16') -3672 self.assertEqual(_bytes('<a><b></b><c></c></a>'), -3673 canonicalize(result)) -
3674 -
3675 - def test_tostring_none(self): -
3676 # ElementTree raises an AssertionError here -3677 tostring = self.etree.tostring -3678 self.assertRaises(TypeError, self.etree.tostring, None) -
3679 -
3680 - def test_tostring_pretty(self): -
3681 tostring = self.etree.tostring -3682 Element = self.etree.Element -3683 SubElement = self.etree.SubElement -3684 -3685 a = Element('a') -3686 b = SubElement(a, 'b') -3687 c = SubElement(a, 'c') -3688 -3689 result = tostring(a) -3690 self.assertEqual(result, _bytes("<a><b/><c/></a>")) -3691 -3692 result = tostring(a, pretty_print=False) -3693 self.assertEqual(result, _bytes("<a><b/><c/></a>")) -3694 -3695 result = tostring(a, pretty_print=True) -3696 self.assertEqual(result, _bytes("<a>\n <b/>\n <c/>\n</a>\n")) -
3697 -
3698 - def test_tostring_with_tail(self): -
3699 tostring = self.etree.tostring -3700 Element = self.etree.Element -3701 SubElement = self.etree.SubElement -3702 -3703 a = Element('a') -3704 a.tail = "aTAIL" -3705 b = SubElement(a, 'b') -3706 b.tail = "bTAIL" -3707 c = SubElement(a, 'c') -3708 -3709 result = tostring(a) -3710 self.assertEqual(result, _bytes("<a><b/>bTAIL<c/></a>aTAIL")) -3711 -3712 result = tostring(a, with_tail=False) -3713 self.assertEqual(result, _bytes("<a><b/>bTAIL<c/></a>")) -3714 -3715 result = tostring(a, with_tail=True) -3716 self.assertEqual(result, _bytes("<a><b/>bTAIL<c/></a>aTAIL")) -
3717 -
3719 tostring = self.etree.tostring -3720 html = self.etree.fromstring( -3721 '<html><body>' -3722 '<div><p>Some text<i>\r\n</i></p></div>\r\n' -3723 '</body></html>', -3724 parser=self.etree.HTMLParser()) -3725 self.assertEqual(html.tag, 'html') -3726 div = html.find('.//div') -3727 self.assertEqual(div.tail, '\r\n') -3728 result = tostring(div, method='html') -3729 self.assertEqual( -3730 result, -3731 _bytes("<div><p>Some text<i>\r\n</i></p></div>\r\n")) -3732 result = tostring(div, method='html', with_tail=True) -3733 self.assertEqual( -3734 result, -3735 _bytes("<div><p>Some text<i>\r\n</i></p></div>\r\n")) -3736 result = tostring(div, method='html', with_tail=False) -3737 self.assertEqual( -3738 result, -3739 _bytes("<div><p>Some text<i>\r\n</i></p></div>")) -
3740 -
3741 - def test_standalone(self): -
3742 tostring = self.etree.tostring -3743 XML = self.etree.XML -3744 ElementTree = self.etree.ElementTree -3745 Element = self.etree.Element -3746 -3747 tree = Element("root").getroottree() -3748 self.assertEqual(None, tree.docinfo.standalone) -3749 -3750 tree = XML(_bytes("<root/>")).getroottree() -3751 self.assertEqual(None, tree.docinfo.standalone) -3752 -3753 tree = XML(_bytes( -3754 "<?xml version='1.0' encoding='ASCII' standalone='yes'?>\n<root/>" -3755 )).getroottree() -3756 self.assertEqual(True, tree.docinfo.standalone) -3757 -3758 tree = XML(_bytes( -3759 "<?xml version='1.0' encoding='ASCII' standalone='no'?>\n<root/>" -3760 )).getroottree() -3761 self.assertEqual(False, tree.docinfo.standalone) -
3762 -
3763 - def test_tostring_standalone(self): -
3764 tostring = self.etree.tostring -3765 XML = self.etree.XML -3766 ElementTree = self.etree.ElementTree -3767 -3768 root = XML(_bytes("<root/>")) -3769 -3770 tree = ElementTree(root) -3771 self.assertEqual(None, tree.docinfo.standalone) -3772 -3773 result = tostring(root, xml_declaration=True, encoding="ASCII") -3774 self.assertEqual(result, _bytes( -3775 "<?xml version='1.0' encoding='ASCII'?>\n<root/>")) -3776 -3777 result = tostring(root, xml_declaration=True, encoding="ASCII", -3778 standalone=True) -3779 self.assertEqual(result, _bytes( -3780 "<?xml version='1.0' encoding='ASCII' standalone='yes'?>\n<root/>")) -3781 -3782 tree = ElementTree(XML(result)) -3783 self.assertEqual(True, tree.docinfo.standalone) -3784 -3785 result = tostring(root, xml_declaration=True, encoding="ASCII", -3786 standalone=False) -3787 self.assertEqual(result, _bytes( -3788 "<?xml version='1.0' encoding='ASCII' standalone='no'?>\n<root/>")) -3789 -3790 tree = ElementTree(XML(result)) -3791 self.assertEqual(False, tree.docinfo.standalone) -
3792 -
3794 tostring = self.etree.tostring -3795 XML = self.etree.XML -3796 ElementTree = self.etree.ElementTree -3797 -3798 root = XML(_bytes( -3799 "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n<root/>")) -3800 -3801 tree = ElementTree(root) -3802 self.assertEqual(True, tree.docinfo.standalone) -3803 -3804 result = tostring(root, xml_declaration=True, encoding="ASCII") -3805 self.assertEqual(result, _bytes( -3806 "<?xml version='1.0' encoding='ASCII'?>\n<root/>")) -3807 -3808 result = tostring(root, xml_declaration=True, encoding="ASCII", -3809 standalone=True) -3810 self.assertEqual(result, _bytes( -3811 "<?xml version='1.0' encoding='ASCII' standalone='yes'?>\n<root/>")) -
3812 -
3814 tostring = self.etree.tostring -3815 Element = self.etree.Element -3816 SubElement = self.etree.SubElement -3817 -3818 a = Element('a') -3819 a.text = "A" -3820 a.tail = "tail" -3821 b = SubElement(a, 'b') -3822 b.text = "B" -3823 b.tail = _str("Søk på nettet") -3824 c = SubElement(a, 'c') -3825 c.text = "C" -3826 -3827 result = tostring(a, method="text", encoding="UTF-16") -3828 -3829 self.assertEqual(_str('ABSøk på nettetCtail').encode("UTF-16"), -3830 result) -
3831 -
3833 tostring = self.etree.tostring -3834 Element = self.etree.Element -3835 SubElement = self.etree.SubElement -3836 -3837 a = Element('a') -3838 a.text = _str('Søk på nettetA') -3839 a.tail = "tail" -3840 b = SubElement(a, 'b') -3841 b.text = "B" -3842 b.tail = _str('Søk på nettetB') -3843 c = SubElement(a, 'c') -3844 c.text = "C" -3845 -3846 self.assertRaises(UnicodeEncodeError, -3847 tostring, a, method="text") -3848 -3849 self.assertEqual( -3850 _str('Søk på nettetABSøk på nettetBCtail').encode('utf-8'), -3851 tostring(a, encoding="UTF-8", method="text")) -
3852 -
3853 - def test_tounicode(self): -
3854 tounicode = self.etree.tounicode -3855 Element = self.etree.Element -3856 SubElement = self.etree.SubElement -3857 -3858 a = Element('a') -3859 b = SubElement(a, 'b') -3860 c = SubElement(a, 'c') -3861 -3862 self.assertTrue(isinstance(tounicode(a), _unicode)) -3863 self.assertEqual(_bytes('<a><b></b><c></c></a>'), -3864 canonicalize(tounicode(a))) -
3865 -
3866 - def test_tounicode_element(self): -
3867 tounicode = self.etree.tounicode -3868 Element = self.etree.Element -3869 SubElement = self.etree.SubElement -3870 -3871 a = Element('a') -3872 b = SubElement(a, 'b') -3873 c = SubElement(a, 'c') -3874 d = SubElement(c, 'd') -3875 self.assertTrue(isinstance(tounicode(b), _unicode)) -3876 self.assertTrue(isinstance(tounicode(c), _unicode)) -3877 self.assertEqual(_bytes('<b></b>'), -3878 canonicalize(tounicode(b))) -3879 self.assertEqual(_bytes('<c><d></d></c>'), -3880 canonicalize(tounicode(c))) -
3881 -
3882 - def test_tounicode_none(self): -
3883 tounicode = self.etree.tounicode -3884 self.assertRaises(TypeError, self.etree.tounicode, None) -
3885 -
3886 - def test_tounicode_element_tail(self): -
3887 tounicode = self.etree.tounicode -3888 Element = self.etree.Element -3889 SubElement = self.etree.SubElement -3890 -3891 a = Element('a') -3892 b = SubElement(a, 'b') -3893 c = SubElement(a, 'c') -3894 d = SubElement(c, 'd') -3895 b.tail = 'Foo' -3896 -3897 self.assertTrue(isinstance(tounicode(b), _unicode)) -3898 self.assertTrue(tounicode(b) == '<b/>Foo' or -3899 tounicode(b) == '<b />Foo') -
3900 -
3901 - def test_tounicode_pretty(self): -
3902 tounicode = self.etree.tounicode -3903 Element = self.etree.Element -3904 SubElement = self.etree.SubElement -3905 -3906 a = Element('a') -3907 b = SubElement(a, 'b') -3908 c = SubElement(a, 'c') -3909 -3910 result = tounicode(a) -3911 self.assertEqual(result, "<a><b/><c/></a>") -3912 -3913 result = tounicode(a, pretty_print=False) -3914 self.assertEqual(result, "<a><b/><c/></a>") -3915 -3916 result = tounicode(a, pretty_print=True) -3917 self.assertEqual(result, "<a>\n <b/>\n <c/>\n</a>\n") -
3918 -
3919 - def test_tostring_unicode(self): -
3920 tostring = self.etree.tostring -3921 Element = self.etree.Element -3922 SubElement = self.etree.SubElement -3923 -3924 a = Element('a') -3925 b = SubElement(a, 'b') -3926 c = SubElement(a, 'c') -3927 -3928 self.assertTrue(isinstance(tostring(a, encoding=_unicode), _unicode)) -3929 self.assertEqual(_bytes('<a><b></b><c></c></a>'), -3930 canonicalize(tostring(a, encoding=_unicode))) -
3931 -
3933 tostring = self.etree.tostring -3934 Element = self.etree.Element -3935 SubElement = self.etree.SubElement -3936 -3937 a = Element('a') -3938 b = SubElement(a, 'b') -3939 c = SubElement(a, 'c') -3940 d = SubElement(c, 'd') -3941 self.assertTrue(isinstance(tostring(b, encoding=_unicode), _unicode)) -3942 self.assertTrue(isinstance(tostring(c, encoding=_unicode), _unicode)) -3943 self.assertEqual(_bytes('<b></b>'), -3944 canonicalize(tostring(b, encoding=_unicode))) -3945 self.assertEqual(_bytes('<c><d></d></c>'), -3946 canonicalize(tostring(c, encoding=_unicode))) -
3947 -
3948 - def test_tostring_unicode_none(self): -
3949 tostring = self.etree.tostring -3950 self.assertRaises(TypeError, self.etree.tostring, -3951 None, encoding=_unicode) -
3952 -
3954 tostring = self.etree.tostring -3955 Element = self.etree.Element -3956 SubElement = self.etree.SubElement -3957 -3958 a = Element('a') -3959 b = SubElement(a, 'b') -3960 c = SubElement(a, 'c') -3961 d = SubElement(c, 'd') -3962 b.tail = 'Foo' -3963 -3964 self.assertTrue(isinstance(tostring(b, encoding=_unicode), _unicode)) -3965 self.assertTrue(tostring(b, encoding=_unicode) == '<b/>Foo' or -3966 tostring(b, encoding=_unicode) == '<b />Foo') -
3967 -
3969 tostring = self.etree.tostring -3970 Element = self.etree.Element -3971 SubElement = self.etree.SubElement -3972 -3973 a = Element('a') -3974 b = SubElement(a, 'b') -3975 c = SubElement(a, 'c') -3976 -3977 result = tostring(a, encoding=_unicode) -3978 self.assertEqual(result, "<a><b/><c/></a>") -3979 -3980 result = tostring(a, encoding=_unicode, pretty_print=False) -3981 self.assertEqual(result, "<a><b/><c/></a>") -3982 -3983 result = tostring(a, encoding=_unicode, pretty_print=True) -3984 self.assertEqual(result, "<a>\n <b/>\n <c/>\n</a>\n") -
3985 -
3986 - def test_pypy_proxy_collect(self): -
3987 root = etree.Element('parent') -3988 etree.SubElement(root, 'child') -3989 -3990 self.assertEqual(len(root), 1) -3991 self.assertEqual(root[0].tag, 'child') -3992 -3993 # in PyPy, GC used to kill the Python proxy instance without cleanup -3994 gc.collect() -3995 self.assertEqual(len(root), 1) -3996 self.assertEqual(root[0].tag, 'child') -
3997 -
3998 - def test_element_refcycle(self): -
3999 class SubEl(etree.ElementBase): -4000 pass -
4001 -4002 el1 = SubEl() -4003 el2 = SubEl() -4004 self.assertEqual('SubEl', el1.tag) -4005 self.assertEqual('SubEl', el2.tag) -4006 el1.other = el2 -4007 el2.other = el1 -4008 -4009 del el1, el2 -4010 gc.collect() -4011 # not really testing anything here, but it shouldn't crash -4012 -
4013 - def test_proxy_collect_siblings(self): -
4014 root = etree.Element('parent') -4015 c1 = etree.SubElement(root, 'child1') -4016 c2 = etree.SubElement(root, 'child2') -4017 -4018 root.remove(c1) -4019 root.remove(c2) -4020 c1.addnext(c2) -4021 del c1 -4022 # trigger deallocation attempt of c1 -4023 c2.getprevious() -4024 # make sure it wasn't deallocated -4025 self.assertEqual('child1', c2.getprevious().tag) -
4026 -
4028 root = etree.Element('parent') -4029 c1 = etree.SubElement(root, 'child1') -4030 c2 = etree.SubElement(root, 'child2') -4031 -4032 root.remove(c1) -4033 root.remove(c2) -4034 c1.addnext(c2) -4035 c1.tail = 'abc' -4036 c2.tail = 'xyz' -4037 del c1 -4038 # trigger deallocation attempt of c1 -4039 c2.getprevious() -4040 # make sure it wasn't deallocated -4041 self.assertEqual('child1', c2.getprevious().tag) -4042 self.assertEqual('abc', c2.getprevious().tail) -
4043 -4044 # helper methods -4045 -
4046 - def _writeElement(self, element, encoding='us-ascii', compression=0): -
4047 """Write out element for comparison. -4048 """ -4049 ElementTree = self.etree.ElementTree -4050 f = BytesIO() -4051 tree = ElementTree(element=element) -4052 tree.write(f, encoding=encoding, compression=compression) -4053 data = f.getvalue() -4054 if compression: -4055 data = zlib.decompress(data) -4056 return canonicalize(data) -
4057 -
4058 -4059 -class _XIncludeTestCase(HelperTestCase): -
4060 - def test_xinclude_text(self): -
4061 filename = fileInTestDir('test_broken.xml') -4062 root = etree.XML(_bytes('''\ -4063 <doc xmlns:xi="http://www.w3.org/2001/XInclude"> -4064 <xi:include href="%s" parse="text"/> -4065 </doc> -4066 ''' % path2url(filename))) -4067 old_text = root.text -4068 content = read_file(filename) -4069 old_tail = root[0].tail -4070 -4071 self.include( etree.ElementTree(root) ) -4072 self.assertEqual(old_text + content + old_tail, -4073 root.text) -
4074 -
4075 - def test_xinclude(self): -
4076 tree = etree.parse(fileInTestDir('include/test_xinclude.xml')) -4077 self.assertNotEqual( -4078 'a', -4079 tree.getroot()[1].tag) -4080 # process xincludes -4081 self.include( tree ) -4082 # check whether we find it replaced with included data -4083 self.assertEqual( -4084 'a', -4085 tree.getroot()[1].tag) -
4086 -
4087 - def test_xinclude_resolver(self): -
4088 class res(etree.Resolver): -4089 include_text = read_file(fileInTestDir('test.xml')) -4090 called = {} -4091 def resolve(self, url, id, context): -4092 if url.endswith(".dtd"): -4093 self.called["dtd"] = True -4094 return self.resolve_filename( -4095 fileInTestDir('test.dtd'), context) -4096 elif url.endswith("test_xinclude.xml"): -4097 self.called["input"] = True -4098 return None # delegate to default resolver -4099 else: -4100 self.called["include"] = True -4101 return self.resolve_string(self.include_text, context) -
4102 -4103 res_instance = res() -4104 parser = etree.XMLParser(load_dtd = True) -4105 parser.resolvers.add(res_instance) -4106 -4107 tree = etree.parse(fileInTestDir('include/test_xinclude.xml'), -4108 parser = parser) -4109 -4110 self.include(tree) -4111 -4112 called = list(res_instance.called.items()) -4113 called.sort() -4114 self.assertEqual( -4115 [("dtd", True), ("include", True), ("input", True)], -4116 called) -4117 -
4119 data = textwrap.dedent(''' -4120 <doc xmlns:xi="http://www.w3.org/2001/XInclude"> -4121 <foo/> -4122 <xi:include href="./test.xml" /> -4123 </doc> -4124 ''') -4125 -4126 class Resolver(etree.Resolver): -4127 called = {} -4128 -4129 def resolve(self, url, id, context): -4130 if url.endswith("test_xinclude.xml"): -4131 assert not self.called.get("input") -4132 self.called["input"] = True -4133 return None # delegate to default resolver -4134 elif url.endswith('/test5.xml'): -4135 assert not self.called.get("DONE") -4136 self.called["DONE"] = True -4137 return self.resolve_string('<DONE/>', context) -4138 else: -4139 _, filename = url.rsplit('/', 1) -4140 assert not self.called.get(filename) -4141 self.called[filename] = True -4142 next_data = data.replace( -4143 'test.xml', 'test%d.xml' % len(self.called)) -4144 return self.resolve_string(next_data, context) -
4145 -4146 res_instance = Resolver() -4147 parser = etree.XMLParser(load_dtd=True) -4148 parser.resolvers.add(res_instance) -4149 -4150 tree = etree.parse(fileInTestDir('include/test_xinclude.xml'), -4151 parser=parser) -4152 -4153 self.include(tree) -4154 -4155 called = list(res_instance.called.items()) -4156 called.sort() -4157 self.assertEqual( -4158 [("DONE", True), ("input", True), ("test.xml", True), -4159 ("test2.xml", True), ("test3.xml", True), ("test4.xml", True)], -4160 called) -4161 -
4162 -4163 -class ETreeXIncludeTestCase(_XIncludeTestCase): -
4164 - def include(self, tree): -
4165 tree.xinclude() -
4166 -
4167 -4168 -class ElementIncludeTestCase(_XIncludeTestCase): -
4169 from lxml import ElementInclude -
4170 - def include(self, tree): -
4171 self.ElementInclude.include(tree.getroot()) -
4172 -
4173 -4174 -class ETreeC14NTestCase(HelperTestCase): -
4175 - def test_c14n(self): -
4176 tree = self.parse(_bytes('<a><b/></a>')) -4177 f = BytesIO() -4178 tree.write_c14n(f) -4179 s = f.getvalue() -4180 self.assertEqual(_bytes('<a><b></b></a>'), -4181 s) -
4182 -
4183 - def test_c14n_gzip(self): -
4184 tree = self.parse(_bytes('<a>'+'<b/>'*200+'</a>')) -4185 f = BytesIO() -4186 tree.write_c14n(f, compression=9) -4187 with closing(gzip.GzipFile(fileobj=BytesIO(f.getvalue()))) as gzfile: -4188 s = gzfile.read() -4189 self.assertEqual(_bytes('<a>'+'<b></b>'*200+'</a>'), -4190 s) -
4191 -
4192 - def test_c14n_file(self): -
4193 tree = self.parse(_bytes('<a><b/></a>')) -4194 with tmpfile() as filename: -4195 tree.write_c14n(filename) -4196 data = read_file(filename, 'rb') -4197 self.assertEqual(_bytes('<a><b></b></a>'), -4198 data) -
4199 -
4200 - def test_c14n_file_gzip(self): -
4201 tree = self.parse(_bytes('<a>'+'<b/>'*200+'</a>')) -4202 with tmpfile() as filename: -4203 tree.write_c14n(filename, compression=9) -4204 with closing(gzip.open(filename, 'rb')) as f: -4205 data = f.read() -4206 self.assertEqual(_bytes('<a>'+'<b></b>'*200+'</a>'), -4207 data) -
4208 -
4209 - def test_c14n_with_comments(self): -
4210 tree = self.parse(_bytes('<!--hi--><a><!--ho--><b/></a><!--hu-->')) -4211 f = BytesIO() -4212 tree.write_c14n(f) -4213 s = f.getvalue() -4214 self.assertEqual(_bytes('<!--hi-->\n<a><!--ho--><b></b></a>\n<!--hu-->'), -4215 s) -4216 f = BytesIO() -4217 tree.write_c14n(f, with_comments=True) -4218 s = f.getvalue() -4219 self.assertEqual(_bytes('<!--hi-->\n<a><!--ho--><b></b></a>\n<!--hu-->'), -4220 s) -4221 f = BytesIO() -4222 tree.write_c14n(f, with_comments=False) -4223 s = f.getvalue() -4224 self.assertEqual(_bytes('<a><b></b></a>'), -4225 s) -
4226 -
4228 tree = self.parse(_bytes('<!--hi--><a><!--ho--><b/></a><!--hu-->')) -4229 s = etree.tostring(tree, method='c14n') -4230 self.assertEqual(_bytes('<!--hi-->\n<a><!--ho--><b></b></a>\n<!--hu-->'), -4231 s) -4232 s = etree.tostring(tree, method='c14n', with_comments=True) -4233 self.assertEqual(_bytes('<!--hi-->\n<a><!--ho--><b></b></a>\n<!--hu-->'), -4234 s) -4235 s = etree.tostring(tree, method='c14n', with_comments=False) -4236 self.assertEqual(_bytes('<a><b></b></a>'), -4237 s) -
4238 -
4240 tree = self.parse(_bytes('<!--hi--><a><!--ho--><b/></a><!--hu-->')) -4241 s = etree.tostring(tree.getroot(), method='c14n') -4242 self.assertEqual(_bytes('<a><!--ho--><b></b></a>'), -4243 s) -4244 s = etree.tostring(tree.getroot(), method='c14n', with_comments=True) -4245 self.assertEqual(_bytes('<a><!--ho--><b></b></a>'), -4246 s) -4247 s = etree.tostring(tree.getroot(), method='c14n', with_comments=False) -4248 self.assertEqual(_bytes('<a><b></b></a>'), -4249 s) -
4250 -
4251 - def test_c14n_exclusive(self): -
4252 tree = self.parse(_bytes( -4253 '<a xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b/></a>')) -4254 f = BytesIO() -4255 tree.write_c14n(f) -4256 s = f.getvalue() -4257 self.assertEqual(_bytes('<a xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b></z:b></a>'), -4258 s) -4259 f = BytesIO() -4260 tree.write_c14n(f, exclusive=False) -4261 s = f.getvalue() -4262 self.assertEqual(_bytes('<a xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b></z:b></a>'), -4263 s) -4264 f = BytesIO() -4265 tree.write_c14n(f, exclusive=True) -4266 s = f.getvalue() -4267 self.assertEqual(_bytes('<a xmlns="http://abc"><z:b xmlns:z="http://cde"></z:b></a>'), -4268 s) -4269 -4270 f = BytesIO() -4271 tree.write_c14n(f, exclusive=True, inclusive_ns_prefixes=['z']) -4272 s = f.getvalue() -4273 self.assertEqual(_bytes('<a xmlns="http://abc" xmlns:z="http://cde"><z:b></z:b></a>'), -4274 s) -
4275 -
4277 tree = self.parse(_bytes( -4278 '<a xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b/></a>')) -4279 s = etree.tostring(tree, method='c14n') -4280 self.assertEqual(_bytes('<a xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b></z:b></a>'), -4281 s) -4282 s = etree.tostring(tree, method='c14n', exclusive=False) -4283 self.assertEqual(_bytes('<a xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b></z:b></a>'), -4284 s) -4285 s = etree.tostring(tree, method='c14n', exclusive=True) -4286 self.assertEqual(_bytes('<a xmlns="http://abc"><z:b xmlns:z="http://cde"></z:b></a>'), -4287 s) -4288 -4289 s = etree.tostring(tree, method='c14n', exclusive=True, inclusive_ns_prefixes=['y']) -4290 self.assertEqual(_bytes('<a xmlns="http://abc" xmlns:y="http://bcd"><z:b xmlns:z="http://cde"></z:b></a>'), -4291 s) -
4292 -
4294 tree = self.parse(_bytes( -4295 '<a xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b/></a>')) -4296 s = etree.tostring(tree.getroot(), method='c14n') -4297 self.assertEqual(_bytes('<a xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b></z:b></a>'), -4298 s) -4299 s = etree.tostring(tree.getroot(), method='c14n', exclusive=False) -4300 self.assertEqual(_bytes('<a xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b></z:b></a>'), -4301 s) -4302 s = etree.tostring(tree.getroot(), method='c14n', exclusive=True) -4303 self.assertEqual(_bytes('<a xmlns="http://abc"><z:b xmlns:z="http://cde"></z:b></a>'), -4304 s) -4305 -4306 s = etree.tostring(tree.getroot()[0], method='c14n', exclusive=False) -4307 self.assertEqual(_bytes('<z:b xmlns="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"></z:b>'), -4308 s) -4309 s = etree.tostring(tree.getroot()[0], method='c14n', exclusive=True) -4310 self.assertEqual(_bytes('<z:b xmlns:z="http://cde"></z:b>'), -4311 s) -4312 -4313 s = etree.tostring(tree.getroot()[0], method='c14n', exclusive=True, inclusive_ns_prefixes=['y']) -4314 self.assertEqual(_bytes('<z:b xmlns:y="http://bcd" xmlns:z="http://cde"></z:b>'), -4315 s) -
4316 -
4318 """ Regression test to fix memory allocation issues (use 3+ inclusive NS spaces)""" -4319 tree = self.parse(_bytes( -4320 '<a xmlns:x="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b/></a>')) -4321 -4322 s = etree.tostring(tree, method='c14n', exclusive=True, inclusive_ns_prefixes=['x', 'y', 'z']) -4323 self.assertEqual(_bytes('<a xmlns:x="http://abc" xmlns:y="http://bcd" xmlns:z="http://cde"><z:b></z:b></a>'), -4324 s) -
4325 -
4326 -4327 -class ETreeWriteTestCase(HelperTestCase): -
4328 - def test_write(self): -
4329 tree = self.parse(_bytes('<a><b/></a>')) -4330 f = BytesIO() -4331 tree.write(f) -4332 s = f.getvalue() -4333 self.assertEqual(_bytes('<a><b/></a>'), -4334 s) -
4335 -
4336 - def test_write_doctype(self): -
4337 tree = self.parse(_bytes('<a><b/></a>')) -4338 f = BytesIO() -4339 tree.write(f, doctype='HUHU') -4340 s = f.getvalue() -4341 self.assertEqual(_bytes('HUHU\n<a><b/></a>'), -4342 s) -
4343 -
4344 - def test_write_gzip(self): -
4345 tree = self.parse(_bytes('<a>'+'<b/>'*200+'</a>')) -4346 f = BytesIO() -4347 tree.write(f, compression=9) -4348 with closing(gzip.GzipFile(fileobj=BytesIO(f.getvalue()))) as gzfile: -4349 s = gzfile.read() -4350 self.assertEqual(_bytes('<a>'+'<b/>'*200+'</a>'), -4351 s) -
4352 -
4353 - def test_write_gzip_doctype(self): -
4354 tree = self.parse(_bytes('<a>'+'<b/>'*200+'</a>')) -4355 f = BytesIO() -4356 tree.write(f, compression=9, doctype='<!DOCTYPE a>') -4357 with closing(gzip.GzipFile(fileobj=BytesIO(f.getvalue()))) as gzfile: -4358 s = gzfile.read() -4359 self.assertEqual(_bytes('<!DOCTYPE a>\n<a>'+'<b/>'*200+'</a>'), -4360 s) -
4361 -
4362 - def test_write_gzip_level(self): -
4363 tree = self.parse(_bytes('<a>'+'<b/>'*200+'</a>')) -4364 f = BytesIO() -4365 tree.write(f, compression=0) -4366 s0 = f.getvalue() -4367 -4368 f = BytesIO() -4369 tree.write(f) -4370 self.assertEqual(f.getvalue(), s0) -4371 -4372 f = BytesIO() -4373 tree.write(f, compression=1) -4374 s = f.getvalue() -4375 self.assertTrue(len(s) <= len(s0)) -4376 with closing(gzip.GzipFile(fileobj=BytesIO(s))) as gzfile: -4377 s1 = gzfile.read() -4378 -4379 f = BytesIO() -4380 tree.write(f, compression=9) -4381 s = f.getvalue() -4382 self.assertTrue(len(s) <= len(s0)) -4383 with closing(gzip.GzipFile(fileobj=BytesIO(s))) as gzfile: -4384 s9 = gzfile.read() -4385 -4386 self.assertEqual(_bytes('<a>'+'<b/>'*200+'</a>'), -4387 s0) -4388 self.assertEqual(_bytes('<a>'+'<b/>'*200+'</a>'), -4389 s1) -4390 self.assertEqual(_bytes('<a>'+'<b/>'*200+'</a>'), -4391 s9) -
4392 -
4393 - def test_write_file(self): -
4394 tree = self.parse(_bytes('<a><b/></a>')) -4395 with tmpfile() as filename: -4396 tree.write(filename) -4397 data = read_file(filename, 'rb') -4398 self.assertEqual(_bytes('<a><b/></a>'), -4399 data) -
4400 -
4401 - def test_write_file_gzip(self): -
4402 tree = self.parse(_bytes('<a>'+'<b/>'*200+'</a>')) -4403 with tmpfile() as filename: -4404 tree.write(filename, compression=9) -4405 with closing(gzip.open(filename, 'rb')) as f: -4406 data = f.read() -4407 self.assertEqual(_bytes('<a>'+'<b/>'*200+'</a>'), -4408 data) -
4409 -
4410 - def test_write_file_gzip_parse(self): -
4411 tree = self.parse(_bytes('<a>'+'<b/>'*200+'</a>')) -4412 with tmpfile() as filename: -4413 tree.write(filename, compression=9) -4414 data = etree.tostring(etree.parse(filename)) -4415 self.assertEqual(_bytes('<a>'+'<b/>'*200+'</a>'), -4416 data) -
4417 -
4419 tree = self.parse(_bytes('<a>'+'<b/>'*200+'</a>')) -4420 with tmpfile() as filename: -4421 tree.write(filename, compression=9) -4422 with closing(gzip.GzipFile(filename)) as f: -4423 data = etree.tostring(etree.parse(f)) -4424 self.assertEqual(_bytes('<a>'+'<b/>'*200+'</a>'), -4425 data) -
4426 -
4427 -4428 -class ETreeErrorLogTest(HelperTestCase): -
4429 etree = etree -4430 -
4431 - def test_parse_error_logging(self): -
4432 parse = self.etree.parse -4433 f = BytesIO('<a><b></c></b></a>') -4434 self.etree.clear_error_log() -4435 try: -4436 parse(f) -4437 logs = None -4438 except SyntaxError: -4439 e = sys.exc_info()[1] -4440 logs = e.error_log -4441 f.close() -4442 self.assertTrue([ log for log in logs -4443 if 'mismatch' in log.message ]) -4444 self.assertTrue([ log for log in logs -4445 if 'PARSER' in log.domain_name]) -4446 self.assertTrue([ log for log in logs -4447 if 'ERR_TAG_NAME_MISMATCH' in log.type_name ]) -4448 self.assertTrue([ log for log in logs -4449 if 1 == log.line ]) -4450 self.assertTrue([ log for log in logs -4451 if 15 == log.column ]) -
4452 -
4453 - def _test_python_error_logging(self): -
4454 """This can't really be tested as long as there isn't a way to -4455 reset the logging setup ... -4456 """ -4457 parse = self.etree.parse -4458 -4459 messages = [] -4460 class Logger(self.etree.PyErrorLog): -4461 def log(self, entry, message, *args): -4462 messages.append(message) -
4463 -4464 self.etree.use_global_python_log(Logger()) -4465 f = BytesIO('<a><b></c></b></a>') -4466 try: -4467 parse(f) -4468 except SyntaxError: -4469 pass -4470 f.close() -4471 -4472 self.assertTrue([ message for message in messages -4473 if 'mismatch' in message ]) -4474 self.assertTrue([ message for message in messages -4475 if ':PARSER:' in message]) -4476 self.assertTrue([ message for message in messages -4477 if ':ERR_TAG_NAME_MISMATCH:' in message ]) -4478 self.assertTrue([ message for message in messages -4479 if ':1:15:' in message ]) -4480 -
4481 -4482 -class XMLPullParserTest(unittest.TestCase): -
4483 etree = etree -4484 -
4485 - def assert_event_tags(self, events, expected): -
4486 self.assertEqual([(action, elem.tag) for action, elem in events], -4487 expected) -
4488 -
4490 class Target(object): -4491 def start(self, tag, attrib): -4492 return 'start(%s)' % tag -
4493 def end(self, tag): -4494 return 'end(%s)' % tag -
4495 def close(self): -4496 return 'close()' -4497 -4498 parser = self.etree.XMLPullParser(target=Target()) -4499 events = parser.read_events() -4500 -4501 parser.feed('<root><element>') -4502 self.assertFalse(list(events)) -4503 self.assertFalse(list(events)) -4504 parser.feed('</element><child>') -4505 self.assertEqual([('end', 'end(element)')], list(events)) -4506 parser.feed('</child>') -4507 self.assertEqual([('end', 'end(child)')], list(events)) -4508 parser.feed('</root>') -4509 self.assertEqual([('end', 'end(root)')], list(events)) -4510 self.assertFalse(list(events)) -4511 self.assertEqual('close()', parser.close()) -4512 -
4514 class Target(object): -4515 def start(self, tag, attrib): -4516 return 'start(%s)' % tag -
4517 def end(self, tag): -4518 return 'end(%s)' % tag -4519 def close(self): -4520 return 'close()' -4521 -4522 parser = self.etree.XMLPullParser( -4523 ['start', 'end'], target=Target()) -4524 events = parser.read_events() -4525 -4526 parser.feed('<root><element>') -4527 self.assertEqual( -4528 [('start', 'start(root)'), ('start', 'start(element)')], -4529 list(events)) -4530 self.assertFalse(list(events)) -4531 parser.feed('</element><child>') -4532 self.assertEqual( -4533 [('end', 'end(element)'), ('start', 'start(child)')], -4534 list(events)) -4535 parser.feed('</child>') -4536 self.assertEqual( -4537 [('end', 'end(child)')], -4538 list(events)) -4539 parser.feed('</root>') -4540 self.assertEqual( -4541 [('end', 'end(root)')], -4542 list(events)) -4543 self.assertFalse(list(events)) -4544 self.assertEqual('close()', parser.close()) -4545 -
4546 - def test_pull_from_tree_builder(self): -
4547 parser = self.etree.XMLPullParser( -4548 ['start', 'end'], target=etree.TreeBuilder()) -4549 events = parser.read_events() -4550 -4551 parser.feed('<root><element>') -4552 self.assert_event_tags( -4553 events, [('start', 'root'), ('start', 'element')]) -4554 self.assertFalse(list(events)) -4555 parser.feed('</element><child>') -4556 self.assert_event_tags( -4557 events, [('end', 'element'), ('start', 'child')]) -4558 parser.feed('</child>') -4559 self.assert_event_tags( -4560 events, [('end', 'child')]) -4561 parser.feed('</root>') -4562 self.assert_event_tags( -4563 events, [('end', 'root')]) -4564 self.assertFalse(list(events)) -4565 root = parser.close() -4566 self.assertEqual('root', root.tag) -
4567 -
4569 class Target(etree.TreeBuilder): -4570 def end(self, tag): -4571 el = super(Target, self).end(tag) -4572 el.tag += '-huhu' -4573 return el -
4574 -4575 parser = self.etree.XMLPullParser( -4576 ['start', 'end'], target=Target()) -4577 events = parser.read_events() -4578 -4579 parser.feed('<root><element>') -4580 self.assert_event_tags( -4581 events, [('start', 'root'), ('start', 'element')]) -4582 self.assertFalse(list(events)) -4583 parser.feed('</element><child>') -4584 self.assert_event_tags( -4585 events, [('end', 'element-huhu'), ('start', 'child')]) -4586 parser.feed('</child>') -4587 self.assert_event_tags( -4588 events, [('end', 'child-huhu')]) -4589 parser.feed('</root>') -4590 self.assert_event_tags( -4591 events, [('end', 'root-huhu')]) -4592 self.assertFalse(list(events)) -4593 root = parser.close() -4594 self.assertEqual('root-huhu', root.tag) -4595 -
4596 -4597 -def test_suite(): -
4598 suite = unittest.TestSuite() -4599 suite.addTests([unittest.makeSuite(ETreeOnlyTestCase)]) -4600 suite.addTests([unittest.makeSuite(ETreeXIncludeTestCase)]) -4601 suite.addTests([unittest.makeSuite(ElementIncludeTestCase)]) -4602 suite.addTests([unittest.makeSuite(ETreeC14NTestCase)]) -4603 suite.addTests([unittest.makeSuite(ETreeWriteTestCase)]) -4604 suite.addTests([unittest.makeSuite(ETreeErrorLogTest)]) -4605 suite.addTests([unittest.makeSuite(XMLPullParserTest)]) -4606 -4607 # add original doctests from ElementTree selftest modules -4608 from . import selftest, selftest2 -4609 suite.addTests(doctest.DocTestSuite(selftest)) -4610 suite.addTests(doctest.DocTestSuite(selftest2)) -4611 -4612 # add doctests -4613 suite.addTests(doctest.DocTestSuite(etree)) -4614 suite.addTests( -4615 [make_doctest('../../../doc/tutorial.txt')]) -4616 if sys.version_info >= (2,6): -4617 # now requires the 'with' statement -4618 suite.addTests( -4619 [make_doctest('../../../doc/api.txt')]) -4620 suite.addTests( -4621 [make_doctest('../../../doc/FAQ.txt')]) -4622 suite.addTests( -4623 [make_doctest('../../../doc/parsing.txt')]) -4624 suite.addTests( -4625 [make_doctest('../../../doc/resolvers.txt')]) -4626 return suite -
4627 -4628 -4629 if __name__ == '__main__': -4630 print('to test use test.py %s' % __file__) -4631 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree.ETreeC14NTestCase-class.html b/doc/html/api/lxml.tests.test_etree.ETreeC14NTestCase-class.html deleted file mode 100644 index 72389875..00000000 --- a/doc/html/api/lxml.tests.test_etree.ETreeC14NTestCase-class.html +++ /dev/null @@ -1,522 +0,0 @@ - - - - - lxml.tests.test_etree.ETreeC14NTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree :: - Class ETreeC14NTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeC14NTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeC14NTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_c14n(self) - source code - -
- -
-   - - - - - - -
test_c14n_gzip(self) - source code - -
- -
-   - - - - - - -
test_c14n_file(self) - source code - -
- -
-   - - - - - - -
test_c14n_file_gzip(self) - source code - -
- -
-   - - - - - - -
test_c14n_with_comments(self) - source code - -
- -
-   - - - - - - -
test_c14n_tostring_with_comments(self) - source code - -
- -
-   - - - - - - -
test_c14n_element_tostring_with_comments(self) - source code - -
- -
-   - - - - - - -
test_c14n_exclusive(self) - source code - -
- -
-   - - - - - - -
test_c14n_tostring_exclusive(self) - source code - -
- -
-   - - - - - - -
test_c14n_element_tostring_exclusive(self) - source code - -
- -
-   - - - - - - -
test_c14n_tostring_inclusive_ns_prefixes(self)
- Regression test to fix memory allocation issues (use 3+ inclusive NS spaces)
- source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree.ETreeErrorLogTest-class.html b/doc/html/api/lxml.tests.test_etree.ETreeErrorLogTest-class.html deleted file mode 100644 index 8b0f0239..00000000 --- a/doc/html/api/lxml.tests.test_etree.ETreeErrorLogTest-class.html +++ /dev/null @@ -1,421 +0,0 @@ - - - - - lxml.tests.test_etree.ETreeErrorLogTest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree :: - Class ETreeErrorLogTest - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeErrorLogTest

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeErrorLogTest
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_parse_error_logging(self) - source code - -
- -
-   - - - - - - -
_test_python_error_logging(self)
- This can't really be tested as long as there isn't a way to -reset the logging setup ...
- source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree.ETreeOnlyTestCase-class.html b/doc/html/api/lxml.tests.test_etree.ETreeOnlyTestCase-class.html deleted file mode 100644 index 83a43f32..00000000 --- a/doc/html/api/lxml.tests.test_etree.ETreeOnlyTestCase-class.html +++ /dev/null @@ -1,4619 +0,0 @@ - - - - - lxml.tests.test_etree.ETreeOnlyTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree :: - Class ETreeOnlyTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeOnlyTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeOnlyTestCase
-
- -
-Tests only for etree, not ElementTree - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_version(self) - source code - -
- -
-   - - - - - - -
test_c_api(self) - source code - -
- -
-   - - - - - - -
test_include_paths(self) - source code - -
- -
-   - - - - - - -
test_element_names(self) - source code - -
- -
-   - - - - - - -
test_element_name_empty(self) - source code - -
- -
-   - - - - - - -
test_element_name_colon(self) - source code - -
- -
-   - - - - - - -
test_element_name_quote(self) - source code - -
- -
-   - - - - - - -
test_element_name_space(self) - source code - -
- -
-   - - - - - - -
test_subelement_name_empty(self) - source code - -
- -
-   - - - - - - -
test_subelement_name_colon(self) - source code - -
- -
-   - - - - - - -
test_subelement_name_quote(self) - source code - -
- -
-   - - - - - - -
test_subelement_name_space(self) - source code - -
- -
-   - - - - - - -
test_subelement_attribute_invalid(self) - source code - -
- -
-   - - - - - - -
test_qname_empty(self) - source code - -
- -
-   - - - - - - -
test_qname_none(self) - source code - -
- -
-   - - - - - - -
test_qname_colon(self) - source code - -
- -
-   - - - - - - -
test_qname_space(self) - source code - -
- -
-   - - - - - - -
test_qname_namespace_localname(self) - source code - -
- -
-   - - - - - - -
test_qname_element(self) - source code - -
- -
-   - - - - - - -
test_qname_text_resolve(self) - source code - -
- -
-   - - - - - - -
test_nsmap_prefix_invalid(self) - source code - -
- -
-   - - - - - - -
test_attribute_has_key(self) - source code - -
- -
-   - - - - - - -
test_attribute_set(self) - source code - -
- -
-   - - - - - - -
test_attribute_set_nonstring(self) - source code - -
- -
-   - - - - - - -
test_attrib_and_keywords(self) - source code - -
- -
-   - - - - - - -
test_attrib_order(self) - source code - -
- -
-   - - - - - - -
test_attribute_set_invalid(self) - source code - -
- -
-   - - - - - - -
test_strip_attributes(self) - source code - -
- -
-   - - - - - - -
test_strip_attributes_ns(self) - source code - -
- -
-   - - - - - - -
test_strip_elements(self) - source code - -
- -
-   - - - - - - -
test_strip_elements_ns(self) - source code - -
- -
-   - - - - - - -
test_strip_tags(self) - source code - -
- -
-   - - - - - - -
test_strip_tags_pi_comment(self) - source code - -
- -
-   - - - - - - -
test_strip_tags_pi_comment_all(self) - source code - -
- -
-   - - - - - - -
test_strip_tags_doc_style(self) - source code - -
- -
-   - - - - - - -
test_strip_tags_ns(self) - source code - -
- -
-   - - - - - - -
test_strip_tags_and_remove(self) - source code - -
- -
-   - - - - - - -
test_pi(self) - source code - -
- -
-   - - - - - - -
test_pi_parse(self) - source code - -
- -
-   - - - - - - -
test_pi_pseudo_attributes_get(self) - source code - -
- -
-   - - - - - - -
test_pi_pseudo_attributes_attrib(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_pi(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_elementtree_pi(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_elementtree_dtd(self) - source code - -
- -
-   - - - - - - -
test_deepcopy_pi_dtd(self) - source code - -
- -
-   - - - - - - -
test_parse_remove_comments(self) - source code - -
- -
-   - - - - - - -
test_parse_remove_pis(self) - source code - -
- -
-   - - - - - - -
test_parse_parser_type_error(self) - source code - -
- -
-   - - - - - - -
test_iterparse_tree_comments(self) - source code - -
- -
-   - - - - - - -
test_iterparse_comments(self) - source code - -
- -
-   - - - - - - -
test_iterparse_pis(self) - source code - -
- -
-   - - - - - - -
test_iterparse_remove_comments(self) - source code - -
- -
-   - - - - - - -
test_iterparse_broken(self) - source code - -
- -
-   - - - - - - -
test_iterparse_broken_recover(self) - source code - -
- -
-   - - - - - - -
test_iterparse_broken_multi_recover(self) - source code - -
- -
-   - - - - - - -
test_iterparse_strip(self) - source code - -
- -
-   - - - - - - -
test_iterparse_tag(self) - source code - -
- -
-   - - - - - - -
test_iterparse_tag_all(self) - source code - -
- -
-   - - - - - - -
test_iterparse_tag_ns(self) - source code - -
- -
-   - - - - - - -
test_iterparse_tag_ns_empty(self) - source code - -
- -
-   - - - - - - -
test_iterparse_tag_ns_all(self) - source code - -
- -
-   - - - - - - -
test_iterparse_tag_ns_empty_all(self) - source code - -
- -
-   - - - - - - -
test_iterparse_encoding_error(self) - source code - -
- -
-   - - - - - - -
test_iterparse_encoding_8bit_override(self) - source code - -
- -
-   - - - - - - -
test_iterparse_keep_cdata(self) - source code - -
- -
-   - - - - - - -
test_parser_encoding_unknown(self) - source code - -
- -
-   - - - - - - -
test_parser_encoding(self) - source code - -
- -
-   - - - - - - -
test_feed_parser_recover(self) - source code - -
- -
-   - - - - - - -
test_feed_parser_recover_no_id_dict(self) - source code - -
- -
-   - - - - - - -
test_elementtree_parser_target_type_error(self) - source code - -
- -
-   - - - - - - -
test_parser_target_feed_exception(self) - source code - -
- -
-   - - - - - - -
test_parser_target_fromstring_exception(self) - source code - -
- -
-   - - - - - - -
test_parser_target_feed_no_id_dict(self) - source code - -
- -
-   - - - - - - -
test_parser_target_comment(self) - source code - -
- -
-   - - - - - - -
test_parser_target_pi(self) - source code - -
- -
-   - - - - - - -
test_parser_target_cdata(self) - source code - -
- -
-   - - - - - - -
test_parser_target_recover(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_tag(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_tag_all(self) - source code - -
- -
-   - - - - - - -
test_iterwalk(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_start(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_start_end(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_start_tags(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_start_end_tags(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_start_end_tags_with_root(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_clear(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_attrib_ns(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_end_skip(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_start_end_skip(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_ns_skip(self) - source code - -
- -
-   - - - - - - -
test_iterwalk_getiterator(self) - source code - -
- -
-   - - - - - - -
test_resolve_string_dtd(self) - source code - -
- -
-   - - - - - - -
test_resolve_bytes_dtd(self) - source code - -
- -
-   - - - - - - -
test_resolve_filelike_dtd(self) - source code - -
- -
-   - - - - - - -
test_resolve_filename_dtd(self) - source code - -
- -
-   - - - - - - -
test_resolve_filename_dtd_relative(self) - source code - -
- -
-   - - - - - - -
test_resolve_file_dtd(self) - source code - -
- -
-   - - - - - - -
test_resolve_empty(self) - source code - -
- -
-   - - - - - - -
test_resolve_error(self) - source code - -
- -
-   - - - - - - -
test_entity_parse(self) - source code - -
- -
-   - - - - - - -
test_entity_restructure(self) - source code - -
- -
-   - - - - - - -
test_entity_append(self) - source code - -
- -
-   - - - - - - -
test_entity_values(self) - source code - -
- -
-   - - - - - - -
test_entity_error(self) - source code - -
- -
-   - - - - - - -
test_cdata(self) - source code - -
- -
-   - - - - - - -
test_cdata_tail(self) - source code - -
- -
-   - - - - - - -
test_cdata_type(self) - source code - -
- -
-   - - - - - - -
test_cdata_errors(self) - source code - -
- -
-   - - - - - - -
test_cdata_parser(self) - source code - -
- -
-   - - - - - - -
test_cdata_xpath(self) - source code - -
- -
-   - - - - - - -
test_setitem_assert(self) - source code - -
- -
-   - - - - - - -
test_append_error(self) - source code - -
- -
-   - - - - - - -
test_append_recursive_error(self) - source code - -
- -
-   - - - - - - -
test_addnext(self) - source code - -
- -
-   - - - - - - -
test_addprevious(self) - source code - -
- -
-   - - - - - - -
test_addnext_cycle(self) - source code - -
- -
-   - - - - - - -
test_addprevious_cycle(self) - source code - -
- -
-   - - - - - - -
test_addnext_cycle_long(self) - source code - -
- -
-   - - - - - - -
test_addprevious_cycle_long(self) - source code - -
- -
-   - - - - - - -
test_addprevious_noops(self) - source code - -
- -
-   - - - - - - -
test_addnext_noops(self) - source code - -
- -
-   - - - - - - -
test_addnext_root(self) - source code - -
- -
-   - - - - - - -
test_addprevious_pi(self) - source code - -
- -
-   - - - - - - -
test_addprevious_root_pi(self) - source code - -
- -
-   - - - - - - -
test_addnext_pi(self) - source code - -
- -
-   - - - - - - -
test_addnext_root_pi(self) - source code - -
- -
-   - - - - - - -
test_addnext_comment(self) - source code - -
- -
-   - - - - - - -
test_addnext_root_comment(self) - source code - -
- -
-   - - - - - - -
test_addprevious_comment(self) - source code - -
- -
-   - - - - - - -
test_addprevious_root_comment(self) - source code - -
- -
-   - - - - - - -
test_attribute_values(self) - source code - -
- -
-   - - - - - - -
test_comment_empty(self) - source code - -
- -
-   - - - - - - -
test_comment_parse_empty(self) - source code - -
- -
-   - - - - - - -
test_comment_no_proxy_yet(self) - source code - -
- -
-   - - - - - - -
test_comment_immutable(self) - source code - -
- -
-   - - - - - - -
test_comment_immutable_attrib(self) - source code - -
- -
-   - - - - - - -
test_dump_none(self) - source code - -
- -
-   - - - - - - -
test_prefix(self) - source code - -
- -
-   - - - - - - -
test_prefix_default_ns(self) - source code - -
- -
-   - - - - - - -
test_getparent(self) - source code - -
- -
-   - - - - - - -
test_iterchildren(self) - source code - -
- -
-   - - - - - - -
test_iterchildren_reversed(self) - source code - -
- -
-   - - - - - - -
test_iterchildren_tag(self) - source code - -
- -
-   - - - - - - -
test_iterchildren_tag_posarg(self) - source code - -
- -
-   - - - - - - -
test_iterchildren_tag_reversed(self) - source code - -
- -
-   - - - - - - -
test_iterchildren_tag_multiple(self) - source code - -
- -
-   - - - - - - -
test_iterchildren_tag_multiple_posarg(self) - source code - -
- -
-   - - - - - - -
test_iterchildren_tag_multiple_reversed(self) - source code - -
- -
-   - - - - - - -
test_iterancestors(self) - source code - -
- -
-   - - - - - - -
test_iterancestors_tag(self) - source code - -
- -
-   - - - - - - -
test_iterancestors_tag_multiple(self) - source code - -
- -
-   - - - - - - -
test_iterdescendants(self) - source code - -
- -
-   - - - - - - -
test_iterdescendants_tag(self) - source code - -
- -
-   - - - - - - -
test_iterdescendants_tag_multiple(self) - source code - -
- -
-   - - - - - - -
test_getroottree(self) - source code - -
- -
-   - - - - - - -
test_getnext(self) - source code - -
- -
-   - - - - - - -
test_getprevious(self) - source code - -
- -
-   - - - - - - -
test_itersiblings(self) - source code - -
- -
-   - - - - - - -
test_itersiblings_tag(self) - source code - -
- -
-   - - - - - - -
test_itersiblings_tag_multiple(self) - source code - -
- -
-   - - - - - - -
test_parseid(self) - source code - -
- -
-   - - - - - - -
test_XMLDTDID(self) - source code - -
- -
-   - - - - - - -
test_XMLDTDID_empty(self) - source code - -
- -
-   - - - - - - -
test_XMLDTDID_no_id_dict(self) - source code - -
- -
-   - - - - - - -
_checkIDDict(self, - dic, - expected) - source code - -
- -
-   - - - - - - -
test_namespaces(self) - source code - -
- -
-   - - - - - - -
test_namespaces_default(self) - source code - -
- -
-   - - - - - - -
test_namespaces_default_and_other(self) - source code - -
- -
-   - - - - - - -
test_namespaces_default_and_attr(self) - source code - -
- -
-   - - - - - - -
test_attribute_keeps_namespace_prefix_on_merge(self) - source code - -
- -
-   - - - - - - -
test_attribute_keeps_namespace_prefix_on_merge_with_nons(self) - source code - -
- -
-   - - - - - - -
test_attribute_gets_namespace_prefix_on_merge_with_nons(self) - source code - -
- -
-   - - - - - - -
test_attribute_gets_namespace_prefix_on_merge(self) - source code - -
- -
-   - - - - - - -
test_namespaces_elementtree(self) - source code - -
- -
-   - - - - - - -
test_namespaces_default_copy_element(self) - source code - -
- -
-   - - - - - - -
test_namespaces_copy_element(self) - source code - -
- -
-   - - - - - - -
test_namespaces_reuse_after_move(self) - source code - -
- -
-   - - - - - - -
test_namespace_cleanup(self) - source code - -
- -
-   - - - - - - -
test_namespace_cleanup_attributes(self) - source code - -
- -
-   - - - - - - -
test_namespace_cleanup_many(self) - source code - -
- -
-   - - - - - - -
test_namespace_cleanup_deep(self) - source code - -
- -
-   - - - - - - -
test_namespace_cleanup_deep_to_top(self) - source code - -
- -
-   - - - - - - -
test_namespace_cleanup_keep_prefixes(self) - source code - -
- -
-   - - - - - - -
test_namespace_cleanup_keep_prefixes_top(self) - source code - -
- -
-   - - - - - - -
test_element_nsmap(self) - source code - -
- -
-   - - - - - - -
test_subelement_nsmap(self) - source code - -
- -
-   - - - - - - -
test_html_prefix_nsmap(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_multiple(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_multiple_tuple(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_namespace(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_local_name(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_entities(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_element(self) - source code - -
- -
-   - - - - - - -
test_getiterator_filter_all_comment_pi(self) - source code - -
- -
-   - - - - - - -
test_elementtree_getelementpath(self) - source code - -
- -
-   - - - - - - -
test_elementtree_getelementpath_ns(self) - source code - -
- -
-   - - - - - - -
test_elementtree_find_qname(self) - source code - -
- -
-   - - - - - - -
test_elementtree_findall_qname(self) - source code - -
- -
-   - - - - - - -
test_elementtree_findall_ns_qname(self) - source code - -
- -
-   - - - - - - -
test_findall_ns(self) - source code - -
- -
-   - - - - - - -
test_findall_different_nsmaps(self) - source code - -
- -
-   - - - - - - -
test_findall_empty_prefix(self) - source code - -
- -
-   - - - - - - -
test_findall_syntax_error(self) - source code - -
- -
-   - - - - - - -
test_index(self) - source code - -
- -
-   - - - - - - -
test_replace(self) - source code - -
- -
-   - - - - - - -
test_replace_new(self) - source code - -
- -
-   - - - - - - -
test_setslice_all_empty_reversed(self) - source code - -
- -
-   - - - - - - -
test_setslice_step(self) - source code - -
- -
-   - - - - - - -
test_setslice_step_negative(self) - source code - -
- -
-   - - - - - - -
test_setslice_step_negative2(self) - source code - -
- -
-   - - - - - - -
test_setslice_step_overrun(self) - source code - -
- -
-   - - - - - - -
test_sourceline_XML(self) - source code - -
- -
-   - - - - - - -
test_large_sourceline_XML(self) - source code - -
- -
-   - - - - - - -
test_sourceline_parse(self) - source code - -
- -
-   - - - - - - -
test_sourceline_iterparse_end(self) - source code - -
- -
-   - - - - - - -
test_sourceline_iterparse_start(self) - source code - -
- -
-   - - - - - - -
test_sourceline_element(self) - source code - -
- -
-   - - - - - - -
test_XML_base_url_docinfo(self) - source code - -
- -
-   - - - - - - -
test_XML_set_base_url_docinfo(self) - source code - -
- -
-   - - - - - - -
test_parse_stringio_base_url(self) - source code - -
- -
-   - - - - - - -
test_parse_base_url_docinfo(self) - source code - -
- -
-   - - - - - - -
test_HTML_base_url_docinfo(self) - source code - -
- -
-   - - - - - - -
test_docinfo_public(self) - source code - -
- -
-   - - - - - - -
test_docinfo_system(self) - source code - -
- -
-   - - - - - - -
test_docinfo_empty(self) - source code - -
- -
-   - - - - - - -
test_docinfo_name_only(self) - source code - -
- -
-   - - - - - - -
test_doctype_name_only_roundtrip(self) - source code - -
- -
-   - - - - - - -
test_doctype_output_override(self) - source code - -
- -
-   - - - - - - -
test_xml_base(self) - source code - -
- -
-   - - - - - - -
test_xml_base_attribute(self) - source code - -
- -
-   - - - - - - -
test_html_base(self) - source code - -
- -
-   - - - - - - -
test_html_base_tag(self) - source code - -
- -
-   - - - - - - -
test_parse_fileobject_unicode(self) - source code - -
- -
-   - - - - - - -
test_dtd_io(self) - source code - -
- -
-   - - - - - - -
test_byte_zero(self) - source code - -
- -
-   - - - - - - -
test_unicode_byte_zero(self) - source code - -
- -
-   - - - - - - -
test_byte_invalid(self) - source code - -
- -
-   - - - - - - -
test_unicode_byte_invalid(self) - source code - -
- -
-   - - - - - - -
test_unicode_byte_invalid_sequence(self) - source code - -
- -
-   - - - - - - -
test_encoding_tostring_utf16(self) - source code - -
- -
-   - - - - - - -
test_tostring_none(self) - source code - -
- -
-   - - - - - - -
test_tostring_pretty(self) - source code - -
- -
-   - - - - - - -
test_tostring_with_tail(self) - source code - -
- -
-   - - - - - - -
test_tostring_method_html_with_tail(self) - source code - -
- -
-   - - - - - - -
test_standalone(self) - source code - -
- -
-   - - - - - - -
test_tostring_standalone(self) - source code - -
- -
-   - - - - - - -
test_tostring_standalone_in_out(self) - source code - -
- -
-   - - - - - - -
test_tostring_method_text_encoding(self) - source code - -
- -
-   - - - - - - -
test_tostring_method_text_unicode(self) - source code - -
- -
-   - - - - - - -
test_tounicode(self) - source code - -
- -
-   - - - - - - -
test_tounicode_element(self) - source code - -
- -
-   - - - - - - -
test_tounicode_none(self) - source code - -
- -
-   - - - - - - -
test_tounicode_element_tail(self) - source code - -
- -
-   - - - - - - -
test_tounicode_pretty(self) - source code - -
- -
-   - - - - - - -
test_tostring_unicode(self) - source code - -
- -
-   - - - - - - -
test_tostring_unicode_element(self) - source code - -
- -
-   - - - - - - -
test_tostring_unicode_none(self) - source code - -
- -
-   - - - - - - -
test_tostring_unicode_element_tail(self) - source code - -
- -
-   - - - - - - -
test_tostring_unicode_pretty(self) - source code - -
- -
-   - - - - - - -
test_pypy_proxy_collect(self) - source code - -
- -
-   - - - - - - -
test_element_refcycle(self) - source code - -
- -
-   - - - - - - -
test_proxy_collect_siblings(self) - source code - -
- -
-   - - - - - - -
test_proxy_collect_siblings_text(self) - source code - -
- -
-   - - - - - - -
_writeElement(self, - element, - encoding='us-ascii', - compression=0)
- Write out element for comparison.
- source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree.ETreeWriteTestCase-class.html b/doc/html/api/lxml.tests.test_etree.ETreeWriteTestCase-class.html deleted file mode 100644 index 71285277..00000000 --- a/doc/html/api/lxml.tests.test_etree.ETreeWriteTestCase-class.html +++ /dev/null @@ -1,489 +0,0 @@ - - - - - lxml.tests.test_etree.ETreeWriteTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree :: - Class ETreeWriteTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeWriteTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeWriteTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_write(self) - source code - -
- -
-   - - - - - - -
test_write_doctype(self) - source code - -
- -
-   - - - - - - -
test_write_gzip(self) - source code - -
- -
-   - - - - - - -
test_write_gzip_doctype(self) - source code - -
- -
-   - - - - - - -
test_write_gzip_level(self) - source code - -
- -
-   - - - - - - -
test_write_file(self) - source code - -
- -
-   - - - - - - -
test_write_file_gzip(self) - source code - -
- -
-   - - - - - - -
test_write_file_gzip_parse(self) - source code - -
- -
-   - - - - - - -
test_write_file_gzipfile_parse(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree.ETreeXIncludeTestCase-class.html b/doc/html/api/lxml.tests.test_etree.ETreeXIncludeTestCase-class.html deleted file mode 100644 index 430ba7a4..00000000 --- a/doc/html/api/lxml.tests.test_etree.ETreeXIncludeTestCase-class.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - lxml.tests.test_etree.ETreeXIncludeTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree :: - Class ETreeXIncludeTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeXIncludeTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-                _XIncludeTestCase --+
-                                    |
-                                   ETreeXIncludeTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
include(self, - tree) - source code - -
- -
-

Inherited from _XIncludeTestCase: - test_xinclude, - test_xinclude_resolver, - test_xinclude_resolver_recursive, - test_xinclude_text -

-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree.ElementIncludeTestCase-class.html b/doc/html/api/lxml.tests.test_etree.ElementIncludeTestCase-class.html deleted file mode 100644 index b7a3a882..00000000 --- a/doc/html/api/lxml.tests.test_etree.ElementIncludeTestCase-class.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - lxml.tests.test_etree.ElementIncludeTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree :: - Class ElementIncludeTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementIncludeTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-                _XIncludeTestCase --+
-                                    |
-                                   ElementIncludeTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
include(self, - tree) - source code - -
- -
-

Inherited from _XIncludeTestCase: - test_xinclude, - test_xinclude_resolver, - test_xinclude_resolver_recursive, - test_xinclude_text -

-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree.XMLPullParserTest-class.html b/doc/html/api/lxml.tests.test_etree.XMLPullParserTest-class.html deleted file mode 100644 index a347e53d..00000000 --- a/doc/html/api/lxml.tests.test_etree.XMLPullParserTest-class.html +++ /dev/null @@ -1,461 +0,0 @@ - - - - - lxml.tests.test_etree.XMLPullParserTest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree :: - Class XMLPullParserTest - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XMLPullParserTest

source code

-
-            object --+    
-                     |    
-unittest.case.TestCase --+
-                         |
-                        XMLPullParserTest
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
assert_event_tags(self, - events, - expected) - source code - -
- -
-   - - - - - - -
test_pull_from_simple_target(self) - source code - -
- -
-   - - - - - - -
test_pull_from_simple_target_start_end(self) - source code - -
- -
-   - - - - - - -
test_pull_from_tree_builder(self) - source code - -
- -
-   - - - - - - -
test_pull_from_tree_builder_subclass(self) - source code - -
- -
-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest, - tearDown -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_etree._XIncludeTestCase-class.html b/doc/html/api/lxml.tests.test_etree._XIncludeTestCase-class.html deleted file mode 100644 index f5c9ad53..00000000 --- a/doc/html/api/lxml.tests.test_etree._XIncludeTestCase-class.html +++ /dev/null @@ -1,415 +0,0 @@ - - - - - lxml.tests.test_etree._XIncludeTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_etree :: - Class _XIncludeTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _XIncludeTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               _XIncludeTestCase
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_xinclude_text(self) - source code - -
- -
-   - - - - - - -
test_xinclude(self) - source code - -
- -
-   - - - - - - -
test_xinclude_resolver(self) - source code - -
- -
-   - - - - - - -
test_xinclude_resolver_recursive(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_external_document-module.html b/doc/html/api/lxml.tests.test_external_document-module.html deleted file mode 100644 index d50de18e..00000000 --- a/doc/html/api/lxml.tests.test_external_document-module.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - lxml.tests.test_external_document - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_external_document - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_external_document

source code

-Test cases related to direct loading of external libxml2 documents - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ExternalDocumentTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - DOC_NAME = 'libxml2:xmlDoc' -
-   - - DESTRUCTOR_NAME = 'destructor:xmlFreeDoc' -
-   - - __package__ = 'lxml.tests' -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_external_document-pysrc.html b/doc/html/api/lxml.tests.test_external_document-pysrc.html deleted file mode 100644 index 139e8b4d..00000000 --- a/doc/html/api/lxml.tests.test_external_document-pysrc.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - lxml.tests.test_external_document - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_external_document - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_external_document

-
-  1  # -*- coding: utf-8 -*- 
-  2  """ 
-  3  Test cases related to direct loading of external libxml2 documents 
-  4  """ 
-  5   
-  6  from __future__ import absolute_import 
-  7   
-  8  import sys 
-  9  import unittest 
- 10   
- 11  from .common_imports import HelperTestCase, etree, skipIf 
- 12   
- 13  DOC_NAME = b'libxml2:xmlDoc' 
- 14  DESTRUCTOR_NAME = b'destructor:xmlFreeDoc' 
- 15   
- 16   
- 17  @skipIf(sys.version_info[:2] < (2, 7), 
- 18          'Not supported for python < 2.7') 
-
19 -class ExternalDocumentTestCase(HelperTestCase): -
20 - def setUp(self): -
21 import ctypes - 22 from ctypes import pythonapi - 23 from ctypes.util import find_library - 24 - 25 def wrap(func, restype, *argtypes): - 26 func.restype = restype - 27 func.argtypes = list(argtypes) - 28 return func -
29 - 30 self.get_capsule_name = wrap(pythonapi.PyCapsule_GetName, - 31 ctypes.c_char_p, ctypes.py_object) - 32 self.capsule_is_valid = wrap(pythonapi.PyCapsule_IsValid, ctypes.c_int, - 33 ctypes.py_object, ctypes.c_char_p) - 34 self.new_capsule = wrap(pythonapi.PyCapsule_New, ctypes.py_object, - 35 ctypes.c_void_p, ctypes.c_char_p, - 36 ctypes.c_void_p) - 37 self.set_capsule_name = wrap(pythonapi.PyCapsule_SetName, ctypes.c_int, - 38 ctypes.py_object, ctypes.c_char_p) - 39 self.set_capsule_context = wrap(pythonapi.PyCapsule_SetContext, - 40 ctypes.c_int, ctypes.py_object, - 41 ctypes.c_char_p) - 42 self.get_capsule_context = wrap(pythonapi.PyCapsule_GetContext, - 43 ctypes.c_char_p, ctypes.py_object) - 44 self.get_capsule_pointer = wrap(pythonapi.PyCapsule_GetPointer, - 45 ctypes.c_void_p, ctypes.py_object, - 46 ctypes.c_char_p) - 47 self.set_capsule_pointer = wrap(pythonapi.PyCapsule_SetPointer, - 48 ctypes.c_int, ctypes.py_object, - 49 ctypes.c_void_p) - 50 self.set_capsule_destructor = wrap(pythonapi.PyCapsule_SetDestructor, - 51 ctypes.c_int, ctypes.py_object, - 52 ctypes.c_void_p) - 53 self.PyCapsule_Destructor = ctypes.CFUNCTYPE(None, ctypes.py_object) - 54 libxml2 = ctypes.CDLL(find_library('xml2')) - 55 self.create_doc = wrap(libxml2.xmlReadMemory, ctypes.c_void_p, - 56 ctypes.c_char_p, ctypes.c_int, ctypes.c_char_p, - 57 ctypes.c_char_p, ctypes.c_int) - 58 self.free_doc = wrap(libxml2.xmlFreeDoc, None, ctypes.c_void_p) -
59 -
60 - def as_capsule(self, text, capsule_name=DOC_NAME): -
61 if not isinstance(text, bytes): - 62 text = text.encode('utf-8') - 63 doc = self.create_doc(text, len(text), b'base.xml', b'utf-8', 0) - 64 ans = self.new_capsule(doc, capsule_name, None) - 65 self.set_capsule_context(ans, DESTRUCTOR_NAME) - 66 return ans -
67 -
69 xml = '<r a="1">t</r>' - 70 self.assertRaises(TypeError, etree.adopt_external_document, None) - 71 capsule = self.as_capsule(xml) - 72 self.assertTrue(self.capsule_is_valid(capsule, DOC_NAME)) - 73 self.assertEqual(DOC_NAME, self.get_capsule_name(capsule)) - 74 # Create an lxml tree from the capsule (this is a move not a copy) - 75 root = etree.adopt_external_document(capsule).getroot() - 76 self.assertIsNone(self.get_capsule_name(capsule)) - 77 self.assertEqual(root.text, 't') - 78 root.text = 'new text' - 79 # Now reset the capsule so we can copy it - 80 self.assertEqual(0, self.set_capsule_name(capsule, DOC_NAME)) - 81 self.assertEqual(0, self.set_capsule_context(capsule, b'invalid')) - 82 # Create an lxml tree from the capsule (this is a copy not a move) - 83 root2 = etree.adopt_external_document(capsule).getroot() - 84 self.assertEqual(self.get_capsule_context(capsule), b'invalid') - 85 # Check that the modification to the tree using the transferred - 86 # document was successful - 87 self.assertEqual(root.text, root2.text) - 88 # Check that further modifications do not show up in the copy (they are - 89 # disjoint) - 90 root.text = 'other text' - 91 self.assertNotEqual(root.text, root2.text) - 92 # delete root and ensure root2 survives - 93 del root - 94 self.assertEqual(root2.text, 'new text') -
95 -
96 - 97 -def test_suite(): -
98 suite = unittest.TestSuite() - 99 suite.addTests([unittest.makeSuite(ExternalDocumentTestCase)]) -100 return suite -
101 -102 -103 if __name__ == '__main__': -104 print('to test use test.py %s' % __file__) -105 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_external_document.ExternalDocumentTestCase-class.html b/doc/html/api/lxml.tests.test_external_document.ExternalDocumentTestCase-class.html deleted file mode 100644 index 7e9d25d1..00000000 --- a/doc/html/api/lxml.tests.test_external_document.ExternalDocumentTestCase-class.html +++ /dev/null @@ -1,437 +0,0 @@ - - - - - lxml.tests.test_external_document.ExternalDocumentTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_external_document :: - Class ExternalDocumentTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ExternalDocumentTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ExternalDocumentTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
setUp(self)
- Hook method for setting up the test fixture before exercising it.
- source code - -
- -
-   - - - - - - -
as_capsule(self, - text, - capsule_name='libxml2:xmlDoc') - source code - -
- -
-   - - - - - - -
test_external_document_adoption(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUp(self) -

-
source code  -
- - Hook method for setting up the test fixture before exercising it. -
-
Overrides: - unittest.case.TestCase.setUp -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_htmlparser-module.html b/doc/html/api/lxml.tests.test_htmlparser-module.html deleted file mode 100644 index 06257625..00000000 --- a/doc/html/api/lxml.tests.test_htmlparser-module.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - lxml.tests.test_htmlparser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_htmlparser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_htmlparser

source code

-HTML parser test cases for etree - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - unicode
- str(object='') -> string -
-   - - HtmlParserTestCase
- HTML parser test cases -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_htmlparser-pysrc.html b/doc/html/api/lxml.tests.test_htmlparser-pysrc.html deleted file mode 100644 index bf598566..00000000 --- a/doc/html/api/lxml.tests.test_htmlparser-pysrc.html +++ /dev/null @@ -1,2035 +0,0 @@ - - - - - lxml.tests.test_htmlparser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_htmlparser - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_htmlparser

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  HTML parser test cases for etree 
-  5  """ 
-  6   
-  7  import unittest 
-  8  import tempfile, os, os.path, sys 
-  9   
- 10  this_dir = os.path.dirname(__file__) 
- 11  if this_dir not in sys.path: 
- 12      sys.path.insert(0, this_dir) # needed for Py3 
- 13   
- 14  from common_imports import etree, html, StringIO, BytesIO, fileInTestDir, _bytes, _str 
- 15  from common_imports import SillyFileLike, HelperTestCase, write_to_file, next 
- 16   
- 17  try: 
- 18      unicode 
- 19  except NameError: 
- 20      unicode = str 
- 21   
- 22   
-
23 -class HtmlParserTestCase(HelperTestCase): -
24 """HTML parser test cases - 25 """ - 26 etree = etree - 27 - 28 html_str = _bytes("<html><head><title>test</title></head><body><h1>page title</h1></body></html>") - 29 html_str_pretty = _bytes("""\ - 30 <html> - 31 <head><title>test</title></head> - 32 <body><h1>page title</h1></body> - 33 </html> - 34 """) - 35 broken_html_str = _bytes("<html><head><title>test" - 36 "<body><h1>page title</h3></p></html>") - 37 uhtml_str = _bytes( - 38 "<html><head><title>test á</title></head>" - 39 "<body><h1>page á title</h1></body></html>").decode('utf8') - 40 -
41 - def tearDown(self): -
42 super(HtmlParserTestCase, self).tearDown() - 43 self.etree.set_default_parser() -
44 -
45 - def test_module_HTML(self): -
46 element = self.etree.HTML(self.html_str) - 47 self.assertEqual(self.etree.tostring(element, method="html"), - 48 self.html_str) -
49 -
50 - def test_module_HTML_unicode(self): -
51 element = self.etree.HTML(self.uhtml_str) - 52 self.assertEqual( - 53 self.etree.tostring(element, method="html", encoding='unicode'), - 54 self.uhtml_str) - 55 self.assertEqual(element.findtext('.//h1'), - 56 _bytes("page á title").decode('utf8')) -
57 -
58 - def test_wide_unicode_xml(self): -
59 if sys.maxunicode < 1114111: - 60 return # skip test - 61 element = self.etree.HTML(_bytes( - 62 '<html><body><p>\\U00026007</p></body></html>' - 63 ).decode('unicode_escape')) - 64 p_text = element.findtext('.//p') - 65 self.assertEqual(1, len(p_text)) - 66 self.assertEqual(_bytes('\\U00026007').decode('unicode_escape'), - 67 p_text) -
68 -
69 - def test_html_ids(self): -
70 parser = self.etree.HTMLParser(recover=False) - 71 fromstring = self.etree.fromstring - 72 html = fromstring(''' - 73 <html><body id="bodyID"><p id="pID"></p></body></html> - 74 ''', parser=parser) - 75 self.assertEqual(len(html.xpath('//p[@id="pID"]')), 1) -
76 -
78 parser = self.etree.HTMLParser(recover=False, collect_ids=False) - 79 fromstring = self.etree.fromstring - 80 html = fromstring(''' - 81 <html><body id="bodyID"><p id="pID"></p></body></html> - 82 ''', parser=parser) - 83 self.assertEqual(len(html.xpath('//p[@id="pID"]')), 1) -
84 -
86 element = self.etree.HTML(self.html_str) - 87 self.assertEqual(self.etree.tostring(element, method="html", pretty_print=True), - 88 self.html_str_pretty) -
89 -
91 parser = self.etree.HTMLParser(recover=False) - 92 parse = self.etree.parse - 93 f = BytesIO("<html></body>") - 94 self.assertRaises(self.etree.XMLSyntaxError, - 95 parse, f, parser) -
96 -
98 parser = self.etree.HTMLParser() - 99 Element = parser.makeelement -100 -101 el = Element('name') -102 self.assertRaises(ValueError, Element, '{}') -103 self.assertRaises(ValueError, setattr, el, 'tag', '{}') -104 -105 self.assertRaises(ValueError, Element, '{test}') -106 self.assertRaises(ValueError, setattr, el, 'tag', '{test}') -
107 -
109 parser = self.etree.HTMLParser() -110 Element = parser.makeelement -111 -112 pname = Element('p:name') -113 self.assertEqual(pname.tag, 'p:name') -114 -115 pname = Element('{test}p:name') -116 self.assertEqual(pname.tag, '{test}p:name') -117 -118 pname = Element('name') -119 pname.tag = 'p:name' -120 self.assertEqual(pname.tag, 'p:name') -
121 -
123 parser = self.etree.HTMLParser() -124 Element = parser.makeelement -125 -126 self.assertRaises(ValueError, Element, 'p"name') -127 self.assertRaises(ValueError, Element, "na'me") -128 self.assertRaises(ValueError, Element, '{test}"name') -129 self.assertRaises(ValueError, Element, "{test}name'") -130 -131 el = Element('name') -132 self.assertRaises(ValueError, setattr, el, 'tag', "pname'") -133 self.assertRaises(ValueError, setattr, el, 'tag', '"pname') -134 self.assertEqual(el.tag, "name") -
135 -
137 parser = self.etree.HTMLParser() -138 Element = parser.makeelement -139 -140 self.assertRaises(ValueError, Element, ' name ') -141 self.assertRaises(ValueError, Element, 'na me') -142 self.assertRaises(ValueError, Element, '{test} name') -143 -144 el = Element('name') -145 self.assertRaises(ValueError, setattr, el, 'tag', ' name ') -146 self.assertEqual(el.tag, "name") -
147 -
149 parser = self.etree.HTMLParser() -150 Element = parser.makeelement -151 -152 SubElement = self.etree.SubElement -153 -154 el = Element('name') -155 self.assertRaises(ValueError, SubElement, el, '{}') -156 self.assertRaises(ValueError, SubElement, el, '{test}') -
157 -
159 parser = self.etree.HTMLParser() -160 Element = parser.makeelement -161 SubElement = self.etree.SubElement -162 -163 el = Element('name') -164 pname = SubElement(el, 'p:name') -165 self.assertEqual(pname.tag, 'p:name') -166 -167 pname = SubElement(el, '{test}p:name') -168 self.assertEqual(pname.tag, '{test}p:name') -
169 -
171 parser = self.etree.HTMLParser() -172 Element = parser.makeelement -173 SubElement = self.etree.SubElement -174 -175 el = Element('name') -176 self.assertRaises(ValueError, SubElement, el, "name'") -177 self.assertRaises(ValueError, SubElement, el, 'na"me') -178 self.assertRaises(ValueError, SubElement, el, "{test}na'me") -179 self.assertRaises(ValueError, SubElement, el, '{test}"name') -
180 -
182 parser = self.etree.HTMLParser() -183 Element = parser.makeelement -184 SubElement = self.etree.SubElement -185 -186 el = Element('name') -187 self.assertRaises(ValueError, SubElement, el, ' name ') -188 self.assertRaises(ValueError, SubElement, el, 'na me') -189 self.assertRaises(ValueError, SubElement, el, '{test} name') -
190 -
192 parser = self.etree.HTMLParser(recover=False) -193 parse = self.etree.parse -194 f = BytesIO(self.broken_html_str) -195 self.assertRaises(self.etree.XMLSyntaxError, -196 parse, f, parser) -
197 -
199 parser = self.etree.HTMLParser(default_doctype=False) -200 d = html.fromstring('<!DOCTYPE html><h1>S</h1></html>', parser=parser) -201 self.assertEqual(d.getroottree().docinfo.doctype, '<!DOCTYPE html>') -202 -203 d = html.fromstring('<html><h1>S</h1></html>', parser=parser) -204 self.assertEqual(d.getroottree().docinfo.doctype, '') -
205 -
207 text = _str('Søk på nettet') -208 html_latin1 = (_str('<p>%s</p>') % text).encode('iso-8859-1') -209 -210 tree = self.etree.parse( -211 BytesIO(html_latin1), -212 self.etree.HTMLParser(encoding="iso-8859-1")) -213 p = tree.find("//p") -214 self.assertEqual(p.text, text) -
215 -
217 text = _str('Søk på nettet') -218 wrong_head = _str(''' -219 <head> -220 <meta http-equiv="Content-Type" -221 content="text/html; charset=UTF-8" /> -222 </head>''') -223 html_latin1 = (_str('<html>%s<body><p>%s</p></body></html>') % (wrong_head, -224 text) -225 ).encode('iso-8859-1') -226 -227 self.assertRaises(self.etree.ParseError, -228 self.etree.parse, -229 BytesIO(html_latin1)) -230 -231 tree = self.etree.parse( -232 BytesIO(html_latin1), -233 self.etree.HTMLParser(encoding="iso-8859-1")) -234 p = tree.find("//p") -235 self.assertEqual(p.text, text) -
236 -
237 - def test_module_HTML_broken(self): -
238 element = self.etree.HTML(self.broken_html_str) -239 self.assertEqual(self.etree.tostring(element, method="html"), -240 self.html_str) -
241 -
242 - def test_module_HTML_cdata(self): -
243 # by default, libxml2 generates CDATA nodes for <script> content -244 html = _bytes('<html><head><style>foo</style></head></html>') -245 element = self.etree.HTML(html) -246 self.assertEqual(element[0][0].text, "foo") -
247 -
248 - def test_module_HTML_access(self): -
249 element = self.etree.HTML(self.html_str) -250 self.assertEqual(element[0][0].tag, 'title') -
251 -
252 - def test_module_parse_html(self): -
253 parser = self.etree.HTMLParser() -254 filename = tempfile.mktemp(suffix=".html") -255 write_to_file(filename, self.html_str, 'wb') -256 try: -257 f = open(filename, 'rb') -258 tree = self.etree.parse(f, parser) -259 f.close() -260 self.assertEqual(self.etree.tostring(tree.getroot(), method="html"), -261 self.html_str) -262 finally: -263 os.remove(filename) -
264 -
266 parser = self.etree.HTMLParser() -267 f = SillyFileLike(self.html_str) -268 tree = self.etree.parse(f, parser) -269 html = self.etree.tostring(tree.getroot(), -270 method="html", encoding='UTF-8') -271 self.assertEqual(html, self.html_str) -
272 -273 ## def test_module_parse_html_filelike_unicode(self): -274 ## parser = self.etree.HTMLParser() -275 ## f = SillyFileLike(self.uhtml_str) -276 ## tree = self.etree.parse(f, parser) -277 ## html = self.etree.tostring(tree.getroot(), encoding='UTF-8') -278 ## self.assertEqual(unicode(html, 'UTF-8'), self.uhtml_str) -279 -
280 - def test_html_file_error(self): -
281 parser = self.etree.HTMLParser() -282 parse = self.etree.parse -283 self.assertRaises(IOError, -284 parse, "__some_hopefully_nonexisting_file__.html", -285 parser) -
286 -
288 self.assertRaises(self.etree.XMLSyntaxError, -289 self.etree.parse, BytesIO(self.broken_html_str)) -290 -291 self.etree.set_default_parser( self.etree.HTMLParser() ) -292 -293 tree = self.etree.parse(BytesIO(self.broken_html_str)) -294 self.assertEqual(self.etree.tostring(tree.getroot(), method="html"), -295 self.html_str) -296 -297 self.etree.set_default_parser() -298 -299 self.assertRaises(self.etree.XMLSyntaxError, -300 self.etree.parse, BytesIO(self.broken_html_str)) -
301 -
302 - def test_html_iterparse(self): -
303 iterparse = self.etree.iterparse -304 f = BytesIO( -305 '<html><head><title>TITLE</title><body><p>P</p></body></html>') -306 -307 iterator = iterparse(f, html=True) -308 self.assertEqual(None, iterator.root) -309 -310 events = list(iterator) -311 root = iterator.root -312 self.assertTrue(root is not None) -313 self.assertEqual( -314 [('end', root[0][0]), ('end', root[0]), ('end', root[1][0]), -315 ('end', root[1]), ('end', root)], -316 events) -
317 -
319 iterparse = self.etree.iterparse -320 f = BytesIO( -321 '<html><head><title>TITLE</title><body><p>P</p></body></html>') -322 -323 iterator = iterparse(f, html=True) -324 self.assertEqual(None, iterator.root) -325 -326 event, element = next(iterator) -327 self.assertEqual('end', event) -328 self.assertEqual('title', element.tag) -329 self.assertEqual(None, iterator.root) -330 del element -331 -332 event, element = next(iterator) -333 self.assertEqual('end', event) -334 self.assertEqual('head', element.tag) -335 self.assertEqual(None, iterator.root) -336 del element -337 del iterator -
338 -
339 - def test_html_iterparse_broken(self): -
340 iterparse = self.etree.iterparse -341 f = BytesIO('<head><title>TEST></head><p>P<br></div>') -342 -343 iterator = iterparse(f, html=True) -344 self.assertEqual(None, iterator.root) -345 -346 events = list(iterator) -347 root = iterator.root -348 self.assertTrue(root is not None) -349 self.assertEqual('html', root.tag) -350 self.assertEqual('head', root[0].tag) -351 self.assertEqual('body', root[1].tag) -352 self.assertEqual('p', root[1][0].tag) -353 self.assertEqual('br', root[1][0][0].tag) -354 self.assertEqual( -355 [('end', root[0][0]), ('end', root[0]), ('end', root[1][0][0]), -356 ('end', root[1][0]), ('end', root[1]), ('end', root)], -357 events) -
358 -
360 iterparse = self.etree.iterparse -361 f = BytesIO('<p>P<br></div>') -362 iterator = iterparse(f, html=True, recover=False) -363 self.assertRaises(self.etree.XMLSyntaxError, list, iterator) -
364 -
365 - def test_html_iterparse_file(self): -
366 iterparse = self.etree.iterparse -367 iterator = iterparse(fileInTestDir("shakespeare.html"), -368 html=True) -369 -370 self.assertEqual(None, iterator.root) -371 events = list(iterator) -372 root = iterator.root -373 self.assertTrue(root is not None) -374 self.assertEqual(249, len(events)) -375 self.assertFalse( -376 [event for (event, element) in events if event != 'end']) -
377 -
378 - def test_html_iterparse_start(self): -
379 iterparse = self.etree.iterparse -380 f = BytesIO( -381 '<html><head><title>TITLE</title><body><p>P</p></body></html>') -382 -383 iterator = iterparse(f, html=True, events=('start',)) -384 self.assertEqual(None, iterator.root) -385 -386 events = list(iterator) -387 root = iterator.root -388 self.assertNotEqual(None, root) -389 self.assertEqual( -390 [('start', root), ('start', root[0]), ('start', root[0][0]), -391 ('start', root[1]), ('start', root[1][0])], -392 events) -
393 -
394 - def test_html_feed_parser(self): -
395 parser = self.etree.HTMLParser() -396 parser.feed("<html><body></") -397 parser.feed("body></html>") -398 root = parser.close() -399 -400 self.assertEqual('html', root.tag) -401 # test that we find all names in the parser dict -402 self.assertEqual([root], list(root.iter('html'))) -403 self.assertEqual([root[0]], list(root.iter('body'))) -
404 -
406 parser = self.etree.HTMLParser() -407 parser.feed("<htm") -408 parser.feed("l><body") -409 parser.feed("><") -410 parser.feed("p><") -411 parser.feed("strong") -412 parser.feed(">some ") -413 parser.feed("text</strong></p><") -414 parser.feed("/body></html>") -415 root = parser.close() -416 -417 self.assertEqual('html', root.tag) -418 # test that we find all names in the parser dict -419 self.assertEqual([root], list(root.iter('html'))) -420 self.assertEqual([root[0]], list(root.iter('body'))) -421 self.assertEqual([root[0][0]], list(root.iter('p'))) -422 self.assertEqual([root[0][0][0]], list(root.iter('strong'))) -
423 -
425 parser = self.etree.HTMLParser() -426 parser.feed('<html><head>') -427 parser.feed('<title>TITLE</title><body><p>P</p></body><') -428 parser.feed("/html>") -429 root = parser.close() -430 -431 self.assertEqual('html', root.tag) -432 # test that we find all names in the parser dict -433 self.assertEqual([root], list(root.iter('html'))) -434 self.assertEqual([root[0]], list(root.iter('head'))) -435 self.assertEqual([root[0][0]], list(root.iter('title'))) -436 self.assertEqual([root[1]], list(root.iter('body'))) -437 self.assertEqual([root[1][0]], list(root.iter('p'))) -
438 -
440 assertFalse = self.assertFalse -441 events = [] -442 class Target(object): -443 def start(self, tag, attrib): -444 events.append(("start", tag)) -445 assertFalse(attrib) -
446 def end(self, tag): -447 events.append(("end", tag)) -
448 def close(self): -449 return "DONE" -450 -451 parser = self.etree.HTMLParser(target=Target()) -452 -453 parser.feed("<html><body></body></html>") -454 done = parser.close() -455 -456 self.assertEqual("DONE", done) -457 self.assertEqual([ -458 ("start", "html"), ("start", "body"), -459 ("end", "body"), ("end", "html")], events) -460 -
462 assertFalse = self.assertFalse -463 events = [] -464 class Target(object): -465 def start(self, tag, attrib): -466 events.append(("start", tag)) -467 assertFalse(attrib) -
468 def end(self, tag): -469 events.append(("end", tag)) -470 def doctype(self, *args): -471 events.append(("doctype", args)) -472 def close(self): -473 return "DONE" -474 -475 parser = self.etree.HTMLParser(target=Target()) -476 parser.feed("<!DOCTYPE><html><body></body></html>") -477 done = parser.close() -478 -479 self.assertEqual("DONE", done) -480 self.assertEqual([ -481 ("doctype", (None, None, None)), -482 ("start", "html"), ("start", "body"), -483 ("end", "body"), ("end", "html")], events) -484 -
486 assertFalse = self.assertFalse -487 events = [] -488 class Target(object): -489 def start(self, tag, attrib): -490 events.append(("start", tag)) -491 assertFalse(attrib) -
492 def end(self, tag): -493 events.append(("end", tag)) -494 def doctype(self, *args): -495 events.append(("doctype", args)) -496 def close(self): -497 return "DONE" -498 -499 parser = self.etree.HTMLParser(target=Target()) -500 parser.feed("<!DOCTYPE html><html><body></body></html>") -501 done = parser.close() -502 -503 self.assertEqual("DONE", done) -504 self.assertEqual([ -505 ("doctype", ("html", None, None)), -506 ("start", "html"), ("start", "body"), -507 ("end", "body"), ("end", "html")], events) -508 -
510 assertFalse = self.assertFalse -511 events = [] -512 class Target(object): -513 def start(self, tag, attrib): -514 events.append(("start", tag)) -515 assertFalse(attrib) -
516 def end(self, tag): -517 events.append(("end", tag)) -518 def doctype(self, *args): -519 events.append(("doctype", args)) -520 def close(self): -521 return "DONE" -522 -523 parser = self.etree.HTMLParser(target=Target()) -524 parser.feed('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "sys.dtd">' -525 '<html><body></body></html>') -526 done = parser.close() -527 -528 self.assertEqual("DONE", done) -529 self.assertEqual([ -530 ("doctype", ("html", "-//W3C//DTD HTML 4.01//EN", "sys.dtd")), -531 ("start", "html"), ("start", "body"), -532 ("end", "body"), ("end", "html")], events) -533 -
535 events = [] -536 class Target(object): -537 def start(self, tag, attrib): -538 events.append(("start", tag)) -539 raise ValueError("START") -
540 def end(self, tag): -541 events.append(("end", tag)) -542 raise TypeError("END") -543 def close(self): -544 return "DONE" -545 -546 parser = self.etree.HTMLParser(target=Target()) -547 try: -548 parser.feed('<html><body>') -549 parser.feed('</body></html>') -550 except ValueError as exc: -551 assert "START" in str(exc) -552 except TypeError as exc: -553 assert "END" in str(exc) -554 self.assertTrue(False, "wrong exception raised") -555 else: -556 self.assertTrue(False, "no exception raised") -557 -558 self.assertTrue(("start", "html") in events, events) -559 self.assertTrue(("end", "html") not in events, events) -560 -
562 events = [] -563 class Target(object): -564 def start(self, tag, attrib): -565 events.append(("start", tag)) -566 raise ValueError("START") -
567 def end(self, tag): -568 events.append(("end", tag)) -569 raise TypeError("END") -570 def close(self): -571 return "DONE" -572 -573 parser = self.etree.HTMLParser(target=Target()) -574 try: -575 self.etree.fromstring('<html><body></body></html>', parser) -576 except ValueError as exc: -577 assert "START" in str(exc), str(exc) -578 except TypeError as exc: -579 assert "END" in str(exc), str(exc) -580 self.assertTrue(False, "wrong exception raised") -581 else: -582 self.assertTrue(False, "no exception raised") -583 -584 self.assertTrue(("start", "html") in events, events) -585 self.assertTrue(("end", "html") not in events, events) -586 -
587 - def test_set_decl_html(self): -
588 doc = html.Element('html').getroottree() -589 doc.docinfo.public_id = "-//W3C//DTD XHTML 1.0 Strict//EN" -590 doc.docinfo.system_url = \ -591 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" -592 self.assertEqual(doc.docinfo.doctype, -593 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">') -594 self.assertEqual(self.etree.tostring(doc), -595 _bytes('''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -596 <html xmlns="http://www.w3.org/1999/xhtml"></html>''')) -
597 -
598 - def test_html5_doctype(self): -
599 # document type declaration with neither public if nor system url -600 doc = html.Element('html').getroottree() -601 doc.docinfo.public_id = None -602 doc.docinfo.system_url = None -603 self.assertEqual(doc.docinfo.doctype, -604 '<!DOCTYPE html>') -605 self.assertTrue(doc.docinfo.public_id is None) -606 self.assertEqual(self.etree.tostring(doc), -607 _bytes('<!DOCTYPE html>\n<html/>')) -
608 -
609 - def test_ietf_decl(self): -
610 # legacy declaration with public id, no system url -611 doc = html.Element('html').getroottree() -612 doc.docinfo.public_id = '-//IETF//DTD HTML//EN' -613 doc.docinfo.system_url = None -614 self.assertEqual(doc.docinfo.doctype, -615 '<!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN">') -616 self.assertEqual(self.etree.tostring(doc), -617 _bytes('<!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN">\n<html/>')) -
618 -
619 - def test_boolean_attribute(self): -
620 # ability to serialize boolean attribute by setting value to None -621 form = html.Element('form') -622 form.set('novalidate', None) -623 self.assertEqual(html.tostring(form), -624 _bytes('<form novalidate></form>')) -625 form.set('custom') -626 self.assertEqual(html.tostring(form), -627 _bytes('<form novalidate custom></form>')) -
628 -
630 # ability to pass boolean attributes unmodified -631 fragment = '<tag attribute></tag>' -632 self.assertEqual(html.tostring(html.fragment_fromstring(fragment)), -633 _bytes(fragment)) -
634 -
636 # html serialized as xml converts boolean attributes to empty strings -637 fragment = '<tag attribute></tag>' -638 self.assertEqual(self.etree.tostring(html.fragment_fromstring(fragment)), -639 _bytes('<tag attribute=""/>')) -
640 -641 -
642 -def test_suite(): -
643 suite = unittest.TestSuite() -644 suite.addTests([unittest.makeSuite(HtmlParserTestCase)]) -645 return suite -
646 -647 -648 if __name__ == '__main__': -649 print('to test use test.py %s' % __file__) -650 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_htmlparser.HtmlParserTestCase-class.html b/doc/html/api/lxml.tests.test_htmlparser.HtmlParserTestCase-class.html deleted file mode 100644 index 2ab7c574..00000000 --- a/doc/html/api/lxml.tests.test_htmlparser.HtmlParserTestCase-class.html +++ /dev/null @@ -1,1311 +0,0 @@ - - - - - lxml.tests.test_htmlparser.HtmlParserTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_htmlparser :: - Class HtmlParserTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HtmlParserTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               HtmlParserTestCase
-
- -
-HTML parser test cases - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
- source code - -
- -
-   - - - - - - -
test_module_HTML(self) - source code - -
- -
-   - - - - - - -
test_module_HTML_unicode(self) - source code - -
- -
-   - - - - - - -
test_wide_unicode_xml(self) - source code - -
- -
-   - - - - - - -
test_html_ids(self) - source code - -
- -
-   - - - - - - -
test_html_ids_no_collect_ids(self) - source code - -
- -
-   - - - - - - -
test_module_HTML_pretty_print(self) - source code - -
- -
-   - - - - - - -
test_module_parse_html_error(self) - source code - -
- -
-   - - - - - - -
test_html_element_name_empty(self) - source code - -
- -
-   - - - - - - -
test_html_element_name_colon(self) - source code - -
- -
-   - - - - - - -
test_html_element_name_quote(self) - source code - -
- -
-   - - - - - - -
test_html_element_name_space(self) - source code - -
- -
-   - - - - - - -
test_html_subelement_name_empty(self) - source code - -
- -
-   - - - - - - -
test_html_subelement_name_colon(self) - source code - -
- -
-   - - - - - - -
test_html_subelement_name_quote(self) - source code - -
- -
-   - - - - - - -
test_html_subelement_name_space(self) - source code - -
- -
-   - - - - - - -
test_module_parse_html_norecover(self) - source code - -
- -
-   - - - - - - -
test_module_parse_html_default_doctype(self) - source code - -
- -
-   - - - - - - -
test_parse_encoding_8bit_explicit(self) - source code - -
- -
-   - - - - - - -
test_parse_encoding_8bit_override(self) - source code - -
- -
-   - - - - - - -
test_module_HTML_broken(self) - source code - -
- -
-   - - - - - - -
test_module_HTML_cdata(self) - source code - -
- -
-   - - - - - - -
test_module_HTML_access(self) - source code - -
- -
-   - - - - - - -
test_module_parse_html(self) - source code - -
- -
-   - - - - - - -
test_module_parse_html_filelike(self) - source code - -
- -
-   - - - - - - -
test_html_file_error(self) - source code - -
- -
-   - - - - - - -
test_default_parser_HTML_broken(self) - source code - -
- -
-   - - - - - - -
test_html_iterparse(self) - source code - -
- -
-   - - - - - - -
test_html_iterparse_stop_short(self) - source code - -
- -
-   - - - - - - -
test_html_iterparse_broken(self) - source code - -
- -
-   - - - - - - -
test_html_iterparse_broken_no_recover(self) - source code - -
- -
-   - - - - - - -
test_html_iterparse_file(self) - source code - -
- -
-   - - - - - - -
test_html_iterparse_start(self) - source code - -
- -
-   - - - - - - -
test_html_feed_parser(self) - source code - -
- -
-   - - - - - - -
test_html_feed_parser_chunky(self) - source code - -
- -
-   - - - - - - -
test_html_feed_parser_more_tags(self) - source code - -
- -
-   - - - - - - -
test_html_parser_target_tag(self) - source code - -
- -
-   - - - - - - -
test_html_parser_target_doctype_empty(self) - source code - -
- -
-   - - - - - - -
test_html_parser_target_doctype_html(self) - source code - -
- -
-   - - - - - - -
test_html_parser_target_doctype_html_full(self) - source code - -
- -
-   - - - - - - -
test_html_parser_target_exceptions(self) - source code - -
- -
-   - - - - - - -
test_html_fromstring_target_exceptions(self) - source code - -
- -
-   - - - - - - -
test_set_decl_html(self) - source code - -
- -
-   - - - - - - -
test_html5_doctype(self) - source code - -
- -
-   - - - - - - -
test_ietf_decl(self) - source code - -
- -
-   - - - - - - -
test_boolean_attribute(self) - source code - -
- -
-   - - - - - - -
test_boolean_attribute_round_trip(self) - source code - -
- -
-   - - - - - - -
test_boolean_attribute_xml_adds_empty_string(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-   - - html_str = '<html><head><title>test</title></head><body><h1>pa... -
-   - - html_str_pretty = '<html>\n<head><title>test</title></head>\n<... -
-   - - broken_html_str = '<html><head><title>test<body><h1>page title... -
-   - - uhtml_str = u'<html><head><title>test á</title></head><body>... -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

tearDown(self) -

-
source code  -
- - Hook method for deconstructing the test fixture after testing it. -
-
Overrides: - unittest.case.TestCase.tearDown -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
- -
- -
-

html_str

- -
-
-
-
Value:
-
-'<html><head><title>test</title></head><body><h1>page title</h1></body\
-></html>'
-
-
-
-
-
- -
- -
-

html_str_pretty

- -
-
-
-
Value:
-
-'''<html>
-<head><title>test</title></head>
-<body><h1>page title</h1></body>
-</html>
-'''
-
-
-
-
-
- -
- -
-

broken_html_str

- -
-
-
-
Value:
-
-'<html><head><title>test<body><h1>page title</h3></p></html>'
-
-
-
-
-
- -
- -
-

uhtml_str

- -
-
-
-
Value:
-
-u'<html><head><title>test á</title></head><body><h1>page á title</\
-h1></body></html>'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_http_io-module.html b/doc/html/api/lxml.tests.test_http_io-module.html deleted file mode 100644 index 72138e4e..00000000 --- a/doc/html/api/lxml.tests.test_http_io-module.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - - lxml.tests.test_http_io - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_http_io - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_http_io

source code

-Web IO test cases that need Python 2.5+ (wsgiref) - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - HttpIOTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_http_io-pysrc.html b/doc/html/api/lxml.tests.test_http_io-pysrc.html deleted file mode 100644 index 9102d1fc..00000000 --- a/doc/html/api/lxml.tests.test_http_io-pysrc.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - - lxml.tests.test_http_io - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_http_io - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_http_io

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Web IO test cases that need Python 2.5+ (wsgiref) 
-  5  """ 
-  6   
-  7  from __future__ import with_statement 
-  8   
-  9  import unittest 
- 10  import textwrap 
- 11  import os 
- 12  import sys 
- 13  import gzip 
- 14   
- 15  this_dir = os.path.dirname(__file__) 
- 16  if this_dir not in sys.path: 
- 17      sys.path.insert(0, this_dir)  # needed for Py3 
- 18   
- 19  from .common_imports import ( 
- 20      etree, HelperTestCase, BytesIO, _bytes) 
- 21  from .dummy_http_server import webserver, HTTPRequestCollector 
- 22   
- 23   
-
24 -class HttpIOTestCase(HelperTestCase): -
25 etree = etree - 26 -
27 - def _parse_from_http(self, data, code=200, headers=None, parser=None): -
28 handler = HTTPRequestCollector(data, code, headers) - 29 with webserver(handler) as host_url: - 30 tree = self.etree.parse(host_url + 'TEST', parser=parser) - 31 self.assertEqual([('/TEST', [])], handler.requests) - 32 return tree -
33 -
34 - def test_http_client(self): -
35 tree = self._parse_from_http(_bytes('<root><a/></root>')) - 36 self.assertEqual('root', tree.getroot().tag) - 37 self.assertEqual('a', tree.getroot()[0].tag) -
38 -
39 - def test_http_client_404(self): -
40 try: - 41 self._parse_from_http(_bytes('<root/>'), code=404) - 42 except IOError: - 43 self.assertTrue(True) - 44 else: - 45 self.assertTrue(False, "expected IOError") -
46 -
47 - def test_http_client_gzip(self): -
48 f = BytesIO() - 49 gz = gzip.GzipFile(fileobj=f, mode='w', filename='test.xml') - 50 gz.write(_bytes('<root><a/></root>')) - 51 gz.close() - 52 data = f.getvalue() - 53 del f, gz - 54 - 55 headers = [('Content-Encoding', 'gzip')] - 56 tree = self._parse_from_http(data, headers=headers) - 57 self.assertEqual('root', tree.getroot().tag) - 58 self.assertEqual('a', tree.getroot()[0].tag) -
59 -
60 - def test_parser_input_mix(self): -
61 data = _bytes('<root><a/></root>') - 62 handler = HTTPRequestCollector(data) - 63 - 64 with webserver(handler) as host_url: - 65 tree = self.etree.parse(host_url) - 66 root = tree.getroot() - 67 self.assertEqual('a', root[0].tag) - 68 - 69 root = self.etree.fromstring(data) - 70 self.assertEqual('a', root[0].tag) - 71 - 72 tree = self.etree.parse(host_url) - 73 root = tree.getroot() - 74 self.assertEqual('a', root[0].tag) - 75 - 76 root = self.etree.fromstring(data) - 77 self.assertEqual('a', root[0].tag) - 78 - 79 root = self.etree.fromstring(data) - 80 self.assertEqual('a', root[0].tag) -
81 -
82 - def test_network_dtd(self): -
83 data = [_bytes(textwrap.dedent(s)) for s in [ - 84 # XML file - 85 '''\ - 86 <?xml version="1.0"?> - 87 <!DOCTYPE root SYSTEM "./file.dtd"> - 88 <root>&myentity;</root> - 89 ''', - 90 # DTD - 91 '<!ENTITY myentity "DEFINED">', - 92 ]] - 93 - 94 responses = [] - 95 def handler(environ, start_response): - 96 start_response('200 OK', []) - 97 return [responses.pop()] -
98 - 99 with webserver(handler) as host_url: -100 # DTD network loading enabled -101 responses = data[::-1] -102 tree = self.etree.parse( -103 host_url + 'dir/test.xml', -104 parser=self.etree.XMLParser( -105 load_dtd=True, no_network=False)) -106 self.assertFalse(responses) # all read -107 root = tree.getroot() -108 self.assertEqual('DEFINED', root.text) -109 -110 # DTD network loading disabled -111 responses = data[::-1] -112 try: -113 self.etree.parse( -114 host_url + 'dir/test.xml', -115 parser=self.etree.XMLParser( -116 load_dtd=True, no_network=True)) -117 except self.etree.XMLSyntaxError: -118 self.assertTrue("myentity" in str(sys.exc_info()[1])) -119 else: -120 self.assertTrue(False) -121 self.assertEqual(1, len(responses)) # DTD not read -
122 -123 -
124 -def test_suite(): -
125 suite = unittest.TestSuite() -126 suite.addTests([unittest.makeSuite(HttpIOTestCase)]) -127 return suite -
128 -129 -130 if __name__ == '__main__': -131 print('to test use test.py %s' % __file__) -132 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_http_io.HttpIOTestCase-class.html b/doc/html/api/lxml.tests.test_http_io.HttpIOTestCase-class.html deleted file mode 100644 index 1e27c32c..00000000 --- a/doc/html/api/lxml.tests.test_http_io.HttpIOTestCase-class.html +++ /dev/null @@ -1,487 +0,0 @@ - - - - - lxml.tests.test_http_io.HttpIOTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_http_io :: - Class HttpIOTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HttpIOTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               HttpIOTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
_parse_from_http(self, - data, - code=200, - headers=None, - parser=None) - source code - -
- -
-   - - - - - - -
test_http_client(self) - source code - -
- -
-   - - - - - - -
test_http_client_404(self) - source code - -
- -
-   - - - - - - -
test_http_client_gzip(self) - source code - -
- -
-   - - - - - - -
test_parser_input_mix(self) - source code - -
- -
-   - - - - - - -
test_network_dtd(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile-module.html b/doc/html/api/lxml.tests.test_incremental_xmlfile-module.html deleted file mode 100644 index 1c3ed009..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile-module.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_incremental_xmlfile

source code

-Tests for the incremental XML serialisation API. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - _XmlFileTestCaseBase -
-   - - BytesIOXmlFileTestCase -
-   - - TempXmlFileTestCase -
-   - - TempPathXmlFileTestCase -
-   - - SimpleFileLikeXmlFileTestCase -
-   - - HtmlFileTestCase -
-   - - AsyncXmlFileTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile-pysrc.html b/doc/html/api/lxml.tests.test_incremental_xmlfile-pysrc.html deleted file mode 100644 index 4ddc9b2a..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile-pysrc.html +++ /dev/null @@ -1,1392 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_incremental_xmlfile

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Tests for the incremental XML serialisation API. 
-  5  """ 
-  6   
-  7  from __future__ import absolute_import 
-  8   
-  9  import io 
- 10  import os 
- 11  import sys 
- 12  import unittest 
- 13  import textwrap 
- 14  import tempfile 
- 15   
- 16  from lxml.etree import LxmlSyntaxError 
- 17   
- 18  this_dir = os.path.dirname(__file__) 
- 19  if this_dir not in sys.path: 
- 20      sys.path.insert(0, this_dir) # needed for Py3 
- 21   
- 22  from .common_imports import etree, BytesIO, HelperTestCase, skipIf, _str 
-
23 - 24 - 25 -class _XmlFileTestCaseBase(HelperTestCase): -
26 _file = None # to be set by specific subtypes below - 27 -
28 - def test_element(self): -
29 with etree.xmlfile(self._file) as xf: - 30 with xf.element('test'): - 31 pass - 32 self.assertXml('<test></test>') -
33 -
34 - def test_element_write_text(self): -
35 with etree.xmlfile(self._file) as xf: - 36 with xf.element('test'): - 37 xf.write('toast') - 38 self.assertXml('<test>toast</test>') -
39 -
40 - def test_element_write_empty(self): -
41 with etree.xmlfile(self._file) as xf: - 42 with xf.element('test'): - 43 xf.write(None) - 44 xf.write('') - 45 xf.write('') - 46 xf.write(None) - 47 self.assertXml('<test></test>') -
48 -
49 - def test_element_nested(self): -
50 with etree.xmlfile(self._file) as xf: - 51 with xf.element('test'): - 52 with xf.element('toast'): - 53 with xf.element('taste'): - 54 xf.write('conTent') - 55 self.assertXml('<test><toast><taste>conTent</taste></toast></test>') -
56 -
58 with etree.xmlfile(self._file) as xf: - 59 with xf.element('test'): - 60 xf.write('con') - 61 with xf.element('toast'): - 62 xf.write('tent') - 63 with xf.element('taste'): - 64 xf.write('inside') - 65 xf.write('tnet') - 66 xf.write('noc') - 67 self.assertXml('<test>con<toast>tent<taste>inside</taste>' - 68 'tnet</toast>noc</test>') -
69 -
70 - def test_write_Element(self): -
71 with etree.xmlfile(self._file) as xf: - 72 xf.write(etree.Element('test')) - 73 self.assertXml('<test/>') -
74 -
76 element = etree.Element('test') - 77 with etree.xmlfile(self._file) as xf: - 78 with xf.element('test'): - 79 for i in range(100): - 80 xf.write(element) - 81 - 82 tree = self._parse_file() - 83 self.assertTrue(tree is not None) - 84 self.assertEqual(100, len(tree.getroot())) - 85 self.assertEqual(set(['test']), set(el.tag for el in tree.getroot())) -
86 -
87 - def test_namespace_nsmap(self): -
88 with etree.xmlfile(self._file) as xf: - 89 with xf.element('{nsURI}test', nsmap={'x': 'nsURI'}): - 90 pass - 91 self.assertXml('<x:test xmlns:x="nsURI"></x:test>') -
92 -
94 with etree.xmlfile(self._file) as xf: - 95 with xf.element('test', nsmap={'x': 'nsURI'}): - 96 with xf.element('{nsURI}toast'): - 97 pass - 98 self.assertXml('<test xmlns:x="nsURI"><x:toast></x:toast></test>') -
99 -
100 - def test_anonymous_namespace(self): -
101 with etree.xmlfile(self._file) as xf: -102 with xf.element('{nsURI}test'): -103 pass -104 self.assertXml('<ns0:test xmlns:ns0="nsURI"></ns0:test>') -
105 -
107 with etree.xmlfile(self._file) as xf: -108 with xf.element('test'): -109 with xf.element('{nsURI}toast'): -110 pass -111 self.assertXml('<test><ns0:toast xmlns:ns0="nsURI"></ns0:toast></test>') -
112 -
113 - def test_default_namespace(self): -
114 with etree.xmlfile(self._file) as xf: -115 with xf.element('{nsURI}test', nsmap={None: 'nsURI'}): -116 pass -117 self.assertXml('<test xmlns="nsURI"></test>') -
118 -
120 with etree.xmlfile(self._file) as xf: -121 with xf.element('{nsURI}test', nsmap={None: 'nsURI'}): -122 with xf.element('{nsURI}toast'): -123 pass -124 self.assertXml('<test xmlns="nsURI"><toast></toast></test>') -
125 -
127 with etree.xmlfile(self._file) as xf: -128 with xf.element('{nsURI}test', nsmap={None: 'nsURI', 'p': 'ns2'}): -129 with xf.element('{nsURI}toast'): -130 pass -131 with xf.element('{ns2}toast'): -132 pass -133 self.assertXml( -134 '<test xmlns="nsURI" xmlns:p="ns2"><toast></toast><p:toast></p:toast></test>') -
135 -
136 - def test_pi(self): -
137 with etree.xmlfile(self._file) as xf: -138 xf.write(etree.ProcessingInstruction('pypi')) -139 with xf.element('test'): -140 pass -141 self.assertXml('<?pypi ?><test></test>') -
142 -
143 - def test_comment(self): -
144 with etree.xmlfile(self._file) as xf: -145 xf.write(etree.Comment('a comment')) -146 with xf.element('test'): -147 pass -148 self.assertXml('<!--a comment--><test></test>') -
149 -
150 - def test_attribute(self): -
151 with etree.xmlfile(self._file) as xf: -152 with xf.element('test', attrib={'k': 'v'}): -153 pass -154 self.assertXml('<test k="v"></test>') -
155 -
156 - def test_attribute_extra(self): -
157 with etree.xmlfile(self._file) as xf: -158 with xf.element('test', attrib={'k': 'v'}, n='N'): -159 pass -160 self.assertXml('<test k="v" n="N"></test>') -
161 -
163 with etree.xmlfile(self._file) as xf: -164 with xf.element('test', attrib={'k': 'v'}, k='V'): -165 pass -166 self.assertXml('<test k="V"></test>') -
167 -
168 - def test_escaping(self): -
169 with etree.xmlfile(self._file) as xf: -170 with xf.element('test'): -171 xf.write('Comments: <!-- text -->\n') -172 xf.write('Entities: &amp;') -173 self.assertXml( -174 '<test>Comments: &lt;!-- text --&gt;\nEntities: &amp;amp;</test>') -
175 -
176 - def test_encoding(self): -
177 with etree.xmlfile(self._file, encoding='utf16') as xf: -178 with xf.element('test'): -179 xf.write('toast') -180 self.assertXml('<test>toast</test>', encoding='utf16') -
181 -
182 - def test_buffering(self): -
183 with etree.xmlfile(self._file, buffered=False) as xf: -184 with xf.element('test'): -185 self.assertXml("<test>") -186 xf.write('toast') -187 self.assertXml("<test>toast") -188 with xf.element('taste'): -189 self.assertXml("<test>toast<taste>") -190 xf.write('some', etree.Element("more"), "toast") -191 self.assertXml("<test>toast<taste>some<more/>toast") -192 self.assertXml("<test>toast<taste>some<more/>toast</taste>") -193 xf.write('end') -194 self.assertXml("<test>toast<taste>some<more/>toast</taste>end") -195 self.assertXml("<test>toast<taste>some<more/>toast</taste>end</test>") -196 self.assertXml("<test>toast<taste>some<more/>toast</taste>end</test>") -
197 -
198 - def test_flush(self): -
199 with etree.xmlfile(self._file, buffered=True) as xf: -200 with xf.element('test'): -201 self.assertXml("") -202 xf.write('toast') -203 self.assertXml("") -204 with xf.element('taste'): -205 self.assertXml("") -206 xf.flush() -207 self.assertXml("<test>toast<taste>") -208 self.assertXml("<test>toast<taste>") -209 self.assertXml("<test>toast<taste>") -210 self.assertXml("<test>toast<taste></taste></test>") -
211 -
213 try: -214 with etree.xmlfile(self._file) as xf: -215 with xf.element('root'): -216 with xf.element('test'): -217 xf.write("BEFORE") -218 raise TypeError("FAIL!") -219 xf.write("AFTER") -220 except TypeError as exc: -221 self.assertTrue("FAIL" in str(exc), exc) -222 else: -223 self.assertTrue(False, "exception not propagated") -224 self.assertXml("<root><test>BEFORE</test></root>") -
225 -
227 def gen(): -228 with etree.xmlfile(self._file) as xf: -229 with xf.element('root'): -230 while True: -231 content = (yield) -232 with xf.element('entry'): -233 xf.write(content) -
234 -235 g = gen() -236 next(g) -237 g.send('A') -238 g.send('B') -239 g.send('C') -240 g.close() -241 self.assertXml("<root><entry>A</entry><entry>B</entry><entry>C</entry></root>") -
242 -
244 try: -245 with etree.xmlfile(self._file) as xf: -246 xf.write('toast') -247 except etree.LxmlSyntaxError: -248 self.assertTrue(True) -249 else: -250 self.assertTrue(False) -
251 -
252 - def test_failure_trailing_text(self): -
253 with etree.xmlfile(self._file) as xf: -254 with xf.element('test'): -255 pass -256 try: -257 xf.write('toast') -258 except etree.LxmlSyntaxError: -259 self.assertTrue(True) -260 else: -261 self.assertTrue(False) -
262 -
264 with etree.xmlfile(self._file) as xf: -265 with xf.element('test'): -266 pass -267 try: -268 xf.write(etree.Element('test')) -269 except etree.LxmlSyntaxError: -270 self.assertTrue(True) -271 else: -272 self.assertTrue(False) -
273 -
275 cm_exit = None -276 try: -277 with etree.xmlfile(self._file) as xf: -278 x = xf.element('test') -279 cm_exit = x.__exit__ -280 x.__enter__() -281 raise ValueError('123') -282 except ValueError: -283 self.assertTrue(cm_exit) -284 try: -285 cm_exit(ValueError, ValueError("huhu"), None) -286 except etree.LxmlSyntaxError: -287 self.assertTrue(True) -288 else: -289 self.assertTrue(False) -290 else: -291 self.assertTrue(False) -
292 -
293 - def _read_file(self): -
294 pos = self._file.tell() -295 self._file.seek(0) -296 try: -297 return self._file.read() -298 finally: -299 self._file.seek(pos) -
300 -
301 - def _parse_file(self): -
302 pos = self._file.tell() -303 self._file.seek(0) -304 try: -305 return etree.parse(self._file) -306 finally: -307 self._file.seek(pos) -
308 -
309 - def tearDown(self): -
310 if self._file is not None: -311 self._file.close() -
312 -
313 - def assertXml(self, expected, encoding='utf8'): -
314 self.assertEqual(self._read_file().decode(encoding), expected) -
315 -
316 -317 -class BytesIOXmlFileTestCase(_XmlFileTestCaseBase): -
318 - def setUp(self): -
319 self._file = BytesIO() -
320 -
321 - def test_filelike_close(self): -
322 with etree.xmlfile(self._file, close=True) as xf: -323 with xf.element('test'): -324 pass -325 self.assertRaises(ValueError, self._file.getvalue) -
326 -
327 -328 -class TempXmlFileTestCase(_XmlFileTestCaseBase): -
329 - def setUp(self): -
330 self._file = tempfile.TemporaryFile() -
331 -
332 -333 @skipIf(sys.platform.startswith("win"), "Can't reopen temporary files on Windows") -334 -class TempPathXmlFileTestCase(_XmlFileTestCaseBase): -
335 - def setUp(self): -
336 self._tmpfile = tempfile.NamedTemporaryFile() -337 self._file = self._tmpfile.name -
338 -
339 - def tearDown(self): -
340 try: -341 self._tmpfile.close() -342 finally: -343 if os.path.exists(self._tmpfile.name): -344 os.unlink(self._tmpfile.name) -
345 -
346 - def _read_file(self): -
347 self._tmpfile.seek(0) -348 return self._tmpfile.read() -
349 -
350 - def _parse_file(self): -
351 self._tmpfile.seek(0) -352 return etree.parse(self._tmpfile) -
353 -354 @skipIf(True, "temp file behaviour is too platform specific here") -
355 - def test_buffering(self): -
356 pass -
357 -358 @skipIf(True, "temp file behaviour is too platform specific here") -
359 - def test_flush(self): -
360 pass -
361 -
362 -363 -class SimpleFileLikeXmlFileTestCase(_XmlFileTestCaseBase): -
364 - class SimpleFileLike(object): -
365 - def __init__(self, target): -
366 self._target = target -367 self.write = target.write -368 self.tell = target.tell -369 self.seek = target.seek -370 self.closed = False -
371 -
372 - def close(self): -
373 assert not self.closed -374 self.closed = True -375 self._target.close() -
376 -
377 - def setUp(self): -
378 self._target = BytesIO() -379 self._file = self.SimpleFileLike(self._target) -
380 -
381 - def _read_file(self): -
382 return self._target.getvalue() -
383 -
384 - def _parse_file(self): -
385 pos = self._file.tell() -386 self._target.seek(0) -387 try: -388 return etree.parse(self._target) -389 finally: -390 self._target.seek(pos) -
391 -
392 - def test_filelike_not_closing(self): -
393 with etree.xmlfile(self._file) as xf: -394 with xf.element('test'): -395 pass -396 self.assertFalse(self._file.closed) -
397 -
398 - def test_filelike_close(self): -
399 with etree.xmlfile(self._file, close=True) as xf: -400 with xf.element('test'): -401 pass -402 self.assertTrue(self._file.closed) -403 self._file = None # prevent closing in tearDown() -
404 -
405 - def test_write_fails(self): -
406 class WriteError(Exception): -407 pass -
408 -409 class Writer(object): -410 def __init__(self, trigger): -411 self._trigger = trigger -412 self._failed = False -
413 -414 def write(self, data): -415 assert not self._failed, "write() called again after failure" -416 if self._trigger in data: -417 self._failed = True -418 raise WriteError("FAILED: " + self._trigger.decode('utf8')) -419 -420 for trigger in ['text', 'root', 'tag', 'noflush']: -421 try: -422 with etree.xmlfile(Writer(trigger.encode('utf8')), encoding='utf8') as xf: -423 with xf.element('root'): -424 xf.flush() -425 with xf.element('tag'): -426 xf.write('text') -427 xf.flush() -428 xf.write('noflush') -429 xf.flush() -430 xf.flush() -431 except WriteError as exc: -432 self.assertTrue('FAILED: ' + trigger in str(exc)) -433 else: -434 self.assertTrue(False, "exception not raised for '%s'" % trigger) -435 -
436 -437 -class HtmlFileTestCase(_XmlFileTestCaseBase): -
438 - def setUp(self): -
439 self._file = BytesIO() -
440 -
441 - def test_void_elements(self): -
442 # http://www.w3.org/TR/html5/syntax.html#elements-0 -443 void_elements = set([ -444 "area", "base", "br", "col", "embed", "hr", "img", -445 "input", "keygen", "link", "meta", "param", -446 "source", "track", "wbr" -447 ]) -448 -449 # FIXME: These don't get serialized as void elements. -450 void_elements.difference_update([ -451 'area', 'embed', 'keygen', 'source', 'track', 'wbr' -452 ]) -453 -454 for tag in sorted(void_elements): -455 with etree.htmlfile(self._file) as xf: -456 xf.write(etree.Element(tag)) -457 self.assertXml('<%s>' % tag) -458 self._file = BytesIO() -
459 -
461 with etree.htmlfile(self._file) as xf: -462 with xf.element('foo'): -463 cm = xf.method('xml') -464 cm.__enter__() -465 -466 self.assertRaises(LxmlSyntaxError, cm.__enter__) -467 -468 cm2 = xf.method('xml') -469 cm2.__enter__() -470 cm2.__exit__(None, None, None) -471 -472 self.assertRaises(LxmlSyntaxError, cm2.__exit__, None, None, None) -473 -474 cm3 = xf.method('xml') -475 cm3.__enter__() -476 with xf.method('html'): -477 self.assertRaises(LxmlSyntaxError, cm3.__exit__, None, None, None) -
478 -
480 tag = 'foo' -481 attrib = {'selected': 'bar'} -482 elt = etree.Element(tag, attrib=attrib) -483 -484 with etree.htmlfile(self._file) as xf: -485 with xf.element("root"): -486 xf.write(elt) # 1 -487 -488 assert elt.text is None -489 xf.write(elt, method='xml') # 2 -490 -491 elt.text = "" -492 xf.write(elt, method='xml') # 3 -493 -494 with xf.element(tag, attrib=attrib, method='xml'): -495 pass # 4 -496 -497 xf.write(elt) # 5 -498 -499 with xf.method('xml'): -500 xf.write(elt) # 6 -501 -502 self.assertXml( -503 '<root>' -504 '<foo selected></foo>' # 1 -505 '<foo selected="bar"/>' # 2 -506 '<foo selected="bar"></foo>' # 3 -507 '<foo selected="bar"></foo>' # 4 -508 '<foo selected></foo>' # 5 -509 '<foo selected="bar"></foo>' # 6 -510 '</root>') -511 self._file = BytesIO() -
512 -
514 # The htmlfile already outputs in xml mode for .element calls. This -515 # test actually illustrates a bug -516 -517 with etree.htmlfile(self._file) as xf: -518 with xf.element("root"): -519 with xf.element('foo', attrib={'selected': 'bar'}): -520 pass -521 -522 self.assertXml( -523 '<root>' -524 # '<foo selected></foo>' # FIXME: this is the correct output -525 # in html mode -526 '<foo selected="bar"></foo>' -527 '</root>') -528 self._file = BytesIO() -
529 -
530 - def test_attribute_quoting(self): -
531 with etree.htmlfile(self._file) as xf: -532 with xf.element("tagname", attrib={"attr": '"misquoted"'}): -533 xf.write("foo") -534 -535 self.assertXml('<tagname attr="&quot;misquoted&quot;">foo</tagname>') -
536 -
538 with etree.htmlfile(self._file) as xf: -539 with xf.element("tagname", attrib={"attr": _str('"misquöted\\u3344\\U00013344"')}): -540 xf.write("foo") -541 -542 self.assertXml('<tagname attr="&quot;misqu&#xF6;ted&#x3344;&#x13344;&quot;">foo</tagname>') -
543 -
544 - def test_unescaped_script(self): -
545 with etree.htmlfile(self._file) as xf: -546 elt = etree.Element('script') -547 elt.text = "if (a < b);" -548 xf.write(elt) -549 self.assertXml('<script>if (a < b);</script>') -
550 -
552 with etree.htmlfile(self._file) as xf: -553 with xf.element('script'): -554 xf.write("if (a < b);") -555 -556 self.assertXml('<script>if (a < b);</script>') -
557 -
558 - def test_write_declaration(self): -
559 with etree.htmlfile(self._file) as xf: -560 try: -561 xf.write_declaration() -562 except etree.LxmlSyntaxError: -563 self.assertTrue(True) -564 else: -565 self.assertTrue(False) -566 xf.write(etree.Element('html')) -
567 -
569 with etree.htmlfile(self._file) as xf: -570 xf.write(etree.Element('{some_ns}some_tag')) -571 self.assertXml('<ns0:some_tag xmlns:ns0="some_ns"></ns0:some_tag>') -
572 -
574 with etree.htmlfile(self._file) as xf: -575 with xf.element("{some_ns}some_tag"): -576 pass -577 self.assertXml('<ns0:some_tag xmlns:ns0="some_ns"></ns0:some_tag>') -
578 -
579 -580 -class AsyncXmlFileTestCase(HelperTestCase): -
581 - def test_async_api(self): -
582 out = io.BytesIO() -583 xf = etree.xmlfile(out) -584 scm = xf.__enter__() -585 acm = xf.__aenter__() -586 list(acm.__await__()) # fake await to avoid destructor warning -587 -588 def api_of(obj): -589 return sorted(name for name in dir(scm) if not name.startswith('__')) -
590 -591 a_api = api_of(acm) -592 -593 self.assertEqual(api_of(scm), api_of(acm)) -594 self.assertTrue('write' in a_api) -595 self.assertTrue('element' in a_api) -596 self.assertTrue('method' in a_api) -597 self.assertTrue(len(a_api) > 5) -
598 -
599 - def _run_async(self, coro): -
600 while True: -601 try: -602 coro.send(None) -603 except StopIteration as ex: -604 return ex.value -
605 -606 @skipIf(sys.version_info < (3, 5), "requires support for async-def (Py3.5+)") -
607 - def test_async(self): -
608 code = textwrap.dedent("""\ -609 async def test_async_xmlfile(close=True, buffered=True): -610 class Writer(object): -611 def __init__(self): -612 self._data = [] -613 self._all_data = None -614 self._calls = 0 -615 -616 async def write(self, data): -617 self._calls += 1 -618 self._data.append(data) -619 -620 async def close(self): -621 assert self._all_data is None -622 assert self._data is not None -623 self._all_data = b''.join(self._data) -624 self._data = None # make writing fail afterwards -625 -626 async def generate(out, close=True, buffered=True): -627 async with etree.xmlfile(out, close=close, buffered=buffered) as xf: -628 async with xf.element('root'): -629 await xf.write('root-text') -630 async with xf.method('html'): -631 await xf.write(etree.Element('img', src='http://huhu.org/')) -632 await xf.flush() -633 for i in range(3): -634 async with xf.element('el'): -635 await xf.write('text-%d' % i) -636 -637 out = Writer() -638 await generate(out, close=close, buffered=buffered) -639 if not close: -640 await out.close() -641 assert out._data is None, out._data -642 return out._all_data, out._calls -643 """) -644 lns = {} -645 exec(code, globals(), lns) -646 test_async_xmlfile = lns['test_async_xmlfile'] -647 -648 expected = ( -649 b'<root>root-text<img src="http://huhu.org/">' -650 b'<el>text-0</el><el>text-1</el><el>text-2</el></root>' -651 ) -652 -653 data, calls = self._run_async(test_async_xmlfile(close=True)) -654 self.assertEqual(expected, data) -655 self.assertEqual(2, calls) # only flush() and close() -656 -657 data, calls = self._run_async(test_async_xmlfile(close=False)) -658 self.assertEqual(expected, data) -659 self.assertEqual(2, calls) # only flush() and close() -660 -661 data, unbuffered_calls = self._run_async(test_async_xmlfile(buffered=False)) -662 self.assertEqual(expected, data) -663 self.assertTrue(unbuffered_calls > calls, unbuffered_calls) -
664 -
665 -666 -def test_suite(): -
667 suite = unittest.TestSuite() -668 suite.addTests([ -669 unittest.makeSuite(BytesIOXmlFileTestCase), -670 unittest.makeSuite(TempXmlFileTestCase), -671 unittest.makeSuite(TempPathXmlFileTestCase), -672 unittest.makeSuite(SimpleFileLikeXmlFileTestCase), -673 unittest.makeSuite(HtmlFileTestCase), -674 unittest.makeSuite(AsyncXmlFileTestCase), -675 ]) -676 return suite -
677 -678 -679 if __name__ == '__main__': -680 print('to test use test.py %s' % __file__) -681 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html b/doc/html/api/lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html deleted file mode 100644 index c180abd4..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile :: - Class AsyncXmlFileTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class AsyncXmlFileTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               AsyncXmlFileTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_async_api(self) - source code - -
- -
-   - - - - - - -
_run_async(self, - coro) - source code - -
- -
-   - - - - - - -
test_async(*args, - **kwargs) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

test_async(*args, - **kwargs) -

-
source code  -
- - -
-
Decorators:
-
    -
  • @skipIf(sys.version_info <(3, 5), "requires support for async-def (Py3.5+)")
  • -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html b/doc/html/api/lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html deleted file mode 100644 index b8f671d3..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html +++ /dev/null @@ -1,460 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile :: - Class BytesIOXmlFileTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class BytesIOXmlFileTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-             _XmlFileTestCaseBase --+
-                                    |
-                                   BytesIOXmlFileTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
setUp(self)
- Hook method for setting up the test fixture before exercising it.
- source code - -
- -
-   - - - - - - -
test_filelike_close(self) - source code - -
- -
-

Inherited from _XmlFileTestCaseBase: - assertXml, - tearDown, - test_anonymous_namespace, - test_attribute, - test_attribute_extra, - test_attribute_extra_duplicate, - test_buffering, - test_closing_out_of_order_in_error_case, - test_comment, - test_default_namespace, - test_element, - test_element_nested, - test_element_nested_with_text, - test_element_write_empty, - test_element_write_text, - test_encoding, - test_escaping, - test_failure_preceding_text, - test_failure_trailing_Element, - test_failure_trailing_text, - test_flush, - test_generator_close_continues_closing, - test_namespace_nested_anonymous, - test_namespace_nested_nsmap, - test_namespace_nsmap, - test_nested_default_namespace, - test_nested_default_namespace_and_other, - test_non_io_exception_continues_closing, - test_pi, - test_write_Element, - test_write_Element_repeatedly -

-

Inherited from _XmlFileTestCaseBase (private): - _parse_file, - _read_file -

-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from _XmlFileTestCaseBase (private): - _file -

-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUp(self) -

-
source code  -
- - Hook method for setting up the test fixture before exercising it. -
-
Overrides: - unittest.case.TestCase.setUp -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html b/doc/html/api/lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html deleted file mode 100644 index f2e79d68..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html +++ /dev/null @@ -1,620 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile.HtmlFileTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile :: - Class HtmlFileTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class HtmlFileTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-             _XmlFileTestCaseBase --+
-                                    |
-                                   HtmlFileTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
setUp(self)
- Hook method for setting up the test fixture before exercising it.
- source code - -
- -
-   - - - - - - -
test_void_elements(self) - source code - -
- -
-   - - - - - - -
test_method_context_manager_misuse(self) - source code - -
- -
-   - - - - - - -
test_xml_mode_write_inside_html(self) - source code - -
- -
-   - - - - - - -
test_xml_mode_element_inside_html(self) - source code - -
- -
-   - - - - - - -
test_attribute_quoting(self) - source code - -
- -
-   - - - - - - -
test_attribute_quoting_unicode(self) - source code - -
- -
-   - - - - - - -
test_unescaped_script(self) - source code - -
- -
-   - - - - - - -
test_unescaped_script_incremental(self) - source code - -
- -
-   - - - - - - -
test_write_declaration(self) - source code - -
- -
-   - - - - - - -
test_write_namespaced_element(self) - source code - -
- -
-   - - - - - - -
test_open_namespaced_element(self) - source code - -
- -
-

Inherited from _XmlFileTestCaseBase: - assertXml, - tearDown, - test_anonymous_namespace, - test_attribute, - test_attribute_extra, - test_attribute_extra_duplicate, - test_buffering, - test_closing_out_of_order_in_error_case, - test_comment, - test_default_namespace, - test_element, - test_element_nested, - test_element_nested_with_text, - test_element_write_empty, - test_element_write_text, - test_encoding, - test_escaping, - test_failure_preceding_text, - test_failure_trailing_Element, - test_failure_trailing_text, - test_flush, - test_generator_close_continues_closing, - test_namespace_nested_anonymous, - test_namespace_nested_nsmap, - test_namespace_nsmap, - test_nested_default_namespace, - test_nested_default_namespace_and_other, - test_non_io_exception_continues_closing, - test_pi, - test_write_Element, - test_write_Element_repeatedly -

-

Inherited from _XmlFileTestCaseBase (private): - _parse_file, - _read_file -

-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from _XmlFileTestCaseBase (private): - _file -

-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUp(self) -

-
source code  -
- - Hook method for setting up the test fixture before exercising it. -
-
Overrides: - unittest.case.TestCase.setUp -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html b/doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html deleted file mode 100644 index d58e04b3..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html +++ /dev/null @@ -1,571 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile :: - Class SimpleFileLikeXmlFileTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SimpleFileLikeXmlFileTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-             _XmlFileTestCaseBase --+
-                                    |
-                                   SimpleFileLikeXmlFileTestCase
-
- -
- - - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-   - - SimpleFileLike -
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
setUp(self)
- Hook method for setting up the test fixture before exercising it.
- source code - -
- -
-   - - - - - - -
_read_file(self) - source code - -
- -
-   - - - - - - -
_parse_file(self) - source code - -
- -
-   - - - - - - -
test_filelike_not_closing(self) - source code - -
- -
-   - - - - - - -
test_filelike_close(self) - source code - -
- -
-   - - - - - - -
test_write_fails(self) - source code - -
- -
-

Inherited from _XmlFileTestCaseBase: - assertXml, - tearDown, - test_anonymous_namespace, - test_attribute, - test_attribute_extra, - test_attribute_extra_duplicate, - test_buffering, - test_closing_out_of_order_in_error_case, - test_comment, - test_default_namespace, - test_element, - test_element_nested, - test_element_nested_with_text, - test_element_write_empty, - test_element_write_text, - test_encoding, - test_escaping, - test_failure_preceding_text, - test_failure_trailing_Element, - test_failure_trailing_text, - test_flush, - test_generator_close_continues_closing, - test_namespace_nested_anonymous, - test_namespace_nested_nsmap, - test_namespace_nsmap, - test_nested_default_namespace, - test_nested_default_namespace_and_other, - test_non_io_exception_continues_closing, - test_pi, - test_write_Element, - test_write_Element_repeatedly -

-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from _XmlFileTestCaseBase (private): - _file -

-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUp(self) -

-
source code  -
- - Hook method for setting up the test fixture before exercising it. -
-
Overrides: - unittest.case.TestCase.setUp -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

_read_file(self) -

-
source code  -
- - -
-
Overrides: - _XmlFileTestCaseBase._read_file -
-
-
-
- -
- -
- - -
-

_parse_file(self) -

-
source code  -
- - -
-
Overrides: - _XmlFileTestCaseBase._parse_file -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html b/doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html deleted file mode 100644 index bcc3a767..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile :: - Class SimpleFileLikeXmlFileTestCase :: - Class SimpleFileLike - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SimpleFileLike

source code

-
-object --+
-         |
-        SimpleFileLikeXmlFileTestCase.SimpleFileLike
-
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - target)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
close(self) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - target) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html b/doc/html/api/lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html deleted file mode 100644 index b3cba515..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html +++ /dev/null @@ -1,641 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile :: - Class TempPathXmlFileTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class TempPathXmlFileTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-             _XmlFileTestCaseBase --+
-                                    |
-                                   TempPathXmlFileTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
setUp(self)
- Hook method for setting up the test fixture before exercising it.
- source code - -
- -
-   - - - - - - -
tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
- source code - -
- -
-   - - - - - - -
_read_file(self) - source code - -
- -
-   - - - - - - -
_parse_file(self) - source code - -
- -
-   - - - - - - -
test_buffering(*args, - **kwargs) - source code - -
- -
-   - - - - - - -
test_flush(*args, - **kwargs) - source code - -
- -
-

Inherited from _XmlFileTestCaseBase: - assertXml, - test_anonymous_namespace, - test_attribute, - test_attribute_extra, - test_attribute_extra_duplicate, - test_closing_out_of_order_in_error_case, - test_comment, - test_default_namespace, - test_element, - test_element_nested, - test_element_nested_with_text, - test_element_write_empty, - test_element_write_text, - test_encoding, - test_escaping, - test_failure_preceding_text, - test_failure_trailing_Element, - test_failure_trailing_text, - test_generator_close_continues_closing, - test_namespace_nested_anonymous, - test_namespace_nested_nsmap, - test_namespace_nsmap, - test_nested_default_namespace, - test_nested_default_namespace_and_other, - test_non_io_exception_continues_closing, - test_pi, - test_write_Element, - test_write_Element_repeatedly -

-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from _XmlFileTestCaseBase (private): - _file -

-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUp(self) -

-
source code  -
- - Hook method for setting up the test fixture before exercising it. -
-
Overrides: - unittest.case.TestCase.setUp -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

tearDown(self) -

-
source code  -
- - Hook method for deconstructing the test fixture after testing it. -
-
Overrides: - unittest.case.TestCase.tearDown -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

_read_file(self) -

-
source code  -
- - -
-
Overrides: - _XmlFileTestCaseBase._read_file -
-
-
-
- -
- -
- - -
-

_parse_file(self) -

-
source code  -
- - -
-
Overrides: - _XmlFileTestCaseBase._parse_file -
-
-
-
- -
- -
- - -
-

test_buffering(*args, - **kwargs) -

-
source code  -
- - -
-
Decorators:
-
    -
  • @skipIf(True, "temp file behaviour is too platform specific here")
  • -
-
Overrides: - _XmlFileTestCaseBase.test_buffering -
-
-
-
- -
- -
- - -
-

test_flush(*args, - **kwargs) -

-
source code  -
- - -
-
Decorators:
-
    -
  • @skipIf(True, "temp file behaviour is too platform specific here")
  • -
-
Overrides: - _XmlFileTestCaseBase.test_flush -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html b/doc/html/api/lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html deleted file mode 100644 index a9e66e92..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile :: - Class TempXmlFileTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class TempXmlFileTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-             _XmlFileTestCaseBase --+
-                                    |
-                                   TempXmlFileTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
setUp(self)
- Hook method for setting up the test fixture before exercising it.
- source code - -
- -
-

Inherited from _XmlFileTestCaseBase: - assertXml, - tearDown, - test_anonymous_namespace, - test_attribute, - test_attribute_extra, - test_attribute_extra_duplicate, - test_buffering, - test_closing_out_of_order_in_error_case, - test_comment, - test_default_namespace, - test_element, - test_element_nested, - test_element_nested_with_text, - test_element_write_empty, - test_element_write_text, - test_encoding, - test_escaping, - test_failure_preceding_text, - test_failure_trailing_Element, - test_failure_trailing_text, - test_flush, - test_generator_close_continues_closing, - test_namespace_nested_anonymous, - test_namespace_nested_nsmap, - test_namespace_nsmap, - test_nested_default_namespace, - test_nested_default_namespace_and_other, - test_non_io_exception_continues_closing, - test_pi, - test_write_Element, - test_write_Element_repeatedly -

-

Inherited from _XmlFileTestCaseBase (private): - _parse_file, - _read_file -

-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from _XmlFileTestCaseBase (private): - _file -

-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUp(self) -

-
source code  -
- - Hook method for setting up the test fixture before exercising it. -
-
Overrides: - unittest.case.TestCase.setUp -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html b/doc/html/api/lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html deleted file mode 100644 index f9e0008c..00000000 --- a/doc/html/api/lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html +++ /dev/null @@ -1,931 +0,0 @@ - - - - - lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_incremental_xmlfile :: - Class _XmlFileTestCaseBase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _XmlFileTestCaseBase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               _XmlFileTestCaseBase
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_element(self) - source code - -
- -
-   - - - - - - -
test_element_write_text(self) - source code - -
- -
-   - - - - - - -
test_element_write_empty(self) - source code - -
- -
-   - - - - - - -
test_element_nested(self) - source code - -
- -
-   - - - - - - -
test_element_nested_with_text(self) - source code - -
- -
-   - - - - - - -
test_write_Element(self) - source code - -
- -
-   - - - - - - -
test_write_Element_repeatedly(self) - source code - -
- -
-   - - - - - - -
test_namespace_nsmap(self) - source code - -
- -
-   - - - - - - -
test_namespace_nested_nsmap(self) - source code - -
- -
-   - - - - - - -
test_anonymous_namespace(self) - source code - -
- -
-   - - - - - - -
test_namespace_nested_anonymous(self) - source code - -
- -
-   - - - - - - -
test_default_namespace(self) - source code - -
- -
-   - - - - - - -
test_nested_default_namespace(self) - source code - -
- -
-   - - - - - - -
test_nested_default_namespace_and_other(self) - source code - -
- -
-   - - - - - - -
test_pi(self) - source code - -
- -
-   - - - - - - -
test_comment(self) - source code - -
- -
-   - - - - - - -
test_attribute(self) - source code - -
- -
-   - - - - - - -
test_attribute_extra(self) - source code - -
- -
-   - - - - - - -
test_attribute_extra_duplicate(self) - source code - -
- -
-   - - - - - - -
test_escaping(self) - source code - -
- -
-   - - - - - - -
test_encoding(self) - source code - -
- -
-   - - - - - - -
test_buffering(self) - source code - -
- -
-   - - - - - - -
test_flush(self) - source code - -
- -
-   - - - - - - -
test_non_io_exception_continues_closing(self) - source code - -
- -
-   - - - - - - -
test_generator_close_continues_closing(self) - source code - -
- -
-   - - - - - - -
test_failure_preceding_text(self) - source code - -
- -
-   - - - - - - -
test_failure_trailing_text(self) - source code - -
- -
-   - - - - - - -
test_failure_trailing_Element(self) - source code - -
- -
-   - - - - - - -
test_closing_out_of_order_in_error_case(self) - source code - -
- -
-   - - - - - - -
_read_file(self) - source code - -
- -
-   - - - - - - -
_parse_file(self) - source code - -
- -
-   - - - - - - -
tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
- source code - -
- -
-   - - - - - - -
assertXml(self, - expected, - encoding='utf8') - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - _file = None
- hash(x) -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

tearDown(self) -

-
source code  -
- - Hook method for deconstructing the test fixture after testing it. -
-
Overrides: - unittest.case.TestCase.tearDown -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_io-module.html b/doc/html/api/lxml.tests.test_io-module.html deleted file mode 100644 index 0d0137b6..00000000 --- a/doc/html/api/lxml.tests.test_io-module.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - lxml.tests.test_io - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_io - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_io

source code

-IO test cases that apply to both etree and ElementTree - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - _IOTestCaseBase
- (c)ElementTree compatibility for IO functions/methods -
-   - - ETreeIOTestCase -
-   - - ElementTreeIOTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_io-pysrc.html b/doc/html/api/lxml.tests.test_io-pysrc.html deleted file mode 100644 index cf964221..00000000 --- a/doc/html/api/lxml.tests.test_io-pysrc.html +++ /dev/null @@ -1,1189 +0,0 @@ - - - - - lxml.tests.test_io - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_io - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_io

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  IO test cases that apply to both etree and ElementTree 
-  5  """ 
-  6   
-  7  import unittest 
-  8  import tempfile, gzip, os, os.path, sys, gc, shutil 
-  9   
- 10  this_dir = os.path.dirname(__file__) 
- 11  if this_dir not in sys.path: 
- 12      sys.path.insert(0, this_dir)  # needed for Py3 
- 13   
- 14  from common_imports import etree, ElementTree, _str, _bytes 
- 15  from common_imports import SillyFileLike, LargeFileLike, HelperTestCase 
- 16  from common_imports import read_file, write_to_file, BytesIO 
- 17   
- 18  if sys.version_info < (2,6): 
-
19 - class NamedTemporaryFile(object): -
20 - def __init__(self, delete=True, **kwargs): -
21 self._tmpfile = tempfile.NamedTemporaryFile(**kwargs) -
22 - def close(self): -
23 self._tmpfile.flush() -
24 - def __getattr__(self, name): -
25 return getattr(self._tmpfile, name) -
26 else: - 27 NamedTemporaryFile = tempfile.NamedTemporaryFile - 28 - 29 -
30 -class _IOTestCaseBase(HelperTestCase): -
31 """(c)ElementTree compatibility for IO functions/methods - 32 """ - 33 etree = None - 34 -
35 - def setUp(self): -
36 """Setting up a minimal tree - 37 """ - 38 self.root = self.etree.Element('a') - 39 self.root_str = self.etree.tostring(self.root) - 40 self.tree = self.etree.ElementTree(self.root) - 41 self._temp_dir = tempfile.mkdtemp() -
42 -
43 - def tearDown(self): -
44 gc.collect() - 45 shutil.rmtree(self._temp_dir) -
46 -
47 - def getTestFilePath(self, name): -
48 return os.path.join(self._temp_dir, name) -
49 -
50 - def buildNodes(self, element, children, depth): -
51 Element = self.etree.Element - 52 - 53 if depth == 0: - 54 return - 55 for i in range(children): - 56 new_element = Element('element_%s_%s' % (depth, i)) - 57 self.buildNodes(new_element, children, depth - 1) - 58 element.append(new_element) -
59 -
60 - def test_tree_io(self): -
61 Element = self.etree.Element - 62 ElementTree = self.etree.ElementTree - 63 - 64 element = Element('top') - 65 element.text = _str("qwrtioüöä\uAABB") - 66 tree = ElementTree(element) - 67 self.buildNodes(element, 10, 3) - 68 f = open(self.getTestFilePath('testdump.xml'), 'wb') - 69 tree.write(f, encoding='UTF-8') - 70 f.close() - 71 f = open(self.getTestFilePath('testdump.xml'), 'rb') - 72 tree = ElementTree(file=f) - 73 f.close() - 74 f = open(self.getTestFilePath('testdump2.xml'), 'wb') - 75 tree.write(f, encoding='UTF-8') - 76 f.close() - 77 f = open(self.getTestFilePath('testdump.xml'), 'rb') - 78 data1 = f.read() - 79 f.close() - 80 f = open(self.getTestFilePath('testdump2.xml'), 'rb') - 81 data2 = f.read() - 82 f.close() - 83 self.assertEqual(data1, data2) -
84 -
85 - def test_tree_io_latin1(self): -
86 Element = self.etree.Element - 87 ElementTree = self.etree.ElementTree - 88 - 89 element = Element('top') - 90 element.text = _str("qwrtioüöäßá") - 91 tree = ElementTree(element) - 92 self.buildNodes(element, 10, 3) - 93 f = open(self.getTestFilePath('testdump.xml'), 'wb') - 94 tree.write(f, encoding='iso-8859-1') - 95 f.close() - 96 f = open(self.getTestFilePath('testdump.xml'), 'rb') - 97 tree = ElementTree(file=f) - 98 f.close() - 99 f = open(self.getTestFilePath('testdump2.xml'), 'wb') -100 tree.write(f, encoding='iso-8859-1') -101 f.close() -102 f = open(self.getTestFilePath('testdump.xml'), 'rb') -103 data1 = f.read() -104 f.close() -105 f = open(self.getTestFilePath('testdump2.xml'), 'rb') -106 data2 = f.read() -107 f.close() -108 self.assertEqual(data1, data2) -
109 -
110 - def test_write_filename(self): -
111 # (c)ElementTree supports filename strings as write argument -112 -113 handle, filename = tempfile.mkstemp(suffix=".xml") -114 self.tree.write(filename) -115 try: -116 self.assertEqual(read_file(filename, 'rb').replace(_bytes('\n'), _bytes('')), -117 self.root_str) -118 finally: -119 os.close(handle) -120 os.remove(filename) -
121 -
123 filename = os.path.join( -124 os.path.join('hopefullynonexistingpathname'), -125 'invalid_file.xml') -126 try: -127 self.tree.write(filename) -128 except IOError: -129 pass -130 else: -131 self.assertTrue( -132 False, "writing to an invalid file path should fail") -
133 -
135 # (c)ElementTree supports gzip instance as parse argument -136 handle, filename = tempfile.mkstemp(suffix=".xml.gz") -137 f = gzip.open(filename, 'wb') -138 f.write(self.root_str) -139 f.close() -140 try: -141 f_gz = gzip.open(filename, 'rb') -142 tree = self.etree.parse(f_gz) -143 f_gz.close() -144 self.assertEqual(self.etree.tostring(tree.getroot()), self.root_str) -145 finally: -146 os.close(handle) -147 os.remove(filename) -
148 -
149 - def test_class_parse_filename(self): -
150 # (c)ElementTree class ElementTree has a 'parse' method that returns -151 # the root of the tree -152 -153 # parse from filename -154 -155 handle, filename = tempfile.mkstemp(suffix=".xml") -156 write_to_file(filename, self.root_str, 'wb') -157 try: -158 tree = self.etree.ElementTree() -159 root = tree.parse(filename) -160 self.assertEqual(self.etree.tostring(root), self.root_str) -161 finally: -162 os.close(handle) -163 os.remove(filename) -
164 -
166 handle, filename = tempfile.mkstemp(suffix=".xml") -167 write_to_file(filename, self.root_str, 'wb') -168 try: -169 tree = self.etree.ElementTree() -170 root = tree.parse(filename) -171 # and now do it again; previous content should still be there -172 root2 = tree.parse(filename) -173 self.assertEqual('a', root.tag) -174 self.assertEqual('a', root2.tag) -175 # now remove all references to root2, and parse again -176 del root2 -177 root3 = tree.parse(filename) -178 self.assertEqual('a', root.tag) -179 self.assertEqual('a', root3.tag) -180 # root2's memory should've been freed here -181 # XXX how to check? -182 finally: -183 os.close(handle) -184 os.remove(filename) -
185 -
187 # (c)ElementTree class ElementTree has a 'parse' method that returns -188 # the root of the tree -189 -190 # parse from file object -191 -192 handle, filename = tempfile.mkstemp(suffix=".xml") -193 try: -194 os.write(handle, self.root_str) -195 f = open(filename, 'rb') -196 tree = self.etree.ElementTree() -197 root = tree.parse(f) -198 f.close() -199 self.assertEqual(self.etree.tostring(root), self.root_str) -200 finally: -201 os.close(handle) -202 os.remove(filename) -
203 -
205 # (c)ElementTree class ElementTree has a 'parse' method that returns -206 # the root of the tree -207 -208 # parse from unamed file object -209 f = SillyFileLike() -210 root = self.etree.ElementTree().parse(f) -211 self.assertTrue(root.tag.endswith('foo')) -
212 -
214 # parse from unamed file object -215 f = LargeFileLike() -216 tree = self.etree.parse(f) -217 root = tree.getroot() -218 self.assertTrue(root.tag.endswith('root')) -
219 -
221 class LocalError(Exception): -222 pass -
223 class TestFile: -224 def read(*args): -225 raise LocalError -
226 f = TestFile() -227 self.assertRaises(LocalError, self.etree.parse, f) -228 -
230 class LocalError(Exception): -231 pass -
232 class TestFile: -233 data = '<root>test</' -234 try: -235 next_char = iter(data).next -236 except AttributeError: -237 # Python 3 -238 next_char = iter(data).__next__ -239 counter = 0 -240 def read(self, amount=None): -241 if amount is None: -242 while True: -243 self.read(1) -244 else: -245 try: -246 self.counter += 1 -247 return _bytes(self.next_char()) -248 except StopIteration: -249 raise LocalError -250 f = TestFile() -251 self.assertRaises(LocalError, self.etree.parse, f) -252 self.assertEqual(f.counter, len(f.data)+1) -253 -
255 class TestFile: -256 def read(*args): -257 return 1 -
258 f = TestFile() -259 -260 try: -261 expect_exc = (TypeError, self.etree.ParseError) -262 except AttributeError: -263 expect_exc = TypeError -264 self.assertRaises(expect_exc, self.etree.parse, f) -265 -
266 - def test_etree_parse_io_error(self): -
267 # this is a directory name that contains characters beyond latin-1 -268 dirnameEN = _str('Directory') -269 dirnameRU = _str('Каталог') -270 filename = _str('nosuchfile.xml') -271 dn = tempfile.mkdtemp(prefix=dirnameEN) -272 try: -273 self.assertRaises(IOError, self.etree.parse, os.path.join(dn, filename)) -274 finally: -275 os.rmdir(dn) -276 dn = tempfile.mkdtemp(prefix=dirnameRU) -277 try: -278 self.assertRaises(IOError, self.etree.parse, os.path.join(dn, filename)) -279 finally: -280 os.rmdir(dn) -
281 -
282 - def test_parse_utf8_bom(self): -
283 utext = _str('Søk på nettet') -284 uxml = '<?xml version="1.0" encoding="UTF-8"?><p>%s</p>' % utext -285 bom = _bytes('\\xEF\\xBB\\xBF').decode( -286 "unicode_escape").encode("latin1") -287 self.assertEqual(3, len(bom)) -288 f = NamedTemporaryFile(delete=False) -289 try: -290 try: -291 f.write(bom) -292 f.write(uxml.encode("utf-8")) -293 finally: -294 f.close() -295 tree = self.etree.parse(f.name) -296 finally: -297 os.unlink(f.name) -298 self.assertEqual(utext, tree.getroot().text) -
299 -
300 - def test_iterparse_utf8_bom(self): -
301 utext = _str('Søk på nettet') -302 uxml = '<?xml version="1.0" encoding="UTF-8"?><p>%s</p>' % utext -303 bom = _bytes('\\xEF\\xBB\\xBF').decode( -304 "unicode_escape").encode("latin1") -305 self.assertEqual(3, len(bom)) -306 f = NamedTemporaryFile(delete=False) -307 try: -308 try: -309 f.write(bom) -310 f.write(uxml.encode("utf-8")) -311 finally: -312 f.close() -313 elements = [el for _, el in self.etree.iterparse(f.name)] -314 self.assertEqual(1, len(elements)) -315 root = elements[0] -316 finally: -317 os.unlink(f.name) -318 self.assertEqual(utext, root.text) -
319 -
320 - def test_iterparse_utf16_bom(self): -
321 utext = _str('Søk på nettet') -322 uxml = '<?xml version="1.0" encoding="UTF-16"?><p>%s</p>' % utext -323 boms = _bytes('\\xFE\\xFF \\xFF\\xFE').decode( -324 "unicode_escape").encode("latin1") -325 self.assertEqual(5, len(boms)) -326 xml = uxml.encode("utf-16") -327 self.assertTrue(xml[:2] in boms, repr(xml[:2])) -328 -329 f = NamedTemporaryFile(delete=False) -330 try: -331 try: -332 f.write(xml) -333 finally: -334 f.close() -335 elements = [el for _, el in self.etree.iterparse(f.name)] -336 self.assertEqual(1, len(elements)) -337 root = elements[0] -338 finally: -339 os.unlink(f.name) -340 self.assertEqual(utext, root.text) -
341 -342 -
343 -class ETreeIOTestCase(_IOTestCaseBase): -
344 etree = etree -345 -
346 - def test_write_compressed_text(self): -
347 Element = self.etree.Element -348 SubElement = self.etree.SubElement -349 ElementTree = self.etree.ElementTree -350 text = _str("qwrtioüöä") -351 -352 root = Element('root') -353 root.text = text -354 child = SubElement(root, 'sub') -355 child.text = 'TEXT' -356 child.tail = 'TAIL' -357 SubElement(root, 'sub').text = text -358 -359 tree = ElementTree(root) -360 out = BytesIO() -361 tree.write(out, method='text', encoding='utf8', compression=9) -362 out.seek(0) -363 -364 f = gzip.GzipFile(fileobj=out) -365 try: -366 result = f.read().decode('utf8') -367 finally: -368 f.close() -369 self.assertEqual(text+'TEXTTAIL'+text, result) -
370 -371 -372 if ElementTree: -
373 - class ElementTreeIOTestCase(_IOTestCaseBase): -
375 -376 -
377 -def test_suite(): -
378 suite = unittest.TestSuite() -379 suite.addTests([unittest.makeSuite(ETreeIOTestCase)]) -380 if ElementTree: -381 suite.addTests([unittest.makeSuite(ElementTreeIOTestCase)]) -382 return suite -
383 -384 -385 if __name__ == '__main__': -386 print('to test use test.py %s' % __file__) -387 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_io.ETreeIOTestCase-class.html b/doc/html/api/lxml.tests.test_io.ETreeIOTestCase-class.html deleted file mode 100644 index 8191d4aa..00000000 --- a/doc/html/api/lxml.tests.test_io.ETreeIOTestCase-class.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - - lxml.tests.test_io.ETreeIOTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_io :: - Class ETreeIOTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeIOTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-                  _IOTestCaseBase --+
-                                    |
-                                   ETreeIOTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_write_compressed_text(self) - source code - -
- -
-

Inherited from _IOTestCaseBase: - buildNodes, - getTestFilePath, - setUp, - tearDown, - test_class_parse_filename, - test_class_parse_filename_remove_previous, - test_class_parse_fileobject, - test_class_parse_unamed_fileobject, - test_etree_parse_io_error, - test_iterparse_utf16_bom, - test_iterparse_utf8_bom, - test_module_parse_fileobject_error, - test_module_parse_fileobject_late_error, - test_module_parse_fileobject_type_error, - test_module_parse_gzipobject, - test_module_parse_large_fileobject, - test_parse_utf8_bom, - test_tree_io, - test_tree_io_latin1, - test_write_filename, - test_write_invalid_filename -

-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_io.ElementTreeIOTestCase-class.html b/doc/html/api/lxml.tests.test_io.ElementTreeIOTestCase-class.html deleted file mode 100644 index afbd8163..00000000 --- a/doc/html/api/lxml.tests.test_io.ElementTreeIOTestCase-class.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - - lxml.tests.test_io.ElementTreeIOTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_io :: - Class ElementTreeIOTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementTreeIOTestCase

source code

-
-               object --+            
-                        |            
-   unittest.case.TestCase --+        
-                            |        
-common_imports.HelperTestCase --+    
-                                |    
-                  _IOTestCaseBase --+
-                                    |
-                                   ElementTreeIOTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from _IOTestCaseBase: - buildNodes, - getTestFilePath, - setUp, - tearDown, - test_class_parse_filename, - test_class_parse_filename_remove_previous, - test_class_parse_fileobject, - test_class_parse_unamed_fileobject, - test_etree_parse_io_error, - test_iterparse_utf16_bom, - test_iterparse_utf8_bom, - test_module_parse_fileobject_error, - test_module_parse_fileobject_late_error, - test_module_parse_fileobject_type_error, - test_module_parse_gzipobject, - test_module_parse_large_fileobject, - test_parse_utf8_bom, - test_tree_io, - test_tree_io_latin1, - test_write_filename, - test_write_invalid_filename -

-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- hash(x) -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- hash(x) -
-
-
-
Value:
-
xml.etree.ElementTree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_io._IOTestCaseBase-class.html b/doc/html/api/lxml.tests.test_io._IOTestCaseBase-class.html deleted file mode 100644 index 2c2497f9..00000000 --- a/doc/html/api/lxml.tests.test_io._IOTestCaseBase-class.html +++ /dev/null @@ -1,765 +0,0 @@ - - - - - lxml.tests.test_io._IOTestCaseBase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_io :: - Class _IOTestCaseBase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _IOTestCaseBase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               _IOTestCaseBase
-
- -
Known Subclasses:
-
- -
- -
-(c)ElementTree compatibility for IO functions/methods - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
setUp(self)
- Setting up a minimal tree
- source code - -
- -
-   - - - - - - -
tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
- source code - -
- -
-   - - - - - - -
getTestFilePath(self, - name) - source code - -
- -
-   - - - - - - -
buildNodes(self, - element, - children, - depth) - source code - -
- -
-   - - - - - - -
test_tree_io(self) - source code - -
- -
-   - - - - - - -
test_tree_io_latin1(self) - source code - -
- -
-   - - - - - - -
test_write_filename(self) - source code - -
- -
-   - - - - - - -
test_write_invalid_filename(self) - source code - -
- -
-   - - - - - - -
test_module_parse_gzipobject(self) - source code - -
- -
-   - - - - - - -
test_class_parse_filename(self) - source code - -
- -
-   - - - - - - -
test_class_parse_filename_remove_previous(self) - source code - -
- -
-   - - - - - - -
test_class_parse_fileobject(self) - source code - -
- -
-   - - - - - - -
test_class_parse_unamed_fileobject(self) - source code - -
- -
-   - - - - - - -
test_module_parse_large_fileobject(self) - source code - -
- -
-   - - - - - - -
test_module_parse_fileobject_error(self) - source code - -
- -
-   - - - - - - -
test_module_parse_fileobject_late_error(self) - source code - -
- -
-   - - - - - - -
test_module_parse_fileobject_type_error(self) - source code - -
- -
-   - - - - - - -
test_etree_parse_io_error(self) - source code - -
- -
-   - - - - - - -
test_parse_utf8_bom(self) - source code - -
- -
-   - - - - - - -
test_iterparse_utf8_bom(self) - source code - -
- -
-   - - - - - - -
test_iterparse_utf16_bom(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree = None
- hash(x) -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUp(self) -

-
source code  -
- - Setting up a minimal tree -
-
Overrides: - unittest.case.TestCase.setUp -
-
-
-
- -
- -
- - -
-

tearDown(self) -

-
source code  -
- - Hook method for deconstructing the test fixture after testing it. -
-
Overrides: - unittest.case.TestCase.tearDown -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_isoschematron-module.html b/doc/html/api/lxml.tests.test_isoschematron-module.html deleted file mode 100644 index a2118bf1..00000000 --- a/doc/html/api/lxml.tests.test_isoschematron-module.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - - lxml.tests.test_isoschematron - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_isoschematron - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_isoschematron

source code

-Test cases related to ISO-Schematron parsing and validation - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ETreeISOSchematronTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_isoschematron-pysrc.html b/doc/html/api/lxml.tests.test_isoschematron-pysrc.html deleted file mode 100644 index 6a5fadbf..00000000 --- a/doc/html/api/lxml.tests.test_isoschematron-pysrc.html +++ /dev/null @@ -1,1681 +0,0 @@ - - - - - lxml.tests.test_isoschematron - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_isoschematron - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_isoschematron

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Test cases related to ISO-Schematron parsing and validation 
-  5  """ 
-  6   
-  7  import unittest, sys, os.path 
-  8  from lxml import isoschematron 
-  9   
- 10  this_dir = os.path.dirname(__file__) 
- 11  if this_dir not in sys.path: 
- 12      sys.path.insert(0, this_dir) # needed for Py3 
- 13   
- 14  from common_imports import etree, HelperTestCase, fileInTestDir 
- 15  from common_imports import doctest, make_doctest 
- 16   
- 17   
-
18 -class ETreeISOSchematronTestCase(HelperTestCase): -
19 - def test_schematron(self): -
20 tree_valid = self.parse('<AAA><BBB/><CCC/></AAA>') - 21 tree_invalid = self.parse('<AAA><BBB/><CCC/><DDD/></AAA>') - 22 schema = self.parse('''\ - 23 <schema xmlns="http://purl.oclc.org/dsdl/schematron" > - 24 <pattern id="OpenModel"> - 25 <title>Open Model</title> - 26 <rule context="AAA"> - 27 <assert test="BBB"> BBB element is not present</assert> - 28 <assert test="CCC"> CCC element is not present</assert> - 29 </rule> - 30 </pattern> - 31 <pattern id="ClosedModel"> - 32 <title>Closed model"</title> - 33 <rule context="AAA"> - 34 <assert test="BBB"> BBB element is not present</assert> - 35 <assert test="CCC"> CCC element is not present</assert> - 36 <assert test="count(BBB|CCC) = count (*)">There is an extra element</assert> - 37 </rule> - 38 </pattern> - 39 </schema> - 40 ''') - 41 - 42 schema = isoschematron.Schematron(schema) - 43 self.assertTrue(schema.validate(tree_valid)) - 44 self.assertTrue(not schema.validate(tree_invalid)) -
45 -
47 self.assertRaises(ValueError, isoschematron.Schematron, etree.ElementTree()) -
48 - 49 # an empty pattern is valid in iso schematron -
51 schema = self.parse('''\ - 52 <schema xmlns="http://purl.oclc.org/dsdl/schematron" > - 53 <pattern id="OpenModel"> - 54 <title>Open model</title> - 55 </pattern> - 56 </schema> - 57 ''') - 58 schema = isoschematron.Schematron(schema) - 59 self.assertTrue(schema) -
60 -
62 schema = self.parse('''\ - 63 <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> - 64 ''') - 65 self.assertRaises(etree.SchematronParseError, - 66 isoschematron.Schematron, schema) -
67 -
69 schema = self.parse('''\ - 70 <schema xmlns="mynamespace" /> - 71 ''') - 72 self.assertRaises(etree.SchematronParseError, - 73 isoschematron.Schematron, schema) -
74 -
75 - def test_schematron_from_tree(self): -
76 schema = self.parse('''\ - 77 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> - 78 <sch:pattern id="number_of_entries"> - 79 <sch:title>mandatory number_of_entries tests</sch:title> - 80 <sch:rule context="number_of_entries"> - 81 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> - 82 </sch:rule> - 83 </sch:pattern> - 84 </sch:schema> - 85 ''') - 86 schematron = isoschematron.Schematron(schema) - 87 self.assertTrue(isinstance(schematron, isoschematron.Schematron)) -
88 -
90 schema = self.parse('''\ - 91 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> - 92 <sch:pattern id="number_of_entries"> - 93 <sch:title>mandatory number_of_entries tests</sch:title> - 94 <sch:rule context="number_of_entries"> - 95 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> - 96 </sch:rule> - 97 </sch:pattern> - 98 </sch:schema> - 99 ''') -100 schematron = isoschematron.Schematron(schema.getroot()) -101 self.assertTrue(isinstance(schematron, isoschematron.Schematron)) -
102 -
103 - def test_schematron_from_file(self): -
104 schematron = isoschematron.Schematron(file=fileInTestDir('test.sch')) -105 self.assertTrue(isinstance(schematron, isoschematron.Schematron)) -
106 -
107 - def test_schematron_call(self): -
108 schema = self.parse('''\ -109 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -110 <sch:pattern id="number_of_entries"> -111 <sch:title>mandatory number_of_entries tests</sch:title> -112 <sch:rule context="number_of_entries"> -113 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -114 </sch:rule> -115 </sch:pattern> -116 </sch:schema> -117 ''') -118 tree_valid = self.parse('''\ -119 <message> -120 <number_of_entries>0</number_of_entries> -121 <entries> -122 </entries> -123 </message> -124 ''') -125 tree_invalid = self.parse('''\ -126 <message> -127 <number_of_entries>3</number_of_entries> -128 <entries> -129 <entry>Entry 1</entry> -130 <entry>Entry 2</entry> -131 </entries> -132 </message> -133 ''') -134 schematron = isoschematron.Schematron(schema) -135 self.assertTrue(schematron(tree_valid), schematron.error_log) -136 valid = schematron(tree_invalid) -137 self.assertTrue(not valid) -
138 -
139 - def test_schematron_validate(self): -
140 schema = self.parse('''\ -141 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -142 <sch:pattern id="number_of_entries"> -143 <sch:title>mandatory number_of_entries tests</sch:title> -144 <sch:rule context="number_of_entries"> -145 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -146 </sch:rule> -147 </sch:pattern> -148 </sch:schema> -149 ''') -150 tree_valid = self.parse('''\ -151 <message> -152 <number_of_entries>0</number_of_entries> -153 <entries> -154 </entries> -155 </message> -156 ''') -157 tree_invalid = self.parse('''\ -158 <message> -159 <number_of_entries>3</number_of_entries> -160 <entries> -161 <entry>Entry 1</entry> -162 <entry>Entry 2</entry> -163 </entries> -164 </message> -165 ''') -166 schematron = isoschematron.Schematron(schema) -167 self.assertTrue(schematron.validate(tree_valid), schematron.error_log) -168 valid = schematron.validate(tree_invalid) -169 self.assertTrue(not valid) -
170 -
172 schema = self.parse('''\ -173 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -174 <sch:pattern id="number_of_entries"> -175 <sch:title>mandatory number_of_entries tests</sch:title> -176 <sch:rule context="number_of_entries"> -177 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -178 </sch:rule> -179 </sch:pattern> -180 </sch:schema> -181 ''') -182 tree_valid = self.parse('''\ -183 <message> -184 <number_of_entries>0</number_of_entries> -185 <entries> -186 </entries> -187 </message> -188 ''') -189 tree_invalid = self.parse('''\ -190 <message> -191 <number_of_entries>3</number_of_entries> -192 <entries> -193 <entry>Entry 1</entry> -194 <entry>Entry 2</entry> -195 </entries> -196 </message> -197 ''') -198 schematron = isoschematron.Schematron(schema) -199 self.assertTrue(schematron(tree_valid), schematron.error_log) -200 self.assertRaises(etree.DocumentInvalid, schematron.assertValid, -201 tree_invalid) -
202 -
203 - def test_schematron_error_log(self): -
204 schema = self.parse('''\ -205 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -206 <sch:pattern id="number_of_entries"> -207 <sch:title>mandatory number_of_entries tests</sch:title> -208 <sch:rule context="number_of_entries"> -209 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -210 </sch:rule> -211 </sch:pattern> -212 </sch:schema> -213 ''') -214 tree_valid = self.parse('''\ -215 <message> -216 <number_of_entries>0</number_of_entries> -217 <entries> -218 </entries> -219 </message> -220 ''') -221 tree_invalid = self.parse('''\ -222 <message> -223 <number_of_entries>3</number_of_entries> -224 <entries> -225 <entry>Entry 1</entry> -226 <entry>Entry 2</entry> -227 </entries> -228 </message> -229 ''') -230 schematron = isoschematron.Schematron(schema) -231 self.assertTrue(schematron(tree_valid), schematron.error_log) -232 valid = schematron(tree_invalid) -233 self.assertTrue(not valid) -234 self.assertEqual(len(schematron.error_log), 1, -235 'expected single error: %s (%s errors)' % -236 (schematron.error_log, len(schematron.error_log))) -
237 -
239 schema = self.parse('''\ -240 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -241 <sch:pattern id="number_of_entries"> -242 <sch:title>mandatory number_of_entries tests</sch:title> -243 <sch:rule context="number_of_entries"> -244 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -245 </sch:rule> -246 </sch:pattern> -247 </sch:schema> -248 ''') -249 tree_valid = self.parse('''\ -250 <message> -251 <number_of_entries>0</number_of_entries> -252 <entries> -253 </entries> -254 </message> -255 ''') -256 tree_invalid = self.parse('''\ -257 <message> -258 <number_of_entries>3</number_of_entries> -259 <entries> -260 <entry>Entry 1</entry> -261 <entry>Entry 2</entry> -262 </entries> -263 </message> -264 ''') -265 schematron = isoschematron.Schematron(schema, store_report=True) -266 self.assertTrue(schematron(tree_valid), schematron.error_log) -267 valid = schematron(tree_invalid) -268 self.assertTrue(not valid) -269 self.assertTrue( -270 isinstance(schematron.validation_report, etree._ElementTree), -271 'expected a validation report result tree, got: %s' % -272 (schematron.validation_report)) -273 -274 schematron = isoschematron.Schematron(schema, store_report=False) -275 self.assertTrue(schematron(tree_valid), schematron.error_log) -276 valid = schematron(tree_invalid) -277 self.assertTrue(not valid) -278 self.assertTrue(schematron.validation_report is None, -279 'validation reporting switched off, still: %s' % -280 (schematron.validation_report)) -
281 -
283 schema = self.parse('''\ -284 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -285 <sch:pattern id="number_of_entries"> -286 <sch:title>mandatory number_of_entries tests</sch:title> -287 <sch:rule context="number_of_entries"> -288 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -289 </sch:rule> -290 </sch:pattern> -291 </sch:schema> -292 ''') -293 schematron = isoschematron.Schematron(schema) -294 self.assertTrue(schematron.validator_xslt is None) -295 -296 schematron = isoschematron.Schematron(schema, store_schematron=True) -297 self.assertTrue(isinstance(schematron.schematron, etree._ElementTree), -298 'expected schematron schema to be stored') -
299 -
300 - def test_schematron_store_xslt(self): -
301 schema = self.parse('''\ -302 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -303 <sch:pattern id="number_of_entries"> -304 <sch:title>mandatory number_of_entries tests</sch:title> -305 <sch:rule context="number_of_entries"> -306 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -307 </sch:rule> -308 </sch:pattern> -309 </sch:schema> -310 ''') -311 schematron = isoschematron.Schematron(schema) -312 self.assertTrue(schematron.validator_xslt is None) -313 -314 schematron = isoschematron.Schematron(schema, store_xslt=True) -315 self.assertTrue(isinstance(schematron.validator_xslt, etree._ElementTree), -316 'expected validator xslt to be stored') -
317 -
318 - def test_schematron_abstract(self): -
319 schema = self.parse('''\ -320 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -321 <sch:title>iso schematron validation</sch:title> -322 <sch:ns uri="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi"/> -323 <sch:ns uri="http://codespeak.net/lxml/objectify/pytype" prefix="py"/> -324 -325 <!-- of course, these only really make sense when combined with a schema that -326 ensures datatype xs:dateTime --> -327 -328 <sch:pattern abstract="true" id="abstract.dateTime.tz_utc"> -329 <sch:rule context="$datetime"> -330 <sch:let name="tz" value="concat(substring-after(substring-after(./text(), 'T'), '+'), substring-after(substring-after(./text(), 'T'), '-'))"/> -331 <sch:let name="lastchar" value="substring(./text(), string-length(./text()))"/> -332 <sch:assert test="$lastchar='Z' or $tz='00:00'">[ERROR] element (<sch:value-of select="name(.)"/>) dateTime value (<sch:value-of select="."/>) is not qualified as UTC (tz: <sch:value-of select="$tz"/>)</sch:assert> -333 </sch:rule> -334 </sch:pattern> -335 -336 <sch:pattern abstract="true" id="abstract.dateTime.tz_utc_nillable"> -337 <sch:rule context="$datetime"> -338 <sch:let name="tz" value="concat(substring-after(substring-after(./text(), 'T'), '+'), substring-after(substring-after(./text(), 'T'), '-'))"/> -339 <sch:let name="lastchar" value="substring(./text(), string-length(./text()))"/> -340 <sch:assert test="@xsi:nil='true' or ($lastchar='Z' or $tz='00:00')">[ERROR] element (<sch:value-of select="name(.)"/>) dateTime value (<sch:value-of select="."/>) is not qualified as UTC (tz: <sch:value-of select="$tz"/>)</sch:assert> -341 </sch:rule> -342 </sch:pattern> -343 -344 <sch:pattern is-a="abstract.dateTime.tz_utc" id="datetime" > -345 <sch:param name="datetime" value="datetime"/> -346 </sch:pattern> -347 -348 <sch:pattern is-a="abstract.dateTime.tz_utc_nillable" id="nillableDatetime"> -349 <sch:param name="datetime" value="nillableDatetime"/> -350 </sch:pattern> -351 -352 </sch:schema> -353 ''') -354 valid_trees = [ -355 self.parse('''\ -356 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -357 <datetime>2009-12-10T15:21:00Z</datetime> -358 <nillableDatetime xsi:nil="true"/> -359 </root> -360 '''), -361 self.parse('''\ -362 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -363 <datetime>2009-12-10T15:21:00Z</datetime> -364 <nillableDatetime>2009-12-10T15:21:00Z</nillableDatetime> -365 </root> -366 '''), -367 self.parse('''\ -368 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -369 <datetime>2009-12-10T15:21:00+00:00</datetime> -370 <nillableDatetime>2009-12-10T15:21:00-00:00</nillableDatetime> -371 </root> -372 '''), -373 ] -374 -375 schematron = isoschematron.Schematron(schema) -376 for tree_valid in valid_trees: -377 self.assertTrue(schematron(tree_valid), schematron.error_log) -378 -379 tree_invalid = self.parse('''\ -380 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -381 <datetime>2009-12-10T16:21:00+01:00</datetime> -382 <nillableDatetime>2009-12-10T16:21:00+01:00</nillableDatetime> -383 </root> -384 ''') -385 expected = 2 -386 valid = schematron(tree_invalid) -387 self.assertTrue(not valid) -388 self.assertEqual( -389 len(schematron.error_log), expected, -390 'expected %s errors: %s (%s errors)' % -391 (expected, schematron.error_log, len(schematron.error_log))) -392 -393 tree_invalid = self.parse('''\ -394 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -395 <datetime xsi:nil="true"/> -396 <nillableDatetime>2009-12-10T16:21:00Z</nillableDatetime> -397 </root> -398 ''') -399 expected = 1 -400 valid = schematron(tree_invalid) -401 self.assertTrue(not valid) -402 self.assertEqual( -403 len(schematron.error_log), expected, -404 'expected %s errors: %s (%s errors)' % -405 (expected, schematron.error_log, len(schematron.error_log))) -
406 -
407 - def test_schematron_phases(self): -
408 schema = self.parse('''\ -409 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -410 <sch:title>iso schematron validation</sch:title> -411 <sch:ns uri="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi"/> -412 <sch:ns uri="http://codespeak.net/lxml/objectify/pytype" prefix="py"/> -413 -414 <sch:phase id="mandatory"> -415 <sch:active pattern="number_of_entries"/> -416 </sch:phase> -417 -418 <sch:phase id="datetime_checks"> -419 <sch:active pattern="datetime"/> -420 <sch:active pattern="nillableDatetime"/> -421 </sch:phase> -422 -423 <sch:phase id="full"> -424 <sch:active pattern="number_of_entries"/> -425 <sch:active pattern="datetime"/> -426 <sch:active pattern="nillableDatetime"/> -427 </sch:phase> -428 -429 <!-- of course, these only really make sense when combined with a schema that -430 ensures datatype xs:dateTime --> -431 -432 <sch:pattern abstract="true" id="abstract.dateTime.tz_utc"> -433 <sch:rule context="$datetime"> -434 <sch:let name="tz" value="concat(substring-after(substring-after(./text(), 'T'), '+'), substring-after(substring-after(./text(), 'T'), '-'))"/> -435 <sch:let name="lastchar" value="substring(./text(), string-length(./text()))"/> -436 <sch:assert test="$lastchar='Z' or $tz='00:00'">[ERROR] element (<sch:value-of select="name(.)"/>) dateTime value (<sch:value-of select="."/>) is not qualified as UTC (tz: <sch:value-of select="$tz"/>)</sch:assert> -437 </sch:rule> -438 </sch:pattern> -439 -440 <sch:pattern abstract="true" id="abstract.dateTime.tz_utc_nillable"> -441 <sch:rule context="$datetime"> -442 <sch:let name="tz" value="concat(substring-after(substring-after(./text(), 'T'), '+'), substring-after(substring-after(./text(), 'T'), '-'))"/> -443 <sch:let name="lastchar" value="substring(./text(), string-length(./text()))"/> -444 <sch:assert test="@xsi:nil='true' or ($lastchar='Z' or $tz='00:00')">[ERROR] element (<sch:value-of select="name(.)"/>) dateTime value (<sch:value-of select="."/>) is not qualified as UTC (tz: <sch:value-of select="$tz"/>)</sch:assert> -445 </sch:rule> -446 </sch:pattern> -447 -448 <sch:pattern id="number_of_entries"> -449 <sch:title>mandatory number_of_entries test</sch:title> -450 <sch:rule context="number_of_entries"> -451 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -452 </sch:rule> -453 </sch:pattern> -454 -455 <sch:pattern id="datetime" is-a="abstract.dateTime.tz_utc"> -456 <sch:param name="datetime" value="datetime"/> -457 </sch:pattern> -458 -459 <sch:pattern id="nillableDatetime" is-a="abstract.dateTime.tz_utc_nillable"> -460 <sch:param name="datetime" value="nillableDatetime"/> -461 </sch:pattern> -462 -463 </sch:schema> -464 ''') -465 tree_valid = self.parse('''\ -466 <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -467 <datetime>2009-12-10T15:21:00Z</datetime> -468 <nillableDatetime xsi:nil="true"/> -469 <number_of_entries>0</number_of_entries> -470 <entries> -471 </entries> -472 </message> -473 ''') -474 tree_invalid = self.parse('''\ -475 <message> -476 <datetime>2009-12-10T16:21:00+01:00</datetime> -477 <nillableDatetime>2009-12-10T16:21:00+01:00</nillableDatetime> -478 <number_of_entries>3</number_of_entries> -479 <entries> -480 <entry>Entry 1</entry> -481 <entry>Entry 2</entry> -482 </entries> -483 </message> -484 ''') -485 # check everything (default phase #ALL) -486 schematron = isoschematron.Schematron(schema) -487 self.assertTrue(schematron(tree_valid), schematron.error_log) -488 expected = 3 -489 valid = schematron(tree_invalid) -490 self.assertTrue(not valid) -491 self.assertEqual( -492 len(schematron.error_log), expected, -493 'expected %s errors: %s (%s errors)' % -494 (expected, schematron.error_log, len(schematron.error_log))) -495 -496 # check phase mandatory -497 schematron = isoschematron.Schematron( -498 schema, compile_params={'phase': 'mandatory'}) -499 self.assertTrue(schematron(tree_valid), schematron.error_log) -500 expected = 1 -501 valid = schematron(tree_invalid) -502 self.assertTrue(not valid) -503 self.assertEqual( -504 len(schematron.error_log), expected, -505 'expected %s errors: %s (%s errors)' % -506 (expected, schematron.error_log, len(schematron.error_log))) -507 -508 # check phase datetime_checks -509 schematron = isoschematron.Schematron( -510 schema, compile_params={'phase': 'datetime_checks'}) -511 self.assertTrue(schematron(tree_valid), schematron.error_log) -512 expected = 2 -513 valid = schematron(tree_invalid) -514 self.assertTrue(not valid) -515 self.assertEqual( -516 len(schematron.error_log), expected, -517 'expected %s errors: %s (%s errors)' % -518 (expected, schematron.error_log, len(schematron.error_log))) -519 -520 # check phase full -521 schematron = isoschematron.Schematron( -522 schema, compile_params={'phase': 'full'}) -523 self.assertTrue(schematron(tree_valid), schematron.error_log) -524 expected = 3 -525 valid = schematron(tree_invalid) -526 self.assertTrue(not valid) -527 self.assertEqual( -528 len(schematron.error_log), expected, -529 'expected %s errors: %s (%s errors)' % -530 (expected, schematron.error_log, len(schematron.error_log))) -
531 -
533 schema = self.parse('''\ -534 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -535 <sch:title>iso schematron validation</sch:title> -536 <sch:ns uri="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi"/> -537 <sch:ns uri="http://codespeak.net/lxml/objectify/pytype" prefix="py"/> -538 -539 <sch:phase id="mandatory"> -540 <sch:active pattern="number_of_entries"/> -541 </sch:phase> -542 -543 <sch:phase id="datetime_checks"> -544 <sch:active pattern="datetime"/> -545 <sch:active pattern="nillableDatetime"/> -546 </sch:phase> -547 -548 <sch:phase id="full"> -549 <sch:active pattern="number_of_entries"/> -550 <sch:active pattern="datetime"/> -551 <sch:active pattern="nillableDatetime"/> -552 </sch:phase> -553 -554 <!-- of course, these only really make sense when combined with a schema that -555 ensures datatype xs:dateTime --> -556 -557 <sch:pattern abstract="true" id="abstract.dateTime.tz_utc"> -558 <sch:rule context="$datetime"> -559 <sch:let name="tz" value="concat(substring-after(substring-after(./text(), 'T'), '+'), substring-after(substring-after(./text(), 'T'), '-'))"/> -560 <sch:let name="lastchar" value="substring(./text(), string-length(./text()))"/> -561 <sch:assert test="$lastchar='Z' or $tz='00:00'">[ERROR] element (<sch:value-of select="name(.)"/>) dateTime value (<sch:value-of select="."/>) is not qualified as UTC (tz: <sch:value-of select="$tz"/>)</sch:assert> -562 </sch:rule> -563 </sch:pattern> -564 -565 <sch:pattern abstract="true" id="abstract.dateTime.tz_utc_nillable"> -566 <sch:rule context="$datetime"> -567 <sch:let name="tz" value="concat(substring-after(substring-after(./text(), 'T'), '+'), substring-after(substring-after(./text(), 'T'), '-'))"/> -568 <sch:let name="lastchar" value="substring(./text(), string-length(./text()))"/> -569 <sch:assert test="@xsi:nil='true' or ($lastchar='Z' or $tz='00:00')">[ERROR] element (<sch:value-of select="name(.)"/>) dateTime value (<sch:value-of select="."/>) is not qualified as UTC (tz: <sch:value-of select="$tz"/>)</sch:assert> -570 </sch:rule> -571 </sch:pattern> -572 -573 <sch:pattern id="number_of_entries"> -574 <sch:title>mandatory number_of_entries test</sch:title> -575 <sch:rule context="number_of_entries"> -576 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -577 </sch:rule> -578 </sch:pattern> -579 -580 <sch:pattern id="datetime" is-a="abstract.dateTime.tz_utc"> -581 <sch:param name="datetime" value="datetime"/> -582 </sch:pattern> -583 -584 <sch:pattern id="nillableDatetime" is-a="abstract.dateTime.tz_utc_nillable"> -585 <sch:param name="datetime" value="nillableDatetime"/> -586 </sch:pattern> -587 -588 </sch:schema> -589 ''') -590 tree_valid = self.parse('''\ -591 <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -592 <datetime>2009-12-10T15:21:00Z</datetime> -593 <nillableDatetime xsi:nil="true"/> -594 <number_of_entries>0</number_of_entries> -595 <entries> -596 </entries> -597 </message> -598 ''') -599 tree_invalid = self.parse('''\ -600 <message> -601 <datetime>2009-12-10T16:21:00+01:00</datetime> -602 <nillableDatetime>2009-12-10T16:21:00+01:00</nillableDatetime> -603 <number_of_entries>3</number_of_entries> -604 <entries> -605 <entry>Entry 1</entry> -606 <entry>Entry 2</entry> -607 </entries> -608 </message> -609 ''') -610 # check everything (default phase #ALL) -611 schematron = isoschematron.Schematron(schema) -612 self.assertTrue(schematron(tree_valid), schematron.error_log) -613 expected = 3 -614 valid = schematron(tree_invalid) -615 self.assertTrue(not valid) -616 self.assertEqual( -617 len(schematron.error_log), expected, -618 'expected %s errors: %s (%s errors)' % -619 (expected, schematron.error_log, len(schematron.error_log))) -620 -621 # check phase mandatory -622 schematron = isoschematron.Schematron(schema, phase='mandatory') -623 self.assertTrue(schematron(tree_valid), schematron.error_log) -624 expected = 1 -625 valid = schematron(tree_invalid) -626 self.assertTrue(not valid) -627 self.assertEqual( -628 len(schematron.error_log), expected, -629 'expected %s errors: %s (%s errors)' % -630 (expected, schematron.error_log, len(schematron.error_log))) -631 -632 # check phase datetime_checks -633 schematron = isoschematron.Schematron(schema, phase='datetime_checks') -634 self.assertTrue(schematron(tree_valid), schematron.error_log) -635 expected = 2 -636 valid = schematron(tree_invalid) -637 self.assertTrue(not valid) -638 self.assertEqual( -639 len(schematron.error_log), expected, -640 'expected %s errors: %s (%s errors)' % -641 (expected, schematron.error_log, len(schematron.error_log))) -642 -643 # check phase full -644 schematron = isoschematron.Schematron(schema, phase='full') -645 self.assertTrue(schematron(tree_valid), schematron.error_log) -646 expected = 3 -647 valid = schematron(tree_invalid) -648 self.assertTrue(not valid) -649 self.assertEqual( -650 len(schematron.error_log), expected, 'expected %s errors: %s (%s errors)' % -651 (expected, schematron.error_log, len(schematron.error_log))) -
652 -
654 schema = self.parse('''\ -655 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" -656 xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -657 <xs:element name="message"> -658 <xs:complexType> -659 <xs:sequence> -660 <xs:element name="number_of_entries" type="xs:positiveInteger"> -661 <xs:annotation> -662 <xs:appinfo> -663 <sch:pattern id="number_of_entries"> -664 <sch:title>mandatory number_of_entries tests</sch:title> -665 <sch:rule context="number_of_entries"> -666 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -667 </sch:rule> -668 </sch:pattern> -669 </xs:appinfo> -670 </xs:annotation> -671 </xs:element> -672 <xs:element name="entries"> -673 <xs:complexType> -674 <xs:sequence> -675 <xs:element name="entry" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> -676 </xs:sequence> -677 </xs:complexType> -678 </xs:element> -679 </xs:sequence> -680 </xs:complexType> -681 </xs:element> -682 </xs:schema> -683 ''') -684 tree_valid = self.parse('''\ -685 <message> -686 <number_of_entries>2</number_of_entries> -687 <entries> -688 <entry>Entry 1</entry> -689 <entry>Entry 2</entry> -690 </entries> -691 </message> -692 ''') -693 tree_invalid = self.parse('''\ -694 <message> -695 <number_of_entries>1</number_of_entries> -696 <entries> -697 <entry>Entry 1</entry> -698 <entry>Entry 2</entry> -699 </entries> -700 </message> -701 ''') -702 xmlschema = etree.XMLSchema(schema) -703 schematron = isoschematron.Schematron(schema) -704 # fwiw, this must also be XMLSchema-valid -705 self.assertTrue(xmlschema(tree_valid), xmlschema.error_log) -706 self.assertTrue(schematron(tree_valid)) -707 # still schema-valid -708 self.assertTrue(xmlschema(tree_invalid), xmlschema.error_log) -709 self.assertTrue(not schematron(tree_invalid)) -
710 -
712 schema = self.parse('''\ -713 <grammar xmlns="http://relaxng.org/ns/structure/1.0" -714 xmlns:sch="http://purl.oclc.org/dsdl/schematron" -715 datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> -716 <start> -717 <ref name="message"/> -718 </start> -719 <define name="message"> -720 <element name="message"> -721 <element name="number_of_entries"> -722 <!-- RelaxNG can be mixed freely with stuff from other namespaces --> -723 <sch:pattern id="number_of_entries"> -724 <sch:title>mandatory number_of_entries tests</sch:title> -725 <sch:rule context="number_of_entries"> -726 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -727 </sch:rule> -728 </sch:pattern> -729 <data type="positiveInteger"/> -730 </element> -731 <element name="entries"> -732 <zeroOrMore> -733 <element name="entry"><data type="string"/></element> -734 </zeroOrMore> -735 </element> -736 </element> -737 </define> -738 </grammar> -739 ''') -740 tree_valid = self.parse('''\ -741 <message> -742 <number_of_entries>2</number_of_entries> -743 <entries> -744 <entry>Entry 1</entry> -745 <entry>Entry 2</entry> -746 </entries> -747 </message> -748 ''') -749 tree_invalid = self.parse('''\ -750 <message> -751 <number_of_entries>1</number_of_entries> -752 <entries> -753 <entry>Entry 1</entry> -754 <entry>Entry 2</entry> -755 </entries> -756 </message> -757 ''') -758 relaxng = etree.RelaxNG(schema) -759 schematron = isoschematron.Schematron(schema) -760 # fwiw, this must also be RelaxNG-valid -761 self.assertTrue(relaxng(tree_valid), relaxng.error_log) -762 self.assertTrue(schematron(tree_valid)) -763 # still schema-valid -764 self.assertTrue(relaxng(tree_invalid), relaxng.error_log) -765 self.assertTrue(not schematron(tree_invalid)) -
766 -
768 schema = self.parse('''\ -769 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> -770 <sch:pattern id="number_of_entries"> -771 <sch:title>mandatory number_of_entries tests</sch:title> -772 <sch:rule context="number_of_entries"> -773 <sch:assert test="text()=count(../entries/entry)">[ERROR] number_of_entries (<sch:value-of select="."/>) must equal the number of entries/entry elements (<sch:value-of select="count(../entries/entry)"/>)</sch:assert> -774 </sch:rule> -775 </sch:pattern> -776 </sch:schema> -777 ''') -778 # handing phase as keyword arg will *not* raise the type error -779 self.assertRaises(TypeError, isoschematron.Schematron, schema, -780 compile_params={'phase': None}) -
781 -
783 class MySchematron(isoschematron.Schematron): -784 def _extract(self, root): -785 schematron = (root.xpath( -786 '//sch:schema', -787 namespaces={'sch': "http://purl.oclc.org/dsdl/schematron"}) -788 or [None])[0] -789 return schematron -
790 -791 def _include(self, schematron, **kwargs): -792 raise RuntimeError('inclusion unsupported') -
793 -794 def _expand(self, schematron, **kwargs): -795 raise RuntimeError('expansion unsupported') -796 -797 def _validation_errors(self, validationReport): -798 valid = etree.XPath( -799 'count(//svrl:successful-report[@flag="critical"])=1', -800 namespaces={'svrl': isoschematron.SVRL_NS})( -801 validationReport) -802 if valid: -803 return [] -804 error = etree.Element('Error') -805 error.text = 'missing critical condition report' -806 return [error] -807 -808 tree_valid = self.parse('<AAA><BBB/><CCC/></AAA>') -809 tree_invalid = self.parse('<AAA><BBB/><CCC/><DDD/></AAA>') -810 schema = self.parse('''\ -811 <schema xmlns="http://www.example.org/yet/another/schema/dialect"> -812 <schema xmlns="http://purl.oclc.org/dsdl/schematron" > -813 <pattern id="OpenModel"> -814 <title>Open Model</title> -815 <rule context="AAA"> -816 <report test="BBB" flag="info">BBB element must be present</report> -817 <report test="CCC" flag="info">CCC element must be present</report> -818 </rule> -819 </pattern> -820 <pattern id="ClosedModel"> -821 <title>Closed model"</title> -822 <rule context="AAA"> -823 <report test="BBB" flag="info">BBB element must be present</report> -824 <report test="CCC" flag="info">CCC element must be present</report> -825 <report test="count(BBB|CCC) = count(*)" flag="critical">Only BBB and CCC children must be present</report> -826 </rule> -827 </pattern> -828 </schema> -829 </schema> -830 ''') -831 # check if overridden _include is run -832 self.assertRaises(RuntimeError, MySchematron, schema, store_report=True) -833 # check if overridden _expand is run -834 self.assertRaises(RuntimeError, MySchematron, schema, store_report=True, -835 include=False) -836 -837 schema = MySchematron(schema, store_report=True, include=False, -838 expand=False) -839 self.assertTrue(schema.validate(tree_valid)) -840 self.assertTrue(not schema.validate(tree_invalid)) -841 -842 #TODO: test xslt parameters for inclusion, expand & compile steps (?) -843 -
845 tree_valid = self.parse('<AAA><BBB/><CCC/></AAA>') -846 tree_invalid = self.parse('<AAA><BBB/><CCC/><DDD/></AAA>') -847 schema = self.parse('''\ -848 <schema xmlns="http://purl.oclc.org/dsdl/schematron" > -849 <pattern id="OpenModel"> -850 <title>Simple Report</title> -851 <rule context="AAA"> -852 <report test="DDD"> DDD element must not be present</report> -853 </rule> -854 </pattern> -855 </schema> -856 ''') -857 schema_report = isoschematron.Schematron( -858 schema, error_finder=isoschematron.Schematron.ASSERTS_AND_REPORTS) -859 schema_no_report = isoschematron.Schematron(schema) -860 self.assertTrue(schema_report.validate(tree_valid)) -861 self.assertTrue(not schema_report.validate(tree_invalid)) -862 self.assertTrue(schema_no_report.validate(tree_valid)) -863 self.assertTrue(schema_no_report.validate(tree_invalid)) -
864 -865 -
866 -def test_suite(): -
867 suite = unittest.TestSuite() -868 suite.addTests([unittest.makeSuite(ETreeISOSchematronTestCase)]) -869 suite.addTests(doctest.DocTestSuite(isoschematron)) -870 suite.addTests( -871 [make_doctest('../../../doc/validation.txt')]) -872 return suite -
873 -874 if __name__ == '__main__': -875 print('to test use test.py %s' % __file__) -876 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html b/doc/html/api/lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html deleted file mode 100644 index c05d6393..00000000 --- a/doc/html/api/lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html +++ /dev/null @@ -1,713 +0,0 @@ - - - - - lxml.tests.test_isoschematron.ETreeISOSchematronTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_isoschematron :: - Class ETreeISOSchematronTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeISOSchematronTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeISOSchematronTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_schematron(self) - source code - -
- -
-   - - - - - - -
test_schematron_elementtree_error(self) - source code - -
- -
-   - - - - - - -
test_schematron_empty_pattern(self) - source code - -
- -
-   - - - - - - -
test_schematron_invalid_schema_empty(self) - source code - -
- -
-   - - - - - - -
test_schematron_invalid_schema_namespace(self) - source code - -
- -
-   - - - - - - -
test_schematron_from_tree(self) - source code - -
- -
-   - - - - - - -
test_schematron_from_element(self) - source code - -
- -
-   - - - - - - -
test_schematron_from_file(self) - source code - -
- -
-   - - - - - - -
test_schematron_call(self) - source code - -
- -
-   - - - - - - -
test_schematron_validate(self) - source code - -
- -
-   - - - - - - -
test_schematron_assertValid(self) - source code - -
- -
-   - - - - - - -
test_schematron_error_log(self) - source code - -
- -
-   - - - - - - -
test_schematron_result_report(self) - source code - -
- -
-   - - - - - - -
test_schematron_store_schematron(self) - source code - -
- -
-   - - - - - - -
test_schematron_store_xslt(self) - source code - -
- -
-   - - - - - - -
test_schematron_abstract(self) - source code - -
- -
-   - - - - - - -
test_schematron_phases(self) - source code - -
- -
-   - - - - - - -
test_schematron_phases_kwarg(self) - source code - -
- -
-   - - - - - - -
test_schematron_xmlschema_embedded(self) - source code - -
- -
-   - - - - - - -
test_schematron_relaxng_embedded(self) - source code - -
- -
-   - - - - - - -
test_schematron_invalid_args(self) - source code - -
- -
-   - - - - - - -
test_schematron_customization(self) - source code - -
- -
-   - - - - - - -
test_schematron_fail_on_report(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_nsclasses-module.html b/doc/html/api/lxml.tests.test_nsclasses-module.html deleted file mode 100644 index b8d70763..00000000 --- a/doc/html/api/lxml.tests.test_nsclasses-module.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - lxml.tests.test_nsclasses - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_nsclasses - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_nsclasses

source code

-Test cases related to namespace implementation classes and the -namespace registry mechanism - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ETreeNamespaceClassesTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_nsclasses-pysrc.html b/doc/html/api/lxml.tests.test_nsclasses-pysrc.html deleted file mode 100644 index 170791c3..00000000 --- a/doc/html/api/lxml.tests.test_nsclasses-pysrc.html +++ /dev/null @@ -1,636 +0,0 @@ - - - - - lxml.tests.test_nsclasses - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_nsclasses - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_nsclasses

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Test cases related to namespace implementation classes and the 
-  5  namespace registry mechanism 
-  6  """ 
-  7   
-  8  import unittest, sys, os.path 
-  9   
- 10  this_dir = os.path.dirname(__file__) 
- 11  if this_dir not in sys.path: 
- 12      sys.path.insert(0, this_dir) # needed for Py3 
- 13   
- 14  from common_imports import etree, HelperTestCase, _bytes 
- 15  from common_imports import doctest, make_doctest 
- 16   
-
17 -class ETreeNamespaceClassesTestCase(HelperTestCase): -
18 -
19 - class default_class(etree.ElementBase): -
20 pass -
21 - class maeh_class(etree.ElementBase): -
22 - def maeh(self): -
23 return 'maeh' -
24 - class bluff_class(etree.ElementBase): -
25 - def bluff(self): -
26 return 'bluff' -
27 -
28 - def setUp(self): -
35 -
36 - def tearDown(self): -
37 etree.set_default_parser() - 38 del self.Namespace - 39 super(ETreeNamespaceClassesTestCase, self).tearDown() -
40 -
41 - def test_registry(self): -
42 ns = self.Namespace('ns01') - 43 ns['maeh'] = self.maeh_class - 44 - 45 self.Namespace('ns01').clear() - 46 - 47 self.Namespace('ns02').update({'maeh' : self.maeh_class}) - 48 self.Namespace('ns03').update({'bluff' : self.bluff_class}.items()) - 49 self.Namespace('ns02').clear() - 50 self.Namespace('ns03').clear() -
51 -
52 - def test_ns_classes(self): -
53 bluff_dict = {'bluff' : self.bluff_class} - 54 maeh_dict = {'maeh' : self.maeh_class} - 55 - 56 self.Namespace('ns10').update(bluff_dict) - 57 - 58 tree = self.parse(_bytes('<bluff xmlns="ns10"><ns11:maeh xmlns:ns11="ns11"/></bluff>')) - 59 - 60 el = tree.getroot() - 61 self.assertTrue(isinstance(el, etree.ElementBase)) - 62 self.assertTrue(hasattr(el, 'bluff')) - 63 self.assertFalse(hasattr(el[0], 'maeh')) - 64 self.assertFalse(hasattr(el[0], 'bluff')) - 65 self.assertEqual(el.bluff(), 'bluff') - 66 del el - 67 - 68 self.Namespace('ns11').update(maeh_dict) - 69 el = tree.getroot() - 70 self.assertTrue(hasattr(el, 'bluff')) - 71 self.assertTrue(hasattr(el[0], 'maeh')) - 72 self.assertEqual(el.bluff(), 'bluff') - 73 self.assertEqual(el[0].maeh(), 'maeh') - 74 del el - 75 - 76 self.Namespace('ns10').clear() - 77 - 78 tree = self.parse(_bytes('<bluff xmlns="ns10"><ns11:maeh xmlns:ns11="ns11"/></bluff>')) - 79 el = tree.getroot() - 80 self.assertFalse(hasattr(el, 'bluff')) - 81 self.assertFalse(hasattr(el, 'maeh')) - 82 self.assertFalse(hasattr(el[0], 'bluff')) - 83 self.assertTrue(hasattr(el[0], 'maeh')) - 84 - 85 self.Namespace('ns11').clear() -
86 -
87 - def test_default_tagname(self): -
88 bluff_dict = { - 89 None : self.bluff_class, - 90 'maeh' : self.maeh_class - 91 } - 92 - 93 ns = self.Namespace("uri:nsDefClass") - 94 ns.update(bluff_dict) - 95 - 96 tree = self.parse(_bytes(''' - 97 <test xmlns="bla" xmlns:ns1="uri:nsDefClass" xmlns:ns2="uri:nsDefClass"> - 98 <ns2:el1/><ns1:el2/><ns1:maeh/><ns2:maeh/><maeh/> - 99 </test> -100 ''')) -101 -102 el = tree.getroot() -103 self.assertFalse(isinstance(el, etree.ElementBase)) -104 for child in el[:-1]: -105 self.assertTrue(isinstance(child, etree.ElementBase), child.tag) -106 self.assertFalse(isinstance(el[-1], etree.ElementBase)) -107 -108 self.assertTrue(hasattr(el[0], 'bluff')) -109 self.assertTrue(hasattr(el[1], 'bluff')) -110 self.assertTrue(hasattr(el[2], 'maeh')) -111 self.assertTrue(hasattr(el[3], 'maeh')) -112 self.assertFalse(hasattr(el[4], 'maeh')) -113 del el -114 -115 ns.clear() -
116 -
117 - def test_create_element(self): -
118 bluff_dict = {'bluff' : self.bluff_class} -119 self.Namespace('ns20').update(bluff_dict) -120 -121 maeh_dict = {'maeh' : self.maeh_class} -122 self.Namespace('ns21').update(maeh_dict) -123 -124 el = etree.Element("{ns20}bluff") -125 self.assertTrue(hasattr(el, 'bluff')) -126 -127 child = etree.SubElement(el, "{ns21}maeh") -128 self.assertTrue(hasattr(child, 'maeh')) -129 child = etree.SubElement(el, "{ns20}bluff") -130 self.assertTrue(hasattr(child, 'bluff')) -131 child = etree.SubElement(el, "{ns21}bluff") -132 self.assertFalse(hasattr(child, 'bluff')) -133 self.assertFalse(hasattr(child, 'maeh')) -134 -135 self.assertTrue(hasattr(el[0], 'maeh')) -136 self.assertTrue(hasattr(el[1], 'bluff')) -137 self.assertFalse(hasattr(el[2], 'bluff')) -138 self.assertFalse(hasattr(el[2], 'maeh')) -139 -140 self.assertEqual(el.bluff(), 'bluff') -141 self.assertEqual(el[0].maeh(), 'maeh') -142 self.assertEqual(el[1].bluff(), 'bluff') -143 -144 self.Namespace('ns20').clear() -145 self.Namespace('ns21').clear() -
146 -
148 bluff_dict = {None : self.bluff_class} -149 self.Namespace('ns30').update(bluff_dict) -150 -151 maeh_dict = {'maeh' : self.maeh_class} -152 self.Namespace(None).update(maeh_dict) -153 -154 el = etree.Element("{ns30}bluff") -155 etree.SubElement(el, "maeh") -156 self.assertTrue(hasattr(el, 'bluff')) -157 self.assertTrue(hasattr(el[0], 'maeh')) -158 self.assertEqual(el.bluff(), 'bluff') -159 self.assertEqual(el[0].maeh(), 'maeh') -160 -161 self.Namespace(None).clear() -162 self.Namespace('ns30').clear() -
163 -
164 - def test_element_creation(self): -
165 default, bluff, maeh = ( -166 self.default_class, self.bluff_class, self.maeh_class) -167 -168 class honk(etree.ElementBase): -169 TAG = 'HONK' -170 NAMESPACE = 'http://a.b/c' -
171 -172 el = default( -173 "test", -174 "text", -175 bluff(honk, "TaIL", maeh), -176 maeh("TeXT", bluff, honk(), "TAiL"), -177 "Tail") -178 -179 self.assertEqual('default_class', el.tag) -180 self.assertEqual('testtext', el.text) -181 self.assertEqual(None, el.tail) -182 self.assertEqual(2, len(el)) -183 self.assertEqual(7, len(list(el.iter()))) -184 -185 self.assertEqual('bluff_class', el[0].tag) -186 self.assertEqual('TaIL', el[0][0].tail) -187 self.assertEqual('TaIL', ''.join(el[0].itertext())) -188 self.assertEqual('{http://a.b/c}HONK', -189 el[0][0].tag) -190 self.assertEqual('maeh_class', -191 el[0][1].tag) -192 -193 self.assertEqual('maeh_class', el[1].tag) -194 self.assertEqual('TeXT', el[1].text) -195 self.assertEqual('bluff_class', el[1][0].tag) -196 self.assertEqual('{http://a.b/c}HONK', el[1][1].tag) -197 self.assertEqual('TAiL', el[1][1].tail) -198 -199 self.assertEqual('TeXTTAiL', -200 ''.join(el[1].itertext())) -201 self.assertEqual('Tail', el[1].tail) -202 self.assertEqual('TAiL', el[1][1].tail) -203 self.assertEqual('bluff_class', el[1][0].tag) -204 self.assertEqual('{http://a.b/c}HONK', el[1][1].tag) -
205 -206 -
207 -def test_suite(): -
208 suite = unittest.TestSuite() -209 suite.addTests([unittest.makeSuite(ETreeNamespaceClassesTestCase)]) -210 suite.addTests( -211 [make_doctest('../../../doc/element_classes.txt')]) -212 return suite -
213 -214 if __name__ == '__main__': -215 print('to test use test.py %s' % __file__) -216 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html b/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html deleted file mode 100644 index c819b3bf..00000000 --- a/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html +++ /dev/null @@ -1,559 +0,0 @@ - - - - - lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_nsclasses :: - Class ETreeNamespaceClassesTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeNamespaceClassesTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeNamespaceClassesTestCase
-
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-   - - default_class -
-   - - maeh_class -
-   - - bluff_class -
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
setUp(self)
- Hook method for setting up the test fixture before exercising it.
- source code - -
- -
-   - - - - - - -
tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
- source code - -
- -
-   - - - - - - -
test_registry(self) - source code - -
- -
-   - - - - - - -
test_ns_classes(self) - source code - -
- -
-   - - - - - - -
test_default_tagname(self) - source code - -
- -
-   - - - - - - -
test_create_element(self) - source code - -
- -
-   - - - - - - -
test_create_element_default(self) - source code - -
- -
-   - - - - - - -
test_element_creation(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUp(self) -

-
source code  -
- - Hook method for setting up the test fixture before exercising it. -
-
Overrides: - unittest.case.TestCase.setUp -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

tearDown(self) -

-
source code  -
- - Hook method for deconstructing the test fixture after testing it. -
-
Overrides: - unittest.case.TestCase.tearDown -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class-class.html b/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class-class.html deleted file mode 100644 index 1fb4065b..00000000 --- a/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class-class.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_nsclasses :: - Class ETreeNamespaceClassesTestCase :: - Class bluff_class - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class bluff_class

source code

-
-    object --+        
-             |        
-etree._Element --+    
-                 |    
- etree.ElementBase --+
-                     |
-                    ETreeNamespaceClassesTestCase.bluff_class
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
bluff(self) - source code - -
- -
-

Inherited from etree.ElementBase: - __init__, - __new__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __repr__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class-class.html b/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class-class.html deleted file mode 100644 index 64a1bf10..00000000 --- a/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class-class.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_nsclasses :: - Class ETreeNamespaceClassesTestCase :: - Class default_class - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class default_class

source code

-
-    object --+        
-             |        
-etree._Element --+    
-                 |    
- etree.ElementBase --+
-                     |
-                    ETreeNamespaceClassesTestCase.default_class
-
- -
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from etree.ElementBase: - __init__, - __new__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __repr__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class-class.html b/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class-class.html deleted file mode 100644 index b480c3e7..00000000 --- a/doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class-class.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_nsclasses :: - Class ETreeNamespaceClassesTestCase :: - Class maeh_class - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class maeh_class

source code

-
-    object --+        
-             |        
-etree._Element --+    
-                 |    
- etree.ElementBase --+
-                     |
-                    ETreeNamespaceClassesTestCase.maeh_class
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
maeh(self) - source code - -
- -
-

Inherited from etree.ElementBase: - __init__, - __new__ -

-

Inherited from etree._Element: - __contains__, - __copy__, - __deepcopy__, - __delitem__, - __getitem__, - __iter__, - __len__, - __nonzero__, - __repr__, - __reversed__, - __setitem__, - addnext, - addprevious, - append, - clear, - cssselect, - extend, - find, - findall, - findtext, - get, - getchildren, - getiterator, - getnext, - getparent, - getprevious, - getroottree, - index, - insert, - items, - iter, - iterancestors, - iterchildren, - iterdescendants, - iterfind, - itersiblings, - itertext, - keys, - makeelement, - remove, - replace, - set, - values, - xpath -

-

Inherited from etree._Element (private): - _init -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from etree._Element: - attrib, - base, - nsmap, - prefix, - sourceline, - tag, - tail, - text -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_objectify-module.html b/doc/html/api/lxml.tests.test_objectify-module.html deleted file mode 100644 index 2b8cdfdc..00000000 --- a/doc/html/api/lxml.tests.test_objectify-module.html +++ /dev/null @@ -1,564 +0,0 @@ - - - - - lxml.tests.test_objectify - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_objectify - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_objectify

source code

-Tests specific to the lxml.objectify API - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ObjectifyTestCase
- Test cases for lxml.objectify -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - PYTYPE_NAMESPACE = 'http://codespeak.net/lxml/objectify/pytype' -
-   - - XML_SCHEMA_NS = 'http://www.w3.org/2001/XMLSchema' -
-   - - XML_SCHEMA_INSTANCE_NS = 'http://www.w3.org/2001/XMLSchema-ins... -
-   - - XML_SCHEMA_INSTANCE_TYPE_ATTR = '{http://www.w3.org/2001/XMLSc... -
-   - - XML_SCHEMA_NIL_ATTR = '{http://www.w3.org/2001/XMLSchema-insta... -
-   - - TREE_PYTYPE = 'TREE' -
-   - - DEFAULT_NSMAP = {'py': 'http://codespeak.net/lxml/objectify/py... -
-   - - objectclass2xsitype = {<type 'lxml.objectify.IntElement'>: ('i... -
-   - - xsitype2objclass = {'ENTITY': <type 'lxml.objectify.StringElem... -
-   - - objectclass2pytype = {<type 'lxml.objectify.IntElement'>: 'int... -
-   - - pytype2objclass = {'bool': <type 'lxml.objectify.BoolElement'>... -
-   - - xml_str = '<obj:root xmlns:obj="objectified" xmlns:other="othe... -
-   - - __package__ = 'lxml.tests' -
-   - - v = 'double' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
- -
- -
-

XML_SCHEMA_INSTANCE_NS

- -
-
-
-
Value:
-
-'http://www.w3.org/2001/XMLSchema-instance'
-
-
-
-
-
- -
- -
-

XML_SCHEMA_INSTANCE_TYPE_ATTR

- -
-
-
-
Value:
-
-'{http://www.w3.org/2001/XMLSchema-instance}type'
-
-
-
-
-
- -
- -
-

XML_SCHEMA_NIL_ATTR

- -
-
-
-
Value:
-
-'{http://www.w3.org/2001/XMLSchema-instance}nil'
-
-
-
-
-
- -
- -
-

DEFAULT_NSMAP

- -
-
-
-
Value:
-
-{'py': 'http://codespeak.net/lxml/objectify/pytype',
- 'xsd': 'http://www.w3.org/2001/XMLSchema',
- 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
-
-
-
-
-
- -
- -
-

objectclass2xsitype

- -
-
-
-
Value:
-
-{<type 'lxml.objectify.IntElement'>: ('int',
-                                      'short',
-                                      'byte',
-                                      'unsignedShort',
-                                      'unsignedByte',
-                                      'integer',
-                                      'nonPositiveInteger',
-                                      'negativeInteger',
-...
-
-
-
-
-
- -
- -
-

xsitype2objclass

- -
-
-
-
Value:
-
-{'ENTITY': <type 'lxml.objectify.StringElement'>,
- 'ID': <type 'lxml.objectify.StringElement'>,
- 'IDREF': <type 'lxml.objectify.StringElement'>,
- 'NCName': <type 'lxml.objectify.StringElement'>,
- 'NMTOKEN': <type 'lxml.objectify.StringElement'>,
- 'Name': <type 'lxml.objectify.StringElement'>,
- 'boolean': <type 'lxml.objectify.BoolElement'>,
- 'byte': <type 'lxml.objectify.IntElement'>,
-...
-
-
-
-
-
- -
- -
-

objectclass2pytype

- -
-
-
-
Value:
-
-{<type 'lxml.objectify.IntElement'>: 'int',
- <type 'lxml.objectify.FloatElement'>: 'float',
- <type 'lxml.objectify.StringElement'>: 'str',
- <type 'lxml.objectify.BoolElement'>: 'bool'}
-
-
-
-
-
- -
- -
-

pytype2objclass

- -
-
-
-
Value:
-
-{'bool': <type 'lxml.objectify.BoolElement'>,
- 'float': <type 'lxml.objectify.FloatElement'>,
- 'int': <type 'lxml.objectify.IntElement'>,
- 'str': <type 'lxml.objectify.StringElement'>}
-
-
-
-
-
- -
- -
-

xml_str

- -
-
-
-
Value:
-
-'''<obj:root xmlns:obj="objectified" xmlns:other="otherNS">
-  <obj:c1 a1="A1" a2="A2" other:a3="A3">
-    <obj:c2>0</obj:c2>
-    <obj:c2>1</obj:c2>
-    <obj:c2>2</obj:c2>
-    <other:c2>3</other:c2>
-    <c2>4</c2>
-  </obj:c1>
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_objectify-pysrc.html b/doc/html/api/lxml.tests.test_objectify-pysrc.html deleted file mode 100644 index 0cb5a350..00000000 --- a/doc/html/api/lxml.tests.test_objectify-pysrc.html +++ /dev/null @@ -1,5980 +0,0 @@ - - - - - lxml.tests.test_objectify - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_objectify - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_objectify

-
-   1  # -*- coding: utf-8 -*- 
-   2   
-   3  """ 
-   4  Tests specific to the lxml.objectify API 
-   5  """ 
-   6   
-   7   
-   8  import unittest, operator, sys, os.path 
-   9   
-  10  this_dir = os.path.dirname(__file__) 
-  11  if this_dir not in sys.path: 
-  12      sys.path.insert(0, this_dir) # needed for Py3 
-  13   
-  14  from common_imports import etree, HelperTestCase, fileInTestDir 
-  15  from common_imports import SillyFileLike, canonicalize, doctest, make_doctest 
-  16  from common_imports import _bytes, _str, StringIO, BytesIO 
-  17   
-  18  from lxml import objectify 
-  19   
-  20  PYTYPE_NAMESPACE = "http://codespeak.net/lxml/objectify/pytype" 
-  21  XML_SCHEMA_NS = "http://www.w3.org/2001/XMLSchema" 
-  22  XML_SCHEMA_INSTANCE_NS = "http://www.w3.org/2001/XMLSchema-instance" 
-  23  XML_SCHEMA_INSTANCE_TYPE_ATTR = "{%s}type" % XML_SCHEMA_INSTANCE_NS 
-  24  XML_SCHEMA_NIL_ATTR = "{%s}nil" % XML_SCHEMA_INSTANCE_NS 
-  25  TREE_PYTYPE = "TREE" 
-  26  DEFAULT_NSMAP = { "py"  : PYTYPE_NAMESPACE, 
-  27                    "xsi" : XML_SCHEMA_INSTANCE_NS, 
-  28                    "xsd" : XML_SCHEMA_NS} 
-  29   
-  30  objectclass2xsitype = { 
-  31      # objectify built-in 
-  32      objectify.IntElement: ("int", "short", "byte", "unsignedShort", 
-  33                             "unsignedByte", "integer", "nonPositiveInteger", 
-  34                             "negativeInteger", "long", "nonNegativeInteger", 
-  35                             "unsignedLong", "unsignedInt", "positiveInteger",), 
-  36      objectify.FloatElement: ("float", "double"), 
-  37      objectify.BoolElement: ("boolean",), 
-  38      objectify.StringElement: ("string", "normalizedString", "token", "language", 
-  39                                "Name", "NCName", "ID", "IDREF", "ENTITY", 
-  40                                "NMTOKEN", ), 
-  41      # None: xsi:nil="true" 
-  42      } 
-  43   
-  44  xsitype2objclass = dict([ (v, k) for k in objectclass2xsitype 
-  45                            for v in objectclass2xsitype[k] ]) 
-  46   
-  47  objectclass2pytype = { 
-  48      # objectify built-in 
-  49      objectify.IntElement: "int", 
-  50      objectify.FloatElement: "float", 
-  51      objectify.BoolElement: "bool", 
-  52      objectify.StringElement: "str", 
-  53      # None: xsi:nil="true" 
-  54      } 
-  55   
-  56  pytype2objclass = dict([ (objectclass2pytype[k], k) 
-  57                           for k in objectclass2pytype]) 
-  58   
-  59  xml_str = '''\ 
-  60  <obj:root xmlns:obj="objectified" xmlns:other="otherNS"> 
-  61    <obj:c1 a1="A1" a2="A2" other:a3="A3"> 
-  62      <obj:c2>0</obj:c2> 
-  63      <obj:c2>1</obj:c2> 
-  64      <obj:c2>2</obj:c2> 
-  65      <other:c2>3</other:c2> 
-  66      <c2>4</c2> 
-  67    </obj:c1> 
-  68  </obj:root>''' 
-  69   
-
70 -class ObjectifyTestCase(HelperTestCase): -
71 """Test cases for lxml.objectify - 72 """ - 73 etree = etree - 74 -
75 - def XML(self, xml): -
76 return self.etree.XML(xml, self.parser) -
77 -
78 - def setUp(self): -
79 super(ObjectifyTestCase, self).setUp() - 80 self.parser = self.etree.XMLParser(remove_blank_text=True) - 81 self.lookup = etree.ElementNamespaceClassLookup( - 82 objectify.ObjectifyElementClassLookup() ) - 83 self.parser.set_element_class_lookup(self.lookup) - 84 - 85 self.Element = self.parser.makeelement - 86 - 87 ns = self.lookup.get_namespace("otherNS") - 88 ns[None] = self.etree.ElementBase - 89 - 90 self._orig_types = objectify.getRegisteredTypes() -
91 -
92 - def tearDown(self): -
93 self.lookup.get_namespace("otherNS").clear() - 94 objectify.set_pytype_attribute_tag() - 95 del self.lookup - 96 del self.parser - 97 - 98 for pytype in objectify.getRegisteredTypes(): - 99 pytype.unregister() - 100 for pytype in self._orig_types: - 101 pytype.register() - 102 del self._orig_types - 103 - 104 super(ObjectifyTestCase, self).tearDown() -
105 - 106 -
107 - def test_element_nsmap_default(self): -
108 elt = objectify.Element("test") - 109 self.assertEqual(elt.nsmap, DEFAULT_NSMAP) -
110 -
111 - def test_element_nsmap_empty(self): -
112 nsmap = {} - 113 elt = objectify.Element("test", nsmap=nsmap) - 114 self.assertEqual(list(elt.nsmap.values()), [PYTYPE_NAMESPACE]) -
115 -
117 nsmap = {"mypy": PYTYPE_NAMESPACE, - 118 "myxsi": XML_SCHEMA_INSTANCE_NS, - 119 "myxsd": XML_SCHEMA_NS} - 120 elt = objectify.Element("test", nsmap=nsmap) - 121 self.assertEqual(elt.nsmap, nsmap) -
122 -
123 - def test_element_nsmap_custom(self): -
124 nsmap = {"my": "someNS", - 125 "myother": "someOtherNS", - 126 "myxsd": XML_SCHEMA_NS} - 127 elt = objectify.Element("test", nsmap=nsmap) - 128 self.assertTrue(PYTYPE_NAMESPACE in elt.nsmap.values()) - 129 for prefix, ns in nsmap.items(): - 130 self.assertTrue(prefix in elt.nsmap) - 131 self.assertEqual(nsmap[prefix], elt.nsmap[prefix]) -
132 -
134 root = objectify.Element("root") - 135 root.sub = objectify.Element("test") - 136 self.assertEqual(root.sub.nsmap, DEFAULT_NSMAP) -
137 -
139 root = objectify.Element("root") - 140 nsmap = {} - 141 root.sub = objectify.Element("test", nsmap=nsmap) - 142 self.assertEqual(root.sub.nsmap, DEFAULT_NSMAP) -
143 -
145 root = objectify.Element("root") - 146 nsmap = {"mypy": PYTYPE_NAMESPACE, - 147 "myxsi": XML_SCHEMA_INSTANCE_NS, - 148 "myxsd": XML_SCHEMA_NS} - 149 root.sub = objectify.Element("test", nsmap=nsmap) - 150 self.assertEqual(root.sub.nsmap, DEFAULT_NSMAP) -
151 -
153 root = objectify.Element("root") - 154 nsmap = {"my": "someNS", - 155 "myother": "someOtherNS", - 156 "myxsd": XML_SCHEMA_NS,} - 157 root.sub = objectify.Element("test", nsmap=nsmap) - 158 expected = nsmap.copy() - 159 del expected["myxsd"] - 160 expected.update(DEFAULT_NSMAP) - 161 self.assertEqual(root.sub.nsmap, expected) -
162 -
164 value = objectify.DataElement("test this") - 165 self.assertEqual(value.nsmap, DEFAULT_NSMAP) -
166 -
168 nsmap = {} - 169 value = objectify.DataElement("test this", nsmap=nsmap) - 170 self.assertEqual(list(value.nsmap.values()), [PYTYPE_NAMESPACE]) -
171 -
173 nsmap = {"mypy": PYTYPE_NAMESPACE, - 174 "myxsi": XML_SCHEMA_INSTANCE_NS, - 175 "myxsd": XML_SCHEMA_NS} - 176 value = objectify.DataElement("test this", nsmap=nsmap) - 177 self.assertEqual(value.nsmap, nsmap) -
178 -
180 nsmap = {"my": "someNS", - 181 "myother": "someOtherNS", - 182 "myxsd": XML_SCHEMA_NS,} - 183 value = objectify.DataElement("test", nsmap=nsmap) - 184 self.assertTrue(PYTYPE_NAMESPACE in value.nsmap.values()) - 185 for prefix, ns in nsmap.items(): - 186 self.assertTrue(prefix in value.nsmap) - 187 self.assertEqual(nsmap[prefix], value.nsmap[prefix]) -
188 -
190 root = objectify.Element("root") - 191 root.value = objectify.DataElement("test this") - 192 self.assertEqual(root.value.nsmap, DEFAULT_NSMAP) -
193 -
195 root = objectify.Element("root") - 196 nsmap = {} - 197 root.value = objectify.DataElement("test this", nsmap=nsmap) - 198 self.assertEqual(root.value.nsmap, DEFAULT_NSMAP) -
199 -
201 root = objectify.Element("root") - 202 nsmap = {"mypy": PYTYPE_NAMESPACE, - 203 "myxsi": XML_SCHEMA_INSTANCE_NS, - 204 "myxsd": XML_SCHEMA_NS} - 205 root.value = objectify.DataElement("test this", nsmap=nsmap) - 206 self.assertEqual(root.value.nsmap, DEFAULT_NSMAP) -
207 -
209 root = objectify.Element("root") - 210 nsmap = {"my": "someNS", - 211 "myother": "someOtherNS", - 212 "myxsd": XML_SCHEMA_NS} - 213 root.value = objectify.DataElement("test", nsmap=nsmap) - 214 expected = nsmap.copy() - 215 del expected["myxsd"] - 216 expected.update(DEFAULT_NSMAP) - 217 self.assertEqual(root.value.nsmap, expected) -
218 -
220 # ObjectifiedDataElement can also be used as E-Factory - 221 value = objectify.ObjectifiedDataElement('test', 'toast') - 222 self.assertEqual(value.text, 'testtoast') -
223 -
225 # ObjectifiedDataElement can also be used as E-Factory - 226 value = objectify.ObjectifiedElement(objectify.ObjectifiedDataElement(), 'test', 'toast') - 227 self.assertEqual(value.ObjectifiedDataElement.tail, 'testtoast') -
228 -
230 # keyword arguments override attrib entries - 231 value = objectify.DataElement(23, _pytype="str", _xsi="foobar", - 232 attrib={"gnu": "muh", "cat": "meeow", - 233 "dog": "wuff"}, - 234 bird="tchilp", dog="grrr") - 235 self.assertEqual(value.get("gnu"), "muh") - 236 self.assertEqual(value.get("cat"), "meeow") - 237 self.assertEqual(value.get("dog"), "grrr") - 238 self.assertEqual(value.get("bird"), "tchilp") -
239 -
241 # Check that DataElement preserves all attributes ObjectifiedDataElement - 242 # arguments - 243 arg = objectify.DataElement(23, _pytype="str", _xsi="foobar", - 244 attrib={"gnu": "muh", "cat": "meeow", - 245 "dog": "wuff"}, - 246 bird="tchilp", dog="grrr") - 247 value = objectify.DataElement(arg) - 248 self.assertTrue(isinstance(value, objectify.StringElement)) - 249 for attr in arg.attrib: - 250 self.assertEqual(value.get(attr), arg.get(attr)) -
251 -
253 # Check that _pytype arg overrides original py:pytype of - 254 # ObjectifiedDataElement - 255 arg = objectify.DataElement(23, _pytype="str", _xsi="foobar", - 256 attrib={"gnu": "muh", "cat": "meeow", - 257 "dog": "wuff"}, - 258 bird="tchilp", dog="grrr") - 259 value = objectify.DataElement(arg, _pytype="NoneType") - 260 self.assertTrue(isinstance(value, objectify.NoneElement)) - 261 self.assertEqual(value.get(XML_SCHEMA_NIL_ATTR), "true") - 262 self.assertEqual(value.text, None) - 263 self.assertEqual(value.pyval, None) - 264 for attr in arg.attrib: - 265 #if not attr == objectify.PYTYPE_ATTRIBUTE: - 266 self.assertEqual(value.get(attr), arg.get(attr)) -
267 -
269 # Check that _pytype arg overrides original py:pytype of - 270 # ObjectifiedDataElement - 271 arg = objectify.DataElement(23, _pytype="str", _xsi="foobar", - 272 attrib={"gnu": "muh", "cat": "meeow", - 273 "dog": "wuff"}, - 274 bird="tchilp", dog="grrr") - 275 value = objectify.DataElement(arg, _pytype="int") - 276 self.assertTrue(isinstance(value, objectify.IntElement)) - 277 self.assertEqual(value.get(objectify.PYTYPE_ATTRIBUTE), "int") - 278 for attr in arg.attrib: - 279 if not attr == objectify.PYTYPE_ATTRIBUTE: - 280 self.assertEqual(value.get(attr), arg.get(attr)) -
281 -
283 # Check that _xsi arg overrides original xsi:type of given - 284 # ObjectifiedDataElement - 285 arg = objectify.DataElement(23, _pytype="str", _xsi="foobar", - 286 attrib={"gnu": "muh", "cat": "meeow", - 287 "dog": "wuff"}, - 288 bird="tchilp", dog="grrr") - 289 value = objectify.DataElement(arg, _xsi="xsd:int") - 290 self.assertTrue(isinstance(value, objectify.IntElement)) - 291 self.assertEqual(value.get(XML_SCHEMA_INSTANCE_TYPE_ATTR), "xsd:int") - 292 self.assertEqual(value.get(objectify.PYTYPE_ATTRIBUTE), "int") - 293 for attr in arg.attrib: - 294 if not attr in [objectify.PYTYPE_ATTRIBUTE, - 295 XML_SCHEMA_INSTANCE_TYPE_ATTR]: - 296 self.assertEqual(value.get(attr), arg.get(attr)) -
297 -
299 # Check that _pytype and _xsi args override original py:pytype and - 300 # xsi:type attributes of given ObjectifiedDataElement - 301 arg = objectify.DataElement(23, _pytype="str", _xsi="foobar", - 302 attrib={"gnu": "muh", "cat": "meeow", - 303 "dog": "wuff"}, - 304 bird="tchilp", dog="grrr") - 305 value = objectify.DataElement(arg, _pytype="int", _xsi="xsd:int") - 306 self.assertTrue(isinstance(value, objectify.IntElement)) - 307 self.assertEqual(value.get(objectify.PYTYPE_ATTRIBUTE), "int") - 308 self.assertEqual(value.get(XML_SCHEMA_INSTANCE_TYPE_ATTR), "xsd:int") - 309 for attr in arg.attrib: - 310 if not attr in [objectify.PYTYPE_ATTRIBUTE, - 311 XML_SCHEMA_INSTANCE_TYPE_ATTR]: - 312 self.assertEqual(value.get(attr), arg.get(attr)) -
313 -
315 self.assertRaises(ValueError, objectify.DataElement, 3.1415, - 316 _pytype="int") -
317 -
319 self.assertRaises(ValueError, objectify.DataElement, 3.1415, - 320 _xsi="xsd:int") -
321 -
323 arg = objectify.DataElement(3.1415) - 324 self.assertRaises(ValueError, objectify.DataElement, arg, - 325 _pytype="int") -
326 -
328 arg = objectify.DataElement(3.1415) - 329 self.assertRaises(ValueError, objectify.DataElement, arg, - 330 _xsi="xsd:int") -
331 -
333 arg = objectify.Element('arg') - 334 value = objectify.DataElement(arg) - 335 self.assertTrue(isinstance(value, objectify.ObjectifiedElement)) - 336 for attr in arg.attrib: - 337 self.assertEqual(value.get(attr), arg.get(attr)) -
338 -
339 - def test_root(self): -
340 root = self.Element("test") - 341 self.assertTrue(isinstance(root, objectify.ObjectifiedElement)) -
342 -
343 - def test_str(self): -
344 root = self.Element("test") - 345 self.assertEqual('', str(root)) -
346 -
347 - def test_child(self): -
348 root = self.XML(xml_str) - 349 self.assertEqual("0", root.c1.c2.text) -
350 -
351 - def test_child_ns_nons(self): -
352 root = self.XML(""" - 353 <root> - 354 <foo:x xmlns:foo="/foo/bar">1</foo:x> - 355 <x>2</x> - 356 </root> - 357 """) - 358 self.assertEqual(2, root.x) -
359 -
360 - def test_countchildren(self): -
361 root = self.XML(xml_str) - 362 self.assertEqual(1, root.countchildren()) - 363 self.assertEqual(5, root.c1.countchildren()) -
364 -
365 - def test_child_getattr(self): -
366 root = self.XML(xml_str) - 367 self.assertEqual("0", getattr(root.c1, "{objectified}c2").text) - 368 self.assertEqual("3", getattr(root.c1, "{otherNS}c2").text) -
369 -
370 - def test_child_nonexistant(self): -
371 root = self.XML(xml_str) - 372 self.assertRaises(AttributeError, getattr, root.c1, "NOT_THERE") - 373 self.assertRaises(AttributeError, getattr, root.c1, "{unknownNS}c2") -
374 -
375 - def test_child_getattr_empty_ns(self): -
376 root = self.XML(xml_str) - 377 self.assertEqual("4", getattr(root.c1, "{}c2").text) - 378 self.assertEqual("0", getattr(root.c1, "c2").text) -
379 -
380 - def test_setattr(self): -
381 for val in [ - 382 2, 2**32, 1.2, "Won't get fooled again", - 383 _str("W\xf6n't get f\xf6\xf6led \xe4g\xe4in", 'ISO-8859-1'), True, - 384 False, None]: - 385 root = self.Element('root') - 386 attrname = 'val' - 387 setattr(root, attrname, val) - 388 result = getattr(root, attrname) - 389 self.assertEqual(val, result) - 390 self.assertEqual(type(val), type(result.pyval)) -
391 -
392 - def test_setattr_nonunicode(self): -
393 root = self.Element('root') - 394 attrname = 'val' - 395 val = _bytes("W\xf6n't get f\xf6\xf6led \xe4g\xe4in", 'ISO-8859-1') - 396 self.assertRaises(ValueError, setattr, root, attrname, val) - 397 self.assertRaises(AttributeError, getattr, root, attrname) -
398 -
399 - def test_addattr(self): -
400 root = self.XML(xml_str) - 401 self.assertEqual(1, len(root.c1)) - 402 root.addattr("c1", "test") - 403 self.assertEqual(2, len(root.c1)) - 404 self.assertEqual("test", root.c1[1].text) -
405 -
406 - def test_addattr_element(self): -
407 root = self.XML(xml_str) - 408 self.assertEqual(1, len(root.c1)) - 409 - 410 new_el = self.Element("test", myattr="5") - 411 root.addattr("c1", new_el) - 412 self.assertEqual(2, len(root.c1)) - 413 self.assertEqual(None, root.c1[0].get("myattr")) - 414 self.assertEqual("5", root.c1[1].get("myattr")) -
415 -
416 - def test_addattr_list(self): -
417 root = self.XML(xml_str) - 418 self.assertEqual(1, len(root.c1)) - 419 - 420 new_el = self.Element("test") - 421 self.etree.SubElement(new_el, "a", myattr="A") - 422 self.etree.SubElement(new_el, "a", myattr="B") - 423 - 424 root.addattr("c1", list(new_el.a)) - 425 self.assertEqual(3, len(root.c1)) - 426 self.assertEqual(None, root.c1[0].get("myattr")) - 427 self.assertEqual("A", root.c1[1].get("myattr")) - 428 self.assertEqual("B", root.c1[2].get("myattr")) -
429 -
430 - def test_child_addattr(self): -
431 root = self.XML(xml_str) - 432 self.assertEqual(3, len(root.c1.c2)) - 433 root.c1.addattr("c2", 3) - 434 self.assertEqual(4, len(root.c1.c2)) - 435 self.assertEqual("3", root.c1.c2[3].text) -
436 -
437 - def test_child_index(self): -
438 root = self.XML(xml_str) - 439 self.assertEqual("0", root.c1.c2[0].text) - 440 self.assertEqual("1", root.c1.c2[1].text) - 441 self.assertEqual("2", root.c1.c2[2].text) - 442 self.assertRaises(IndexError, operator.getitem, root.c1.c2, 3) -
443 -
444 - def test_child_index_neg(self): -
445 root = self.XML(xml_str) - 446 self.assertEqual("0", root.c1.c2[0].text) - 447 self.assertEqual("0", root.c1.c2[-3].text) - 448 self.assertEqual("1", root.c1.c2[-2].text) - 449 self.assertEqual("2", root.c1.c2[-1].text) - 450 self.assertRaises(IndexError, operator.getitem, root.c1.c2, -4) -
451 -
452 - def test_child_len(self): -
453 root = self.XML(xml_str) - 454 self.assertEqual(1, len(root)) - 455 self.assertEqual(1, len(root.c1)) - 456 self.assertEqual(3, len(root.c1.c2)) -
457 -
458 - def test_child_iter(self): -
459 root = self.XML(xml_str) - 460 self.assertEqual([root], - 461 list(iter(root))) - 462 self.assertEqual([root.c1], - 463 list(iter(root.c1))) - 464 self.assertEqual([root.c1.c2[0], root.c1.c2[1], root.c1.c2[2]], - 465 list(iter((root.c1.c2)))) -
466 -
467 - def test_class_lookup(self): -
468 root = self.XML(xml_str) - 469 self.assertTrue(isinstance(root.c1.c2, objectify.ObjectifiedElement)) - 470 self.assertFalse(isinstance(getattr(root.c1, "{otherNS}c2"), - 471 objectify.ObjectifiedElement)) -
472 -
473 - def test_dir(self): -
474 root = self.XML(xml_str) - 475 dir_c1 = dir(objectify.ObjectifiedElement) + ['c1'] - 476 dir_c1.sort() - 477 dir_c2 = dir(objectify.ObjectifiedElement) + ['c2'] - 478 dir_c2.sort() - 479 - 480 self.assertEqual(dir_c1, dir(root)) - 481 self.assertEqual(dir_c2, dir(root.c1)) -
482 -
483 - def test_vars(self): -
484 root = self.XML(xml_str) - 485 self.assertEqual({'c1' : root.c1}, vars(root)) - 486 self.assertEqual({'c2' : root.c1.c2}, vars(root.c1)) -
487 -
488 - def test_child_set_ro(self): -
489 root = self.XML(xml_str) - 490 self.assertRaises(TypeError, setattr, root.c1.c2, 'text', "test") - 491 self.assertRaises(TypeError, setattr, root.c1.c2, 'pyval', "test") -
492 - 493 # slicing - 494 -
495 - def test_getslice_complete(self): -
496 root = self.XML("<root><c>c1</c><c>c2</c></root>") - 497 self.assertEqual(["c1", "c2"], - 498 [ c.text for c in root.c[:] ]) -
499 -
500 - def test_getslice_partial(self): -
501 root = self.XML("<root><c>c1</c><c>c2</c><c>c3</c><c>c4</c></root>") - 502 test_list = ["c1", "c2", "c3", "c4"] - 503 - 504 self.assertEqual(test_list, - 505 [ c.text for c in root.c[:] ]) - 506 self.assertEqual(test_list[1:2], - 507 [ c.text for c in root.c[1:2] ]) - 508 self.assertEqual(test_list[-3:-1], - 509 [ c.text for c in root.c[-3:-1] ]) - 510 self.assertEqual(test_list[-3:3], - 511 [ c.text for c in root.c[-3:3] ]) - 512 self.assertEqual(test_list[-3000:3], - 513 [ c.text for c in root.c[-3000:3] ]) - 514 self.assertEqual(test_list[-3:3000], - 515 [ c.text for c in root.c[-3:3000] ]) -
516 -
517 - def test_getslice_partial_neg(self): -
518 root = self.XML("<root><c>c1</c><c>c2</c><c>c3</c><c>c4</c></root>") - 519 test_list = ["c1", "c2", "c3", "c4"] - 520 - 521 self.assertEqual(test_list, - 522 [ c.text for c in root.c[:] ]) - 523 self.assertEqual(test_list[2:1:-1], - 524 [ c.text for c in root.c[2:1:-1] ]) - 525 self.assertEqual(test_list[-1:-3:-1], - 526 [ c.text for c in root.c[-1:-3:-1] ]) - 527 self.assertEqual(test_list[2:-3:-1], - 528 [ c.text for c in root.c[2:-3:-1] ]) - 529 self.assertEqual(test_list[2:-3000:-1], - 530 [ c.text for c in root.c[2:-3000:-1] ]) -
531 - 532 # slice assignment - 533 -
534 - def test_setslice_complete(self): -
535 Element = self.Element - 536 root = Element("root") - 537 root.c = ["c1", "c2"] - 538 - 539 c1 = root.c[0] - 540 c2 = root.c[1] - 541 - 542 self.assertEqual([c1,c2], list(root.c)) - 543 self.assertEqual(["c1", "c2"], - 544 [ c.text for c in root.c ]) -
545 -
546 - def test_setslice_elements(self): -
547 Element = self.Element - 548 root = Element("root") - 549 root.c = ["c1", "c2"] - 550 - 551 c1 = root.c[0] - 552 c2 = root.c[1] - 553 - 554 self.assertEqual([c1,c2], list(root.c)) - 555 self.assertEqual(["c1", "c2"], - 556 [ c.text for c in root.c ]) - 557 - 558 root2 = Element("root2") - 559 root2.el = [ "test", "test" ] - 560 self.assertEqual(["test", "test"], - 561 [ el.text for el in root2.el ]) - 562 - 563 root.c = [ root2.el, root2.el ] - 564 self.assertEqual(["test", "test"], - 565 [ c.text for c in root.c ]) - 566 self.assertEqual(["test", "test"], - 567 [ el.text for el in root2.el ]) - 568 - 569 root.c[:] = [ c1, c2, c2, c1 ] - 570 self.assertEqual(["c1", "c2", "c2", "c1"], - 571 [ c.text for c in root.c ]) -
572 -
573 - def test_setslice_partial(self): -
574 Element = self.Element - 575 root = Element("root") - 576 l = ["c1", "c2", "c3", "c4"] - 577 root.c = l - 578 - 579 self.assertEqual(["c1", "c2", "c3", "c4"], - 580 [ c.text for c in root.c ]) - 581 self.assertEqual(l, - 582 [ c.text for c in root.c ]) - 583 - 584 new_slice = ["cA", "cB"] - 585 l[1:2] = new_slice - 586 root.c[1:2] = new_slice - 587 - 588 self.assertEqual(["c1", "cA", "cB", "c3", "c4"], l) - 589 self.assertEqual(["c1", "cA", "cB", "c3", "c4"], - 590 [ c.text for c in root.c ]) - 591 self.assertEqual(l, - 592 [ c.text for c in root.c ]) -
593 -
594 - def test_setslice_insert(self): -
595 Element = self.Element - 596 root = Element("root") - 597 l = ["c1", "c2", "c3", "c4"] - 598 root.c = l - 599 - 600 self.assertEqual(["c1", "c2", "c3", "c4"], - 601 [ c.text for c in root.c ]) - 602 self.assertEqual(l, - 603 [ c.text for c in root.c ]) - 604 - 605 new_slice = ["cA", "cB"] - 606 l[1:1] = new_slice - 607 root.c[1:1] = new_slice - 608 - 609 self.assertEqual(["c1", "cA", "cB", "c2", "c3", "c4"], l) - 610 self.assertEqual(["c1", "cA", "cB", "c2", "c3", "c4"], - 611 [ c.text for c in root.c ]) - 612 self.assertEqual(l, - 613 [ c.text for c in root.c ]) -
614 -
615 - def test_setslice_insert_neg(self): -
616 Element = self.Element - 617 root = Element("root") - 618 l = ["c1", "c2", "c3", "c4"] - 619 root.c = l - 620 - 621 self.assertEqual(["c1", "c2", "c3", "c4"], - 622 [ c.text for c in root.c ]) - 623 self.assertEqual(l, - 624 [ c.text for c in root.c ]) - 625 - 626 new_slice = ["cA", "cB"] - 627 l[-2:-2] = new_slice - 628 root.c[-2:-2] = new_slice - 629 - 630 self.assertEqual(["c1", "c2", "cA", "cB", "c3", "c4"], l) - 631 self.assertEqual(["c1", "c2", "cA", "cB", "c3", "c4"], - 632 [ c.text for c in root.c ]) - 633 self.assertEqual(l, - 634 [ c.text for c in root.c ]) -
635 -
636 - def test_setslice_empty(self): -
637 Element = self.Element - 638 root = Element("root") - 639 - 640 root.c = [] - 641 self.assertRaises( - 642 AttributeError, getattr, root, 'c') -
643 -
645 Element = self.Element - 646 root = Element("root") - 647 l = ["c1", "c2", "c3", "c4"] - 648 root.c = l - 649 - 650 self.assertEqual(["c1", "c2", "c3", "c4"], - 651 [ c.text for c in root.c ]) - 652 self.assertEqual(l, - 653 [ c.text for c in root.c ]) - 654 - 655 new_slice = ["cA", "cB", "cC"] - 656 self.assertRaises( - 657 ValueError, operator.setitem, - 658 l, slice(1,2,-1), new_slice) - 659 self.assertRaises( - 660 ValueError, operator.setitem, - 661 root.c, slice(1,2,-1), new_slice) -
662 -
663 - def test_setslice_partial_neg(self): -
664 Element = self.Element - 665 root = Element("root") - 666 l = ["c1", "c2", "c3", "c4"] - 667 root.c = l - 668 - 669 self.assertEqual(["c1", "c2", "c3", "c4"], - 670 [ c.text for c in root.c ]) - 671 self.assertEqual(l, - 672 [ c.text for c in root.c ]) - 673 - 674 new_slice = ["cA", "cB"] - 675 l[-1:1:-1] = new_slice - 676 root.c[-1:1:-1] = new_slice - 677 - 678 self.assertEqual(["c1", "c2", "cB", "cA"], l) - 679 self.assertEqual(["c1", "c2", "cB", "cA"], - 680 [ c.text for c in root.c ]) - 681 self.assertEqual(l, - 682 [ c.text for c in root.c ]) -
683 -
685 Element = self.Element - 686 root = Element("root") - 687 l = ["c1", "c2", "c3", "c4"] - 688 root.c = l - 689 - 690 self.assertEqual(["c1", "c2", "c3", "c4"], - 691 [ c.text for c in root.c ]) - 692 self.assertEqual(l, - 693 [ c.text for c in root.c ]) - 694 - 695 new_slice = ["cA", "cB"] - 696 l[-1:-4:-2] = new_slice - 697 root.c[-1:-4:-2] = new_slice - 698 - 699 self.assertEqual(["c1", "cB", "c3", "cA"], l) - 700 self.assertEqual(["c1", "cB", "c3", "cA"], - 701 [ c.text for c in root.c ]) - 702 self.assertEqual(l, - 703 [ c.text for c in root.c ]) -
704 - 705 # other stuff - 706 -
707 - def test_set_string(self): -
708 # make sure strings are not handled as sequences - 709 Element = self.Element - 710 root = Element("root") - 711 root.c = "TEST" - 712 self.assertEqual(["TEST"], - 713 [ c.text for c in root.c ]) -
714 -
715 - def test_setitem_string(self): -
716 # make sure strings are set as children - 717 Element = self.Element - 718 root = Element("root") - 719 root["c"] = "TEST" - 720 self.assertEqual(["TEST"], - 721 [ c.text for c in root.c ]) -
722 -
723 - def test_setitem_string_special(self): -
724 # make sure 'text' etc. are set as children - 725 Element = self.Element - 726 root = Element("root") - 727 - 728 root["text"] = "TEST" - 729 self.assertEqual(["TEST"], - 730 [ c.text for c in root["text"] ]) - 731 - 732 root["tail"] = "TEST" - 733 self.assertEqual(["TEST"], - 734 [ c.text for c in root["tail"] ]) - 735 - 736 root["pyval"] = "TEST" - 737 self.assertEqual(["TEST"], - 738 [ c.text for c in root["pyval"] ]) - 739 - 740 root["tag"] = "TEST" - 741 self.assertEqual(["TEST"], - 742 [ c.text for c in root["tag"] ]) -
743 -
744 - def test_findall(self): -
745 XML = self.XML - 746 root = XML('<a><b><c/></b><b/><c><b/></c></a>') - 747 self.assertEqual(1, len(root.findall("c"))) - 748 self.assertEqual(2, len(root.findall(".//c"))) - 749 self.assertEqual(3, len(root.findall(".//b"))) - 750 self.assertTrue(root.findall(".//b")[1] is root.getchildren()[1]) -
751 -
752 - def test_findall_ns(self): -
753 XML = self.XML - 754 root = XML('<a xmlns:x="X" xmlns:y="Y"><x:b><c/></x:b><b/><c><x:b/><b/></c><b/></a>') - 755 self.assertEqual(2, len(root.findall(".//{X}b"))) - 756 self.assertEqual(3, len(root.findall(".//b"))) - 757 self.assertEqual(2, len(root.findall("b"))) -
758 -
759 - def test_build_tree(self): -
760 root = self.Element('root') - 761 root.a = 5 - 762 root.b = 6 - 763 self.assertTrue(isinstance(root, objectify.ObjectifiedElement)) - 764 self.assertTrue(isinstance(root.a, objectify.IntElement)) - 765 self.assertTrue(isinstance(root.b, objectify.IntElement)) -
766 -
767 - def test_type_NoneType(self): -
768 Element = self.Element - 769 SubElement = self.etree.SubElement - 770 - 771 nil_attr = XML_SCHEMA_NIL_ATTR - 772 root = Element("{objectified}root") - 773 SubElement(root, "{objectified}none") - 774 SubElement(root, "{objectified}none", {nil_attr : "true"}) - 775 self.assertFalse(isinstance(root.none, objectify.NoneElement)) - 776 self.assertFalse(isinstance(root.none[0], objectify.NoneElement)) - 777 self.assertTrue(isinstance(root.none[1], objectify.NoneElement)) - 778 self.assertEqual(hash(root.none[1]), hash(None)) - 779 self.assertEqual(root.none[1], None) - 780 self.assertFalse(root.none[1]) -
781 -
782 - def test_data_element_NoneType(self): -
783 value = objectify.DataElement(None) - 784 self.assertTrue(isinstance(value, objectify.NoneElement)) - 785 self.assertEqual(value, None) - 786 self.assertEqual(value.get(XML_SCHEMA_NIL_ATTR), "true") -
787 -
788 - def test_type_bool(self): -
789 Element = self.Element - 790 SubElement = self.etree.SubElement - 791 root = Element("{objectified}root") - 792 root.bool = True - 793 self.assertEqual(root.bool, True) - 794 self.assertEqual(root.bool + root.bool, True + True) - 795 self.assertEqual(True + root.bool, True + root.bool) - 796 self.assertEqual(root.bool * root.bool, True * True) - 797 self.assertEqual(int(root.bool), int(True)) - 798 self.assertEqual(hash(root.bool), hash(True)) - 799 self.assertEqual(complex(root.bool), complex(True)) - 800 self.assertTrue(isinstance(root.bool, objectify.BoolElement)) - 801 - 802 root.bool = False - 803 self.assertEqual(root.bool, False) - 804 self.assertEqual(root.bool + root.bool, False + False) - 805 self.assertEqual(False + root.bool, False + root.bool) - 806 self.assertEqual(root.bool * root.bool, False * False) - 807 self.assertEqual(int(root.bool), int(False)) - 808 self.assertEqual(hash(root.bool), hash(False)) - 809 self.assertEqual(complex(root.bool), complex(False)) - 810 self.assertTrue(isinstance(root.bool, objectify.BoolElement)) -
811 -
812 - def test_data_element_bool(self): -
813 value = objectify.DataElement(True) - 814 self.assertTrue(isinstance(value, objectify.BoolElement)) - 815 self.assertEqual(value, True) - 816 - 817 value = objectify.DataElement(False) - 818 self.assertTrue(isinstance(value, objectify.BoolElement)) - 819 self.assertEqual(value, False) -
820 -
821 - def test_type_str(self): -
822 Element = self.Element - 823 SubElement = self.etree.SubElement - 824 root = Element("{objectified}root") - 825 root.s = "test" - 826 self.assertTrue(isinstance(root.s, objectify.StringElement)) -
827 -
828 - def test_type_str_intliteral(self): -
829 Element = self.Element - 830 SubElement = self.etree.SubElement - 831 root = Element("{objectified}root") - 832 root.s = "3" - 833 self.assertTrue(isinstance(root.s, objectify.StringElement)) -
834 -
835 - def test_type_str_floatliteral(self): -
836 Element = self.Element - 837 SubElement = self.etree.SubElement - 838 root = Element("{objectified}root") - 839 root.s = "3.72" - 840 self.assertTrue(isinstance(root.s, objectify.StringElement)) -
841 -
842 - def test_type_str_mul(self): -
843 Element = self.Element - 844 SubElement = self.etree.SubElement - 845 root = Element("{objectified}root") - 846 root.s = "test" - 847 - 848 self.assertEqual("test" * 5, root.s * 5) - 849 self.assertEqual(5 * "test", 5 * root.s) - 850 - 851 self.assertRaises(TypeError, operator.mul, root.s, "honk") - 852 self.assertRaises(TypeError, operator.mul, "honk", root.s) -
853 -
854 - def test_type_str_add(self): -
855 Element = self.Element - 856 SubElement = self.etree.SubElement - 857 root = Element("{objectified}root") - 858 root.s = "test" - 859 - 860 s = "toast" - 861 self.assertEqual("test" + s, root.s + s) - 862 self.assertEqual(s + "test", s + root.s) -
863 -
864 - def test_type_str_mod(self): -
865 s = "%d %f %s %r" - 866 el = objectify.DataElement(s) - 867 values = (1, 7.0, "abcd", None) - 868 self.assertEqual(s % values, el % values) - 869 - 870 s = "%d" - 871 el = objectify.DataElement(s) - 872 val = 5 - 873 self.assertEqual(s % val, el % val) - 874 - 875 s = "%d %s" - 876 el = objectify.DataElement(s) - 877 val = 5 - 878 self.assertRaises(TypeError, el.__mod__, val) - 879 - 880 s = "" - 881 el = objectify.DataElement(s) - 882 val = 5 - 883 self.assertRaises(TypeError, el.__mod__, val) -
884 -
885 - def test_type_str_hash(self): -
886 v = "1" - 887 el = objectify.DataElement(v) - 888 self.assertEqual(hash(el), hash("1")) -
889 -
890 - def test_type_str_as_int(self): -
891 v = "1" - 892 el = objectify.DataElement(v) - 893 self.assertEqual(int(el), 1) -
894 -
895 - def test_type_str_as_float(self): -
896 v = "1" - 897 el = objectify.DataElement(v) - 898 self.assertEqual(float(el), 1) -
899 -
900 - def test_type_str_as_complex(self): -
901 v = "1" - 902 el = objectify.DataElement(v) - 903 self.assertEqual(complex(el), 1) -
904 -
906 s = "%d %f %s %r" - 907 el = objectify.DataElement(s) - 908 values = (objectify.DataElement(1), - 909 objectify.DataElement(7.0), - 910 objectify.DataElement("abcd"), - 911 objectify.DataElement(None)) - 912 self.assertEqual(s % values, el % values) -
913 -
914 - def test_data_element_str(self): -
915 value = objectify.DataElement("test") - 916 self.assertTrue(isinstance(value, objectify.StringElement)) - 917 self.assertEqual(value, "test") -
918 -
920 value = objectify.DataElement("3") - 921 self.assertTrue(isinstance(value, objectify.StringElement)) - 922 self.assertEqual(value, "3") -
923 -
925 value = objectify.DataElement("3.20") - 926 self.assertTrue(isinstance(value, objectify.StringElement)) - 927 self.assertEqual(value, "3.20") -
928 -
929 - def test_type_ustr(self): -
930 Element = self.Element - 931 SubElement = self.etree.SubElement - 932 root = Element("{objectified}root") - 933 root.s = _str("test") - 934 self.assertTrue(isinstance(root.s, objectify.StringElement)) -
935 -
936 - def test_type_ustr_intliteral(self): -
937 Element = self.Element - 938 SubElement = self.etree.SubElement - 939 root = Element("{objectified}root") - 940 root.s = _str("3") - 941 self.assertTrue(isinstance(root.s, objectify.StringElement)) -
942 -
943 - def test_type_ustr_floatliteral(self): -
944 Element = self.Element - 945 SubElement = self.etree.SubElement - 946 root = Element("{objectified}root") - 947 root.s = _str("3.72") - 948 self.assertTrue(isinstance(root.s, objectify.StringElement)) -
949 -
950 - def test_type_ustr_mul(self): -
951 Element = self.Element - 952 SubElement = self.etree.SubElement - 953 root = Element("{objectified}root") - 954 root.s = _str("test") - 955 - 956 self.assertEqual(_str("test") * 5, root.s * 5) - 957 self.assertEqual(5 * _str("test"), 5 * root.s) - 958 - 959 self.assertRaises(TypeError, operator.mul, root.s, _str("honk")) - 960 self.assertRaises(TypeError, operator.mul, _str("honk"), root.s) -
961 -
962 - def test_type_ustr_add(self): -
963 Element = self.Element - 964 SubElement = self.etree.SubElement - 965 root = Element("{objectified}root") - 966 root.s = _str("test") - 967 - 968 s = _str("toast") - 969 self.assertEqual(_str("test") + s, root.s + s) - 970 self.assertEqual(s + _str("test"), s + root.s) -
971 -
972 - def test_data_element_ustr(self): -
973 value = objectify.DataElement(_str("test")) - 974 self.assertTrue(isinstance(value, objectify.StringElement)) - 975 self.assertEqual(value, _str("test")) -
976 -
978 value = objectify.DataElement("3") - 979 self.assertTrue(isinstance(value, objectify.StringElement)) - 980 self.assertEqual(value, _str("3")) -
981 -
983 value = objectify.DataElement(_str("3.20")) - 984 self.assertTrue(isinstance(value, objectify.StringElement)) - 985 self.assertEqual(value, _str("3.20")) -
986 -
987 - def test_type_int(self): -
988 Element = self.Element - 989 SubElement = self.etree.SubElement - 990 root = Element("{objectified}root") - 991 root.none = 5 - 992 self.assertTrue(isinstance(root.none, objectify.IntElement)) -
993 -
994 - def test_data_element_int(self): -
995 value = objectify.DataElement(5) - 996 self.assertTrue(isinstance(value, objectify.IntElement)) - 997 self.assertEqual(value, 5) -
998 -
999 - def test_data_element_int_hash(self): -
1000 value = objectify.DataElement(123) -1001 self.assertEqual(hash(value), hash(123)) -
1002 -
1003 - def test_type_float(self): -
1004 Element = self.Element -1005 SubElement = self.etree.SubElement -1006 root = Element("{objectified}root") -1007 root.none = 5.5 -1008 self.assertTrue(isinstance(root.none, objectify.FloatElement)) -
1009 -
1010 - def test_data_element_float(self): -
1011 value = objectify.DataElement(5.5) -1012 self.assertTrue(isinstance(value, objectify.FloatElement)) -1013 self.assertEqual(value, 5.5) -
1014 -
1016 value = objectify.DataElement(5.5) -1017 self.assertEqual(hash(value), hash(5.5)) -
1018 -
1019 - def test_type_float_precision(self): -
1020 # test not losing precision by shortened float str() value -1021 # repr(2.305064300557): '2.305064300557' -1022 # str(2.305064300557): '2.30506430056' -1023 # "%57.54f" % 2.305064300557: -1024 # ' 2.305064300556999956626214043353684246540069580078125000' -1025 Element = self.Element -1026 root = Element("{objectified}root") -1027 s = "2.305064300557" -1028 root.f = float(s) -1029 self.assertTrue(isinstance(root.f, objectify.FloatElement)) -1030 self.assertEqual(root.f.text, s) -1031 self.assertEqual(root.f.pyval, float(s)) -
1032 -
1034 # test precision preservation for FloatElement instantiation -1035 s = "2.305064300557" -1036 self.assertEqual(objectify.FloatElement(s), float(s)) -
1037 -
1039 # test consistent FloatElement values for the different instantiation -1040 # possibilities -1041 Element = self.Element -1042 root = Element("{objectified}root") -1043 s = "2.305064300557" -1044 f = float(s) -1045 float_elem = objectify.FloatElement(s) -1046 float_data_elem = objectify.DataElement(f) -1047 root.float_child = float(f) -1048 self.assertTrue(f == float_elem == float_data_elem == root.float_child) -
1049 -
1051 # test not losing precision by shortened float str() value -1052 f = 2305064300557.0 -1053 value = objectify.DataElement(f) -1054 self.assertTrue(isinstance(value, objectify.FloatElement)) -1055 self.assertEqual(value, f) -
1056 -
1058 # test not losing precision by shortened float str() value -1059 f = 2305064300557.0 -1060 value = objectify.DataElement(f) -1061 self.assertEqual(hash(value), hash(f)) -
1062 -
1063 - def test_data_element_xsitypes(self): -
1064 for xsi, objclass in xsitype2objclass.items(): -1065 # 1 is a valid value for all ObjectifiedDataElement classes -1066 pyval = 1 -1067 value = objectify.DataElement(pyval, _xsi=xsi) -1068 self.assertTrue(isinstance(value, objclass), -1069 "DataElement(%s, _xsi='%s') returns %s, expected %s" -1070 % (pyval, xsi, type(value), objclass)) -
1071 -
1073 for xsi, objclass in xsitype2objclass.items(): -1074 # 1 is a valid value for all ObjectifiedDataElement classes -1075 pyval = 1 -1076 value = objectify.DataElement(pyval, _xsi="xsd:%s" % xsi) -1077 self.assertTrue(isinstance(value, objclass), -1078 "DataElement(%s, _xsi='%s') returns %s, expected %s" -1079 % (pyval, xsi, type(value), objclass)) -
1080 -
1082 for xsi, objclass in xsitype2objclass.items(): -1083 # 1 is a valid value for all ObjectifiedDataElement classes -1084 self.assertRaises(ValueError, objectify.DataElement, 1, -1085 _xsi="foo:%s" % xsi) -
1086 -
1087 - def test_data_element_pytypes(self): -
1088 for pytype, objclass in pytype2objclass.items(): -1089 # 1 is a valid value for all ObjectifiedDataElement classes -1090 pyval = 1 -1091 value = objectify.DataElement(pyval, _pytype=pytype) -1092 self.assertTrue(isinstance(value, objclass), -1093 "DataElement(%s, _pytype='%s') returns %s, expected %s" -1094 % (pyval, pytype, type(value), objclass)) -
1095 -
1097 pyval = 1 -1098 pytype = "NoneType" -1099 objclass = objectify.NoneElement -1100 value = objectify.DataElement(pyval, _pytype=pytype) -1101 self.assertTrue(isinstance(value, objclass), -1102 "DataElement(%s, _pytype='%s') returns %s, expected %s" -1103 % (pyval, pytype, type(value), objclass)) -1104 self.assertEqual(value.text, None) -1105 self.assertEqual(value.pyval, None) -
1106 -
1108 # pre-2.0 lxml called NoneElement "none" -1109 pyval = 1 -1110 pytype = "none" -1111 objclass = objectify.NoneElement -1112 value = objectify.DataElement(pyval, _pytype=pytype) -1113 self.assertTrue(isinstance(value, objclass), -1114 "DataElement(%s, _pytype='%s') returns %s, expected %s" -1115 % (pyval, pytype, type(value), objclass)) -1116 self.assertEqual(value.text, None) -1117 self.assertEqual(value.pyval, None) -
1118 -
1119 - def test_type_unregistered(self): -
1120 Element = self.Element -1121 SubElement = self.etree.SubElement -1122 class MyFloat(float): -1123 pass -
1124 root = Element("{objectified}root") -1125 root.myfloat = MyFloat(5.5) -1126 self.assertTrue(isinstance(root.myfloat, objectify.FloatElement)) -1127 self.assertEqual(root.myfloat.get(objectify.PYTYPE_ATTRIBUTE), None) -
1128 -
1130 class MyFloat(float): -1131 pass -
1132 value = objectify.DataElement(MyFloat(5.5)) -1133 self.assertTrue(isinstance(value, objectify.FloatElement)) -1134 self.assertEqual(value, 5.5) -1135 self.assertEqual(value.get(objectify.PYTYPE_ATTRIBUTE), None) -1136 -
1137 - def test_schema_types(self): -
1138 XML = self.XML -1139 root = XML('''\ -1140 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -1141 <b xsi:type="boolean">true</b> -1142 <b xsi:type="boolean">false</b> -1143 <b xsi:type="boolean">1</b> -1144 <b xsi:type="boolean">0</b> -1145 -1146 <f xsi:type="float">5</f> -1147 <f xsi:type="double">5</f> -1148 -1149 <s xsi:type="string">5</s> -1150 <s xsi:type="normalizedString">5</s> -1151 <s xsi:type="token">5</s> -1152 <s xsi:type="language">5</s> -1153 <s xsi:type="Name">5</s> -1154 <s xsi:type="NCName">5</s> -1155 <s xsi:type="ID">5</s> -1156 <s xsi:type="IDREF">5</s> -1157 <s xsi:type="ENTITY">5</s> -1158 <s xsi:type="NMTOKEN">5</s> -1159 -1160 <l xsi:type="integer">5</l> -1161 <l xsi:type="nonPositiveInteger">5</l> -1162 <l xsi:type="negativeInteger">5</l> -1163 <l xsi:type="long">5</l> -1164 <l xsi:type="nonNegativeInteger">5</l> -1165 <l xsi:type="unsignedLong">5</l> -1166 <l xsi:type="unsignedInt">5</l> -1167 <l xsi:type="positiveInteger">5</l> -1168 -1169 <i xsi:type="int">5</i> -1170 <i xsi:type="short">5</i> -1171 <i xsi:type="byte">5</i> -1172 <i xsi:type="unsignedShort">5</i> -1173 <i xsi:type="unsignedByte">5</i> -1174 -1175 <n xsi:nil="true"/> -1176 </root> -1177 ''') -1178 -1179 for b in root.b: -1180 self.assertTrue(isinstance(b, objectify.BoolElement)) -1181 self.assertEqual(True, root.b[0]) -1182 self.assertEqual(False, root.b[1]) -1183 self.assertEqual(True, root.b[2]) -1184 self.assertEqual(False, root.b[3]) -1185 -1186 for f in root.f: -1187 self.assertTrue(isinstance(f, objectify.FloatElement)) -1188 self.assertEqual(5, f) -1189 -1190 for s in root.s: -1191 self.assertTrue(isinstance(s, objectify.StringElement)) -1192 self.assertEqual("5", s) -1193 -1194 for i in root.i: -1195 self.assertTrue(isinstance(i, objectify.IntElement)) -1196 self.assertEqual(5, i) -1197 -1198 for l in root.l: -1199 self.assertTrue(isinstance(l, objectify.IntElement)) -1200 self.assertEqual(5, i) -1201 -1202 self.assertTrue(isinstance(root.n, objectify.NoneElement)) -1203 self.assertEqual(None, root.n) -
1204 -
1205 - def test_schema_types_prefixed(self): -
1206 XML = self.XML -1207 root = XML('''\ -1208 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1209 xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -1210 <b xsi:type="xsd:boolean">true</b> -1211 <b xsi:type="xsd:boolean">false</b> -1212 <b xsi:type="xsd:boolean">1</b> -1213 <b xsi:type="xsd:boolean">0</b> -1214 -1215 <f xsi:type="xsd:float">5</f> -1216 <f xsi:type="xsd:double">5</f> -1217 -1218 <s xsi:type="xsd:string">5</s> -1219 <s xsi:type="xsd:normalizedString">5</s> -1220 <s xsi:type="xsd:token">5</s> -1221 <s xsi:type="xsd:language">5</s> -1222 <s xsi:type="xsd:Name">5</s> -1223 <s xsi:type="xsd:NCName">5</s> -1224 <s xsi:type="xsd:ID">5</s> -1225 <s xsi:type="xsd:IDREF">5</s> -1226 <s xsi:type="xsd:ENTITY">5</s> -1227 <s xsi:type="xsd:NMTOKEN">5</s> -1228 -1229 <l xsi:type="xsd:integer">5</l> -1230 <l xsi:type="xsd:nonPositiveInteger">5</l> -1231 <l xsi:type="xsd:negativeInteger">5</l> -1232 <l xsi:type="xsd:long">5</l> -1233 <l xsi:type="xsd:nonNegativeInteger">5</l> -1234 <l xsi:type="xsd:unsignedLong">5</l> -1235 <l xsi:type="xsd:unsignedInt">5</l> -1236 <l xsi:type="xsd:positiveInteger">5</l> -1237 -1238 <i xsi:type="xsd:int">5</i> -1239 <i xsi:type="xsd:short">5</i> -1240 <i xsi:type="xsd:byte">5</i> -1241 <i xsi:type="xsd:unsignedShort">5</i> -1242 <i xsi:type="xsd:unsignedByte">5</i> -1243 -1244 <n xsi:nil="true"/> -1245 </root> -1246 ''') -1247 -1248 for b in root.b: -1249 self.assertTrue(isinstance(b, objectify.BoolElement)) -1250 self.assertEqual(True, root.b[0]) -1251 self.assertEqual(False, root.b[1]) -1252 self.assertEqual(True, root.b[2]) -1253 self.assertEqual(False, root.b[3]) -1254 -1255 for f in root.f: -1256 self.assertTrue(isinstance(f, objectify.FloatElement)) -1257 self.assertEqual(5, f) -1258 -1259 for s in root.s: -1260 self.assertTrue(isinstance(s, objectify.StringElement)) -1261 self.assertEqual("5", s) -1262 -1263 for i in root.i: -1264 self.assertTrue(isinstance(i, objectify.IntElement)) -1265 self.assertEqual(5, i) -1266 -1267 for l in root.l: -1268 self.assertTrue(isinstance(l, objectify.IntElement)) -1269 self.assertEqual(5, l) -1270 -1271 self.assertTrue(isinstance(root.n, objectify.NoneElement)) -1272 self.assertEqual(None, root.n) -
1273 -
1274 - def test_type_str_sequence(self): -
1275 XML = self.XML -1276 root = XML(_bytes('<root><b>why</b><b>try</b></root>')) -1277 strs = [ str(s) for s in root.b ] -1278 self.assertEqual(["why", "try"], -1279 strs) -
1280 -
1281 - def test_type_str_cmp(self): -
1282 XML = self.XML -1283 root = XML(_bytes('<root><b>test</b><b>taste</b><b></b><b/></root>')) -1284 self.assertFalse(root.b[0] < root.b[1]) -1285 self.assertFalse(root.b[0] <= root.b[1]) -1286 self.assertFalse(root.b[0] == root.b[1]) -1287 -1288 self.assertTrue(root.b[0] != root.b[1]) -1289 self.assertTrue(root.b[0] >= root.b[1]) -1290 self.assertTrue(root.b[0] > root.b[1]) -1291 -1292 self.assertEqual(root.b[0], "test") -1293 self.assertEqual("test", root.b[0]) -1294 -1295 self.assertEqual("", root.b[2]) -1296 self.assertEqual(root.b[2], "") -1297 self.assertEqual("", root.b[3]) -1298 self.assertEqual(root.b[3], "") -1299 self.assertEqual(root.b[2], root.b[3]) -1300 -1301 root.b = "test" -1302 self.assertTrue(root.b) -1303 root.b = "" -1304 self.assertFalse(root.b) -1305 self.assertEqual(root.b, "") -1306 self.assertEqual("", root.b) -
1307 -
1308 - def test_type_int_cmp(self): -
1309 XML = self.XML -1310 root = XML(_bytes('<root><b>5</b><b>6</b></root>')) -1311 self.assertTrue(root.b[0] < root.b[1]) -1312 self.assertTrue(root.b[0] <= root.b[1]) -1313 self.assertTrue(root.b[0] != root.b[1]) -1314 -1315 self.assertFalse(root.b[0] == root.b[1]) -1316 self.assertFalse(root.b[0] >= root.b[1]) -1317 self.assertFalse(root.b[0] > root.b[1]) -1318 -1319 self.assertEqual(root.b[0], 5) -1320 self.assertEqual(5, root.b[0]) -1321 self.assertNotEqual(root.b[0], "5") -1322 -1323 root.b = 5 -1324 self.assertTrue(root.b) -1325 root.b = 0 -1326 self.assertFalse(root.b) -
1327 -1328 # float + long share the NumberElement implementation with int -1329 -
1330 - def test_type_bool_cmp(self): -
1331 XML = self.XML -1332 root = XML(_bytes('<root><b>false</b><b>true</b></root>')) -1333 self.assertTrue(root.b[0] < root.b[1]) -1334 self.assertTrue(root.b[0] <= root.b[1]) -1335 self.assertTrue(root.b[0] != root.b[1]) -1336 -1337 self.assertFalse(root.b[0] == root.b[1]) -1338 self.assertFalse(root.b[0] >= root.b[1]) -1339 self.assertFalse(root.b[0] > root.b[1]) -1340 -1341 self.assertFalse(root.b[0]) -1342 self.assertTrue(root.b[1]) -1343 -1344 self.assertEqual(root.b[0], False) -1345 self.assertEqual(False, root.b[0]) -1346 self.assertTrue(root.b[0] < 5) -1347 self.assertTrue(5 > root.b[0]) -1348 -1349 root.b = True -1350 self.assertTrue(root.b) -1351 root.b = False -1352 self.assertFalse(root.b) -
1353 -
1354 - def test_type_none_cmp(self): -
1355 XML = self.XML -1356 root = XML(_bytes(""" -1357 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -1358 <b xsi:nil="true"></b><b xsi:nil="true"/> -1359 </root>""")) -1360 self.assertTrue(root.b[0] == root.b[1]) -1361 self.assertFalse(root.b[0]) -1362 self.assertEqual(root.b[0], None) -1363 self.assertEqual(None, root.b[0]) -
1364 -1365 # doesn't work in Py3: -1366 -1367 #for comparison in ["abc", 5, 7.3, True, [], ()]: -1368 # none = root.b[1] -1369 # self.assertTrue(none < comparison, "%s (%s) should be < %s" % -1370 # (none, type(none), comparison) ) -1371 # self.assertTrue(comparison > none, "%s should be > %s (%s)" % -1372 # (comparison, none, type(none)) ) -1373 -
1374 - def test_dataelement_xsi(self): -
1375 el = objectify.DataElement(1, _xsi="string") -1376 self.assertEqual( -1377 el.get(XML_SCHEMA_INSTANCE_TYPE_ATTR), -1378 'xsd:string') -
1379 -
1380 - def test_dataelement_xsi_nsmap(self): -
1381 el = objectify.DataElement(1, _xsi="string", -1382 nsmap={'schema': XML_SCHEMA_NS}) -1383 self.assertEqual( -1384 el.get(XML_SCHEMA_INSTANCE_TYPE_ATTR), -1385 'schema:string') -
1386 -
1388 self.assertRaises(ValueError, objectify.DataElement, 1, -1389 _xsi="foo:string") -
1390 -
1391 - def test_pytype_annotation(self): -
1392 XML = self.XML -1393 root = XML(_bytes('''\ -1394 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1395 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1396 <b>5</b> -1397 <b>test</b> -1398 <c>1.1</c> -1399 <c>\uF8D2</c> -1400 <x>true</x> -1401 <n xsi:nil="true" /> -1402 <n></n> -1403 <b xsi:type="double">5</b> -1404 <b xsi:type="float">5</b> -1405 <s xsi:type="string">23</s> -1406 <s py:pytype="str">42</s> -1407 <f py:pytype="float">300</f> -1408 <l py:pytype="long">2</l> -1409 <t py:pytype="TREE"></t> -1410 </a> -1411 ''')) -1412 objectify.annotate(root) -1413 -1414 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1415 for c in root.iterchildren() ] -1416 self.assertEqual("int", child_types[ 0]) -1417 self.assertEqual("str", child_types[ 1]) -1418 self.assertEqual("float", child_types[ 2]) -1419 self.assertEqual("str", child_types[ 3]) -1420 self.assertEqual("bool", child_types[ 4]) -1421 self.assertEqual("NoneType", child_types[ 5]) -1422 self.assertEqual(None, child_types[ 6]) -1423 self.assertEqual("float", child_types[ 7]) -1424 self.assertEqual("float", child_types[ 8]) -1425 self.assertEqual("str", child_types[ 9]) -1426 self.assertEqual("int", child_types[10]) -1427 self.assertEqual("int", child_types[11]) -1428 self.assertEqual("int", child_types[12]) -1429 self.assertEqual(None, child_types[13]) -1430 -1431 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -
1432 -
1434 XML = self.XML -1435 root = XML(_bytes('''\ -1436 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1437 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1438 <n></n> -1439 </a> -1440 ''')) -1441 objectify.annotate(root) -1442 -1443 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1444 for c in root.iterchildren() ] -1445 self.assertEqual(None, child_types[0]) -1446 -1447 objectify.annotate(root, empty_pytype="str") -1448 -1449 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1450 for c in root.iterchildren() ] -1451 self.assertEqual("str", child_types[0]) -
1452 -
1454 XML = self.XML -1455 root = XML(_bytes('''\ -1456 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1457 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1458 <b>5</b> -1459 <b>test</b> -1460 <c>1.1</c> -1461 <c>\uF8D2</c> -1462 <x>true</x> -1463 <n xsi:nil="true" /> -1464 <n></n> -1465 <b xsi:type="double">5</b> -1466 <b xsi:type="float">5</b> -1467 <s xsi:type="string">23</s> -1468 <s py:pytype="str">42</s> -1469 <f py:pytype="float">300</f> -1470 <l py:pytype="long">2</l> -1471 <t py:pytype="TREE"></t> -1472 </a> -1473 ''')) -1474 objectify.annotate(root, ignore_old=False) -1475 -1476 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1477 for c in root.iterchildren() ] -1478 self.assertEqual("int", child_types[ 0]) -1479 self.assertEqual("str", child_types[ 1]) -1480 self.assertEqual("float", child_types[ 2]) -1481 self.assertEqual("str", child_types[ 3]) -1482 self.assertEqual("bool", child_types[ 4]) -1483 self.assertEqual("NoneType", child_types[ 5]) -1484 self.assertEqual(None, child_types[ 6]) -1485 self.assertEqual("float", child_types[ 7]) -1486 self.assertEqual("float", child_types[ 8]) -1487 self.assertEqual("str", child_types[ 9]) -1488 self.assertEqual("str", child_types[10]) -1489 self.assertEqual("float", child_types[11]) -1490 self.assertEqual("int", child_types[12]) -1491 self.assertEqual(TREE_PYTYPE, child_types[13]) -1492 -1493 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -
1494 -
1496 XML = self.XML -1497 root = XML(_bytes('''\ -1498 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1499 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1500 <b>5</b> -1501 <b>test</b> -1502 <c>1.1</c> -1503 <c>\uF8D2</c> -1504 <x>true</x> -1505 <n xsi:nil="true" /> -1506 <n></n> -1507 <b xsi:type="double">5</b> -1508 <b xsi:type="float">5</b> -1509 <s xsi:type="string">23</s> -1510 <s py:pytype="str">42</s> -1511 <f py:pytype="float">300</f> -1512 <l py:pytype="long">2</l> -1513 <t py:pytype="TREE"></t> -1514 </a> -1515 ''')) -1516 objectify.annotate(root, ignore_old=False, ignore_xsi=False, -1517 annotate_xsi=1, annotate_pytype=1) -1518 -1519 # check py annotations -1520 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1521 for c in root.iterchildren() ] -1522 self.assertEqual("int", child_types[ 0]) -1523 self.assertEqual("str", child_types[ 1]) -1524 self.assertEqual("float", child_types[ 2]) -1525 self.assertEqual("str", child_types[ 3]) -1526 self.assertEqual("bool", child_types[ 4]) -1527 self.assertEqual("NoneType", child_types[ 5]) -1528 self.assertEqual(None, child_types[ 6]) -1529 self.assertEqual("float", child_types[ 7]) -1530 self.assertEqual("float", child_types[ 8]) -1531 self.assertEqual("str", child_types[ 9]) -1532 self.assertEqual("str", child_types[10]) -1533 self.assertEqual("float", child_types[11]) -1534 self.assertEqual("int", child_types[12]) -1535 self.assertEqual(TREE_PYTYPE, child_types[13]) -1536 -1537 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -1538 -1539 child_xsitypes = [ c.get(XML_SCHEMA_INSTANCE_TYPE_ATTR) -1540 for c in root.iterchildren() ] -1541 -1542 # check xsi annotations -1543 child_types = [ c.get(XML_SCHEMA_INSTANCE_TYPE_ATTR) -1544 for c in root.iterchildren() ] -1545 self.assertEqual("xsd:integer", child_types[ 0]) -1546 self.assertEqual("xsd:string", child_types[ 1]) -1547 self.assertEqual("xsd:double", child_types[ 2]) -1548 self.assertEqual("xsd:string", child_types[ 3]) -1549 self.assertEqual("xsd:boolean", child_types[ 4]) -1550 self.assertEqual(None, child_types[ 5]) -1551 self.assertEqual(None, child_types[ 6]) -1552 self.assertEqual("xsd:double", child_types[ 7]) -1553 self.assertEqual("xsd:float", child_types[ 8]) -1554 self.assertEqual("xsd:string", child_types[ 9]) -1555 self.assertEqual("xsd:string", child_types[10]) -1556 self.assertEqual("xsd:double", child_types[11]) -1557 self.assertEqual("xsd:integer", child_types[12]) -1558 self.assertEqual(None, child_types[13]) -1559 -1560 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -
1561 -
1562 - def test_xsiannotate_use_old(self): -
1563 XML = self.XML -1564 root = XML(_bytes('''\ -1565 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1566 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1567 <b>5</b> -1568 <b>test</b> -1569 <c>1.1</c> -1570 <c>\uF8D2</c> -1571 <x>true</x> -1572 <n xsi:nil="true" /> -1573 <n></n> -1574 <b xsi:type="double">5</b> -1575 <b xsi:type="float">5</b> -1576 <s xsi:type="string">23</s> -1577 <s py:pytype="str">42</s> -1578 <f py:pytype="float">300</f> -1579 <l py:pytype="long">2</l> -1580 <t py:pytype="TREE"></t> -1581 </a> -1582 ''')) -1583 objectify.xsiannotate(root, ignore_old=False) -1584 -1585 child_types = [ c.get(XML_SCHEMA_INSTANCE_TYPE_ATTR) -1586 for c in root.iterchildren() ] -1587 self.assertEqual("xsd:integer", child_types[ 0]) -1588 self.assertEqual("xsd:string", child_types[ 1]) -1589 self.assertEqual("xsd:double", child_types[ 2]) -1590 self.assertEqual("xsd:string", child_types[ 3]) -1591 self.assertEqual("xsd:boolean", child_types[ 4]) -1592 self.assertEqual(None, child_types[ 5]) -1593 self.assertEqual(None, child_types[ 6]) -1594 self.assertEqual("xsd:double", child_types[ 7]) -1595 self.assertEqual("xsd:float", child_types[ 8]) -1596 self.assertEqual("xsd:string", child_types[ 9]) -1597 self.assertEqual("xsd:string", child_types[10]) -1598 self.assertEqual("xsd:double", child_types[11]) -1599 self.assertEqual("xsd:integer", child_types[12]) -1600 self.assertEqual(None, child_types[13]) -
1601 -
1602 - def test_pyannotate_ignore_old(self): -
1603 XML = self.XML -1604 root = XML(_bytes('''\ -1605 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1606 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1607 <b>5</b> -1608 <b>test</b> -1609 <c>1.1</c> -1610 <c>\uF8D2</c> -1611 <x>true</x> -1612 <n xsi:nil="true" /> -1613 <n></n> -1614 <b xsi:type="double">5</b> -1615 <b xsi:type="float">5</b> -1616 <s xsi:type="string">23</s> -1617 <s py:pytype="str">42</s> -1618 <f py:pytype="float">300</f> -1619 <l py:pytype="long">2</l> -1620 <t py:pytype="TREE"></t> -1621 </a> -1622 ''')) -1623 objectify.pyannotate(root, ignore_old=True) -1624 -1625 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1626 for c in root.iterchildren() ] -1627 self.assertEqual("int", child_types[ 0]) -1628 self.assertEqual("str", child_types[ 1]) -1629 self.assertEqual("float", child_types[ 2]) -1630 self.assertEqual("str", child_types[ 3]) -1631 self.assertEqual("bool", child_types[ 4]) -1632 self.assertEqual("NoneType", child_types[ 5]) -1633 self.assertEqual(None, child_types[ 6]) -1634 self.assertEqual("float", child_types[ 7]) -1635 self.assertEqual("float", child_types[ 8]) -1636 self.assertEqual("str", child_types[ 9]) -1637 self.assertEqual("int", child_types[10]) -1638 self.assertEqual("int", child_types[11]) -1639 self.assertEqual("int", child_types[12]) -1640 self.assertEqual(None, child_types[13]) -1641 -1642 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -
1643 -
1644 - def test_pyannotate_empty(self): -
1645 XML = self.XML -1646 root = XML('''\ -1647 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1648 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1649 <n></n> -1650 </a> -1651 ''') -1652 objectify.pyannotate(root) -1653 -1654 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1655 for c in root.iterchildren() ] -1656 self.assertEqual(None, child_types[0]) -1657 -1658 objectify.annotate(root, empty_pytype="str") -1659 -1660 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1661 for c in root.iterchildren() ] -1662 self.assertEqual("str", child_types[0]) -
1663 -
1664 - def test_pyannotate_use_old(self): -
1665 XML = self.XML -1666 root = XML('''\ -1667 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1668 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1669 <b>5</b> -1670 <b>test</b> -1671 <c>1.1</c> -1672 <c>\uF8D2</c> -1673 <x>true</x> -1674 <n xsi:nil="true" /> -1675 <n></n> -1676 <b xsi:type="double">5</b> -1677 <b xsi:type="float">5</b> -1678 <s xsi:type="string">23</s> -1679 <s py:pytype="str">42</s> -1680 <f py:pytype="float">300</f> -1681 <l py:pytype="long">2</l> -1682 <t py:pytype="TREE"></t> -1683 </a> -1684 ''') -1685 objectify.pyannotate(root) -1686 -1687 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1688 for c in root.iterchildren() ] -1689 self.assertEqual("int", child_types[ 0]) -1690 self.assertEqual("str", child_types[ 1]) -1691 self.assertEqual("float", child_types[ 2]) -1692 self.assertEqual("str", child_types[ 3]) -1693 self.assertEqual("bool", child_types[ 4]) -1694 self.assertEqual("NoneType", child_types[ 5]) -1695 self.assertEqual(None, child_types[ 6]) -1696 self.assertEqual("float", child_types[ 7]) -1697 self.assertEqual("float", child_types[ 8]) -1698 self.assertEqual("str", child_types[ 9]) -1699 self.assertEqual("str", child_types[10]) -1700 self.assertEqual("float", child_types[11]) -1701 self.assertEqual("int", child_types[12]) -1702 self.assertEqual(TREE_PYTYPE, child_types[13]) -1703 -1704 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -
1705 -
1706 - def test_xsiannotate_ignore_old(self): -
1707 XML = self.XML -1708 root = XML(_bytes('''\ -1709 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1710 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1711 <b>5</b> -1712 <b>test</b> -1713 <c>1.1</c> -1714 <c>\uF8D2</c> -1715 <x>true</x> -1716 <n xsi:nil="true" /> -1717 <n></n> -1718 <b xsi:type="double">5</b> -1719 <b xsi:type="float">5</b> -1720 <s xsi:type="string">23</s> -1721 <s py:pytype="str">42</s> -1722 <f py:pytype="float">300</f> -1723 <l py:pytype="long">2</l> -1724 <t py:pytype="TREE"></t> -1725 </a> -1726 ''')) -1727 objectify.xsiannotate(root, ignore_old=True) -1728 -1729 child_types = [ c.get(XML_SCHEMA_INSTANCE_TYPE_ATTR) -1730 for c in root.iterchildren() ] -1731 self.assertEqual("xsd:integer", child_types[ 0]) -1732 self.assertEqual("xsd:string", child_types[ 1]) -1733 self.assertEqual("xsd:double", child_types[ 2]) -1734 self.assertEqual("xsd:string", child_types[ 3]) -1735 self.assertEqual("xsd:boolean", child_types[ 4]) -1736 self.assertEqual(None, child_types[ 5]) -1737 self.assertEqual(None, child_types[ 6]) -1738 self.assertEqual("xsd:integer", child_types[ 7]) -1739 self.assertEqual("xsd:integer", child_types[ 8]) -1740 self.assertEqual("xsd:integer", child_types[ 9]) -1741 self.assertEqual("xsd:string", child_types[10]) -1742 self.assertEqual("xsd:double", child_types[11]) -1743 self.assertEqual("xsd:integer", child_types[12]) -1744 self.assertEqual(None, child_types[13]) -1745 -1746 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -
1747 -
1748 - def test_deannotate(self): -
1749 XML = self.XML -1750 root = XML(_bytes('''\ -1751 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1752 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1753 <b>5</b> -1754 <b>test</b> -1755 <c>1.1</c> -1756 <c>\uF8D2</c> -1757 <x>true</x> -1758 <n xsi:nil="true" /> -1759 <n></n> -1760 <b xsi:type="double">5</b> -1761 <b xsi:type="float">5</b> -1762 <s xsi:type="string">23</s> -1763 <s py:pytype="str">42</s> -1764 <f py:pytype="float">300</f> -1765 <l py:pytype="long">2</l> -1766 <t py:pytype="TREE"></t> -1767 </a> -1768 ''')) -1769 objectify.deannotate(root) -1770 -1771 for c in root.getiterator(): -1772 self.assertEqual(None, c.get(XML_SCHEMA_INSTANCE_TYPE_ATTR)) -1773 self.assertEqual(None, c.get(objectify.PYTYPE_ATTRIBUTE)) -1774 -1775 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -
1776 -
1777 - def test_xsinil_deannotate(self): -
1778 XML = self.XML -1779 root = XML(_bytes('''\ -1780 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1781 xmlns:py="http://codespeak.net/lxml/objectify/pytype"> -1782 <b>5</b> -1783 <b>test</b> -1784 <c>1.1</c> -1785 <c>\uF8D2</c> -1786 <x>true</x> -1787 <n xsi:nil="true" /> -1788 <n></n> -1789 <b xsi:type="double">5</b> -1790 <b xsi:type="float">5</b> -1791 <s xsi:type="string">23</s> -1792 <s py:pytype="str">42</s> -1793 <f py:pytype="float">300</f> -1794 <l py:pytype="long">2</l> -1795 <t py:pytype="TREE"></t> -1796 </a> -1797 ''')) -1798 objectify.annotate( -1799 root, ignore_old=False, ignore_xsi=False, annotate_xsi=True, -1800 empty_pytype='str', empty_type='string') -1801 objectify.deannotate(root, pytype=False, xsi=False, xsi_nil=True) -1802 -1803 child_types = [ c.get(XML_SCHEMA_INSTANCE_TYPE_ATTR) -1804 for c in root.iterchildren() ] -1805 self.assertEqual("xsd:integer", child_types[ 0]) -1806 self.assertEqual("xsd:string", child_types[ 1]) -1807 self.assertEqual("xsd:double", child_types[ 2]) -1808 self.assertEqual("xsd:string", child_types[ 3]) -1809 self.assertEqual("xsd:boolean", child_types[ 4]) -1810 self.assertEqual(None, child_types[ 5]) -1811 self.assertEqual("xsd:string", child_types[ 6]) -1812 self.assertEqual("xsd:double", child_types[ 7]) -1813 self.assertEqual("xsd:float", child_types[ 8]) -1814 self.assertEqual("xsd:string", child_types[ 9]) -1815 self.assertEqual("xsd:string", child_types[10]) -1816 self.assertEqual("xsd:double", child_types[11]) -1817 self.assertEqual("xsd:integer", child_types[12]) -1818 self.assertEqual(None, child_types[13]) -1819 -1820 self.assertEqual(None, root.n.get(XML_SCHEMA_NIL_ATTR)) -1821 -1822 for c in root.iterchildren(): -1823 self.assertNotEqual(None, c.get(objectify.PYTYPE_ATTRIBUTE)) -1824 # these have no equivalent in xsi:type -1825 if (c.get(objectify.PYTYPE_ATTRIBUTE) not in [TREE_PYTYPE, -1826 "NoneType"]): -1827 self.assertNotEqual( -1828 None, c.get(XML_SCHEMA_INSTANCE_TYPE_ATTR)) -
1829 -
1830 - def test_xsitype_deannotate(self): -
1831 XML = self.XML -1832 root = XML(_bytes('''\ -1833 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1834 xmlns:py="http://codespeak.net/lxml/objectify/pytype" -1835 xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -1836 <b>5</b> -1837 <b>test</b> -1838 <c>1.1</c> -1839 <c>\uF8D2</c> -1840 <x>true</x> -1841 <n xsi:nil="true" /> -1842 <n></n> -1843 <b xsi:type="xsd:double">5</b> -1844 <b xsi:type="xsd:float">5</b> -1845 <s xsi:type="xsd:string">23</s> -1846 <s py:pytype="str">42</s> -1847 <f py:pytype="float">300</f> -1848 <l py:pytype="long">2</l> -1849 <t py:pytype="TREE"></t> -1850 </a> -1851 ''')) -1852 objectify.annotate(root) -1853 objectify.deannotate(root, pytype=False) -1854 -1855 child_types = [ c.get(objectify.PYTYPE_ATTRIBUTE) -1856 for c in root.iterchildren() ] -1857 self.assertEqual("int", child_types[ 0]) -1858 self.assertEqual("str", child_types[ 1]) -1859 self.assertEqual("float", child_types[ 2]) -1860 self.assertEqual("str", child_types[ 3]) -1861 self.assertEqual("bool", child_types[ 4]) -1862 self.assertEqual("NoneType", child_types[ 5]) -1863 self.assertEqual(None, child_types[ 6]) -1864 self.assertEqual("float", child_types[ 7]) -1865 self.assertEqual("float", child_types[ 8]) -1866 self.assertEqual("str", child_types[ 9]) -1867 self.assertEqual("int", child_types[10]) -1868 self.assertEqual("int", child_types[11]) -1869 self.assertEqual("int", child_types[12]) -1870 self.assertEqual(None, child_types[13]) -1871 -1872 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -1873 -1874 for c in root.getiterator(): -1875 self.assertEqual(None, c.get(XML_SCHEMA_INSTANCE_TYPE_ATTR)) -
1876 -
1877 - def test_pytype_deannotate(self): -
1878 XML = self.XML -1879 root = XML(_bytes('''\ -1880 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -1881 xmlns:py="http://codespeak.net/lxml/objectify/pytype" -1882 xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -1883 <b xsi:type="xsd:int">5</b> -1884 <b xsi:type="xsd:string">test</b> -1885 <c xsi:type="xsd:float">1.1</c> -1886 <c xsi:type="xsd:string">\uF8D2</c> -1887 <x xsi:type="xsd:boolean">true</x> -1888 <n xsi:nil="true" /> -1889 <n></n> -1890 <b xsi:type="xsd:double">5</b> -1891 <b xsi:type="xsd:float">5</b> -1892 <s xsi:type="xsd:string">23</s> -1893 <s xsi:type="xsd:string">42</s> -1894 <f xsi:type="xsd:float">300</f> -1895 <l xsi:type="xsd:long">2</l> -1896 <t py:pytype="TREE"></t> -1897 </a> -1898 ''')) -1899 objectify.annotate(root) -1900 objectify.deannotate(root, xsi=False) -1901 -1902 child_types = [ c.get(XML_SCHEMA_INSTANCE_TYPE_ATTR) -1903 for c in root.iterchildren() ] -1904 self.assertEqual("xsd:int", child_types[ 0]) -1905 self.assertEqual("xsd:string", child_types[ 1]) -1906 self.assertEqual("xsd:float", child_types[ 2]) -1907 self.assertEqual("xsd:string", child_types[ 3]) -1908 self.assertEqual("xsd:boolean", child_types[ 4]) -1909 self.assertEqual(None, child_types[ 5]) -1910 self.assertEqual(None, child_types[ 6]) -1911 self.assertEqual("xsd:double", child_types[ 7]) -1912 self.assertEqual("xsd:float", child_types[ 8]) -1913 self.assertEqual("xsd:string", child_types[ 9]) -1914 self.assertEqual("xsd:string", child_types[10]) -1915 self.assertEqual("xsd:float", child_types[11]) -1916 self.assertEqual("xsd:long", child_types[12]) -1917 self.assertEqual(None, child_types[13]) -1918 -1919 self.assertEqual("true", root.n.get(XML_SCHEMA_NIL_ATTR)) -1920 -1921 for c in root.getiterator(): -1922 self.assertEqual(None, c.get(objectify.PYTYPE_ATTRIBUTE)) -
1923 -
1925 XML = self.XML -1926 -1927 xml = _bytes('''\ -1928 <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -1929 <b>5</b> -1930 <b>test</b> -1931 <c>1.1</c> -1932 <c>\uF8D2</c> -1933 <x>true</x> -1934 <n xsi:nil="true" /> -1935 <n></n> -1936 <b xsi:type="double">5</b> -1937 </a> -1938 ''') -1939 -1940 pytype_ns, pytype_name = objectify.PYTYPE_ATTRIBUTE[1:].split('}') -1941 objectify.set_pytype_attribute_tag("{TEST}test") -1942 -1943 root = XML(xml) -1944 objectify.annotate(root) -1945 -1946 attribs = root.xpath("//@py:%s" % pytype_name, -1947 namespaces={"py" : pytype_ns}) -1948 self.assertEqual(0, len(attribs)) -1949 attribs = root.xpath("//@py:test", -1950 namespaces={"py" : "TEST"}) -1951 self.assertEqual(7, len(attribs)) -1952 -1953 objectify.set_pytype_attribute_tag() -1954 pytype_ns, pytype_name = objectify.PYTYPE_ATTRIBUTE[1:].split('}') -1955 -1956 self.assertNotEqual("test", pytype_ns.lower()) -1957 self.assertNotEqual("test", pytype_name.lower()) -1958 -1959 root = XML(xml) -1960 attribs = root.xpath("//@py:%s" % pytype_name, -1961 namespaces={"py" : pytype_ns}) -1962 self.assertEqual(0, len(attribs)) -1963 -1964 objectify.annotate(root) -1965 attribs = root.xpath("//@py:%s" % pytype_name, -1966 namespaces={"py" : pytype_ns}) -1967 self.assertEqual(7, len(attribs)) -
1968 -
1969 - def test_registered_types(self): -
1970 orig_types = objectify.getRegisteredTypes() -1971 orig_types[0].unregister() -1972 self.assertEqual(orig_types[1:], objectify.getRegisteredTypes()) -1973 -1974 class NewType(objectify.ObjectifiedDataElement): -1975 pass -
1976 -1977 def checkMyType(s): -1978 return True -1979 -1980 pytype = objectify.PyType("mytype", checkMyType, NewType) -1981 self.assertTrue(pytype not in objectify.getRegisteredTypes()) -1982 pytype.register() -1983 self.assertTrue(pytype in objectify.getRegisteredTypes()) -1984 pytype.unregister() -1985 self.assertTrue(pytype not in objectify.getRegisteredTypes()) -1986 -1987 pytype.register(before = [objectify.getRegisteredTypes()[0].name]) -1988 self.assertEqual(pytype, objectify.getRegisteredTypes()[0]) -1989 pytype.unregister() -1990 -1991 pytype.register(after = [objectify.getRegisteredTypes()[0].name]) -1992 self.assertNotEqual(pytype, objectify.getRegisteredTypes()[0]) -1993 pytype.unregister() -1994 -1995 self.assertRaises(ValueError, pytype.register, -1996 before = [objectify.getRegisteredTypes()[0].name], -1997 after = [objectify.getRegisteredTypes()[1].name]) -1998 -
2000 from datetime import datetime -2001 def parse_date(value): -2002 if len(value) != 14: -2003 raise ValueError(value) -2004 Y = int(value[0:4]) -2005 M = int(value[4:6]) -2006 D = int(value[6:8]) -2007 h = int(value[8:10]) -2008 m = int(value[10:12]) -2009 s = int(value[12:14]) -2010 return datetime(Y, M, D, h, m, s) -
2011 -2012 def stringify_date(date): -2013 return date.strftime("%Y%m%d%H%M%S") -2014 -2015 class DatetimeElement(objectify.ObjectifiedDataElement): -2016 def pyval(self): -2017 return parse_date(self.text) -2018 pyval = property(pyval) -2019 -2020 datetime_type = objectify.PyType( -2021 "datetime", parse_date, DatetimeElement, stringify_date) -2022 datetime_type.xmlSchemaTypes = "dateTime" -2023 datetime_type.register() -2024 -2025 NAMESPACE = "http://foo.net/xmlns" -2026 NAMESPACE_MAP = {'ns': NAMESPACE} -2027 -2028 r = objectify.Element("{%s}root" % NAMESPACE, nsmap=NAMESPACE_MAP) -2029 time = datetime.now() -2030 r.date = time -2031 -2032 self.assertTrue(isinstance(r.date, DatetimeElement)) -2033 self.assertTrue(isinstance(r.date.pyval, datetime)) -2034 -2035 self.assertEqual(r.date.pyval, parse_date(stringify_date(time))) -2036 self.assertEqual(r.date.text, stringify_date(time)) -2037 -2038 r.date = objectify.E.date(time) -2039 -2040 self.assertTrue(isinstance(r.date, DatetimeElement)) -2041 self.assertTrue(isinstance(r.date.pyval, datetime)) -2042 -2043 self.assertEqual(r.date.pyval, parse_date(stringify_date(time))) -2044 self.assertEqual(r.date.text, stringify_date(time)) -2045 -2046 date = objectify.DataElement(time) -2047 -2048 self.assertTrue(isinstance(date, DatetimeElement)) -2049 self.assertTrue(isinstance(date.pyval, datetime)) -2050 -2051 self.assertEqual(date.pyval, parse_date(stringify_date(time))) -2052 self.assertEqual(date.text, stringify_date(time)) -2053 -
2054 - def test_object_path(self): -
2055 root = self.XML(xml_str) -2056 path = objectify.ObjectPath( "root.c1.c2" ) -2057 self.assertEqual(root.c1.c2.text, path.find(root).text) -2058 self.assertEqual(root.c1.c2.text, path(root).text) -
2059 -
2060 - def test_object_path_list(self): -
2061 root = self.XML(xml_str) -2062 path = objectify.ObjectPath( ['root', 'c1', 'c2'] ) -2063 self.assertEqual(root.c1.c2.text, path.find(root).text) -2064 self.assertEqual(root.c1.c2.text, path(root).text) -
2065 -
2066 - def test_object_path_fail(self): -
2067 root = self.XML(xml_str) -2068 path = objectify.ObjectPath( "root.c1.c99" ) -2069 self.assertRaises(AttributeError, path, root) -
2070 -
2072 root = self.XML(xml_str) -2073 path = objectify.ObjectPath( "root.c1.c99" ) -2074 self.assertEqual(None, path(root, None)) -2075 path = objectify.ObjectPath( "root.c99.c2" ) -2076 self.assertEqual(None, path(root, None)) -2077 path = objectify.ObjectPath( "notroot.c99.c2" ) -2078 self.assertEqual(None, path(root, None)) -
2079 -
2081 root = self.XML(xml_str) -2082 path = objectify.ObjectPath( ".c1.c99" ) -2083 self.assertEqual(None, path(root, None)) -2084 path = objectify.ObjectPath( ".c99.c2" ) -2085 self.assertEqual(None, path(root, None)) -
2086 -
2087 - def test_object_path_syntax(self): -
2088 root = self.XML(xml_str) -2089 path = objectify.ObjectPath("root . {objectified}c1. c2") -2090 self.assertEqual(root.c1.c2.text, path(root).text) -2091 -2092 path = objectify.ObjectPath(" root.{objectified} c1.c2 [ 0 ] ") -2093 self.assertEqual(root.c1.c2.text, path(root).text) -
2094 -
2096 self.assertRaises(ValueError, objectify.ObjectPath, "") -
2097 -
2099 self.assertRaises(ValueError, objectify.ObjectPath, []) -
2100 -
2101 - def test_object_path_hasattr(self): -
2102 root = self.XML(xml_str) -2103 path = objectify.ObjectPath( "root" ) -2104 self.assertTrue(path.hasattr(root)) -2105 path = objectify.ObjectPath( "root.c1" ) -2106 self.assertTrue(path.hasattr(root)) -2107 path = objectify.ObjectPath( "root.c1.c2" ) -2108 self.assertTrue(path.hasattr(root)) -2109 path = objectify.ObjectPath( "root.c1.{otherNS}c2" ) -2110 self.assertTrue(path.hasattr(root)) -2111 path = objectify.ObjectPath( "root.c1.c2[1]" ) -2112 self.assertTrue(path.hasattr(root)) -2113 path = objectify.ObjectPath( "root.c1.c2[2]" ) -2114 self.assertTrue(path.hasattr(root)) -2115 path = objectify.ObjectPath( "root.c1.c2[3]" ) -2116 self.assertFalse(path.hasattr(root)) -2117 path = objectify.ObjectPath( "root.c1[1].c2" ) -2118 self.assertFalse(path.hasattr(root)) -
2119 -
2120 - def test_object_path_dot(self): -
2121 root = self.XML(xml_str) -2122 path = objectify.ObjectPath( "." ) -2123 self.assertEqual(root.c1.c2.text, path(root).c1.c2.text) -
2124 -
2125 - def test_object_path_dot_list(self): -
2126 root = self.XML(xml_str) -2127 path = objectify.ObjectPath( [''] ) -2128 self.assertEqual(root.c1.c2.text, path(root).c1.c2.text) -
2129 -
2130 - def test_object_path_dot_root(self): -
2131 root = self.XML(xml_str) -2132 path = objectify.ObjectPath( ".c1.c2" ) -2133 self.assertEqual(root.c1.c2.text, path(root).text) -
2134 -
2136 root = self.XML(xml_str) -2137 path = objectify.ObjectPath( ['', 'c1', 'c2'] ) -2138 self.assertEqual(root.c1.c2.text, path(root).text) -
2139 -
2140 - def test_object_path_index(self): -
2141 root = self.XML(xml_str) -2142 path = objectify.ObjectPath( "root.c1[0].c2[0]" ) -2143 self.assertEqual(root.c1.c2.text, path(root).text) -2144 -2145 path = objectify.ObjectPath( "root.c1[0].c2" ) -2146 self.assertEqual(root.c1.c2.text, path(root).text) -2147 -2148 path = objectify.ObjectPath( "root.c1[0].c2[1]" ) -2149 self.assertEqual(root.c1.c2[1].text, path(root).text) -2150 -2151 path = objectify.ObjectPath( "root.c1.c2[2]" ) -2152 self.assertEqual(root.c1.c2[2].text, path(root).text) -2153 -2154 path = objectify.ObjectPath( "root.c1.c2[-1]" ) -2155 self.assertEqual(root.c1.c2[-1].text, path(root).text) -2156 -2157 path = objectify.ObjectPath( "root.c1.c2[-3]" ) -2158 self.assertEqual(root.c1.c2[-3].text, path(root).text) -
2159 -
2160 - def test_object_path_index_list(self): -
2161 root = self.XML(xml_str) -2162 path = objectify.ObjectPath( ['root', 'c1[0]', 'c2[0]'] ) -2163 self.assertEqual(root.c1.c2.text, path(root).text) -2164 -2165 path = objectify.ObjectPath( ['root', 'c1[0]', 'c2[2]'] ) -2166 self.assertEqual(root.c1.c2[2].text, path(root).text) -2167 -2168 path = objectify.ObjectPath( ['root', 'c1', 'c2[2]'] ) -2169 self.assertEqual(root.c1.c2[2].text, path(root).text) -2170 -2171 path = objectify.ObjectPath( ['root', 'c1', 'c2[-1]'] ) -2172 self.assertEqual(root.c1.c2[-1].text, path(root).text) -2173 -2174 path = objectify.ObjectPath( ['root', 'c1', 'c2[-3]'] ) -2175 self.assertEqual(root.c1.c2[-3].text, path(root).text) -
2176 -
2178 self.assertRaises(ValueError, objectify.ObjectPath, -2179 "root.c1[0].c2[-1-2]") -2180 self.assertRaises(ValueError, objectify.ObjectPath, -2181 ['root', 'c1[0]', 'c2[-1-2]']) -2182 -2183 self.assertRaises(ValueError, objectify.ObjectPath, -2184 "root[2].c1.c2") -2185 self.assertRaises(ValueError, objectify.ObjectPath, -2186 ['root[2]', 'c1', 'c2']) -2187 -2188 self.assertRaises(ValueError, objectify.ObjectPath, -2189 []) -2190 self.assertRaises(ValueError, objectify.ObjectPath, -2191 ['', '', '']) -
2192 -
2194 root = self.XML(xml_str) -2195 path = objectify.ObjectPath("root.c1[9999].c2") -2196 self.assertRaises(AttributeError, path, root) -2197 -2198 path = objectify.ObjectPath("root.c1[0].c2[9999]") -2199 self.assertRaises(AttributeError, path, root) -2200 -2201 path = objectify.ObjectPath(".c1[9999].c2[0]") -2202 self.assertRaises(AttributeError, path, root) -2203 -2204 path = objectify.ObjectPath("root.c1[-2].c2") -2205 self.assertRaises(AttributeError, path, root) -2206 -2207 path = objectify.ObjectPath("root.c1[0].c2[-4]") -2208 self.assertRaises(AttributeError, path, root) -
2209 -
2210 - def test_object_path_ns(self): -
2211 root = self.XML(xml_str) -2212 path = objectify.ObjectPath( "{objectified}root.c1.c2" ) -2213 self.assertEqual(root.c1.c2.text, path.find(root).text) -2214 path = objectify.ObjectPath( "{objectified}root.{objectified}c1.c2" ) -2215 self.assertEqual(root.c1.c2.text, path.find(root).text) -2216 path = objectify.ObjectPath( "root.{objectified}c1.{objectified}c2" ) -2217 self.assertEqual(root.c1.c2.text, path.find(root).text) -2218 path = objectify.ObjectPath( "root.c1.{objectified}c2" ) -2219 self.assertEqual(root.c1.c2.text, path.find(root).text) -2220 path = objectify.ObjectPath( "root.c1.{otherNS}c2" ) -2221 self.assertEqual(getattr(root.c1, '{otherNS}c2').text, -2222 path.find(root).text) -
2223 -
2224 - def test_object_path_ns_list(self): -
2225 root = self.XML(xml_str) -2226 path = objectify.ObjectPath( ['{objectified}root', 'c1', 'c2'] ) -2227 self.assertEqual(root.c1.c2.text, path.find(root).text) -2228 path = objectify.ObjectPath( ['{objectified}root', '{objectified}c1', 'c2'] ) -2229 self.assertEqual(root.c1.c2.text, path.find(root).text) -2230 path = objectify.ObjectPath( ['root', '{objectified}c1', '{objectified}c2'] ) -2231 self.assertEqual(root.c1.c2.text, path.find(root).text) -2232 path = objectify.ObjectPath( ['root', '{objectified}c1', '{objectified}c2[2]'] ) -2233 self.assertEqual(root.c1.c2[2].text, path.find(root).text) -2234 path = objectify.ObjectPath( ['root', 'c1', '{objectified}c2'] ) -2235 self.assertEqual(root.c1.c2.text, path.find(root).text) -2236 path = objectify.ObjectPath( ['root', 'c1', '{objectified}c2[2]'] ) -2237 self.assertEqual(root.c1.c2[2].text, path.find(root).text) -2238 path = objectify.ObjectPath( ['root', 'c1', '{otherNS}c2'] ) -2239 self.assertEqual(getattr(root.c1, '{otherNS}c2').text, -2240 path.find(root).text) -
2241 -
2242 - def test_object_path_set(self): -
2243 root = self.XML(xml_str) -2244 path = objectify.ObjectPath( "root.c1.c2" ) -2245 self.assertEqual(root.c1.c2.text, path.find(root).text) -2246 self.assertEqual("1", root.c1.c2[1].text) -2247 -2248 new_value = "my new value" -2249 path.setattr(root, new_value) -2250 -2251 self.assertEqual(new_value, root.c1.c2.text) -2252 self.assertEqual(new_value, path(root).text) -2253 self.assertEqual("1", root.c1.c2[1].text) -
2254 -
2256 root = self.XML(xml_str) -2257 path = objectify.ObjectPath( "root.c1.c2" ) -2258 self.assertEqual(root.c1.c2.text, path.find(root).text) -2259 self.assertEqual("1", root.c1.c2[1].text) -2260 -2261 new_el = self.Element("{objectified}test") -2262 etree.SubElement(new_el, "{objectified}sub", myattr="ATTR").a = "TEST" -2263 path.setattr(root, new_el.sub) -2264 -2265 self.assertEqual("ATTR", root.c1.c2.get("myattr")) -2266 self.assertEqual("TEST", root.c1.c2.a.text) -2267 self.assertEqual("TEST", path(root).a.text) -2268 self.assertEqual("1", root.c1.c2[1].text) -
2269 -
2270 - def test_object_path_set_create(self): -
2271 root = self.XML(xml_str) -2272 path = objectify.ObjectPath( "root.c1.c99" ) -2273 self.assertRaises(AttributeError, path.find, root) -2274 -2275 new_value = "my new value" -2276 path.setattr(root, new_value) -2277 -2278 self.assertEqual(1, len(root.c1.c99)) -2279 self.assertEqual(new_value, root.c1.c99.text) -2280 self.assertEqual(new_value, path(root).text) -
2281 -
2283 root = self.XML(xml_str) -2284 path = objectify.ObjectPath( "root.c1.c99" ) -2285 self.assertRaises(AttributeError, path.find, root) -2286 -2287 new_el = self.Element("{objectified}test") -2288 etree.SubElement(new_el, "{objectified}sub", myattr="ATTR").a = "TEST" -2289 path.setattr(root, new_el.sub) -2290 -2291 self.assertEqual(1, len(root.c1.c99)) -2292 self.assertEqual("ATTR", root.c1.c99.get("myattr")) -2293 self.assertEqual("TEST", root.c1.c99.a.text) -2294 self.assertEqual("TEST", path(root).a.text) -
2295 -
2297 root = self.XML(xml_str) -2298 path = objectify.ObjectPath( "root.c1.c99" ) -2299 self.assertRaises(AttributeError, path.find, root) -2300 -2301 new_el = self.Element("{objectified}test") -2302 new_el.a = ["TEST1", "TEST2"] -2303 new_el.a[0].set("myattr", "ATTR1") -2304 new_el.a[1].set("myattr", "ATTR2") -2305 -2306 path.setattr(root, list(new_el.a)) -2307 -2308 self.assertEqual(2, len(root.c1.c99)) -2309 self.assertEqual("ATTR1", root.c1.c99[0].get("myattr")) -2310 self.assertEqual("TEST1", root.c1.c99[0].text) -2311 self.assertEqual("ATTR2", root.c1.c99[1].get("myattr")) -2312 self.assertEqual("TEST2", root.c1.c99[1].text) -2313 self.assertEqual("TEST1", path(root).text) -
2314 -
2315 - def test_object_path_addattr(self): -
2316 root = self.XML(xml_str) -2317 path = objectify.ObjectPath( "root.c1.c2" ) -2318 self.assertEqual(3, len(root.c1.c2)) -2319 path.addattr(root, "test") -2320 self.assertEqual(4, len(root.c1.c2)) -2321 self.assertEqual(["0", "1", "2", "test"], -2322 [el.text for el in root.c1.c2]) -
2323 -
2325 root = self.XML(xml_str) -2326 path = objectify.ObjectPath( "root.c1.c2" ) -2327 self.assertEqual(3, len(root.c1.c2)) -2328 -2329 new_el = self.Element("{objectified}test") -2330 etree.SubElement(new_el, "{objectified}sub").a = "TEST" -2331 -2332 path.addattr(root, new_el.sub) -2333 self.assertEqual(4, len(root.c1.c2)) -2334 self.assertEqual("TEST", root.c1.c2[3].a.text) -2335 self.assertEqual(["0", "1", "2"], -2336 [el.text for el in root.c1.c2[:3]]) -
2337 -
2339 root = self.XML(xml_str) -2340 path = objectify.ObjectPath( "root.c1.c99" ) -2341 self.assertRaises(AttributeError, path.find, root) -2342 -2343 new_value = "my new value" -2344 path.addattr(root, new_value) -2345 -2346 self.assertEqual(1, len(root.c1.c99)) -2347 self.assertEqual(new_value, root.c1.c99.text) -2348 self.assertEqual(new_value, path(root).text) -
2349 -
2351 root = self.XML(xml_str) -2352 path = objectify.ObjectPath( "root.c1.c99" ) -2353 self.assertRaises(AttributeError, path.find, root) -2354 -2355 new_el = self.Element("{objectified}test") -2356 etree.SubElement(new_el, "{objectified}sub", myattr="ATTR").a = "TEST" -2357 -2358 path.addattr(root, new_el.sub) -2359 self.assertEqual(1, len(root.c1.c99)) -2360 self.assertEqual("TEST", root.c1.c99.a.text) -2361 self.assertEqual("TEST", path(root).a.text) -2362 self.assertEqual("ATTR", root.c1.c99.get("myattr")) -
2363 -
2365 root = self.XML(xml_str) -2366 path = objectify.ObjectPath( "root.c1.c99" ) -2367 self.assertRaises(AttributeError, path.find, root) -2368 -2369 new_el = self.Element("{objectified}test") -2370 new_el.a = ["TEST1", "TEST2"] -2371 -2372 self.assertEqual(2, len(new_el.a)) -2373 -2374 path.addattr(root, list(new_el.a)) -2375 self.assertEqual(2, len(root.c1.c99)) -2376 self.assertEqual("TEST1", root.c1.c99.text) -2377 self.assertEqual("TEST2", path(root)[1].text) -
2378 -
2379 - def test_descendant_paths(self): -
2380 root = self.XML(xml_str) -2381 self.assertEqual( -2382 ['{objectified}root', '{objectified}root.c1', -2383 '{objectified}root.c1.c2', -2384 '{objectified}root.c1.c2[1]', '{objectified}root.c1.c2[2]', -2385 '{objectified}root.c1.{otherNS}c2', '{objectified}root.c1.{}c2'], -2386 root.descendantpaths()) -
2387 -
2388 - def test_descendant_paths_child(self): -
2389 root = self.XML(xml_str) -2390 self.assertEqual( -2391 ['{objectified}c1', '{objectified}c1.c2', -2392 '{objectified}c1.c2[1]', '{objectified}c1.c2[2]', -2393 '{objectified}c1.{otherNS}c2', '{objectified}c1.{}c2'], -2394 root.c1.descendantpaths()) -
2395 -
2397 root = self.XML(xml_str) -2398 self.assertEqual( -2399 ['root.{objectified}c1', 'root.{objectified}c1.c2', -2400 'root.{objectified}c1.c2[1]', 'root.{objectified}c1.c2[2]', -2401 'root.{objectified}c1.{otherNS}c2', -2402 'root.{objectified}c1.{}c2'], -2403 root.c1.descendantpaths('root')) -
2404 -
2405 - def test_pickle(self): -
2406 import pickle -2407 -2408 root = self.XML(xml_str) -2409 out = BytesIO() -2410 pickle.dump(root, out) -2411 -2412 new_root = pickle.loads(out.getvalue()) -2413 self.assertEqual( -2414 etree.tostring(new_root), -2415 etree.tostring(root)) -
2416 -
2417 - def test_pickle_elementtree(self): -
2418 import pickle -2419 -2420 tree = etree.ElementTree(self.XML(xml_str + "<?my pi?>")) -2421 out = BytesIO() -2422 pickle.dump(tree, out) -2423 -2424 new_tree = pickle.loads(out.getvalue()) -2425 self.assertTrue(isinstance(new_tree, etree._ElementTree)) -2426 self.assertEqual( -2427 etree.tostring(new_tree), -2428 etree.tostring(tree)) -
2429 -
2430 - def test_pickle_intelement(self): -
2431 self._test_pickle('<x>42</x>') -2432 self._test_pickle(objectify.DataElement(42)) -
2433 -
2434 - def test_pickle_floattelement(self): -
2435 self._test_pickle('<x>42.0</x>') -2436 self._test_pickle(objectify.DataElement(42.0)) -
2437 -
2438 - def test_pickle_strelement(self): -
2439 self._test_pickle('<x>Pickle me!</x>') -2440 self._test_pickle(objectify.DataElement('Pickle me!')) -
2441 -
2442 - def test_pickle_boolelement(self): -
2443 self._test_pickle('<x>true</x>') -2444 self._test_pickle('<x>false</x>') -2445 self._test_pickle(objectify.DataElement(True)) -2446 self._test_pickle(objectify.DataElement(False)) -
2447 -
2448 - def test_pickle_noneelement(self): -
2449 self._test_pickle(''' -2450 <x xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>''') -2451 self._test_pickle(objectify.DataElement(None)) -
2452 -
2453 - def _test_pickle(self, stringOrElt): -
2454 import pickle -2455 if isinstance(stringOrElt, (etree._Element, etree._ElementTree)): -2456 elt = stringOrElt -2457 else: -2458 elt = self.XML(stringOrElt) -2459 out = BytesIO() -2460 pickle.dump(elt, out) -2461 -2462 new_elt = pickle.loads(out.getvalue()) -2463 self.assertEqual( -2464 etree.tostring(new_elt), -2465 etree.tostring(elt)) -
2466 -2467 # E-Factory tests, need to use sub-elements as root element is always -2468 # type-looked-up as ObjectifiedElement (no annotations) -
2469 - def test_efactory_int(self): -
2470 E = objectify.E -2471 root = E.root(E.val(23)) -2472 self.assertTrue(isinstance(root.val, objectify.IntElement)) -
2473 -
2474 - def test_efactory_float(self): -
2475 E = objectify.E -2476 root = E.root(E.val(233.23)) -2477 self.assertTrue(isinstance(root.val, objectify.FloatElement)) -
2478 -
2479 - def test_efactory_str(self): -
2480 E = objectify.E -2481 root = E.root(E.val("what?")) -2482 self.assertTrue(isinstance(root.val, objectify.StringElement)) -
2483 -
2484 - def test_efactory_unicode(self): -
2485 E = objectify.E -2486 root = E.root(E.val(_str("blöödy häll", encoding="ISO-8859-1"))) -2487 self.assertTrue(isinstance(root.val, objectify.StringElement)) -
2488 -
2489 - def test_efactory_bool(self): -
2490 E = objectify.E -2491 root = E.root(E.val(True)) -2492 self.assertTrue(isinstance(root.val, objectify.BoolElement)) -
2493 -
2494 - def test_efactory_none(self): -
2495 E = objectify.E -2496 root = E.root(E.val(None)) -2497 self.assertTrue(isinstance(root.val, objectify.NoneElement)) -
2498 -
2500 E = objectify.E -2501 root = E.root(E.val(1, "foo", 2.0, "bar ", True, None)) -2502 self.assertTrue(isinstance(root.val, objectify.StringElement)) -
2503 -
2504 - def test_efactory_attrib(self): -
2505 E = objectify.E -2506 root = E.root(foo="bar") -2507 self.assertEqual(root.get("foo"), "bar") -
2508 -
2509 - def test_efactory_nested(self): -
2510 E = objectify.E -2511 DataElement = objectify.DataElement -2512 root = E.root("text", E.sub(E.subsub()), "tail", DataElement(1), -2513 DataElement(2.0)) -2514 self.assertTrue(isinstance(root, objectify.ObjectifiedElement)) -2515 self.assertEqual(root.text, "text") -2516 self.assertTrue(isinstance(root.sub, objectify.ObjectifiedElement)) -2517 self.assertEqual(root.sub.tail, "tail") -2518 self.assertTrue(isinstance(root.sub.subsub, objectify.StringElement)) -2519 self.assertEqual(len(root.value), 2) -2520 self.assertTrue(isinstance(root.value[0], objectify.IntElement)) -2521 self.assertTrue(isinstance(root.value[1], objectify.FloatElement)) -
2522 -
2523 - def test_efactory_subtype(self): -
2524 class Attribute(objectify.ObjectifiedDataElement): -2525 def __init__(self): -2526 objectify.ObjectifiedDataElement.__init__(self) -2527 self.set("datatype", "TYPE") -2528 self.set("range", "0.,1.") -
2529 -2530 attr = Attribute() -2531 self.assertEqual(attr.text, None) -2532 self.assertEqual(attr.get("datatype"), "TYPE") -2533 self.assertEqual(attr.get("range"), "0.,1.") -2534 -
2535 - def test_XML_base_url_docinfo(self): -
2536 root = objectify.XML(_bytes("<root/>"), base_url="http://no/such/url") -2537 docinfo = root.getroottree().docinfo -2538 self.assertEqual(docinfo.URL, "http://no/such/url") -
2539 -
2541 root = objectify.XML(_bytes("<root/>"), base_url="http://no/such/url") -2542 docinfo = root.getroottree().docinfo -2543 self.assertEqual(docinfo.URL, "http://no/such/url") -2544 docinfo.URL = "https://secret/url" -2545 self.assertEqual(docinfo.URL, "https://secret/url") -
2546 -
2548 tree = objectify.parse(BytesIO("<root/>"), base_url="http://no/such/url") -2549 docinfo = tree.docinfo -2550 self.assertEqual(docinfo.URL, "http://no/such/url") -
2551 -
2552 - def test_parse_base_url_docinfo(self): -
2553 tree = objectify.parse(fileInTestDir('include/test_xinclude.xml'), -2554 base_url="http://no/such/url") -2555 docinfo = tree.docinfo -2556 self.assertEqual(docinfo.URL, "http://no/such/url") -
2557 -
2558 - def test_xml_base(self): -
2559 root = objectify.XML(_bytes("<root/>"), base_url="http://no/such/url") -2560 self.assertEqual(root.base, "http://no/such/url") -2561 self.assertEqual( -2562 root.get('{http://www.w3.org/XML/1998/namespace}base'), None) -2563 root.base = "https://secret/url" -2564 self.assertEqual(root.base, "https://secret/url") -2565 self.assertEqual( -2566 root.get('{http://www.w3.org/XML/1998/namespace}base'), -2567 "https://secret/url") -
2568 -
2569 - def test_xml_base_attribute(self): -
2570 root = objectify.XML(_bytes("<root/>"), base_url="http://no/such/url") -2571 self.assertEqual(root.base, "http://no/such/url") -2572 self.assertEqual( -2573 root.get('{http://www.w3.org/XML/1998/namespace}base'), None) -2574 root.set('{http://www.w3.org/XML/1998/namespace}base', -2575 "https://secret/url") -2576 self.assertEqual(root.base, "https://secret/url") -2577 self.assertEqual( -2578 root.get('{http://www.w3.org/XML/1998/namespace}base'), -2579 "https://secret/url") -
2580 -
2581 - def test_standard_lookup(self): -
2582 XML = self.XML -2583 -2584 xml = _bytes('''\ -2585 <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -2586 <i>5</i> -2587 <i>-5</i> -2588 <l>4294967296</l> -2589 <l>-4294967296</l> -2590 <f>1.1</f> -2591 <b>true</b> -2592 <b>false</b> -2593 <s>Strange things happen, where strings collide</s> -2594 <s>True</s> -2595 <s>False</s> -2596 <s>t</s> -2597 <s>f</s> -2598 <s></s> -2599 <s>None</s> -2600 <n xsi:nil="true" /> -2601 </root> -2602 ''') -2603 root = XML(xml) -2604 -2605 for i in root.i: -2606 self.assertTrue(isinstance(i, objectify.IntElement)) -2607 for l in root.l: -2608 self.assertTrue(isinstance(l, objectify.IntElement)) -2609 for f in root.f: -2610 self.assertTrue(isinstance(f, objectify.FloatElement)) -2611 for b in root.b: -2612 self.assertTrue(isinstance(b, objectify.BoolElement)) -2613 self.assertEqual(True, root.b[0]) -2614 self.assertEqual(False, root.b[1]) -2615 for s in root.s: -2616 self.assertTrue(isinstance(s, objectify.StringElement)) -2617 self.assertTrue(isinstance(root.n, objectify.NoneElement)) -2618 self.assertEqual(None, root.n) -
2619 -
2620 -def test_suite(): -
2621 suite = unittest.TestSuite() -2622 suite.addTests([unittest.makeSuite(ObjectifyTestCase)]) -2623 suite.addTests(doctest.DocTestSuite(objectify)) -2624 if sys.version_info >= (2,4): -2625 suite.addTests( -2626 [make_doctest('../../../doc/objectify.txt')]) -2627 return suite -
2628 -2629 if __name__ == '__main__': -2630 print('to test use test.py %s' % __file__) -2631 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_objectify.ObjectifyTestCase-class.html b/doc/html/api/lxml.tests.test_objectify.ObjectifyTestCase-class.html deleted file mode 100644 index 65c8a9b9..00000000 --- a/doc/html/api/lxml.tests.test_objectify.ObjectifyTestCase-class.html +++ /dev/null @@ -1,3656 +0,0 @@ - - - - - lxml.tests.test_objectify.ObjectifyTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_objectify :: - Class ObjectifyTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ObjectifyTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ObjectifyTestCase
-
- -
-Test cases for lxml.objectify - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
XML(self, - xml) - source code - -
- -
-   - - - - - - -
setUp(self)
- Hook method for setting up the test fixture before exercising it.
- source code - -
- -
-   - - - - - - -
tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
- source code - -
- -
-   - - - - - - -
test_element_nsmap_default(self) - source code - -
- -
-   - - - - - - -
test_element_nsmap_empty(self) - source code - -
- -
-   - - - - - - -
test_element_nsmap_custom_prefixes(self) - source code - -
- -
-   - - - - - - -
test_element_nsmap_custom(self) - source code - -
- -
-   - - - - - - -
test_sub_element_nsmap_default(self) - source code - -
- -
-   - - - - - - -
test_sub_element_nsmap_empty(self) - source code - -
- -
-   - - - - - - -
test_sub_element_nsmap_custom_prefixes(self) - source code - -
- -
-   - - - - - - -
test_sub_element_nsmap_custom(self) - source code - -
- -
-   - - - - - - -
test_data_element_nsmap_default(self) - source code - -
- -
-   - - - - - - -
test_data_element_nsmap_empty(self) - source code - -
- -
-   - - - - - - -
test_data_element_nsmap_custom_prefixes(self) - source code - -
- -
-   - - - - - - -
test_data_element_nsmap_custom(self) - source code - -
- -
-   - - - - - - -
test_sub_data_element_nsmap_default(self) - source code - -
- -
-   - - - - - - -
test_sub_data_element_nsmap_empty(self) - source code - -
- -
-   - - - - - - -
test_sub_data_element_nsmap_custom_prefixes(self) - source code - -
- -
-   - - - - - - -
test_sub_data_element_nsmap_custom(self) - source code - -
- -
-   - - - - - - -
test_date_element_efactory_text(self) - source code - -
- -
-   - - - - - - -
test_date_element_efactory_tail(self) - source code - -
- -
-   - - - - - - -
test_data_element_attrib_attributes_precedence(self) - source code - -
- -
-   - - - - - - -
test_data_element_data_element_arg(self) - source code - -
- -
-   - - - - - - -
test_data_element_data_element_arg_pytype_none(self) - source code - -
- -
-   - - - - - - -
test_data_element_data_element_arg_pytype(self) - source code - -
- -
-   - - - - - - -
test_data_element_data_element_arg_xsitype(self) - source code - -
- -
-   - - - - - - -
test_data_element_data_element_arg_pytype_xsitype(self) - source code - -
- -
-   - - - - - - -
test_data_element_invalid_pytype(self) - source code - -
- -
-   - - - - - - -
test_data_element_invalid_xsi(self) - source code - -
- -
-   - - - - - - -
test_data_element_data_element_arg_invalid_pytype(self) - source code - -
- -
-   - - - - - - -
test_data_element_data_element_arg_invalid_xsi(self) - source code - -
- -
-   - - - - - - -
test_data_element_element_arg(self) - source code - -
- -
-   - - - - - - -
test_root(self) - source code - -
- -
-   - - - - - - -
test_str(self) - source code - -
- -
-   - - - - - - -
test_child(self) - source code - -
- -
-   - - - - - - -
test_child_ns_nons(self) - source code - -
- -
-   - - - - - - -
test_countchildren(self) - source code - -
- -
-   - - - - - - -
test_child_getattr(self) - source code - -
- -
-   - - - - - - -
test_child_nonexistant(self) - source code - -
- -
-   - - - - - - -
test_child_getattr_empty_ns(self) - source code - -
- -
-   - - - - - - -
test_setattr(self) - source code - -
- -
-   - - - - - - -
test_setattr_nonunicode(self) - source code - -
- -
-   - - - - - - -
test_addattr(self) - source code - -
- -
-   - - - - - - -
test_addattr_element(self) - source code - -
- -
-   - - - - - - -
test_addattr_list(self) - source code - -
- -
-   - - - - - - -
test_child_addattr(self) - source code - -
- -
-   - - - - - - -
test_child_index(self) - source code - -
- -
-   - - - - - - -
test_child_index_neg(self) - source code - -
- -
-   - - - - - - -
test_child_len(self) - source code - -
- -
-   - - - - - - -
test_child_iter(self) - source code - -
- -
-   - - - - - - -
test_class_lookup(self) - source code - -
- -
-   - - - - - - -
test_dir(self) - source code - -
- -
-   - - - - - - -
test_vars(self) - source code - -
- -
-   - - - - - - -
test_child_set_ro(self) - source code - -
- -
-   - - - - - - -
test_getslice_complete(self) - source code - -
- -
-   - - - - - - -
test_getslice_partial(self) - source code - -
- -
-   - - - - - - -
test_getslice_partial_neg(self) - source code - -
- -
-   - - - - - - -
test_setslice_complete(self) - source code - -
- -
-   - - - - - - -
test_setslice_elements(self) - source code - -
- -
-   - - - - - - -
test_setslice_partial(self) - source code - -
- -
-   - - - - - - -
test_setslice_insert(self) - source code - -
- -
-   - - - - - - -
test_setslice_insert_neg(self) - source code - -
- -
-   - - - - - - -
test_setslice_empty(self) - source code - -
- -
-   - - - - - - -
test_setslice_partial_wrong_length(self) - source code - -
- -
-   - - - - - - -
test_setslice_partial_neg(self) - source code - -
- -
-   - - - - - - -
test_setslice_partial_allneg(self) - source code - -
- -
-   - - - - - - -
test_set_string(self) - source code - -
- -
-   - - - - - - -
test_setitem_string(self) - source code - -
- -
-   - - - - - - -
test_setitem_string_special(self) - source code - -
- -
-   - - - - - - -
test_findall(self) - source code - -
- -
-   - - - - - - -
test_findall_ns(self) - source code - -
- -
-   - - - - - - -
test_build_tree(self) - source code - -
- -
-   - - - - - - -
test_type_NoneType(self) - source code - -
- -
-   - - - - - - -
test_data_element_NoneType(self) - source code - -
- -
-   - - - - - - -
test_type_bool(self) - source code - -
- -
-   - - - - - - -
test_data_element_bool(self) - source code - -
- -
-   - - - - - - -
test_type_str(self) - source code - -
- -
-   - - - - - - -
test_type_str_intliteral(self) - source code - -
- -
-   - - - - - - -
test_type_str_floatliteral(self) - source code - -
- -
-   - - - - - - -
test_type_str_mul(self) - source code - -
- -
-   - - - - - - -
test_type_str_add(self) - source code - -
- -
-   - - - - - - -
test_type_str_mod(self) - source code - -
- -
-   - - - - - - -
test_type_str_hash(self) - source code - -
- -
-   - - - - - - -
test_type_str_as_int(self) - source code - -
- -
-   - - - - - - -
test_type_str_as_float(self) - source code - -
- -
-   - - - - - - -
test_type_str_as_complex(self) - source code - -
- -
-   - - - - - - -
test_type_str_mod_data_elements(self) - source code - -
- -
-   - - - - - - -
test_data_element_str(self) - source code - -
- -
-   - - - - - - -
test_data_element_str_intliteral(self) - source code - -
- -
-   - - - - - - -
test_data_element_str_floatliteral(self) - source code - -
- -
-   - - - - - - -
test_type_ustr(self) - source code - -
- -
-   - - - - - - -
test_type_ustr_intliteral(self) - source code - -
- -
-   - - - - - - -
test_type_ustr_floatliteral(self) - source code - -
- -
-   - - - - - - -
test_type_ustr_mul(self) - source code - -
- -
-   - - - - - - -
test_type_ustr_add(self) - source code - -
- -
-   - - - - - - -
test_data_element_ustr(self) - source code - -
- -
-   - - - - - - -
test_data_element_ustr_intliteral(self) - source code - -
- -
-   - - - - - - -
test_data_element_ustr_floatliteral(self) - source code - -
- -
-   - - - - - - -
test_type_int(self) - source code - -
- -
-   - - - - - - -
test_data_element_int(self) - source code - -
- -
-   - - - - - - -
test_data_element_int_hash(self) - source code - -
- -
-   - - - - - - -
test_type_float(self) - source code - -
- -
-   - - - - - - -
test_data_element_float(self) - source code - -
- -
-   - - - - - - -
test_data_element_float_hash(self) - source code - -
- -
-   - - - - - - -
test_type_float_precision(self) - source code - -
- -
-   - - - - - - -
test_type_float_instantiation_precision(self) - source code - -
- -
-   - - - - - - -
test_type_float_precision_consistency(self) - source code - -
- -
-   - - - - - - -
test_data_element_float_precision(self) - source code - -
- -
-   - - - - - - -
test_data_element_float_hash_repr(self) - source code - -
- -
-   - - - - - - -
test_data_element_xsitypes(self) - source code - -
- -
-   - - - - - - -
test_data_element_xsitypes_xsdprefixed(self) - source code - -
- -
-   - - - - - - -
test_data_element_xsitypes_prefixed(self) - source code - -
- -
-   - - - - - - -
test_data_element_pytypes(self) - source code - -
- -
-   - - - - - - -
test_data_element_pytype_none(self) - source code - -
- -
-   - - - - - - -
test_data_element_pytype_none_compat(self) - source code - -
- -
-   - - - - - - -
test_type_unregistered(self) - source code - -
- -
-   - - - - - - -
test_data_element_unregistered(self) - source code - -
- -
-   - - - - - - -
test_schema_types(self) - source code - -
- -
-   - - - - - - -
test_schema_types_prefixed(self) - source code - -
- -
-   - - - - - - -
test_type_str_sequence(self) - source code - -
- -
-   - - - - - - -
test_type_str_cmp(self) - source code - -
- -
-   - - - - - - -
test_type_int_cmp(self) - source code - -
- -
-   - - - - - - -
test_type_bool_cmp(self) - source code - -
- -
-   - - - - - - -
test_type_none_cmp(self) - source code - -
- -
-   - - - - - - -
test_dataelement_xsi(self) - source code - -
- -
-   - - - - - - -
test_dataelement_xsi_nsmap(self) - source code - -
- -
-   - - - - - - -
test_dataelement_xsi_prefix_error(self) - source code - -
- -
-   - - - - - - -
test_pytype_annotation(self) - source code - -
- -
-   - - - - - - -
test_pytype_annotation_empty(self) - source code - -
- -
-   - - - - - - -
test_pytype_annotation_use_old(self) - source code - -
- -
-   - - - - - - -
test_pytype_xsitype_annotation(self) - source code - -
- -
-   - - - - - - -
test_xsiannotate_use_old(self) - source code - -
- -
-   - - - - - - -
test_pyannotate_ignore_old(self) - source code - -
- -
-   - - - - - - -
test_pyannotate_empty(self) - source code - -
- -
-   - - - - - - -
test_pyannotate_use_old(self) - source code - -
- -
-   - - - - - - -
test_xsiannotate_ignore_old(self) - source code - -
- -
-   - - - - - - -
test_deannotate(self) - source code - -
- -
-   - - - - - - -
test_xsinil_deannotate(self) - source code - -
- -
-   - - - - - - -
test_xsitype_deannotate(self) - source code - -
- -
-   - - - - - - -
test_pytype_deannotate(self) - source code - -
- -
-   - - - - - - -
test_change_pytype_attribute(self) - source code - -
- -
-   - - - - - - -
test_registered_types(self) - source code - -
- -
-   - - - - - - -
test_registered_type_stringify(self) - source code - -
- -
-   - - - - - - -
test_object_path(self) - source code - -
- -
-   - - - - - - -
test_object_path_list(self) - source code - -
- -
-   - - - - - - -
test_object_path_fail(self) - source code - -
- -
-   - - - - - - -
test_object_path_default_absolute(self) - source code - -
- -
-   - - - - - - -
test_object_path_default_relative(self) - source code - -
- -
-   - - - - - - -
test_object_path_syntax(self) - source code - -
- -
-   - - - - - - -
test_object_path_fail_parse_empty(self) - source code - -
- -
-   - - - - - - -
test_object_path_fail_parse_empty_list(self) - source code - -
- -
-   - - - - - - -
test_object_path_hasattr(self) - source code - -
- -
-   - - - - - - -
test_object_path_dot(self) - source code - -
- -
-   - - - - - - -
test_object_path_dot_list(self) - source code - -
- -
-   - - - - - - -
test_object_path_dot_root(self) - source code - -
- -
-   - - - - - - -
test_object_path_dot_root_list(self) - source code - -
- -
-   - - - - - - -
test_object_path_index(self) - source code - -
- -
-   - - - - - - -
test_object_path_index_list(self) - source code - -
- -
-   - - - - - - -
test_object_path_index_fail_parse(self) - source code - -
- -
-   - - - - - - -
test_object_path_index_fail_lookup(self) - source code - -
- -
-   - - - - - - -
test_object_path_ns(self) - source code - -
- -
-   - - - - - - -
test_object_path_ns_list(self) - source code - -
- -
-   - - - - - - -
test_object_path_set(self) - source code - -
- -
-   - - - - - - -
test_object_path_set_element(self) - source code - -
- -
-   - - - - - - -
test_object_path_set_create(self) - source code - -
- -
-   - - - - - - -
test_object_path_set_create_element(self) - source code - -
- -
-   - - - - - - -
test_object_path_set_create_list(self) - source code - -
- -
-   - - - - - - -
test_object_path_addattr(self) - source code - -
- -
-   - - - - - - -
test_object_path_addattr_element(self) - source code - -
- -
-   - - - - - - -
test_object_path_addattr_create(self) - source code - -
- -
-   - - - - - - -
test_object_path_addattr_create_element(self) - source code - -
- -
-   - - - - - - -
test_object_path_addattr_create_list(self) - source code - -
- -
-   - - - - - - -
test_descendant_paths(self) - source code - -
- -
-   - - - - - - -
test_descendant_paths_child(self) - source code - -
- -
-   - - - - - - -
test_descendant_paths_prefix(self) - source code - -
- -
-   - - - - - - -
test_pickle(self) - source code - -
- -
-   - - - - - - -
test_pickle_elementtree(self) - source code - -
- -
-   - - - - - - -
test_pickle_intelement(self) - source code - -
- -
-   - - - - - - -
test_pickle_floattelement(self) - source code - -
- -
-   - - - - - - -
test_pickle_strelement(self) - source code - -
- -
-   - - - - - - -
test_pickle_boolelement(self) - source code - -
- -
-   - - - - - - -
test_pickle_noneelement(self) - source code - -
- -
-   - - - - - - -
_test_pickle(self, - stringOrElt) - source code - -
- -
-   - - - - - - -
test_efactory_int(self) - source code - -
- -
-   - - - - - - -
test_efactory_float(self) - source code - -
- -
-   - - - - - - -
test_efactory_str(self) - source code - -
- -
-   - - - - - - -
test_efactory_unicode(self) - source code - -
- -
-   - - - - - - -
test_efactory_bool(self) - source code - -
- -
-   - - - - - - -
test_efactory_none(self) - source code - -
- -
-   - - - - - - -
test_efactory_value_concatenation(self) - source code - -
- -
-   - - - - - - -
test_efactory_attrib(self) - source code - -
- -
-   - - - - - - -
test_efactory_nested(self) - source code - -
- -
-   - - - - - - -
test_efactory_subtype(self) - source code - -
- -
-   - - - - - - -
test_XML_base_url_docinfo(self) - source code - -
- -
-   - - - - - - -
test_XML_set_base_url_docinfo(self) - source code - -
- -
-   - - - - - - -
test_parse_stringio_base_url(self) - source code - -
- -
-   - - - - - - -
test_parse_base_url_docinfo(self) - source code - -
- -
-   - - - - - - -
test_xml_base(self) - source code - -
- -
-   - - - - - - -
test_xml_base_attribute(self) - source code - -
- -
-   - - - - - - -
test_standard_lookup(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

setUp(self) -

-
source code  -
- - Hook method for setting up the test fixture before exercising it. -
-
Overrides: - unittest.case.TestCase.setUp -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

tearDown(self) -

-
source code  -
- - Hook method for deconstructing the test fixture after testing it. -
-
Overrides: - unittest.case.TestCase.tearDown -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_pyclasslookup-module.html b/doc/html/api/lxml.tests.test_pyclasslookup-module.html deleted file mode 100644 index 66312cd0..00000000 --- a/doc/html/api/lxml.tests.test_pyclasslookup-module.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - lxml.tests.test_pyclasslookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_pyclasslookup - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_pyclasslookup

source code

-Tests specific to the Python based class lookup. - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - PyClassLookupTestCase
- Test cases for the lxml.pyclasslookup class lookup mechanism. -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - xml_str = '<obj:root xmlns:obj="objectified" xmlns:other="othe... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
- -
- -
-

xml_str

- -
-
-
-
Value:
-
-'''<obj:root xmlns:obj="objectified" xmlns:other="otherNS">
-  <obj:c1 a1="A1" a2="A2" other:a3="A3">
-    <obj:c2>0</obj:c2>
-    <obj:c2>1</obj:c2>
-    <obj:c2>2</obj:c2>
-    <other:c2>3</other:c2>
-    <c2>3</c2>
-  </obj:c1>
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_pyclasslookup-pysrc.html b/doc/html/api/lxml.tests.test_pyclasslookup-pysrc.html deleted file mode 100644 index 2673e640..00000000 --- a/doc/html/api/lxml.tests.test_pyclasslookup-pysrc.html +++ /dev/null @@ -1,925 +0,0 @@ - - - - - lxml.tests.test_pyclasslookup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_pyclasslookup - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_pyclasslookup

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Tests specific to the Python based class lookup. 
-  5  """ 
-  6   
-  7   
-  8  import unittest, operator, os.path, sys 
-  9   
- 10  this_dir = os.path.dirname(__file__) 
- 11  if this_dir not in sys.path: 
- 12      sys.path.insert(0, this_dir) # needed for Py3 
- 13   
- 14  from common_imports import etree, StringIO, HelperTestCase, fileInTestDir 
- 15  from common_imports import SillyFileLike, canonicalize, doctest, _bytes 
- 16   
- 17  from lxml.etree import PythonElementClassLookup 
- 18   
- 19  xml_str = _bytes('''\ 
- 20  <obj:root xmlns:obj="objectified" xmlns:other="otherNS"> 
- 21    <obj:c1 a1="A1" a2="A2" other:a3="A3"> 
- 22      <obj:c2>0</obj:c2> 
- 23      <obj:c2>1</obj:c2> 
- 24      <obj:c2>2</obj:c2> 
- 25      <other:c2>3</other:c2> 
- 26      <c2>3</c2> 
- 27    </obj:c1> 
- 28  </obj:root>''') 
- 29   
- 30   
-
31 -class PyClassLookupTestCase(HelperTestCase): -
32 """Test cases for the lxml.pyclasslookup class lookup mechanism. - 33 """ - 34 etree = etree - 35 parser = etree.XMLParser() - 36 Element = parser.makeelement - 37 -
38 - def tearDown(self): -
39 self.parser.set_element_class_lookup(None) - 40 super(PyClassLookupTestCase, self).tearDown() -
41 -
42 - def _setClassLookup(self, lookup_function): -
43 class Lookup(PythonElementClassLookup): - 44 def lookup(self, *args): - 45 return lookup_function(*args) -
46 self.parser.set_element_class_lookup( Lookup() ) - 47 -
48 - def _buildElementClass(self): -
49 class LocalElement(etree.ElementBase): - 50 pass -
51 return LocalElement - 52 -
53 - def XML(self, xml): -
54 return self.etree.XML(xml, self.parser) -
55 - 56 # --- Test cases - 57 -
58 - def test_lookup(self): -
59 el_class = self._buildElementClass() - 60 el_class.i = 1 - 61 def lookup(*args): - 62 if el_class.i == 1: - 63 el_class.i = 2 - 64 return el_class -
65 self._setClassLookup(lookup) - 66 root = self.XML(xml_str) - 67 self.assertEqual(2, el_class.i) - 68 -
70 el_class = self._buildElementClass() - 71 el_class.EL = None - 72 def lookup(doc, el): - 73 if el_class.EL is None: - 74 el_class.EL = el - 75 return el_class -
76 self._setClassLookup(lookup) - 77 root = self.XML(xml_str) - 78 self.assertNotEqual(None, el_class.EL) - 79 self.assertRaises(ReferenceError, el_class.EL.getchildren) - 80 -
81 - def test_lookup_tag(self): -
82 el_class = self._buildElementClass() - 83 el_class.TAG = None - 84 def lookup(doc, el): - 85 if el_class.TAG is None: - 86 el_class.TAG = el.tag - 87 return el_class -
88 self._setClassLookup(lookup) - 89 root = self.XML(xml_str) - 90 self.assertNotEqual(None, root.TAG) - 91 self.assertEqual(root.tag, root.TAG) - 92 -
93 - def test_lookup_text(self): -
94 el_class = self._buildElementClass() - 95 el_class.TEXT = None - 96 def lookup(doc, el): - 97 if el_class.TEXT is None: - 98 el_class.TEXT = el.text - 99 return el_class -
100 self._setClassLookup(lookup) -101 root = self.XML(xml_str) -102 self.assertNotEqual(None, root.TEXT) -103 self.assertEqual(root.text, root.TEXT) -104 -
105 - def test_lookup_tail(self): -
106 el_class = self._buildElementClass() -107 el_class.TAIL = None -108 def lookup(doc, el): -109 if el_class.TAIL is None: -110 el_class.TAIL = el.tail -111 return el_class -
112 self._setClassLookup(lookup) -113 root = self.XML(xml_str) -114 self.assertEqual(root.tail, root.TAIL) -115 -
116 - def test_lookup_attrib(self): -
117 el_class = self._buildElementClass() -118 el_class.ATTRIB = None -119 def lookup(doc, el): -120 if el_class.ATTRIB is None: -121 el_class.ATTRIB = el[0].attrib -122 return el_class -
123 self._setClassLookup(lookup) -124 root = self.XML(xml_str) -125 items1 = list(root[0].attrib.items()) -126 items1.sort() -127 items2 = list(root.ATTRIB.items()) -128 items2.sort() -129 self.assertEqual(items1, items2) -130 -
131 - def test_lookup_prefix(self): -
132 el_class = self._buildElementClass() -133 el_class.PREFIX = None -134 def lookup(doc, el): -135 if el_class.PREFIX is None: -136 el_class.PREFIX = el.prefix -137 return el_class -
138 self._setClassLookup(lookup) -139 root = self.XML(xml_str) -140 self.assertEqual(root.prefix, root.PREFIX) -141 -
142 - def test_lookup_sourceline(self): -
143 el_class = self._buildElementClass() -144 el_class.LINE = None -145 def lookup(doc, el): -146 if el_class.LINE is None: -147 el_class.LINE = el.sourceline -148 return el_class -
149 self._setClassLookup(lookup) -150 root = self.XML(xml_str) -151 self.assertEqual(root.sourceline, root.LINE) -152 -
153 - def test_lookup_getitem(self): -
154 el_class = self._buildElementClass() -155 el_class.CHILD_TAG = None -156 def lookup(doc, el): -157 el_class.CHILD_TAG = el[0].tag -158 return el_class -
159 self._setClassLookup(lookup) -160 root = self.XML(xml_str) -161 child_tag = root.CHILD_TAG -162 self.assertNotEqual(None, child_tag) -163 self.assertEqual(root[0].tag, child_tag) -164 -
165 - def test_lookup_getitem_neg(self): -
166 el_class = self._buildElementClass() -167 el_class.CHILD_TAG = None -168 def lookup(doc, el): -169 if el_class.CHILD_TAG is None: -170 el_class.CHILD_TAG = el[-1].tag -171 return el_class -
172 self._setClassLookup(lookup) -173 root = self.XML(xml_str) -174 child_tag = root.CHILD_TAG -175 self.assertNotEqual(None, child_tag) -176 self.assertEqual(root[-1].tag, child_tag) -177 -
178 - def test_lookup_getslice(self): -
179 el_class = self._buildElementClass() -180 el_class.CHILD_TAGS = None -181 def lookup(doc, el): -182 if el_class.CHILD_TAGS is None: -183 el_class.CHILD_TAGS = [ c.tag for c in el[1:-1] ] -184 return el_class -
185 self._setClassLookup(lookup) -186 root = self.XML(xml_str) -187 child_tags = root.CHILD_TAGS -188 self.assertNotEqual(None, child_tags) -189 self.assertEqual([ c.tag for c in root[1:-1] ], -190 child_tags) -191 -
192 - def test_lookup_len(self): -
193 el_class = self._buildElementClass() -194 el_class.LEN = None -195 def lookup(doc, el): -196 if el_class.LEN is None: -197 el_class.LEN = len(el) -198 return el_class -
199 self._setClassLookup(lookup) -200 root = self.XML(xml_str) -201 self.assertEqual(1, el_class.LEN) -202 -
203 - def test_lookup_bool(self): -
204 el_class = self._buildElementClass() -205 el_class.TRUE = None -206 def lookup(doc, el): -207 if el_class.TRUE is None: -208 el_class.TRUE = bool(el) -209 return el_class -
210 self._setClassLookup(lookup) -211 root = self.XML(xml_str) -212 self.assertTrue(el_class.TRUE) -213 -
214 - def test_lookup_get(self): -
215 el_class = self._buildElementClass() -216 el_class.VAL = None -217 def lookup(doc, el): -218 if el_class.VAL is None: -219 el_class.VAL = el[0].get('a1') -220 return el_class -
221 self._setClassLookup(lookup) -222 root = self.XML(xml_str) -223 self.assertNotEqual(None, el_class.VAL) -224 self.assertEqual(root[0].get('a1'), el_class.VAL) -225 -
226 - def test_lookup_get_default(self): -
227 el_class = self._buildElementClass() -228 default = str(id(el_class)) -229 el_class.VAL = None -230 def lookup(doc, el): -231 if el_class.VAL is None: -232 el_class.VAL = el[0].get('unknownattribute', default) -233 return el_class -
234 self._setClassLookup(lookup) -235 root = self.XML(xml_str) -236 self.assertEqual(default, el_class.VAL) -237 -
238 - def test_lookup_getchildren(self): -
239 el_class = self._buildElementClass() -240 el_class.CHILD_TAGS = None -241 def lookup(doc, el): -242 if el_class.CHILD_TAGS is None: -243 el_class.CHILD_TAGS = [ c.tag for c in el.getchildren() ] -244 return el_class -
245 self._setClassLookup(lookup) -246 root = self.XML(xml_str) -247 child_tags = root.CHILD_TAGS -248 self.assertNotEqual(None, child_tags) -249 self.assertEqual([ c.tag for c in root.getchildren() ], -250 child_tags) -251 -
252 - def test_lookup_iter_children(self): -
253 el_class = self._buildElementClass() -254 el_class.CHILD_TAGS = None -255 def lookup(doc, el): -256 if el_class.CHILD_TAGS is None: -257 el_class.CHILD_TAGS = [ c.tag for c in el ] -258 return el_class -
259 self._setClassLookup(lookup) -260 root = self.XML(xml_str) -261 child_tags = root.CHILD_TAGS -262 self.assertNotEqual(None, child_tags) -263 self.assertEqual([ c.tag for c in root.getchildren() ], -264 child_tags) -265 -
266 - def test_lookup_iterchildren(self): -
267 el_class = self._buildElementClass() -268 el_class.CHILD_TAGS = None -269 def lookup(doc, el): -270 if el_class.CHILD_TAGS is None: -271 el_class.CHILD_TAGS = [ c.tag for c in el.iterchildren() ] -272 return el_class -
273 self._setClassLookup(lookup) -274 root = self.XML(xml_str) -275 child_tags = root.CHILD_TAGS -276 self.assertNotEqual(None, child_tags) -277 self.assertEqual([ c.tag for c in root.getchildren() ], -278 child_tags) -279 -
281 el_class = self._buildElementClass() -282 el_class.CHILD_TAGS = None -283 def lookup(doc, el): -284 if not el_class.CHILD_TAGS: -285 el_class.CHILD_TAGS = [ -286 c.tag for c in el.iterchildren(tag='{objectified}c2') ] -287 return el_class -
288 self._setClassLookup(lookup) -289 -290 root = self.XML(xml_str) -291 child_tags = root.CHILD_TAGS -292 self.assertNotEqual(None, child_tags) -293 self.assertEqual([], child_tags) -294 -295 c1 = root[0] -296 child_tags = root.CHILD_TAGS -297 self.assertNotEqual(None, child_tags) -298 self.assertNotEqual([], child_tags) -299 self.assertEqual( -300 [ c.tag for c in root[0].iterchildren(tag='{objectified}c2') ], -301 child_tags) -302 -
303 - def test_lookup_getparent(self): -
304 el_class = self._buildElementClass() -305 el_class.PARENT = None -306 def lookup(doc, el): -307 if el_class.PARENT is None: -308 el_class.PARENT = el[0].getparent().tag -309 return el_class -
310 self._setClassLookup(lookup) -311 root = self.XML(xml_str) -312 self.assertEqual(root.tag, root.PARENT) -313 -
314 - def test_lookup_getnext(self): -
315 el_class = self._buildElementClass() -316 el_class.NEXT = None -317 def lookup(doc, el): -318 if el_class.NEXT is None: -319 el_class.NEXT = el[0][1].getnext().tag -320 return el_class -
321 self._setClassLookup(lookup) -322 root = self.XML(xml_str) -323 self.assertNotEqual(None, el_class.NEXT) -324 self.assertEqual(root[0][1].getnext().tag, el_class.NEXT) -325 -
326 - def test_lookup_getprevious(self): -
327 el_class = self._buildElementClass() -328 el_class.PREV = None -329 def lookup(doc, el): -330 if el_class.PREV is None: -331 el_class.PREV = el[0][1].getprevious().tag -332 return el_class -
333 self._setClassLookup(lookup) -334 root = self.XML(xml_str) -335 self.assertNotEqual(None, el_class.PREV) -336 self.assertEqual(root[0][1].getprevious().tag, el_class.PREV) -337 -
338 - def test_comments_fallback(self): -
339 def return_none(*args): -340 return None -
341 -342 self._setClassLookup(return_none) -343 el = self.XML('<a><!-- hello world --></a>') -344 self.assertEqual(el[0].tag, self.etree.Comment) -345 self.assertEqual(el[0].text, " hello world ") -346 -347 -
348 -def test_suite(): -
349 suite = unittest.TestSuite() -350 suite.addTests([unittest.makeSuite(PyClassLookupTestCase)]) -351 return suite -
352 -353 if __name__ == '__main__': -354 print('to test use test.py %s' % __file__) -355 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html b/doc/html/api/lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html deleted file mode 100644 index 50787b54..00000000 --- a/doc/html/api/lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html +++ /dev/null @@ -1,893 +0,0 @@ - - - - - lxml.tests.test_pyclasslookup.PyClassLookupTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_pyclasslookup :: - Class PyClassLookupTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class PyClassLookupTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               PyClassLookupTestCase
-
- -
-Test cases for the lxml.pyclasslookup class lookup mechanism. - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
Element(self, - _tag, - attrib=None, - nsmap=None, - **_extra)
- Creates a new element associated with this parser.
- - -
- -
-   - - - - - - -
tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
- source code - -
- -
-   - - - - - - -
_setClassLookup(self, - lookup_function) - source code - -
- -
-   - - - - - - -
_buildElementClass(self) - source code - -
- -
-   - - - - - - -
XML(self, - xml) - source code - -
- -
-   - - - - - - -
test_lookup(self) - source code - -
- -
-   - - - - - - -
test_lookup_keep_ref_assertion(self) - source code - -
- -
-   - - - - - - -
test_lookup_tag(self) - source code - -
- -
-   - - - - - - -
test_lookup_text(self) - source code - -
- -
-   - - - - - - -
test_lookup_tail(self) - source code - -
- -
-   - - - - - - -
test_lookup_attrib(self) - source code - -
- -
-   - - - - - - -
test_lookup_prefix(self) - source code - -
- -
-   - - - - - - -
test_lookup_sourceline(self) - source code - -
- -
-   - - - - - - -
test_lookup_getitem(self) - source code - -
- -
-   - - - - - - -
test_lookup_getitem_neg(self) - source code - -
- -
-   - - - - - - -
test_lookup_getslice(self) - source code - -
- -
-   - - - - - - -
test_lookup_len(self) - source code - -
- -
-   - - - - - - -
test_lookup_bool(self) - source code - -
- -
-   - - - - - - -
test_lookup_get(self) - source code - -
- -
-   - - - - - - -
test_lookup_get_default(self) - source code - -
- -
-   - - - - - - -
test_lookup_getchildren(self) - source code - -
- -
-   - - - - - - -
test_lookup_iter_children(self) - source code - -
- -
-   - - - - - - -
test_lookup_iterchildren(self) - source code - -
- -
-   - - - - - - -
test_lookup_iterchildren_tag(self) - source code - -
- -
-   - - - - - - -
test_lookup_getparent(self) - source code - -
- -
-   - - - - - - -
test_lookup_getnext(self) - source code - -
- -
-   - - - - - - -
test_lookup_getprevious(self) - source code - -
- -
-   - - - - - - -
test_comments_fallback(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-   - - parser = <lxml.etree.XMLParser object> -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

tearDown(self) -

-
source code  -
- - Hook method for deconstructing the test fixture after testing it. -
-
Overrides: - unittest.case.TestCase.tearDown -
(inherited documentation)
- -
-
-
-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_relaxng-module.html b/doc/html/api/lxml.tests.test_relaxng-module.html deleted file mode 100644 index e9ca0e0d..00000000 --- a/doc/html/api/lxml.tests.test_relaxng-module.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - lxml.tests.test_relaxng - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_relaxng - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_relaxng

source code

-Test cases related to RelaxNG parsing and validation - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ETreeRelaxNGTestCase -
-   - - RelaxNGCompactTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - rnc2rng = None
- hash(x) -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_relaxng-pysrc.html b/doc/html/api/lxml.tests.test_relaxng-pysrc.html deleted file mode 100644 index 0a81b32f..00000000 --- a/doc/html/api/lxml.tests.test_relaxng-pysrc.html +++ /dev/null @@ -1,740 +0,0 @@ - - - - - lxml.tests.test_relaxng - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_relaxng - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_relaxng

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Test cases related to RelaxNG parsing and validation 
-  5  """ 
-  6   
-  7  import unittest, sys, os.path 
-  8   
-  9  this_dir = os.path.dirname(__file__) 
- 10  if this_dir not in sys.path: 
- 11      sys.path.insert(0, this_dir) # needed for Py3 
- 12   
- 13  from common_imports import etree, BytesIO, _bytes, HelperTestCase, fileInTestDir 
- 14  from common_imports import doctest, make_doctest, skipif 
- 15   
- 16  try: 
- 17      import rnc2rng 
- 18  except ImportError: 
- 19      rnc2rng = None 
- 20   
- 21   
-
22 -class ETreeRelaxNGTestCase(HelperTestCase): -
23 - def test_relaxng(self): -
24 tree_valid = self.parse('<a><b></b></a>') - 25 tree_invalid = self.parse('<a><c></c></a>') - 26 schema = self.parse('''\ - 27 <element name="a" xmlns="http://relaxng.org/ns/structure/1.0"> - 28 <zeroOrMore> - 29 <element name="b"> - 30 <text /> - 31 </element> - 32 </zeroOrMore> - 33 </element> - 34 ''') - 35 schema = etree.RelaxNG(schema) - 36 self.assertTrue(schema.validate(tree_valid)) - 37 self.assertFalse(schema.error_log.filter_from_errors()) - 38 - 39 self.assertFalse(schema.validate(tree_invalid)) - 40 self.assertTrue(schema.error_log.filter_from_errors()) - 41 - 42 self.assertTrue(schema.validate(tree_valid)) # repeat valid - 43 self.assertFalse(schema.error_log.filter_from_errors()) # repeat valid -
44 -
45 - def test_relaxng_stringio(self): -
46 tree_valid = self.parse('<a><b></b></a>') - 47 tree_invalid = self.parse('<a><c></c></a>') - 48 schema_file = BytesIO('''\ - 49 <element name="a" xmlns="http://relaxng.org/ns/structure/1.0"> - 50 <zeroOrMore> - 51 <element name="b"> - 52 <text /> - 53 </element> - 54 </zeroOrMore> - 55 </element> - 56 ''') - 57 schema = etree.RelaxNG(file=schema_file) - 58 self.assertTrue(schema.validate(tree_valid)) - 59 self.assertFalse(schema.validate(tree_invalid)) -
60 -
62 self.assertRaises(ValueError, etree.RelaxNG, etree.ElementTree()) -
63 -
64 - def test_relaxng_error(self): -
65 tree_invalid = self.parse('<a><c></c></a>') - 66 schema = self.parse('''\ - 67 <element name="a" xmlns="http://relaxng.org/ns/structure/1.0"> - 68 <zeroOrMore> - 69 <element name="b"> - 70 <text /> - 71 </element> - 72 </zeroOrMore> - 73 </element> - 74 ''') - 75 schema = etree.RelaxNG(schema) - 76 self.assertFalse(schema.validate(tree_invalid)) - 77 errors = schema.error_log - 78 self.assertTrue([log for log in errors - 79 if log.level_name == "ERROR"]) - 80 self.assertTrue([log for log in errors - 81 if "not expect" in log.message]) -
82 -
83 - def test_relaxng_generic_error(self): -
84 tree_invalid = self.parse('''\ - 85 <test> - 86 <reference id="my-ref">This is my unique ref.</reference> - 87 <data ref="my-ref">Valid data</data> - 88 <data ref="myref">Invalid data</data> - 89 </test> - 90 ''') - 91 schema = self.parse('''\ - 92 <grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" - 93 xmlns="http://relaxng.org/ns/structure/1.0"> - 94 <define name="by-ref"> - 95 <data type="IDREF"/> - 96 </define> - 97 <start> - 98 <element name="test"> - 99 <zeroOrMore> -100 <element name="reference"> -101 <attribute name="id"> -102 <data type="ID"/> -103 </attribute> -104 <text/> -105 </element> -106 </zeroOrMore> -107 <zeroOrMore> -108 <element name="data"> -109 <attribute name="ref"> -110 <data type="IDREF"/> -111 </attribute> -112 <text/> -113 </element> -114 </zeroOrMore> -115 </element> -116 </start> -117 </grammar> -118 ''') -119 -120 schema = etree.RelaxNG(schema) -121 self.assertFalse(schema.validate(tree_invalid)) -122 errors = schema.error_log -123 self.assertTrue(errors) -124 self.assertTrue([log for log in errors if "IDREF" in log.message]) -125 self.assertTrue([log for log in errors if "myref" in log.message]) -
126 -
128 schema = self.parse('''\ -129 <element name="a" xmlns="http://relaxng.org/ns/structure/1.0"> -130 <zeroOrMore> -131 <element name="b" /> -132 </zeroOrMore> -133 </element> -134 ''') -135 self.assertRaises(etree.RelaxNGParseError, -136 etree.RelaxNG, schema) -
137 -
139 schema = self.parse('''\ -140 <grammar xmlns="http://relaxng.org/ns/structure/1.0" /> -141 ''') -142 self.assertRaises(etree.RelaxNGParseError, -143 etree.RelaxNG, schema) -
144 -
146 schema = self.parse('''\ -147 <grammar xmlns="http://relaxng.org/ns/structure/1.0"> -148 <define name="test"> -149 <element name="test"/> -150 </define> -151 </grammar> -152 ''') -153 self.assertRaises(etree.RelaxNGParseError, -154 etree.RelaxNG, schema) -
155 -
157 # segfault -158 schema = self.parse('''\ -159 <element name="a" xmlns="mynamespace" /> -160 ''') -161 self.assertRaises(etree.RelaxNGParseError, -162 etree.RelaxNG, schema) -
163 -
164 - def test_relaxng_include(self): -
165 # this will only work if we access the file through path or -166 # file object.. -167 f = open(fileInTestDir('test1.rng'), 'rb') -168 try: -169 schema = etree.RelaxNG(file=f) -170 finally: -171 f.close() -
172 -
173 - def test_relaxng_shortcut(self): -
174 tree_valid = self.parse('<a><b></b></a>') -175 tree_invalid = self.parse('<a><c></c></a>') -176 schema = self.parse('''\ -177 <element name="a" xmlns="http://relaxng.org/ns/structure/1.0"> -178 <zeroOrMore> -179 <element name="b"> -180 <text /> -181 </element> -182 </zeroOrMore> -183 </element> -184 ''') -185 self.assertTrue(tree_valid.relaxng(schema)) -186 self.assertFalse(tree_invalid.relaxng(schema)) -
187 -
188 - def test_multiple_elementrees(self): -
189 tree = self.parse('<a><b>B</b><c>C</c></a>') -190 schema = etree.RelaxNG( self.parse('''\ -191 <element name="a" xmlns="http://relaxng.org/ns/structure/1.0"> -192 <element name="b"> -193 <text /> -194 </element> -195 <element name="c"> -196 <text /> -197 </element> -198 </element> -199 ''') ) -200 self.assertTrue(schema.validate(tree)) -201 self.assertFalse(schema.error_log.filter_from_errors()) -202 -203 self.assertTrue(schema.validate(tree)) # repeat valid -204 self.assertFalse(schema.error_log.filter_from_errors()) # repeat valid -205 -206 schema = etree.RelaxNG( self.parse('''\ -207 <element name="b" xmlns="http://relaxng.org/ns/structure/1.0"> -208 <text /> -209 </element> -210 ''') ) -211 c_tree = etree.ElementTree(tree.getroot()[1]) -212 self.assertEqual(self._rootstring(c_tree), _bytes('<c>C</c>')) -213 self.assertFalse(schema.validate(c_tree)) -214 self.assertTrue(schema.error_log.filter_from_errors()) -215 -216 b_tree = etree.ElementTree(tree.getroot()[0]) -217 self.assertEqual(self._rootstring(b_tree), _bytes('<b>B</b>')) -218 self.assertTrue(schema.validate(b_tree)) -219 self.assertFalse(schema.error_log.filter_from_errors()) -
220 -
221 -class RelaxNGCompactTestCase(HelperTestCase): -
222 -223 pytestmark = skipif('rnc2rng is None') -224 -
225 - def test_relaxng_compact(self): -
226 tree_valid = self.parse('<a><b>B</b><c>C</c></a>') -227 tree_invalid = self.parse('<a><b></b></a>') -228 schema = etree.RelaxNG(file=fileInTestDir('test.rnc')) -229 self.assertTrue(schema.validate(tree_valid)) -230 self.assertFalse(schema.validate(tree_invalid)) -
231 -
233 f = open(fileInTestDir('test.rnc'), 'rb') -234 try: -235 schema = etree.RelaxNG(file=f) -236 finally: -237 f.close() -
238 -
239 - def test_relaxng_compact_str(self): -
240 tree_valid = self.parse('<a><b>B</b></a>') -241 rnc_str = 'element a { element b { "B" } }' -242 schema = etree.RelaxNG.from_rnc_string(rnc_str) -243 self.assertTrue(schema.validate(tree_valid)) -
244 -245 -
246 -def test_suite(): -
247 suite = unittest.TestSuite() -248 suite.addTests([unittest.makeSuite(ETreeRelaxNGTestCase)]) -249 suite.addTests( -250 [make_doctest('../../../doc/validation.txt')]) -251 if rnc2rng is not None: -252 suite.addTests([unittest.makeSuite(RelaxNGCompactTestCase)]) -253 return suite -
254 -255 if __name__ == '__main__': -256 print('to test use test.py %s' % __file__) -257 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html b/doc/html/api/lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html deleted file mode 100644 index 6d079932..00000000 --- a/doc/html/api/lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html +++ /dev/null @@ -1,537 +0,0 @@ - - - - - lxml.tests.test_relaxng.ETreeRelaxNGTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_relaxng :: - Class ETreeRelaxNGTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeRelaxNGTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeRelaxNGTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_relaxng(self) - source code - -
- -
-   - - - - - - -
test_relaxng_stringio(self) - source code - -
- -
-   - - - - - - -
test_relaxng_elementtree_error(self) - source code - -
- -
-   - - - - - - -
test_relaxng_error(self) - source code - -
- -
-   - - - - - - -
test_relaxng_generic_error(self) - source code - -
- -
-   - - - - - - -
test_relaxng_invalid_schema(self) - source code - -
- -
-   - - - - - - -
test_relaxng_invalid_schema2(self) - source code - -
- -
-   - - - - - - -
test_relaxng_invalid_schema3(self) - source code - -
- -
-   - - - - - - -
test_relaxng_invalid_schema4(self) - source code - -
- -
-   - - - - - - -
test_relaxng_include(self) - source code - -
- -
-   - - - - - - -
test_relaxng_shortcut(self) - source code - -
- -
-   - - - - - - -
test_multiple_elementrees(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html b/doc/html/api/lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html deleted file mode 100644 index 4a4beff4..00000000 --- a/doc/html/api/lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - - lxml.tests.test_relaxng.RelaxNGCompactTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_relaxng :: - Class RelaxNGCompactTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class RelaxNGCompactTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               RelaxNGCompactTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_relaxng_compact(self) - source code - -
- -
-   - - - - - - -
test_relaxng_compact_file_obj(self) - source code - -
- -
-   - - - - - - -
test_relaxng_compact_str(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - pytestmark = <lxml.tests.common_imports.skipif object> -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_sax-module.html b/doc/html/api/lxml.tests.test_sax-module.html deleted file mode 100644 index f6b9a839..00000000 --- a/doc/html/api/lxml.tests.test_sax-module.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - - lxml.tests.test_sax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_sax - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_sax

source code

-Test cases related to SAX I/O - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ETreeSaxTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_sax-pysrc.html b/doc/html/api/lxml.tests.test_sax-pysrc.html deleted file mode 100644 index 18b42270..00000000 --- a/doc/html/api/lxml.tests.test_sax-pysrc.html +++ /dev/null @@ -1,681 +0,0 @@ - - - - - lxml.tests.test_sax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_sax - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_sax

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Test cases related to SAX I/O 
-  5  """ 
-  6   
-  7  import unittest, sys, os.path 
-  8   
-  9  this_dir = os.path.dirname(__file__) 
- 10  if this_dir not in sys.path: 
- 11      sys.path.insert(0, this_dir) # needed for Py3 
- 12   
- 13  from common_imports import HelperTestCase, make_doctest, BytesIO, _bytes 
- 14  from lxml import sax 
- 15  from xml.dom import pulldom 
- 16   
- 17   
-
18 -class ETreeSaxTestCase(HelperTestCase): -
19 -
20 - def test_etree_sax_simple(self): -
21 tree = self.parse('<a>ab<b/>ba</a>') - 22 xml_out = self._saxify_serialize(tree) - 23 self.assertEqual(_bytes('<a>ab<b/>ba</a>'), - 24 xml_out) -
25 -
26 - def test_etree_sax_double(self): -
27 tree = self.parse('<a>ab<b>bb</b>ba</a>') - 28 xml_out = self._saxify_serialize(tree) - 29 self.assertEqual(_bytes('<a>ab<b>bb</b>ba</a>'), - 30 xml_out) -
31 -
32 - def test_etree_sax_comment(self): -
33 tree = self.parse('<a>ab<!-- TEST -->ba</a>') - 34 xml_out = self._saxify_serialize(tree) - 35 self.assertEqual(_bytes('<a>abba</a>'), - 36 xml_out) -
37 -
38 - def test_etree_sax_pi(self): -
39 tree = self.parse('<a>ab<?this and that?>ba</a>') - 40 xml_out = self._saxify_serialize(tree) - 41 self.assertEqual(_bytes('<a>ab<?this and that?>ba</a>'), - 42 xml_out) -
43 -
45 tree = self.parse('<!-- TEST --><a>ab</a>') - 46 xml_out = self._saxify_serialize(tree) - 47 self.assertEqual(_bytes('<a>ab</a>'), - 48 xml_out) -
49 -
50 - def test_etree_sax_pi_root(self): -
51 tree = self.parse('<?this and that?><a>ab</a>') - 52 xml_out = self._saxify_serialize(tree) - 53 self.assertEqual(_bytes('<?this and that?><a>ab</a>'), - 54 xml_out) -
55 -
56 - def test_etree_sax_attributes(self): -
57 tree = self.parse('<a aa="5">ab<b b="5"/>ba</a>') - 58 xml_out = self._saxify_serialize(tree) - 59 self.assertEqual(_bytes('<a aa="5">ab<b b="5"/>ba</a>'), - 60 xml_out) -
61 -
62 - def test_etree_sax_ns1(self): -
63 tree = self.parse('<a xmlns="bla">ab<b>bb</b>ba</a>') - 64 new_tree = self._saxify_unsaxify(tree) - 65 root = new_tree.getroot() - 66 self.assertEqual('{bla}a', - 67 root.tag) - 68 self.assertEqual('{bla}b', - 69 root[0].tag) -
70 -
71 - def test_etree_sax_ns2(self): -
72 tree = self.parse('<a xmlns="blaA">ab<b:b xmlns:b="blaB">bb</b:b>ba</a>') - 73 new_tree = self._saxify_unsaxify(tree) - 74 root = new_tree.getroot() - 75 self.assertEqual('{blaA}a', - 76 root.tag) - 77 self.assertEqual('{blaB}b', - 78 root[0].tag) -
79 -
80 - def test_sax_to_pulldom(self): -
81 tree = self.parse('<a xmlns="blaA">ab<b:b xmlns:b="blaB">bb</b:b>ba</a>') - 82 handler = pulldom.SAX2DOM() - 83 sax.saxify(tree, handler) - 84 dom = handler.document - 85 - 86 self.assertEqual('a', - 87 dom.firstChild.localName) - 88 self.assertEqual('blaA', - 89 dom.firstChild.namespaceURI) - 90 - 91 children = dom.firstChild.childNodes - 92 self.assertEqual('ab', - 93 children[0].nodeValue) - 94 self.assertEqual('blaB', - 95 children[1].namespaceURI) - 96 self.assertEqual('ba', - 97 children[2].nodeValue) -
98 -
99 - def test_element_sax(self): -
100 tree = self.parse('<a><b/></a>') -101 a = tree.getroot() -102 b = a[0] -103 -104 xml_out = self._saxify_serialize(a) -105 self.assertEqual(_bytes('<a><b/></a>'), -106 xml_out) -107 -108 xml_out = self._saxify_serialize(b) -109 self.assertEqual(_bytes('<b/>'), -110 xml_out) -
111 -
112 - def test_element_sax_ns(self): -
113 tree = self.parse('<a:a xmlns:a="blaA"><b/></a:a>') -114 a = tree.getroot() -115 b = a[0] -116 -117 new_tree = self._saxify_unsaxify(a) -118 root = new_tree.getroot() -119 self.assertEqual('{blaA}a', -120 root.tag) -121 self.assertEqual('b', -122 root[0].tag) -123 -124 new_tree = self._saxify_unsaxify(b) -125 root = new_tree.getroot() -126 self.assertEqual('b', -127 root.tag) -128 self.assertEqual(0, -129 len(root)) -
130 -
132 handler = sax.ElementTreeContentHandler() -133 handler.startDocument() -134 handler.startPrefixMapping(None, 'blaA') -135 handler.startElementNS(('blaA', 'a'), 'a', {}) -136 handler.startPrefixMapping(None, 'blaB') -137 handler.startElementNS(('blaB', 'b'), 'b', {}) -138 handler.endElementNS( ('blaB', 'b'), 'b') -139 handler.endPrefixMapping(None) -140 handler.startElementNS(('blaA', 'c'), 'c', {}) -141 handler.endElementNS( ('blaA', 'c'), 'c') -142 handler.endElementNS( ('blaA', 'a'), 'a') -143 handler.endPrefixMapping(None) -144 handler.endDocument() -145 -146 new_tree = handler.etree -147 root = new_tree.getroot() -148 self.assertEqual('{blaA}a', -149 root.tag) -150 self.assertEqual('{blaB}b', -151 root[0].tag) -152 self.assertEqual('{blaA}c', -153 root[1].tag) -
154 -
156 handler = sax.ElementTreeContentHandler() -157 handler.startDocument() -158 handler.startPrefixMapping(None, 'blaA') -159 handler.startElementNS((None, 'a'), 'a', {}) -160 handler.startPrefixMapping(None, 'blaB') -161 handler.startElementNS((None, 'b'), 'b', {}) -162 handler.endElementNS( (None, 'b'), 'b') -163 handler.endPrefixMapping(None) -164 handler.startElementNS((None, 'c'), 'c', {}) -165 handler.endElementNS( (None, 'c'), 'c') -166 handler.endElementNS( (None, 'a'), 'a') -167 handler.endPrefixMapping(None) -168 handler.endDocument() -169 -170 new_tree = handler.etree -171 root = new_tree.getroot() -172 self.assertEqual('{blaA}a', -173 root.tag) -174 self.assertEqual('{blaB}b', -175 root[0].tag) -176 self.assertEqual('{blaA}c', -177 root[1].tag) -
178 -
179 - def test_etree_sax_redefine_ns(self): -
180 handler = sax.ElementTreeContentHandler() -181 handler.startDocument() -182 handler.startPrefixMapping('ns', 'blaA') -183 handler.startElementNS(('blaA', 'a'), 'ns:a', {}) -184 handler.startPrefixMapping('ns', 'blaB') -185 handler.startElementNS(('blaB', 'b'), 'ns:b', {}) -186 handler.endElementNS( ('blaB', 'b'), 'ns:b') -187 handler.endPrefixMapping('ns') -188 handler.startElementNS(('blaA', 'c'), 'ns:c', {}) -189 handler.endElementNS( ('blaA', 'c'), 'ns:c') -190 handler.endElementNS( ('blaA', 'a'), 'ns:a') -191 handler.endPrefixMapping('ns') -192 handler.endDocument() -193 -194 new_tree = handler.etree -195 root = new_tree.getroot() -196 self.assertEqual('{blaA}a', -197 root.tag) -198 self.assertEqual('{blaB}b', -199 root[0].tag) -200 self.assertEqual('{blaA}c', -201 root[1].tag) -
202 -
203 - def test_etree_sax_no_ns(self): -
204 handler = sax.ElementTreeContentHandler() -205 handler.startDocument() -206 handler.startElement('a', {}) -207 handler.startElement('b', {}) -208 handler.endElement('b') -209 handler.startElement('c') # with empty attributes -210 handler.endElement('c') -211 handler.endElement('a') -212 handler.endDocument() -213 -214 new_tree = handler.etree -215 root = new_tree.getroot() -216 self.assertEqual('a', root.tag) -217 self.assertEqual('b', root[0].tag) -218 self.assertEqual('c', root[1].tag) -
219 -
221 handler = sax.ElementTreeContentHandler() -222 handler.startDocument() -223 handler.startElement('a', {"attr_a1": "a1"}) -224 handler.startElement('b', {"attr_b1": "b1"}) -225 handler.endElement('b') -226 handler.endElement('a') -227 handler.endDocument() -228 -229 new_tree = handler.etree -230 root = new_tree.getroot() -231 self.assertEqual('a', root.tag) -232 self.assertEqual('b', root[0].tag) -233 self.assertEqual('a1', root.attrib["attr_a1"]) -234 self.assertEqual('b1', root[0].attrib["attr_b1"]) -
235 -
237 handler = sax.ElementTreeContentHandler() -238 handler.startDocument() -239 -240 self.assertRaises(ValueError, -241 handler.startElement, -242 'a', {"blaA:attr_a1": "a1"} -243 ) -
244 -
245 - def test_etree_sax_error(self): -
246 handler = sax.ElementTreeContentHandler() -247 handler.startDocument() -248 handler.startElement('a') -249 self.assertRaises(sax.SaxError, handler.endElement, 'b') -
250 -
251 - def test_etree_sax_error2(self): -
252 handler = sax.ElementTreeContentHandler() -253 handler.startDocument() -254 handler.startElement('a') -255 handler.startElement('b') -256 self.assertRaises(sax.SaxError, handler.endElement, 'a') -
257 -
258 - def _saxify_unsaxify(self, saxifiable): -
259 handler = sax.ElementTreeContentHandler() -260 sax.ElementTreeProducer(saxifiable, handler).saxify() -261 return handler.etree -
262 -
263 - def _saxify_serialize(self, tree): -
264 new_tree = self._saxify_unsaxify(tree) -265 f = BytesIO() -266 new_tree.write(f) -267 return f.getvalue().replace(_bytes('\n'), _bytes('')) -
268 -269 -
270 -def test_suite(): -
271 suite = unittest.TestSuite() -272 suite.addTests([unittest.makeSuite(ETreeSaxTestCase)]) -273 suite.addTests( -274 [make_doctest('../../../doc/sax.txt')]) -275 return suite -
276 -277 -278 if __name__ == '__main__': -279 print('to test use test.py %s' % __file__) -280 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_sax.ETreeSaxTestCase-class.html b/doc/html/api/lxml.tests.test_sax.ETreeSaxTestCase-class.html deleted file mode 100644 index 77c29609..00000000 --- a/doc/html/api/lxml.tests.test_sax.ETreeSaxTestCase-class.html +++ /dev/null @@ -1,699 +0,0 @@ - - - - - lxml.tests.test_sax.ETreeSaxTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_sax :: - Class ETreeSaxTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeSaxTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeSaxTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_etree_sax_simple(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_double(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_comment(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_pi(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_comment_root(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_pi_root(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_attributes(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_ns1(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_ns2(self) - source code - -
- -
-   - - - - - - -
test_sax_to_pulldom(self) - source code - -
- -
-   - - - - - - -
test_element_sax(self) - source code - -
- -
-   - - - - - - -
test_element_sax_ns(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_handler_default_ns(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_handler_default_ns_None(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_redefine_ns(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_no_ns(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_no_ns_attributes(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_ns_attributes(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_error(self) - source code - -
- -
-   - - - - - - -
test_etree_sax_error2(self) - source code - -
- -
-   - - - - - - -
_saxify_unsaxify(self, - saxifiable) - source code - -
- -
-   - - - - - - -
_saxify_serialize(self, - tree) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_schematron-module.html b/doc/html/api/lxml.tests.test_schematron-module.html deleted file mode 100644 index 20ca6671..00000000 --- a/doc/html/api/lxml.tests.test_schematron-module.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - - lxml.tests.test_schematron - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_schematron - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_schematron

source code

-Test cases related to Schematron parsing and validation - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ETreeSchematronTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_schematron-pysrc.html b/doc/html/api/lxml.tests.test_schematron-pysrc.html deleted file mode 100644 index 91db76bc..00000000 --- a/doc/html/api/lxml.tests.test_schematron-pysrc.html +++ /dev/null @@ -1,376 +0,0 @@ - - - - - lxml.tests.test_schematron - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_schematron - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_schematron

-
- 1  # -*- coding: utf-8 -*- 
- 2   
- 3  """ 
- 4  Test cases related to Schematron parsing and validation 
- 5  """ 
- 6   
- 7  import unittest, sys, os.path 
- 8   
- 9  this_dir = os.path.dirname(__file__) 
-10  if this_dir not in sys.path: 
-11      sys.path.insert(0, this_dir) # needed for Py3 
-12   
-13  from common_imports import etree, HelperTestCase, fileInTestDir 
-14  from common_imports import doctest, make_doctest 
-15   
-
16 -class ETreeSchematronTestCase(HelperTestCase): -
17 - def test_schematron(self): -
18 tree_valid = self.parse('<AAA><BBB/><CCC/></AAA>') -19 tree_invalid = self.parse('<AAA><BBB/><CCC/><DDD/></AAA>') -20 schema = self.parse('''\ -21 <schema xmlns="http://purl.oclc.org/dsdl/schematron" > -22 <pattern name="Open model"> -23 <rule context="AAA"> -24 <assert test="BBB"> BBB element is not present</assert> -25 <assert test="CCC"> CCC element is not present</assert> -26 </rule> -27 </pattern> -28 <pattern name="Closed model"> -29 <rule context="AAA"> -30 <assert test="BBB"> BBB element is not present</assert> -31 <assert test="CCC"> CCC element is not present</assert> -32 <assert test="count(BBB|CCC) = count (*)">There is an extra element</assert> -33 </rule> -34 </pattern> -35 </schema> -36 ''') -37 schema = etree.Schematron(schema) -38 self.assertTrue(schema.validate(tree_valid)) -39 self.assertFalse(schema.error_log.filter_from_errors()) -40 -41 self.assertFalse(schema.validate(tree_invalid)) -42 self.assertTrue(schema.error_log.filter_from_errors()) -43 -44 self.assertTrue(schema.validate(tree_valid)) # repeat valid -45 self.assertFalse(schema.error_log.filter_from_errors()) # repeat valid -
46 -
48 self.assertRaises(ValueError, etree.Schematron, etree.ElementTree()) -
49 -
51 schema = self.parse('''\ -52 <schema xmlns="http://purl.oclc.org/dsdl/schematron" > -53 <pattern name="Open model"> -54 </pattern> -55 </schema> -56 ''') -57 self.assertRaises(etree.SchematronParseError, -58 etree.Schematron, schema) -
59 -
61 schema = self.parse('''\ -62 <schema xmlns="http://purl.oclc.org/dsdl/schematron" /> -63 ''') -64 self.assertRaises(etree.SchematronParseError, -65 etree.Schematron, schema) -
66 -
68 # segfault -69 schema = self.parse('''\ -70 <schema xmlns="mynamespace" /> -71 ''') -72 self.assertRaises(etree.SchematronParseError, -73 etree.Schematron, schema) -
74 -75 -
76 -def test_suite(): -
77 suite = unittest.TestSuite() -78 suite.addTests([unittest.makeSuite(ETreeSchematronTestCase)]) -79 suite.addTests( -80 [make_doctest('../../../doc/validation.txt')]) -81 return suite -
82 -83 if __name__ == '__main__': -84 print('to test use test.py %s' % __file__) -85 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_schematron.ETreeSchematronTestCase-class.html b/doc/html/api/lxml.tests.test_schematron.ETreeSchematronTestCase-class.html deleted file mode 100644 index c7c66798..00000000 --- a/doc/html/api/lxml.tests.test_schematron.ETreeSchematronTestCase-class.html +++ /dev/null @@ -1,425 +0,0 @@ - - - - - lxml.tests.test_schematron.ETreeSchematronTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_schematron :: - Class ETreeSchematronTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeSchematronTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeSchematronTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_schematron(self) - source code - -
- -
-   - - - - - - -
test_schematron_elementtree_error(self) - source code - -
- -
-   - - - - - - -
test_schematron_invalid_schema(self) - source code - -
- -
-   - - - - - - -
test_schematron_invalid_schema_empty(self) - source code - -
- -
-   - - - - - - -
test_schematron_invalid_schema_namespace(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading-module.html b/doc/html/api/lxml.tests.test_threading-module.html deleted file mode 100644 index 4b1c8484..00000000 --- a/doc/html/api/lxml.tests.test_threading-module.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - lxml.tests.test_threading - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_threading

source code

-Tests for thread usage in lxml.etree. - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ThreadingTestCase
- Threading tests -
-   - - ThreadPipelineTestCase
- Threading tests based on a thread worker pipeline. -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading-pysrc.html b/doc/html/api/lxml.tests.test_threading-pysrc.html deleted file mode 100644 index 4faa1515..00000000 --- a/doc/html/api/lxml.tests.test_threading-pysrc.html +++ /dev/null @@ -1,1417 +0,0 @@ - - - - - lxml.tests.test_threading - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_threading

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Tests for thread usage in lxml.etree. 
-  5  """ 
-  6   
-  7  import re 
-  8  import sys 
-  9  import os.path 
- 10  import unittest 
- 11  import threading 
- 12   
- 13  this_dir = os.path.dirname(__file__) 
- 14  if this_dir not in sys.path: 
- 15      sys.path.insert(0, this_dir) # needed for Py3 
- 16   
- 17  from common_imports import etree, HelperTestCase, BytesIO, _bytes 
- 18   
- 19  try: 
- 20      from Queue import Queue 
- 21  except ImportError: 
- 22      from queue import Queue # Py3 
- 23   
- 24   
-
25 -class ThreadingTestCase(HelperTestCase): -
26 """Threading tests""" - 27 etree = etree - 28 -
29 - def _run_thread(self, func): -
30 thread = threading.Thread(target=func) - 31 thread.start() - 32 thread.join() -
33 -
34 - def _run_threads(self, count, func, main_func=None): -
35 sync = threading.Event() - 36 lock = threading.Lock() - 37 counter = dict(started=0, finished=0, failed=0) - 38 - 39 def sync_start(func): - 40 with lock: - 41 started = counter['started'] + 1 - 42 counter['started'] = started - 43 if started < count + (main_func is not None): - 44 sync.wait(4) # wait until the other threads have started up - 45 assert sync.is_set() - 46 sync.set() # all waiting => go! - 47 try: - 48 func() - 49 except: - 50 with lock: - 51 counter['failed'] += 1 - 52 raise - 53 else: - 54 with lock: - 55 counter['finished'] += 1 -
56 - 57 threads = [threading.Thread(target=sync_start, args=(func,)) for _ in range(count)] - 58 for thread in threads: - 59 thread.start() - 60 if main_func is not None: - 61 sync_start(main_func) - 62 for thread in threads: - 63 thread.join() - 64 - 65 self.assertEqual(0, counter['failed']) - 66 self.assertEqual(counter['finished'], counter['started']) -
67 -
68 - def test_subtree_copy_thread(self): -
69 tostring = self.etree.tostring - 70 XML = self.etree.XML - 71 xml = _bytes("<root><threadtag/></root>") - 72 main_root = XML(_bytes("<root/>")) - 73 - 74 def run_thread(): - 75 thread_root = XML(xml) - 76 main_root.append(thread_root[0]) - 77 del thread_root -
78 - 79 self._run_thread(run_thread) - 80 self.assertEqual(xml, tostring(main_root)) - 81 -
82 - def test_main_xslt_in_thread(self): -
83 XML = self.etree.XML - 84 style = XML(_bytes('''\ - 85 <xsl:stylesheet version="1.0" - 86 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 87 <xsl:template match="*"> - 88 <foo><xsl:copy><xsl:value-of select="/a/b/text()" /></xsl:copy></foo> - 89 </xsl:template> - 90 </xsl:stylesheet>''')) - 91 st = etree.XSLT(style) - 92 - 93 result = [] - 94 - 95 def run_thread(): - 96 root = XML(_bytes('<a><b>B</b><c>C</c></a>')) - 97 result.append( st(root) ) -
98 - 99 self._run_thread(run_thread) -100 self.assertEqual('''\ -101 <?xml version="1.0"?> -102 <foo><a>B</a></foo> -103 ''', -104 str(result[0])) -105 -
106 - def test_thread_xslt(self): -
107 XML = self.etree.XML -108 tostring = self.etree.tostring -109 root = XML(_bytes('<a><b>B</b><c>C</c></a>')) -110 -111 def run_thread(): -112 style = XML(_bytes('''\ -113 <xsl:stylesheet version="1.0" -114 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -115 <xsl:template match="*"> -116 <foo><xsl:copy><xsl:value-of select="/a/b/text()" /></xsl:copy></foo> -117 </xsl:template> -118 </xsl:stylesheet>''')) -119 st = etree.XSLT(style) -120 root.append( st(root).getroot() ) -
121 -122 self._run_thread(run_thread) -123 self.assertEqual(_bytes('<a><b>B</b><c>C</c><foo><a>B</a></foo></a>'), -124 tostring(root)) -125 -
127 style = self.parse('''\ -128 <xsl:stylesheet version="1.0" -129 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -130 <xsl:template match="tag" /> -131 <!-- extend time for parsing + transform --> -132 ''' + '\n'.join('<xsl:template match="tag%x" />' % i for i in range(200)) + ''' -133 <xsl:foo /> -134 </xsl:stylesheet>''') -135 self.assertRaises(etree.XSLTParseError, -136 etree.XSLT, style) -137 -138 error_logs = [] -139 -140 def run_thread(): -141 try: -142 etree.XSLT(style) -143 except etree.XSLTParseError as e: -144 error_logs.append(e.error_log) -145 else: -146 self.assertFalse(True, "XSLT parsing should have failed but didn't") -
147 -148 self._run_threads(16, run_thread) -149 -150 self.assertEqual(16, len(error_logs)) -151 last_log = None -152 for log in error_logs: -153 self.assertTrue(len(log)) -154 if last_log is not None: -155 self.assertEqual(len(last_log), len(log)) -156 self.assertEqual(4, len(log)) -157 for error in log: -158 self.assertTrue(':ERROR:XSLT:' in str(error)) -159 last_log = log -160 -
162 tree = self.parse('<tagFF/>') -163 style = self.parse('''\ -164 <xsl:stylesheet version="1.0" -165 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -166 <xsl:template name="tag0"> -167 <xsl:message terminate="yes">FAIL</xsl:message> -168 </xsl:template> -169 <!-- extend time for parsing + transform --> -170 ''' + '\n'.join('<xsl:template match="tag%X" name="tag%x"> <xsl:call-template name="tag%x" /> </xsl:template>' % (i, i, i-1) -171 for i in range(1, 256)) + ''' -172 </xsl:stylesheet>''') -173 self.assertRaises(etree.XSLTApplyError, -174 etree.XSLT(style), tree) -175 -176 error_logs = [] -177 -178 def run_thread(): -179 transform = etree.XSLT(style) -180 try: -181 transform(tree) -182 except etree.XSLTApplyError: -183 error_logs.append(transform.error_log) -184 else: -185 self.assertFalse(True, "XSLT parsing should have failed but didn't") -
186 -187 self._run_threads(16, run_thread) -188 -189 self.assertEqual(16, len(error_logs)) -190 last_log = None -191 for log in error_logs: -192 self.assertTrue(len(log)) -193 if last_log is not None: -194 self.assertEqual(len(last_log), len(log)) -195 self.assertEqual(1, len(log)) -196 for error in log: -197 self.assertTrue(':ERROR:XSLT:' in str(error)) -198 last_log = log -199 -
201 # this is the only case in XSLT where the result tree can be -202 # modified in-place -203 XML = self.etree.XML -204 tostring = self.etree.tostring -205 style = self.etree.XSLT(XML(_bytes('''\ -206 <xsl:stylesheet version="1.0" -207 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -208 <xsl:template match="*"> -209 <root class="abc"> -210 <xsl:copy-of select="@class" /> -211 <xsl:attribute name="class">xyz</xsl:attribute> -212 </root> -213 </xsl:template> -214 </xsl:stylesheet>'''))) -215 -216 result = [] -217 def run_thread(): -218 root = XML(_bytes('<ROOT class="ABC" />')) -219 result.append( style(root).getroot() ) -
220 -221 self._run_thread(run_thread) -222 self.assertEqual(_bytes('<root class="xyz"/>'), -223 tostring(result[0])) -224 -
225 - def test_thread_create_xslt(self): -
226 XML = self.etree.XML -227 tostring = self.etree.tostring -228 root = XML(_bytes('<a><b>B</b><c>C</c></a>')) -229 -230 stylesheets = [] -231 -232 def run_thread(): -233 style = XML(_bytes('''\ -234 <xsl:stylesheet -235 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -236 version="1.0"> -237 <xsl:output method="xml" /> -238 <xsl:template match="/"> -239 <div id="test"> -240 <xsl:apply-templates/> -241 </div> -242 </xsl:template> -243 </xsl:stylesheet>''')) -244 stylesheets.append( etree.XSLT(style) ) -
245 -246 self._run_thread(run_thread) -247 -248 st = stylesheets[0] -249 result = tostring( st(root) ) -250 -251 self.assertEqual(_bytes('<div id="test">BC</div>'), -252 result) -253 -
254 - def test_thread_error_log(self): -
255 XML = self.etree.XML -256 expected_error = [self.etree.ErrorTypes.ERR_TAG_NAME_MISMATCH] -257 children = "<a>test</a>" * 100 -258 -259 def parse_error_test(thread_no): -260 tag = "tag%d" % thread_no -261 xml = "<%s>%s</%s>" % (tag, children, tag.upper()) -262 parser = self.etree.XMLParser() -263 for _ in range(10): -264 errors = None -265 try: -266 XML(xml, parser) -267 except self.etree.ParseError: -268 e = sys.exc_info()[1] -269 errors = e.error_log.filter_types(expected_error) -270 self.assertTrue(errors, "Expected error not found") -271 for error in errors: -272 self.assertTrue( -273 tag in error.message and tag.upper() in error.message, -274 "%s and %s not found in '%s'" % ( -275 tag, tag.upper(), error.message)) -
276 -277 self.etree.clear_error_log() -278 threads = [] -279 for thread_no in range(1, 10): -280 t = threading.Thread(target=parse_error_test, -281 args=(thread_no,)) -282 threads.append(t) -283 t.start() -284 -285 parse_error_test(0) -286 -287 for t in threads: -288 t.join() -289 -
290 - def test_thread_mix(self): -
291 XML = self.etree.XML -292 Element = self.etree.Element -293 SubElement = self.etree.SubElement -294 tostring = self.etree.tostring -295 xml = _bytes('<a><b>B</b><c xmlns="test">C</c></a>') -296 root = XML(xml) -297 fragment = XML(_bytes("<other><tags/></other>")) -298 -299 result = self.etree.Element("{myns}root", att = "someval") -300 -301 def run_XML(): -302 thread_root = XML(xml) -303 result.append(thread_root[0]) -304 result.append(thread_root[-1]) -
305 -306 def run_parse(): -307 thread_root = self.etree.parse(BytesIO(xml)).getroot() -308 result.append(thread_root[0]) -309 result.append(thread_root[-1]) -310 -311 def run_move_main(): -312 result.append(fragment[0]) -313 -314 def run_build(): -315 result.append( -316 Element("{myns}foo", attrib={'{test}attr':'val'})) -317 SubElement(result, "{otherns}tasty") -318 -319 def run_xslt(): -320 style = XML(_bytes('''\ -321 <xsl:stylesheet version="1.0" -322 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -323 <xsl:template match="*"> -324 <xsl:copy><foo><xsl:value-of select="/a/b/text()" /></foo></xsl:copy> -325 </xsl:template> -326 </xsl:stylesheet>''')) -327 st = etree.XSLT(style) -328 result.append( st(root).getroot() ) -329 -330 for test in (run_XML, run_parse, run_move_main, run_xslt, run_build): -331 tostring(result) -332 self._run_thread(test) -333 -334 self.assertEqual( -335 _bytes('<ns0:root xmlns:ns0="myns" att="someval"><b>B</b>' -336 '<c xmlns="test">C</c><b>B</b><c xmlns="test">C</c><tags/>' -337 '<a><foo>B</foo></a>' -338 '<ns0:foo xmlns:ns1="test" ns1:attr="val"/>' -339 '<ns1:tasty xmlns:ns1="otherns"/></ns0:root>'), -340 tostring(result)) -341 -342 def strip_first(): -343 root = Element("newroot") -344 root.append(result[0]) -345 -346 while len(result): -347 self._run_thread(strip_first) -348 -349 self.assertEqual( -350 _bytes('<ns0:root xmlns:ns0="myns" att="someval"/>'), -351 tostring(result)) -352 -
354 SubElement = self.etree.SubElement -355 names = list('abcdefghijklmnop') -356 runs_per_name = range(50) -357 result_matches = re.compile( -358 br'<thread_root>' -359 br'(?:<[a-p]{5} thread_attr_[a-p]="value" thread_attr2_[a-p]="value2"\s?/>)+' -360 br'</thread_root>').match -361 -362 def testrun(): -363 for _ in range(3): -364 root = self.etree.Element('thread_root') -365 for name in names: -366 tag_name = name * 5 -367 new = [] -368 for _ in runs_per_name: -369 el = SubElement(root, tag_name, {'thread_attr_' + name: 'value'}) -370 new.append(el) -371 for el in new: -372 el.set('thread_attr2_' + name, 'value2') -373 s = etree.tostring(root) -374 self.assertTrue(result_matches(s)) -
375 -376 # first, run only in sub-threads -377 self._run_threads(10, testrun) -378 -379 # then, additionally include the main thread (and its parent dict) -380 self._run_threads(10, testrun, main_func=testrun) -381 -
382 - def test_concurrent_proxies(self): -
383 XML = self.etree.XML -384 root = XML(_bytes('<root><a>A</a><b xmlns="test">B</b><c/></root>')) -385 child_count = len(root) -386 def testrun(): -387 for i in range(10000): -388 el = root[i%child_count] -389 del el -
390 self._run_threads(10, testrun) -391 -
393 XML = self.etree.XML -394 -395 class TestElement(etree.ElementBase): -396 pass -
397 -398 class MyLookup(etree.CustomElementClassLookup): -399 repeat = range(100) -400 def lookup(self, t, d, ns, name): -401 count = 0 -402 for i in self.repeat: -403 # allow other threads to run -404 count += 1 -405 return TestElement -406 -407 parser = self.etree.XMLParser() -408 parser.set_element_class_lookup(MyLookup()) -409 -410 root = XML(_bytes('<root><a>A</a><b xmlns="test">B</b><c/></root>'), -411 parser) -412 -413 child_count = len(root) -414 def testrun(): -415 for i in range(1000): -416 el = root[i%child_count] -417 del el -418 self._run_threads(10, testrun) -419 -420 -
421 -class ThreadPipelineTestCase(HelperTestCase): -
422 """Threading tests based on a thread worker pipeline. -423 """ -424 etree = etree -425 item_count = 40 -426 -
427 - class Worker(threading.Thread): -
428 - def __init__(self, in_queue, in_count, **kwargs): -
429 threading.Thread.__init__(self) -430 self.in_queue = in_queue -431 self.in_count = in_count -432 self.out_queue = Queue(in_count) -433 self.__dict__.update(kwargs) -
434 -
435 - def run(self): -
436 get, put = self.in_queue.get, self.out_queue.put -437 handle = self.handle -438 for _ in range(self.in_count): -439 put(handle(get())) -
440 -
441 - def handle(self, data): -
442 raise NotImplementedError() -
443 -
444 - class ParseWorker(Worker): -
445 - def handle(self, xml, _fromstring=etree.fromstring): -
446 return _fromstring(xml) -
447 -
448 - class RotateWorker(Worker): -
449 - def handle(self, element): -
450 first = element[0] -451 element[:] = element[1:] -452 element.append(first) -453 return element -
454 -
455 - class ReverseWorker(Worker): -
456 - def handle(self, element): -
457 element[:] = element[::-1] -458 return element -
459 -
460 - class ParseAndExtendWorker(Worker): -
461 - def handle(self, element, _fromstring=etree.fromstring): -
462 element.extend(_fromstring(self.xml)) -463 return element -
464 -
465 - class ParseAndInjectWorker(Worker): -
466 - def handle(self, element, _fromstring=etree.fromstring): -
467 root = _fromstring(self.xml) -468 root.extend(element) -469 return root -
470 -
471 - class Validate(Worker): -
472 - def handle(self, element): -
475 -
476 - class SerialiseWorker(Worker): -
477 - def handle(self, element): -
478 return etree.tostring(element) -
479 -480 xml = (b'''\ -481 <!DOCTYPE threadtest [ -482 <!ELEMENT threadtest (thread-tag1,thread-tag2)+> -483 <!ATTLIST threadtest -484 version CDATA "1.0" -485 > -486 <!ELEMENT thread-tag1 EMPTY> -487 <!ELEMENT thread-tag2 (div)> -488 <!ELEMENT div (threaded)> -489 <!ATTLIST div -490 huhu CDATA #IMPLIED -491 > -492 <!ELEMENT threaded EMPTY> -493 <!ATTLIST threaded -494 host CDATA #REQUIRED -495 > -496 ]> -497 <threadtest version="123"> -498 ''' + (b''' -499 <thread-tag1 /> -500 <thread-tag2> -501 <div huhu="true"> -502 <threaded host="here" /> -503 </div> -504 </thread-tag2> -505 ''') * 20 + b''' -506 </threadtest>''') -507 -
508 - def _build_pipeline(self, item_count, *classes, **kwargs): -
509 in_queue = Queue(item_count) -510 start = last = classes[0](in_queue, item_count, **kwargs) -511 start.setDaemon(True) -512 for worker_class in classes[1:]: -513 last = worker_class(last.out_queue, item_count, **kwargs) -514 last.setDaemon(True) -515 last.start() -516 return (in_queue, start, last) -
517 -
519 item_count = self.item_count -520 xml = self.xml.replace(b'thread', b'THREAD') # use fresh tag names -521 -522 # build and start the pipeline -523 in_queue, start, last = self._build_pipeline( -524 item_count, -525 self.ParseWorker, -526 self.RotateWorker, -527 self.ReverseWorker, -528 self.ParseAndExtendWorker, -529 self.Validate, -530 self.ParseAndInjectWorker, -531 self.SerialiseWorker, -532 xml=xml) -533 -534 # fill the queue -535 put = start.in_queue.put -536 for _ in range(item_count): -537 put(xml) -538 -539 # start the first thread and thus everything -540 start.start() -541 # make sure the last thread has terminated -542 last.join(60) # time out after 60 seconds -543 self.assertEqual(item_count, last.out_queue.qsize()) -544 # read the results -545 get = last.out_queue.get -546 results = [get() for _ in range(item_count)] -547 -548 comparison = results[0] -549 for i, result in enumerate(results[1:]): -550 self.assertEqual(comparison, result) -
551 -
553 item_count = self.item_count -554 xml = self.xml.replace(b'thread', b'GLOBAL') # use fresh tag names -555 XML = self.etree.XML -556 # build and start the pipeline -557 in_queue, start, last = self._build_pipeline( -558 item_count, -559 self.RotateWorker, -560 self.ReverseWorker, -561 self.ParseAndExtendWorker, -562 self.Validate, -563 self.SerialiseWorker, -564 xml=xml) -565 -566 # fill the queue -567 put = start.in_queue.put -568 for _ in range(item_count): -569 put(XML(xml)) -570 -571 # start the first thread and thus everything -572 start.start() -573 # make sure the last thread has terminated -574 last.join(60) # time out after 90 seconds -575 self.assertEqual(item_count, last.out_queue.qsize()) -576 # read the results -577 get = last.out_queue.get -578 results = [get() for _ in range(item_count)] -579 -580 comparison = results[0] -581 for i, result in enumerate(results[1:]): -582 self.assertEqual(comparison, result) -
583 -584 -
585 -def test_suite(): -
586 suite = unittest.TestSuite() -587 suite.addTests([unittest.makeSuite(ThreadingTestCase)]) -588 suite.addTests([unittest.makeSuite(ThreadPipelineTestCase)]) -589 return suite -
590 -591 if __name__ == '__main__': -592 print('to test use test.py %s' % __file__) -593 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase-class.html b/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase-class.html deleted file mode 100644 index 938da4c4..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase-class.html +++ /dev/null @@ -1,544 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadPipelineTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadPipelineTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ThreadPipelineTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ThreadPipelineTestCase
-
- -
-Threading tests based on a thread worker pipeline. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-   - - Worker -
-   - - ParseWorker -
-   - - RotateWorker -
-   - - ReverseWorker -
-   - - ParseAndExtendWorker -
-   - - ParseAndInjectWorker -
-   - - Validate -
-   - - SerialiseWorker -
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
_build_pipeline(self, - item_count, - *classes, - **kwargs) - source code - -
- -
-   - - - - - - -
test_thread_pipeline_thread_parse(self) - source code - -
- -
-   - - - - - - -
test_thread_pipeline_global_parse(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-   - - item_count = 40 -
-   - - xml = '<!DOCTYPE threadtest [\n <!ELEMENT threadtest (threa... -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
- -
- -
-

xml

- -
-
-
-
Value:
-
-'''<!DOCTYPE threadtest [
-    <!ELEMENT threadtest (thread-tag1,thread-tag2)+>
-    <!ATTLIST threadtest
-        version    CDATA  "1.0"
-    >
-    <!ELEMENT thread-tag1 EMPTY>
-    <!ELEMENT thread-tag2 (div)>
-    <!ELEMENT div (threaded)>
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker-class.html b/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker-class.html deleted file mode 100644 index df5d3e8a..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker-class.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadPipelineTestCase :: - Class ParseAndExtendWorker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ParseAndExtendWorker

source code

-
-           object --+            
-                    |            
-   threading._Verbose --+        
-                        |        
-         threading.Thread --+    
-                            |    
-ThreadPipelineTestCase.Worker --+
-                                |
-                               ThreadPipelineTestCase.ParseAndExtendWorker
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
handle(self, - element, - _fromstring=<cyfunction fromstring at 0x7f42b3de11d0>) - source code - -
- -
-

Inherited from Worker: - __init__, - run -

-

Inherited from threading.Thread: - __repr__, - getName, - isAlive, - isDaemon, - is_alive, - join, - setDaemon, - setName, - start -

-

Inherited from threading.Thread (private): - _reset_internal_locks, - _set_daemon, - _set_ident -

-

Inherited from threading._Verbose (private): - _note -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from threading.Thread: - daemon, - ident, - name -

-

Inherited from threading.Thread (private): - _block -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

handle(self, - element, - _fromstring=<cyfunction fromstring at 0x7f42b3de11d0>) -

-
source code  -
- - -
-
Overrides: - Worker.handle -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker-class.html b/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker-class.html deleted file mode 100644 index 2bb2e81d..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker-class.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadPipelineTestCase :: - Class ParseAndInjectWorker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ParseAndInjectWorker

source code

-
-           object --+            
-                    |            
-   threading._Verbose --+        
-                        |        
-         threading.Thread --+    
-                            |    
-ThreadPipelineTestCase.Worker --+
-                                |
-                               ThreadPipelineTestCase.ParseAndInjectWorker
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
handle(self, - element, - _fromstring=<cyfunction fromstring at 0x7f42b3de11d0>) - source code - -
- -
-

Inherited from Worker: - __init__, - run -

-

Inherited from threading.Thread: - __repr__, - getName, - isAlive, - isDaemon, - is_alive, - join, - setDaemon, - setName, - start -

-

Inherited from threading.Thread (private): - _reset_internal_locks, - _set_daemon, - _set_ident -

-

Inherited from threading._Verbose (private): - _note -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from threading.Thread: - daemon, - ident, - name -

-

Inherited from threading.Thread (private): - _block -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

handle(self, - element, - _fromstring=<cyfunction fromstring at 0x7f42b3de11d0>) -

-
source code  -
- - -
-
Overrides: - Worker.handle -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker-class.html b/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker-class.html deleted file mode 100644 index 1b059003..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker-class.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadPipelineTestCase :: - Class ParseWorker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ParseWorker

source code

-
-           object --+            
-                    |            
-   threading._Verbose --+        
-                        |        
-         threading.Thread --+    
-                            |    
-ThreadPipelineTestCase.Worker --+
-                                |
-                               ThreadPipelineTestCase.ParseWorker
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
handle(self, - xml, - _fromstring=<cyfunction fromstring at 0x7f42b3de11d0>) - source code - -
- -
-

Inherited from Worker: - __init__, - run -

-

Inherited from threading.Thread: - __repr__, - getName, - isAlive, - isDaemon, - is_alive, - join, - setDaemon, - setName, - start -

-

Inherited from threading.Thread (private): - _reset_internal_locks, - _set_daemon, - _set_ident -

-

Inherited from threading._Verbose (private): - _note -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from threading.Thread: - daemon, - ident, - name -

-

Inherited from threading.Thread (private): - _block -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

handle(self, - xml, - _fromstring=<cyfunction fromstring at 0x7f42b3de11d0>) -

-
source code  -
- - -
-
Overrides: - Worker.handle -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker-class.html b/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker-class.html deleted file mode 100644 index 8afd9763..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker-class.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadPipelineTestCase :: - Class ReverseWorker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ReverseWorker

source code

-
-           object --+            
-                    |            
-   threading._Verbose --+        
-                        |        
-         threading.Thread --+    
-                            |    
-ThreadPipelineTestCase.Worker --+
-                                |
-                               ThreadPipelineTestCase.ReverseWorker
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
handle(self, - element) - source code - -
- -
-

Inherited from Worker: - __init__, - run -

-

Inherited from threading.Thread: - __repr__, - getName, - isAlive, - isDaemon, - is_alive, - join, - setDaemon, - setName, - start -

-

Inherited from threading.Thread (private): - _reset_internal_locks, - _set_daemon, - _set_ident -

-

Inherited from threading._Verbose (private): - _note -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from threading.Thread: - daemon, - ident, - name -

-

Inherited from threading.Thread (private): - _block -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

handle(self, - element) -

-
source code  -
- - -
-
Overrides: - Worker.handle -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker-class.html b/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker-class.html deleted file mode 100644 index d4c9b967..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker-class.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadPipelineTestCase :: - Class RotateWorker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class RotateWorker

source code

-
-           object --+            
-                    |            
-   threading._Verbose --+        
-                        |        
-         threading.Thread --+    
-                            |    
-ThreadPipelineTestCase.Worker --+
-                                |
-                               ThreadPipelineTestCase.RotateWorker
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
handle(self, - element) - source code - -
- -
-

Inherited from Worker: - __init__, - run -

-

Inherited from threading.Thread: - __repr__, - getName, - isAlive, - isDaemon, - is_alive, - join, - setDaemon, - setName, - start -

-

Inherited from threading.Thread (private): - _reset_internal_locks, - _set_daemon, - _set_ident -

-

Inherited from threading._Verbose (private): - _note -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from threading.Thread: - daemon, - ident, - name -

-

Inherited from threading.Thread (private): - _block -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

handle(self, - element) -

-
source code  -
- - -
-
Overrides: - Worker.handle -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker-class.html b/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker-class.html deleted file mode 100644 index ca2a0bc1..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker-class.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadPipelineTestCase :: - Class SerialiseWorker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class SerialiseWorker

source code

-
-           object --+            
-                    |            
-   threading._Verbose --+        
-                        |        
-         threading.Thread --+    
-                            |    
-ThreadPipelineTestCase.Worker --+
-                                |
-                               ThreadPipelineTestCase.SerialiseWorker
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
handle(self, - element) - source code - -
- -
-

Inherited from Worker: - __init__, - run -

-

Inherited from threading.Thread: - __repr__, - getName, - isAlive, - isDaemon, - is_alive, - join, - setDaemon, - setName, - start -

-

Inherited from threading.Thread (private): - _reset_internal_locks, - _set_daemon, - _set_ident -

-

Inherited from threading._Verbose (private): - _note -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from threading.Thread: - daemon, - ident, - name -

-

Inherited from threading.Thread (private): - _block -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

handle(self, - element) -

-
source code  -
- - -
-
Overrides: - Worker.handle -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Validate-class.html b/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Validate-class.html deleted file mode 100644 index a9f03dbf..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Validate-class.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadPipelineTestCase.Validate - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadPipelineTestCase :: - Class Validate - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Validate

source code

-
-           object --+            
-                    |            
-   threading._Verbose --+        
-                        |        
-         threading.Thread --+    
-                            |    
-ThreadPipelineTestCase.Worker --+
-                                |
-                               ThreadPipelineTestCase.Validate
-
- -
- - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
handle(self, - element) - source code - -
- -
-

Inherited from Worker: - __init__, - run -

-

Inherited from threading.Thread: - __repr__, - getName, - isAlive, - isDaemon, - is_alive, - join, - setDaemon, - setName, - start -

-

Inherited from threading.Thread (private): - _reset_internal_locks, - _set_daemon, - _set_ident -

-

Inherited from threading._Verbose (private): - _note -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from threading.Thread: - daemon, - ident, - name -

-

Inherited from threading.Thread (private): - _block -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

handle(self, - element) -

-
source code  -
- - -
-
Overrides: - Worker.handle -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html b/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html deleted file mode 100644 index 99f0039c..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadPipelineTestCase.Worker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadPipelineTestCase :: - Class Worker - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Worker

source code

-
-        object --+        
-                 |        
-threading._Verbose --+    
-                     |    
-      threading.Thread --+
-                         |
-                        ThreadPipelineTestCase.Worker
-
- -
Known Subclasses:
-
- -
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - in_queue, - in_count, - **kwargs)
- This constructor should always be called with keyword arguments. Arguments are:
- source code - -
- -
-   - - - - - - -
run(self)
- Method representing the thread's activity.
- source code - -
- -
-   - - - - - - -
handle(self, - data) - source code - -
- -
-

Inherited from threading.Thread: - __repr__, - getName, - isAlive, - isDaemon, - is_alive, - join, - setDaemon, - setName, - start -

-

Inherited from threading.Thread (private): - _reset_internal_locks, - _set_daemon, - _set_ident -

-

Inherited from threading._Verbose (private): - _note -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from threading.Thread: - daemon, - ident, - name -

-

Inherited from threading.Thread (private): - _block -

-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - in_queue, - in_count, - **kwargs) -
(Constructor) -

-
source code  -
- -

This constructor should always be called with keyword arguments. Arguments are:

-

group should be None; reserved for future extension when a ThreadGroup -class is implemented.

-

target is the callable object to be invoked by the run() -method. Defaults to None, meaning nothing is called.

-

name is the thread name. By default, a unique name is constructed of -the form "Thread-N" where N is a small decimal number.

-

args is the argument tuple for the target invocation. Defaults to ().

-

kwargs is a dictionary of keyword arguments for the target -invocation. Defaults to {}.

-

If a subclass overrides the constructor, it must make sure to invoke -the base class constructor (Thread.__init__()) before doing anything -else to the thread.

-
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

run(self) -

-
source code  -
- -

Method representing the thread's activity.

-

You may override this method in a subclass. The standard run() method -invokes the callable object passed to the object's constructor as the -target argument, if any, with sequential and keyword arguments taken -from the args and kwargs arguments, respectively.

-
-
Overrides: - threading.Thread.run -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_threading.ThreadingTestCase-class.html b/doc/html/api/lxml.tests.test_threading.ThreadingTestCase-class.html deleted file mode 100644 index b2c28700..00000000 --- a/doc/html/api/lxml.tests.test_threading.ThreadingTestCase-class.html +++ /dev/null @@ -1,617 +0,0 @@ - - - - - lxml.tests.test_threading.ThreadingTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_threading :: - Class ThreadingTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ThreadingTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ThreadingTestCase
-
- -
-Threading tests - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
_run_thread(self, - func) - source code - -
- -
-   - - - - - - -
_run_threads(self, - count, - func, - main_func=None) - source code - -
- -
-   - - - - - - -
test_subtree_copy_thread(self) - source code - -
- -
-   - - - - - - -
test_main_xslt_in_thread(self) - source code - -
- -
-   - - - - - - -
test_thread_xslt(self) - source code - -
- -
-   - - - - - - -
test_thread_xslt_parsing_error_log(self) - source code - -
- -
-   - - - - - - -
test_thread_xslt_apply_error_log(self) - source code - -
- -
-   - - - - - - -
test_thread_xslt_attr_replace(self) - source code - -
- -
-   - - - - - - -
test_thread_create_xslt(self) - source code - -
- -
-   - - - - - - -
test_thread_error_log(self) - source code - -
- -
-   - - - - - - -
test_thread_mix(self) - source code - -
- -
-   - - - - - - -
test_concurrent_attribute_names_in_dicts(self) - source code - -
- -
-   - - - - - - -
test_concurrent_proxies(self) - source code - -
- -
-   - - - - - - -
test_concurrent_class_lookup(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - etree
- The lxml.etree module implements the extended ElementTree API for XML. -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

etree

- The lxml.etree module implements the extended ElementTree API for XML. -
-
-
-
Value:
-
lxml.etree
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_unicode-module.html b/doc/html/api/lxml.tests.test_unicode-module.html deleted file mode 100644 index 81d26524..00000000 --- a/doc/html/api/lxml.tests.test_unicode-module.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - lxml.tests.test_unicode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_unicode - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_unicode

source code

- - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - unicode
- str(object='') -> string -
-   - - UnicodeTestCase -
-   - - EncodingsTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - ascii_uni = u'a' -
-   - - klingon = u'' -
-   - - invalid_tag = u'test' -
-   - - uni = u'Ãڀㄠ' -
-   - - uxml = u'<test><title>test áㄠ</title><h1>page áㄠ title</h1><... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
- -
- -
-

uxml

- -
-
-
-
Value:
-
-u'<test><title>test áㄠ</title><h1>page áㄠ title</h1></test>'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_unicode-pysrc.html b/doc/html/api/lxml.tests.test_unicode-pysrc.html deleted file mode 100644 index 0014d90e..00000000 --- a/doc/html/api/lxml.tests.test_unicode-pysrc.html +++ /dev/null @@ -1,713 +0,0 @@ - - - - - lxml.tests.test_unicode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_unicode - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_unicode

-
-  1  # -*- coding: utf-8 -*- 
-  2  import unittest 
-  3  import sys 
-  4  import os.path 
-  5   
-  6  this_dir = os.path.dirname(__file__) 
-  7  if this_dir not in sys.path: 
-  8      sys.path.insert(0, this_dir)  # needed for Py3 
-  9   
- 10  from common_imports import StringIO, etree, SillyFileLike, HelperTestCase 
- 11  from common_imports import _str, _bytes, _chr 
- 12   
- 13  try: 
- 14      unicode 
- 15  except NameError: 
- 16      unicode = str 
- 17   
- 18  ascii_uni = _bytes('a').decode('utf8') 
- 19   
- 20  klingon = _bytes("\\uF8D2").decode("unicode_escape") # not valid for XML names 
- 21   
- 22  invalid_tag = _bytes("test").decode('utf8') + klingon 
- 23   
- 24  uni = _bytes('\\xc3\\u0680\\u3120').decode("unicode_escape") # some non-ASCII characters 
- 25   
- 26  uxml = _bytes("<test><title>test \\xc3\\xa1\\u3120</title><h1>page \\xc3\\xa1\\u3120 title</h1></test>" 
- 27                ).decode("unicode_escape") 
- 28   
- 29   
-
30 -class UnicodeTestCase(HelperTestCase): -
31 - def test__str(self): -
32 # test the testing framework, namely _str from common_imports - 33 self.assertEqual(_str('\x10'), _str('\u0010')) - 34 self.assertEqual(_str('\x10'), _str('\U00000010')) - 35 self.assertEqual(_str('\u1234'), _str('\U00001234')) -
36 -
37 - def test_unicode_xml(self): -
38 tree = etree.XML('<p>%s</p>' % uni) - 39 self.assertEqual(uni, tree.text) -
40 -
41 - def test_wide_unicode_xml(self): -
42 if sys.maxunicode < 1114111: - 43 return # skip test - 44 tree = etree.XML(_bytes('<p>\\U00026007</p>').decode('unicode_escape')) - 45 self.assertEqual(1, len(tree.text)) - 46 self.assertEqual(_bytes('\\U00026007').decode('unicode_escape'), - 47 tree.text) -
48 -
49 - def test_unicode_xml_broken(self): -
50 uxml = ('<?xml version="1.0" encoding="UTF-8"?>' + - 51 '<p>%s</p>' % uni) - 52 self.assertRaises(ValueError, etree.XML, uxml) -
53 -
54 - def test_unicode_tag(self): -
55 el = etree.Element(uni) - 56 self.assertEqual(uni, el.tag) -
57 -
58 - def test_unicode_tag_invalid(self): -
59 # sadly, Klingon is not well-formed - 60 self.assertRaises(ValueError, etree.Element, invalid_tag) -
61 -
62 - def test_unicode_nstag(self): -
63 tag = "{http://abc/}%s" % uni - 64 el = etree.Element(tag) - 65 self.assertEqual(tag, el.tag) -
66 -
67 - def test_unicode_ns_invalid(self): -
68 # namespace URIs must conform to RFC 3986 - 69 tag = "{http://%s/}abc" % uni - 70 self.assertRaises(ValueError, etree.Element, tag) -
71 -
72 - def test_unicode_nstag_invalid(self): -
73 # sadly, Klingon is not well-formed - 74 tag = "{http://abc/}%s" % invalid_tag - 75 self.assertRaises(ValueError, etree.Element, tag) -
76 -
77 - def test_unicode_qname(self): -
78 qname = etree.QName(uni, uni) - 79 tag = "{%s}%s" % (uni, uni) - 80 self.assertEqual(qname.text, tag) - 81 self.assertEqual(unicode(qname), tag) -
82 -
83 - def test_unicode_qname_invalid(self): -
84 self.assertRaises(ValueError, etree.QName, invalid_tag) -
85 -
86 - def test_unicode_attr(self): -
87 el = etree.Element('foo', {'bar': uni}) - 88 self.assertEqual(uni, el.attrib['bar']) -
89 -
90 - def test_unicode_comment(self): -
91 el = etree.Comment(uni) - 92 self.assertEqual(uni, el.text) -
93 -
94 - def test_unicode_repr1(self): -
95 x = etree.Element(_str('å')) - 96 # must not raise UnicodeEncodeError - 97 repr(x) -
98 -
99 - def test_unicode_repr2(self): -
100 x = etree.Comment(_str('ö')) -101 repr(x) -
102 -
103 - def test_unicode_repr3(self): -
104 x = etree.ProcessingInstruction(_str('Å'), _str('\u0131')) -105 repr(x) -
106 -
107 - def test_unicode_repr4(self): -
108 x = etree.Entity(_str('ä')) -109 repr(x) -
110 -
111 - def test_unicode_text(self): -
112 e = etree.Element('e') -113 -114 def settext(text): -115 e.text = text -
116 -117 self.assertRaises(ValueError, settext, _str('ab\ufffe')) -118 self.assertRaises(ValueError, settext, _str('ö\ffff')) -119 self.assertRaises(ValueError, settext, _str('\u0123\ud800')) -120 self.assertRaises(ValueError, settext, _str('x\ud8ff')) -121 self.assertRaises(ValueError, settext, _str('\U00010000\udfff')) -122 self.assertRaises(ValueError, settext, _str('abd\x00def')) -123 # should not Raise -124 settext(_str('\ud7ff\ue000\U00010000\U0010FFFFäöas')) -125 -126 for char_val in range(0xD800, 0xDFFF+1): -127 self.assertRaises(ValueError, settext, 'abc' + _chr(char_val)) -128 self.assertRaises(ValueError, settext, _chr(char_val)) -129 self.assertRaises(ValueError, settext, _chr(char_val) + 'abc') -130 -131 self.assertRaises(ValueError, settext, _bytes('\xe4')) -132 self.assertRaises(ValueError, settext, _bytes('\x80')) -133 self.assertRaises(ValueError, settext, _bytes('\xff')) -134 self.assertRaises(ValueError, settext, _bytes('\x08')) -135 self.assertRaises(ValueError, settext, _bytes('\x19')) -136 self.assertRaises(ValueError, settext, _bytes('\x20\x00')) -137 # should not Raise -138 settext(_bytes('\x09\x0A\x0D\x20\x60\x7f')) -
139 -
140 - def test_uniname(self): -
141 Element = etree.Element -142 def el(name): -143 return Element(name) -
144 -145 self.assertRaises(ValueError, el, ':') -146 self.assertRaises(ValueError, el, '0a') -147 self.assertRaises(ValueError, el, _str('\u203f')) -148 # should not Raise -149 el(_str('\u0132')) -150 -151 -152 -
154 el = etree.parse(StringIO('<p>%s</p>' % uni)).getroot() -155 self.assertEqual(uni, el.text) -
156 -157 ## def test_parse_fileobject_unicode(self): -158 ## # parse unicode from unamed file object (not support by ElementTree) -159 ## f = SillyFileLike(uxml) -160 ## root = etree.parse(f).getroot() -161 ## self.assertEqual(unicode(etree.tostring(root, 'UTF-8'), 'UTF-8'), -162 ## uxml) -163 -164 -
165 -class EncodingsTestCase(HelperTestCase): -
166 - def test_illegal_utf8(self): -
167 data = _bytes('<test>\x80\x80\x80</test>', encoding='iso8859-1') -168 self.assertRaises(etree.XMLSyntaxError, etree.fromstring, data) -
169 -
170 - def test_illegal_utf8_recover(self): -
171 data = _bytes('<test>\x80\x80\x80</test>', encoding='iso8859-1') -172 parser = etree.XMLParser(recover=True) -173 self.assertRaises(etree.XMLSyntaxError, etree.fromstring, data, parser) -
174 -
175 - def _test_encoding(self, encoding, xml_encoding_name=None): -
176 foo = """<?xml version='1.0' encoding='%s'?>\n<tag attrib='123'></tag>""" % ( -177 xml_encoding_name or encoding) -178 root = etree.fromstring(foo.encode(encoding)) -179 self.assertEqual('tag', root.tag) -180 -181 doc_encoding = root.getroottree().docinfo.encoding -182 self.assertTrue( -183 doc_encoding.lower().rstrip('lbe'), -184 (xml_encoding_name or encoding).lower().rstrip('lbe')) -
185 -
186 - def test_utf8_fromstring(self): -
187 self._test_encoding('utf-8') -
188 -
189 - def test_utf8sig_fromstring(self): -
190 self._test_encoding('utf_8_sig', 'utf-8') -
191 -
192 - def test_utf16_fromstring(self): -
193 self._test_encoding('utf-16') -
194 -
195 - def test_utf16LE_fromstring(self): -
196 self._test_encoding('utf-16le', 'utf-16') -
197 -
198 - def test_utf16BE_fromstring(self): -
199 self._test_encoding('utf-16be', 'utf-16') -
200 -
201 - def test_utf32_fromstring(self): -
202 self._test_encoding('utf-32', 'utf-32') -
203 -
204 - def test_utf32LE_fromstring(self): -
205 self._test_encoding('utf-32le', 'utf-32') -
206 -
207 - def test_utf32BE_fromstring(self): -
208 self._test_encoding('utf-32be', 'utf-32') -
209 -210 -
211 -def test_suite(): -
212 suite = unittest.TestSuite() -213 suite.addTests([unittest.makeSuite(UnicodeTestCase)]) -214 suite.addTests([unittest.makeSuite(EncodingsTestCase)]) -215 return suite -
216 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_unicode.EncodingsTestCase-class.html b/doc/html/api/lxml.tests.test_unicode.EncodingsTestCase-class.html deleted file mode 100644 index e96cb7e1..00000000 --- a/doc/html/api/lxml.tests.test_unicode.EncodingsTestCase-class.html +++ /dev/null @@ -1,523 +0,0 @@ - - - - - lxml.tests.test_unicode.EncodingsTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_unicode :: - Class EncodingsTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class EncodingsTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               EncodingsTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_illegal_utf8(self) - source code - -
- -
-   - - - - - - -
test_illegal_utf8_recover(self) - source code - -
- -
-   - - - - - - -
_test_encoding(self, - encoding, - xml_encoding_name=None) - source code - -
- -
-   - - - - - - -
test_utf8_fromstring(self) - source code - -
- -
-   - - - - - - -
test_utf8sig_fromstring(self) - source code - -
- -
-   - - - - - - -
test_utf16_fromstring(self) - source code - -
- -
-   - - - - - - -
test_utf16LE_fromstring(self) - source code - -
- -
-   - - - - - - -
test_utf16BE_fromstring(self) - source code - -
- -
-   - - - - - - -
test_utf32_fromstring(self) - source code - -
- -
-   - - - - - - -
test_utf32LE_fromstring(self) - source code - -
- -
-   - - - - - - -
test_utf32BE_fromstring(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_unicode.UnicodeTestCase-class.html b/doc/html/api/lxml.tests.test_unicode.UnicodeTestCase-class.html deleted file mode 100644 index ad94ef1e..00000000 --- a/doc/html/api/lxml.tests.test_unicode.UnicodeTestCase-class.html +++ /dev/null @@ -1,665 +0,0 @@ - - - - - lxml.tests.test_unicode.UnicodeTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_unicode :: - Class UnicodeTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class UnicodeTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               UnicodeTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test__str(self) - source code - -
- -
-   - - - - - - -
test_unicode_xml(self) - source code - -
- -
-   - - - - - - -
test_wide_unicode_xml(self) - source code - -
- -
-   - - - - - - -
test_unicode_xml_broken(self) - source code - -
- -
-   - - - - - - -
test_unicode_tag(self) - source code - -
- -
-   - - - - - - -
test_unicode_tag_invalid(self) - source code - -
- -
-   - - - - - - -
test_unicode_nstag(self) - source code - -
- -
-   - - - - - - -
test_unicode_ns_invalid(self) - source code - -
- -
-   - - - - - - -
test_unicode_nstag_invalid(self) - source code - -
- -
-   - - - - - - -
test_unicode_qname(self) - source code - -
- -
-   - - - - - - -
test_unicode_qname_invalid(self) - source code - -
- -
-   - - - - - - -
test_unicode_attr(self) - source code - -
- -
-   - - - - - - -
test_unicode_comment(self) - source code - -
- -
-   - - - - - - -
test_unicode_repr1(self) - source code - -
- -
-   - - - - - - -
test_unicode_repr2(self) - source code - -
- -
-   - - - - - - -
test_unicode_repr3(self) - source code - -
- -
-   - - - - - - -
test_unicode_repr4(self) - source code - -
- -
-   - - - - - - -
test_unicode_text(self) - source code - -
- -
-   - - - - - - -
test_uniname(self) - source code - -
- -
-   - - - - - - -
test_unicode_parse_stringio(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xmlschema-module.html b/doc/html/api/lxml.tests.test_xmlschema-module.html deleted file mode 100644 index a282d34a..00000000 --- a/doc/html/api/lxml.tests.test_xmlschema-module.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - lxml.tests.test_xmlschema - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xmlschema - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_xmlschema

source code

-Test cases related to XML Schema parsing and validation - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ETreeXMLSchemaTestCase -
-   - - ETreeXMLSchemaResolversTestCase -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xmlschema-pysrc.html b/doc/html/api/lxml.tests.test_xmlschema-pysrc.html deleted file mode 100644 index 3bc7e596..00000000 --- a/doc/html/api/lxml.tests.test_xmlschema-pysrc.html +++ /dev/null @@ -1,1438 +0,0 @@ - - - - - lxml.tests.test_xmlschema - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xmlschema - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_xmlschema

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Test cases related to XML Schema parsing and validation 
-  5  """ 
-  6   
-  7  import unittest, sys, os.path 
-  8   
-  9  this_dir = os.path.dirname(__file__) 
- 10  if this_dir not in sys.path: 
- 11      sys.path.insert(0, this_dir) # needed for Py3 
- 12   
- 13  from common_imports import etree, BytesIO, HelperTestCase, fileInTestDir 
- 14  from common_imports import doctest, make_doctest 
- 15   
- 16   
-
17 -class ETreeXMLSchemaTestCase(HelperTestCase): -
18 - def test_xmlschema(self): -
19 tree_valid = self.parse('<a><b></b></a>') - 20 tree_invalid = self.parse('<a><c></c></a>') - 21 schema = self.parse(''' - 22 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - 23 <xsd:element name="a" type="AType"/> - 24 <xsd:complexType name="AType"> - 25 <xsd:sequence> - 26 <xsd:element name="b" type="xsd:string" /> - 27 </xsd:sequence> - 28 </xsd:complexType> - 29 </xsd:schema> - 30 ''') - 31 schema = etree.XMLSchema(schema) - 32 self.assertTrue(schema.validate(tree_valid)) - 33 self.assertFalse(schema.validate(tree_invalid)) - 34 self.assertTrue(schema.validate(tree_valid)) # retry valid - 35 self.assertFalse(schema.validate(tree_invalid)) # retry invalid -
36 -
37 - def test_xmlschema_error_log(self): -
38 tree_valid = self.parse('<a><b></b></a>') - 39 tree_invalid = self.parse('<a><c></c></a>') - 40 schema = self.parse(''' - 41 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - 42 <xsd:element name="a" type="AType"/> - 43 <xsd:complexType name="AType"> - 44 <xsd:sequence> - 45 <xsd:element name="b" type="xsd:string" /> - 46 </xsd:sequence> - 47 </xsd:complexType> - 48 </xsd:schema> - 49 ''') - 50 schema = etree.XMLSchema(schema) - 51 self.assertTrue(schema.validate(tree_valid)) - 52 self.assertFalse(schema.error_log.filter_from_errors()) - 53 - 54 self.assertFalse(schema.validate(tree_invalid)) - 55 self.assertTrue(schema.error_log.filter_from_errors()) - 56 self.assertTrue(schema.error_log.filter_types( - 57 etree.ErrorTypes.SCHEMAV_ELEMENT_CONTENT)) - 58 - 59 self.assertTrue(schema.validate(tree_valid)) - 60 self.assertFalse(schema.error_log.filter_from_errors()) - 61 - 62 self.assertFalse(schema.validate(tree_invalid)) - 63 self.assertTrue(schema.error_log.filter_from_errors()) - 64 self.assertTrue(schema.error_log.filter_types( - 65 etree.ErrorTypes.SCHEMAV_ELEMENT_CONTENT)) -
66 -
68 """We don't have a guarantee that there will always be a path - 69 for a _LogEntry object (or even a node for which to determina - 70 a path), but at least when this test was created schema validation - 71 errors always got a node and an XPath value. If that ever changes, - 72 we can modify this test to something like: - 73 self.assertTrue(error_path is None or tree_path == error_path) - 74 That way, we can at least verify that if we did get a path value - 75 it wasn't bogus. - 76 """ - 77 tree = self.parse('<a><b>42</b><b>dada</b></a>') - 78 schema = self.parse(''' - 79 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - 80 <xsd:element name="a" type="AType"/> - 81 <xsd:complexType name="AType"> - 82 <xsd:sequence> - 83 <xsd:element name="b" type="xsd:integer" maxOccurs="2"/> - 84 </xsd:sequence> - 85 </xsd:complexType> - 86 </xsd:schema> - 87 ''') - 88 schema = etree.XMLSchema(schema) - 89 schema.validate(tree) - 90 tree_path = tree.getpath(tree.findall('b')[1]) - 91 error_path = schema.error_log[0].path - 92 self.assertTrue(tree_path == error_path) -
93 -
95 schema = self.parse(''' - 96 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - 97 <xsd:element name="a" type="AType"/> - 98 <xsd:complexType name="AType"> - 99 <xsd:sequence minOccurs="4" maxOccurs="4"> -100 <xsd:element name="b" type="BType" /> -101 </xsd:sequence> -102 </xsd:complexType> -103 <xsd:complexType name="BType"> -104 <xsd:attribute name="hardy" type="xsd:string" default="hey" /> -105 </xsd:complexType> -106 </xsd:schema> -107 ''') -108 schema = etree.XMLSchema(schema, attribute_defaults=True) -109 -110 tree = self.parse('<a><b hardy="ho"/><b/><b hardy="ho"/><b/></a>') -111 -112 root = tree.getroot() -113 self.assertEqual('ho', root[0].get('hardy')) -114 self.assertEqual(None, root[1].get('hardy')) -115 self.assertEqual('ho', root[2].get('hardy')) -116 self.assertEqual(None, root[3].get('hardy')) -117 -118 self.assertTrue(schema(tree)) -119 -120 root = tree.getroot() -121 self.assertEqual('ho', root[0].get('hardy')) -122 self.assertEqual('hey', root[1].get('hardy')) -123 self.assertEqual('ho', root[2].get('hardy')) -124 self.assertEqual('hey', root[3].get('hardy')) -
125 -
126 - def test_xmlschema_parse(self): -
127 schema = self.parse(''' -128 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -129 <xsd:element name="a" type="AType"/> -130 <xsd:complexType name="AType"> -131 <xsd:sequence> -132 <xsd:element name="b" type="xsd:string" /> -133 </xsd:sequence> -134 </xsd:complexType> -135 </xsd:schema> -136 ''') -137 schema = etree.XMLSchema(schema) -138 parser = etree.XMLParser(schema=schema) -139 -140 tree_valid = self.parse('<a><b></b></a>', parser=parser) -141 self.assertEqual('a', tree_valid.getroot().tag) -142 -143 self.assertRaises(etree.XMLSyntaxError, -144 self.parse, '<a><c></c></a>', parser=parser) -
145 -
147 # does not work as of libxml2 2.7.3 -148 schema = self.parse(''' -149 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -150 <xsd:element name="a" type="AType"/> -151 <xsd:complexType name="AType"> -152 <xsd:sequence minOccurs="4" maxOccurs="4"> -153 <xsd:element name="b" type="BType" /> -154 </xsd:sequence> -155 </xsd:complexType> -156 <xsd:complexType name="BType"> -157 <xsd:attribute name="hardy" type="xsd:string" default="hey" /> -158 </xsd:complexType> -159 </xsd:schema> -160 ''') -161 schema = etree.XMLSchema(schema) -162 parser = etree.XMLParser(schema=schema, attribute_defaults=True) -163 -164 tree_valid = self.parse('<a><b hardy="ho"/><b/><b hardy="ho"/><b/></a>', -165 parser=parser) -166 root = tree_valid.getroot() -167 self.assertEqual('ho', root[0].get('hardy')) -168 self.assertEqual('hey', root[1].get('hardy')) -169 self.assertEqual('ho', root[2].get('hardy')) -170 self.assertEqual('hey', root[3].get('hardy')) -
171 -
173 # does not work as of libxml2 2.7.3 -174 schema = self.parse(''' -175 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -176 <xsd:element name="a" type="AType"/> -177 <xsd:complexType name="AType"> -178 <xsd:sequence minOccurs="4" maxOccurs="4"> -179 <xsd:element name="b" type="BType" /> -180 </xsd:sequence> -181 </xsd:complexType> -182 <xsd:complexType name="BType"> -183 <xsd:attribute name="hardy" type="xsd:string" default="hey" /> -184 </xsd:complexType> -185 </xsd:schema> -186 ''') -187 schema = etree.XMLSchema(schema, attribute_defaults=True) -188 parser = etree.XMLParser(schema=schema) -189 -190 tree_valid = self.parse('<a><b hardy="ho"/><b/><b hardy="ho"/><b/></a>', -191 parser=parser) -192 root = tree_valid.getroot() -193 self.assertEqual('ho', root[0].get('hardy')) -194 self.assertEqual('hey', root[1].get('hardy')) -195 self.assertEqual('ho', root[2].get('hardy')) -196 self.assertEqual('hey', root[3].get('hardy')) -
197 -
199 # does not work as of libxml2 2.7.3 -200 schema = self.parse(''' -201 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -202 <xsd:element name="a" type="AType"/> -203 <xsd:complexType name="AType"> -204 <xsd:sequence minOccurs="3" maxOccurs="3"> -205 <xsd:element name="b" type="BType" /> -206 </xsd:sequence> -207 </xsd:complexType> -208 <xsd:complexType name="BType"> -209 <xsd:attribute name="hardy" type="xsd:string" fixed="hey" /> -210 </xsd:complexType> -211 </xsd:schema> -212 ''') -213 schema = etree.XMLSchema(schema) -214 parser = etree.XMLParser(schema=schema, attribute_defaults=True) -215 -216 tree_valid = self.parse('<a><b/><b hardy="hey"/><b/></a>', -217 parser=parser) -218 root = tree_valid.getroot() -219 self.assertEqual('hey', root[0].get('hardy')) -220 self.assertEqual('hey', root[1].get('hardy')) -221 self.assertEqual('hey', root[2].get('hardy')) -
222 -
223 - def test_xmlschema_stringio(self): -
224 schema_file = BytesIO(''' -225 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -226 <xsd:element name="a" type="AType"/> -227 <xsd:complexType name="AType"> -228 <xsd:sequence> -229 <xsd:element name="b" type="xsd:string" /> -230 </xsd:sequence> -231 </xsd:complexType> -232 </xsd:schema> -233 ''') -234 schema = etree.XMLSchema(file=schema_file) -235 parser = etree.XMLParser(schema=schema) -236 -237 tree_valid = self.parse('<a><b></b></a>', parser=parser) -238 self.assertEqual('a', tree_valid.getroot().tag) -239 -240 self.assertRaises(etree.XMLSyntaxError, -241 self.parse, '<a><c></c></a>', parser=parser) -
242 -
243 - def test_xmlschema_iterparse(self): -
244 schema = self.parse(''' -245 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -246 <xsd:element name="a" type="AType"/> -247 <xsd:complexType name="AType"> -248 <xsd:sequence> -249 <xsd:element name="b" type="xsd:string" /> -250 </xsd:sequence> -251 </xsd:complexType> -252 </xsd:schema> -253 ''') -254 schema = etree.XMLSchema(schema) -255 xml = BytesIO('<a><b></b></a>') -256 events = [ (event, el.tag) -257 for (event, el) in etree.iterparse(xml, schema=schema) ] -258 -259 self.assertEqual([('end', 'b'), ('end', 'a')], -260 events) -
261 -
263 schema = self.parse(''' -264 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -265 <xsd:element name="a" type="AType"/> -266 <xsd:complexType name="AType"> -267 <xsd:sequence> -268 <xsd:element name="b" type="xsd:string" /> -269 </xsd:sequence> -270 </xsd:complexType> -271 </xsd:schema> -272 ''') -273 schema = etree.XMLSchema(schema) -274 xml = BytesIO('<a><b></b></a>') -275 event, element = next(iter(etree.iterparse(xml, schema=schema))) -276 self.assertEqual('end', event) -277 self.assertEqual('b', element.tag) -
278 -
280 schema = self.parse(''' -281 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -282 <xsd:element name="a" type="AType"/> -283 <xsd:complexType name="AType"> -284 <xsd:sequence> -285 <xsd:element name="b" type="xsd:string" /> -286 </xsd:sequence> -287 </xsd:complexType> -288 </xsd:schema> -289 ''') -290 schema = etree.XMLSchema(schema) -291 self.assertRaises( -292 etree.XMLSyntaxError, -293 list, etree.iterparse(BytesIO('<a><c></c></a>'), schema=schema)) -
294 -
296 self.assertRaises(ValueError, etree.XMLSchema, etree.ElementTree()) -
297 -
299 self.assertRaises(ValueError, etree.XMLSchema, etree.Comment('TEST')) -
300 -
302 schema = self.parse(''' -303 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -304 <xsd:element name="a" type="xsd:string"/> -305 </xsd:schema> -306 ''') -307 schema = etree.XMLSchema(schema) -308 -309 root = etree.Element('a') -310 root.text = 'TEST' -311 self.assertTrue(schema(root)) -312 -313 self.assertRaises(ValueError, schema, etree.Comment('TEST')) -314 self.assertRaises(ValueError, schema, etree.PI('a', 'text')) -315 self.assertRaises(ValueError, schema, etree.Entity('text')) -
316 -
318 schema = self.parse('''\ -319 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -320 <element name="a" type="AType"/> -321 <xsd:complexType name="AType"> -322 <xsd:sequence> -323 <xsd:element name="b" type="xsd:string" /> -324 </xsd:sequence> -325 </xsd:complexType> -326 </xsd:schema> -327 ''') -328 self.assertRaises(etree.XMLSchemaParseError, -329 etree.XMLSchema, schema) -
330 -
332 schema = self.parse('<test/>') -333 self.assertRaises(etree.XMLSchemaParseError, -334 etree.XMLSchema, schema) -
335 -
336 - def test_xmlschema_file(self): -
337 # this will only work if we access the file through path or -338 # file object.. -339 f = open(fileInTestDir('test.xsd'), 'rb') -340 try: -341 schema = etree.XMLSchema(file=f) -342 finally: -343 f.close() -344 tree_valid = self.parse('<a><b></b></a>') -345 self.assertTrue(schema.validate(tree_valid)) -
346 -
347 - def test_xmlschema_import_file(self): -
348 # this will only work if we access the file through path or -349 # file object.. -350 schema = etree.XMLSchema(file=fileInTestDir('test_import.xsd')) -351 tree_valid = self.parse( -352 '<a:x xmlns:a="http://codespeak.net/lxml/schema/ns1"><b></b></a:x>') -353 self.assertTrue(schema.validate(tree_valid)) -
354 -
355 - def test_xmlschema_shortcut(self): -
356 tree_valid = self.parse('<a><b></b></a>') -357 tree_invalid = self.parse('<a><c></c></a>') -358 schema = self.parse('''\ -359 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> -360 <xsd:element name="a" type="AType"/> -361 <xsd:complexType name="AType"> -362 <xsd:sequence> -363 <xsd:element name="b" type="xsd:string" /> -364 </xsd:sequence> -365 </xsd:complexType> -366 </xsd:schema> -367 ''') -368 self.assertTrue(tree_valid.xmlschema(schema)) -369 self.assertFalse(tree_invalid.xmlschema(schema)) -
370 -
372 # this used to crash because the schema part was not properly copied out -373 wsdl = self.parse('''\ -374 <wsdl:definitions -375 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" -376 xmlns:xs="http://www.w3.org/2001/XMLSchema"> -377 <wsdl:types> -378 <xs:schema> -379 </xs:schema> -380 </wsdl:types> -381 </wsdl:definitions> -382 ''') -383 schema_element = wsdl.find( -384 "{http://schemas.xmlsoap.org/wsdl/}types/" -385 "{http://www.w3.org/2001/XMLSchema}schema" -386 ) -387 etree.XMLSchema(schema_element) -388 etree.XMLSchema(schema_element) -389 etree.XMLSchema(schema_element) -
390 -391 -
392 -class ETreeXMLSchemaResolversTestCase(HelperTestCase): -
393 resolver_schema_int = BytesIO("""\ -394 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" -395 xmlns:etype="http://codespeak.net/lxml/test/external" -396 targetNamespace="http://codespeak.net/lxml/test/internal"> -397 <xsd:import namespace="http://codespeak.net/lxml/test/external" schemaLocation="XXX.xsd" /> -398 <xsd:element name="a" type="etype:AType"/> -399 </xsd:schema>""") -400 -401 resolver_schema_int2 = BytesIO("""\ -402 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" -403 xmlns:etype="http://codespeak.net/lxml/test/external" -404 targetNamespace="http://codespeak.net/lxml/test/internal"> -405 <xsd:import namespace="http://codespeak.net/lxml/test/external" schemaLocation="YYY.xsd" /> -406 <xsd:element name="a" type="etype:AType"/> -407 </xsd:schema>""") -408 -409 resolver_schema_ext = """\ -410 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" -411 targetNamespace="http://codespeak.net/lxml/test/external"> -412 <xsd:complexType name="AType"> -413 <xsd:sequence><xsd:element name="b" type="xsd:string" minOccurs="0" maxOccurs="unbounded" /></xsd:sequence> -414 </xsd:complexType> -415 </xsd:schema>""" -416 -
417 - class simple_resolver(etree.Resolver): -
418 - def __init__(self, schema): -
419 self.schema = schema -
420 -
421 - def resolve(self, url, id, context): -
422 assert url == 'XXX.xsd' -423 return self.resolve_string(self.schema, context) -
424 -425 # tests: -426 -
427 - def test_xmlschema_resolvers(self): -
428 # test that resolvers work with schema. -429 parser = etree.XMLParser() -430 parser.resolvers.add(self.simple_resolver(self.resolver_schema_ext)) -431 schema_doc = etree.parse(self.resolver_schema_int, parser = parser) -432 schema = etree.XMLSchema(schema_doc) -
433 -
435 # test that the default resolver will get called if there's no -436 # specific parser resolver. -437 root_resolver = self.simple_resolver(self.resolver_schema_ext) -438 etree.get_default_parser().resolvers.add(root_resolver) -439 schema_doc = etree.parse(self.resolver_schema_int) -440 schema = etree.XMLSchema(schema_doc) -441 etree.get_default_parser().resolvers.remove(root_resolver) -
442 -
444 # test that the default resolver will not get called when a -445 # more specific resolver is registered. -446 -447 class res_root(etree.Resolver): -448 def resolve(self, url, id, context): -449 assert False -450 return None -
451 -452 root_resolver = res_root() -453 etree.get_default_parser().resolvers.add(root_resolver) -454 -455 parser = etree.XMLParser() -456 parser.resolvers.add(self.simple_resolver(self.resolver_schema_ext)) -457 -458 schema_doc = etree.parse(self.resolver_schema_int, parser = parser) -459 schema = etree.XMLSchema(schema_doc) -460 etree.get_default_parser().resolvers.remove(root_resolver) -461 -
463 # test that resolvers work in a nested fashion. -464 -465 resolver_schema = self.resolver_schema_ext -466 -467 class res_nested(etree.Resolver): -468 def __init__(self, ext_schema): -469 self.ext_schema = ext_schema -
470 -471 def resolve(self, url, id, context): -472 assert url == 'YYY.xsd' -473 return self.resolve_string(self.ext_schema, context) -474 -475 class res(etree.Resolver): -476 def __init__(self, ext_schema_1, ext_schema_2): -477 self.ext_schema_1 = ext_schema_1 -478 self.ext_schema_2 = ext_schema_2 -479 -480 def resolve(self, url, id, context): -481 assert url == 'XXX.xsd' -482 -483 new_parser = etree.XMLParser() -484 new_parser.resolvers.add(res_nested(self.ext_schema_2)) -485 new_schema_doc = etree.parse(self.ext_schema_1, parser = new_parser) -486 new_schema = etree.XMLSchema(new_schema_doc) -487 -488 return self.resolve_string(resolver_schema, context) -489 -490 parser = etree.XMLParser() -491 parser.resolvers.add(res(self.resolver_schema_int2, self.resolver_schema_ext)) -492 schema_doc = etree.parse(self.resolver_schema_int, parser = parser) -493 schema = etree.XMLSchema(schema_doc) -494 -495 -
496 -def test_suite(): -
497 suite = unittest.TestSuite() -498 suite.addTests([unittest.makeSuite(ETreeXMLSchemaTestCase)]) -499 suite.addTests([unittest.makeSuite(ETreeXMLSchemaResolversTestCase)]) -500 suite.addTests( -501 [make_doctest('../../../doc/validation.txt')]) -502 return suite -
503 -504 -505 if __name__ == '__main__': -506 print('to test use test.py %s' % __file__) -507 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html b/doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html deleted file mode 100644 index cc317fed..00000000 --- a/doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html +++ /dev/null @@ -1,486 +0,0 @@ - - - - - lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xmlschema :: - Class ETreeXMLSchemaResolversTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeXMLSchemaResolversTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeXMLSchemaResolversTestCase
-
- -
- - - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-   - - simple_resolver -
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_xmlschema_resolvers(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_resolvers_root(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_resolvers_noroot(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_nested_resolvers(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - resolver_schema_int = <_io.BytesIO object> -
-   - - resolver_schema_int2 = <_io.BytesIO object> -
-   - - resolver_schema_ext = '<xsd:schema xmlns:xsd="http://www.w3.or... -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

resolver_schema_ext

- -
-
-
-
Value:
-
-'''<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    targetNamespace="http://codespeak.net/lxml/test/external">
-    <xsd:complexType name="AType">
-      <xsd:sequence><xsd:element name="b" type="xsd:string" minOccurs=\
-"0" maxOccurs="unbounded" /></xsd:sequence>
-    </xsd:complexType>
-</xsd:schema>'''
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html b/doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html deleted file mode 100644 index 88cf333a..00000000 --- a/doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xmlschema :: - Class ETreeXMLSchemaResolversTestCase :: - Class simple_resolver - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class simple_resolver

source code

-
-    object --+    
-             |    
-etree.Resolver --+
-                 |
-                ETreeXMLSchemaResolversTestCase.simple_resolver
-
- -
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - schema)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
resolve(self, - url, - id, - context)
- Override this method to resolve an external source by -system_url and public_id. The third argument is an -opaque context object.
- source code - -
- -
-

Inherited from etree.Resolver: - __new__, - resolve_empty, - resolve_file, - resolve_filename, - resolve_string -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - schema) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

resolve(self, - url, - id, - context) -

-
source code  -
- -

Override this method to resolve an external source by -system_url and public_id. The third argument is an -opaque context object.

-

Return the result of one of the resolve_*() methods.

-
-
Overrides: - etree.Resolver.resolve -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html b/doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html deleted file mode 100644 index fa142dc7..00000000 --- a/doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html +++ /dev/null @@ -1,733 +0,0 @@ - - - - - lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xmlschema :: - Class ETreeXMLSchemaTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeXMLSchemaTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeXMLSchemaTestCase
-
- -
- - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_xmlschema(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_error_log(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_error_log_path(self)
- We don't have a guarantee that there will always be a path -for a _LogEntry object (or even a node for which to determina -a path), but at least when this test was created schema validation -errors always got a node and an XPath value.
- source code - -
- -
-   - - - - - - -
test_xmlschema_default_attributes(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_parse(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_parse_default_attributes(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_parse_default_attributes_schema_config(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_parse_fixed_attributes(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_stringio(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_iterparse(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_iterparse_incomplete(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_iterparse_fail(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_elementtree_error(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_comment_error(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_illegal_validation_error(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_invalid_schema1(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_invalid_schema2(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_file(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_import_file(self) - source code - -
- -
-   - - - - - - -
test_xmlschema_shortcut(self) - source code - -
- -
-   - - - - - - -
test_create_from_partial_doc(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

test_xmlschema_error_log_path(self) -

-
source code  -
- -
-We don't have a guarantee that there will always be a path
-for a _LogEntry object (or even a node for which to determina
-a path), but at least when this test was created schema validation
-errors always got a node and an XPath value. If that ever changes,
-we can modify this test to something like:
-    self.assertTrue(error_path is None or tree_path == error_path)
-That way, we can at least verify that if we did get a path value
-it wasn't bogus.
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xpathevaluator-module.html b/doc/html/api/lxml.tests.test_xpathevaluator-module.html deleted file mode 100644 index d8dab49a..00000000 --- a/doc/html/api/lxml.tests.test_xpathevaluator-module.html +++ /dev/null @@ -1,547 +0,0 @@ - - - - - lxml.tests.test_xpathevaluator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xpathevaluator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_xpathevaluator

source code

-Test cases related to XPath evaluation and the XPath class - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - ETreeXPathTestCase
- XPath tests etree -
-   - - ETreeXPathClassTestCase
- Tests for the XPath class -
-   - - ETreeXPathExsltTestCase
- Tests for the EXSLT support in XPath (requires libxslt 1.1.25+) -
-   - - ETreeETXPathClassTestCase
- Tests for the ETXPath class -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
tag(elem) - source code - -
- -
-   - - - - - - -
tag_or_value(elem) - source code - -
- -
-   - - - - - - -
stringTest(ctxt, - s1) - source code - -
- -
-   - - - - - - -
stringListTest(ctxt, - s1) - source code - -
- -
-   - - - - - - -
floatTest(ctxt, - f1) - source code - -
- -
-   - - - - - - -
booleanTest(ctxt, - b1) - source code - -
- -
-   - - - - - - -
setTest(ctxt, - st1) - source code - -
- -
-   - - - - - - -
setTest2(ctxt, - st1) - source code - -
- -
-   - - - - - - -
argsTest1(ctxt, - s, - f, - b, - st) - source code - -
- -
-   - - - - - - -
argsTest2(ctxt, - st1, - st2) - source code - -
- -
-   - - - - - - -
resultTypesTest(ctxt) - source code - -
- -
-   - - - - - - -
resultTypesTest2(ctxt) - source code - -
- -
-   - - - - - - -
xpath()
- Test xpath extension functions.
- source code - -
- -
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - SAMPLE_XML = <lxml.etree._ElementTree object> -
-   - - uri = 'http://www.example.com/' -
-   - - extension = {(None, 'argsTest1'): <__builtin__.function object... -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
- -
- -
-

extension

- -
-
-
-
Value:
-
-{(None, 'argsTest1'): <__builtin__.function object>,
- (None, 'argsTest2'): <__builtin__.function object>,
- (None, 'booleanTest'): <__builtin__.function object>,
- (None, 'floatTest'): <__builtin__.function object>,
- (None, 'resultTypesTest'): <__builtin__.function object>,
- (None, 'resultTypesTest2'): <__builtin__.function object>,
- (None, 'setTest'): <__builtin__.function object>,
- (None, 'setTest2'): <__builtin__.function object>,
-...
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xpathevaluator-pysrc.html b/doc/html/api/lxml.tests.test_xpathevaluator-pysrc.html deleted file mode 100644 index b90704e2..00000000 --- a/doc/html/api/lxml.tests.test_xpathevaluator-pysrc.html +++ /dev/null @@ -1,2022 +0,0 @@ - - - - - lxml.tests.test_xpathevaluator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xpathevaluator - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_xpathevaluator

-
-  1  # -*- coding: utf-8 -*- 
-  2   
-  3  """ 
-  4  Test cases related to XPath evaluation and the XPath class 
-  5  """ 
-  6   
-  7  import unittest, sys, os.path 
-  8   
-  9  this_dir = os.path.dirname(__file__) 
- 10  if this_dir not in sys.path: 
- 11      sys.path.insert(0, this_dir) # needed for Py3 
- 12   
- 13  from common_imports import etree, HelperTestCase, _bytes, BytesIO 
- 14  from common_imports import doctest, make_doctest 
- 15   
-
16 -class ETreeXPathTestCase(HelperTestCase): -
17 """XPath tests etree""" - 18 -
19 - def test_xpath_boolean(self): -
20 tree = self.parse('<a><b></b><b></b></a>') - 21 self.assertTrue(tree.xpath('boolean(/a/b)')) - 22 self.assertTrue(not tree.xpath('boolean(/a/c)')) -
23 -
24 - def test_xpath_number(self): -
25 tree = self.parse('<a>1</a>') - 26 self.assertEqual(1., - 27 tree.xpath('number(/a)')) - 28 tree = self.parse('<a>A</a>') - 29 actual = str(tree.xpath('number(/a)')) - 30 expected = ['nan', '1.#qnan', 'nanq'] - 31 if not actual.lower() in expected: - 32 self.fail('Expected a NAN value, got %s' % actual) -
33 -
34 - def test_xpath_string(self): -
35 tree = self.parse('<a>Foo</a>') - 36 self.assertEqual('Foo', - 37 tree.xpath('string(/a/text())')) -
38 -
39 - def test_xpath_document_root(self): -
40 tree = self.parse('<a><b/></a>') - 41 self.assertEqual([], - 42 tree.xpath('/')) -
43 -
44 - def test_xpath_namespace(self): -
45 tree = self.parse('<a xmlns="test" xmlns:p="myURI"/>') - 46 self.assertTrue((None, "test") in tree.xpath('namespace::*')) - 47 self.assertTrue(('p', 'myURI') in tree.xpath('namespace::*')) -
48 -
49 - def test_xpath_namespace_empty(self): -
50 tree = self.parse('<a/>') - 51 self.assertEqual([('xml', 'http://www.w3.org/XML/1998/namespace')], - 52 tree.xpath('namespace::*')) -
53 -
54 - def test_xpath_list_elements(self): -
55 tree = self.parse('<a><b>Foo</b><b>Bar</b></a>') - 56 root = tree.getroot() - 57 self.assertEqual([root[0], root[1]], - 58 tree.xpath('/a/b')) -
59 -
60 - def test_xpath_list_nothing(self): -
61 tree = self.parse('<a><b/></a>') - 62 self.assertEqual([], - 63 tree.xpath('/a/c')) - 64 # this seems to pass a different code path, also should return nothing - 65 self.assertEqual([], - 66 tree.xpath('/a/c/text()')) -
67 -
68 - def test_xpath_list_text(self): -
69 tree = self.parse('<a><b>Foo</b><b>Bar</b></a>') - 70 root = tree.getroot() - 71 self.assertEqual(['Foo', 'Bar'], - 72 tree.xpath('/a/b/text()')) -
73 -
75 tree = self.parse('<a><b>FooBar</b><b>BarFoo</b></a>') - 76 root = tree.getroot() - 77 self.assertEqual(['FooBar', 'BarFoo'], - 78 tree.xpath('/a/b/text()')) - 79 self.assertEqual([root[0], root[1]], - 80 [r.getparent() for r in tree.xpath('/a/b/text()')]) -
81 -
83 tree = self.parse('<a><b>FooBar</b><b>BarFoo</b></a>') - 84 root = tree.getroot() - 85 self.assertEqual(['FooBar', 'BarFoo'], - 86 tree.xpath('/a/b/text()', smart_strings=True)) - 87 self.assertEqual([root[0], root[1]], - 88 [r.getparent() for r in - 89 tree.xpath('/a/b/text()', smart_strings=True)]) - 90 self.assertEqual([None, None], - 91 [r.attrname for r in - 92 tree.xpath('/a/b/text()', smart_strings=True)]) - 93 - 94 self.assertEqual(['FooBar', 'BarFoo'], - 95 tree.xpath('/a/b/text()', smart_strings=False)) - 96 self.assertEqual([False, False], - 97 [hasattr(r, 'getparent') for r in - 98 tree.xpath('/a/b/text()', smart_strings=False)]) - 99 self.assertEqual([None, None], -100 [r.attrname for r in -101 tree.xpath('/a/b/text()', smart_strings=True)]) -
102 -
104 xml = _bytes('<a><b>FooBar\\u0680\\u3120</b><b>BarFoo\\u0680\\u3120</b></a>').decode("unicode_escape") -105 tree = self.parse(xml.encode('utf-8')) -106 root = tree.getroot() -107 self.assertEqual([_bytes('FooBar\\u0680\\u3120').decode("unicode_escape"), -108 _bytes('BarFoo\\u0680\\u3120').decode("unicode_escape")], -109 tree.xpath('/a/b/text()')) -110 self.assertEqual([root[0], root[1]], -111 [r.getparent() for r in tree.xpath('/a/b/text()')]) -
112 -
113 - def test_xpath_list_attribute(self): -
114 tree = self.parse('<a b="B" c="C"/>') -115 self.assertEqual(['B'], -116 tree.xpath('/a/@b')) -
117 -
119 tree = self.parse('<a b="BaSdFgHjKl" c="CqWeRtZuI"/>') -120 results = tree.xpath('/a/@c') -121 self.assertEqual(1, len(results)) -122 self.assertEqual('CqWeRtZuI', results[0]) -123 self.assertEqual(tree.getroot().tag, results[0].getparent().tag) -
124 -
126 tree = self.parse('<a b="BaSdFgHjKl" c="CqWeRtZuI"/>') -127 -128 results = tree.xpath('/a/@c', smart_strings=True) -129 self.assertEqual(1, len(results)) -130 self.assertEqual('CqWeRtZuI', results[0]) -131 self.assertEqual('c', results[0].attrname) -132 self.assertEqual(tree.getroot().tag, results[0].getparent().tag) -133 -134 results = tree.xpath('/a/@c', smart_strings=False) -135 self.assertEqual(1, len(results)) -136 self.assertEqual('CqWeRtZuI', results[0]) -137 self.assertEqual(False, hasattr(results[0], 'getparent')) -138 self.assertEqual(False, hasattr(results[0], 'attrname')) -
139 -
141 xml_data = ''' -142 <table> -143 <item xml:id="k1"><value>v1</value></item> -144 <item xml:id="k2"><value>v2</value></item> -145 </table> -146 ''' -147 -148 def lookup(dummy, id): -149 return etree.XML(xml_data).xpath('id(%r)' % id) -
150 functions = {(None, 'lookup') : lookup} -151 -152 root = etree.XML('<dummy/>') -153 values = root.xpath("lookup('k1')/value/text()", -154 extensions=functions) -155 self.assertEqual(['v1'], values) -156 self.assertEqual('value', values[0].getparent().tag) -
157 -
158 - def test_xpath_list_comment(self): -
159 tree = self.parse('<a><!-- Foo --></a>') -160 self.assertEqual(['<!-- Foo -->'], -161 list(map(repr, tree.xpath('/a/node()')))) -
162 -
163 - def test_rel_xpath_boolean(self): -
164 root = etree.XML('<a><b><c/></b></a>') -165 el = root[0] -166 self.assertTrue(el.xpath('boolean(c)')) -167 self.assertTrue(not el.xpath('boolean(d)')) -
168 -
170 tree = self.parse('<a><c><b>Foo</b><b>Bar</b></c><c><b>Hey</b></c></a>') -171 root = tree.getroot() -172 c = root[0] -173 self.assertEqual([c[0], c[1]], -174 c.xpath('b')) -175 self.assertEqual([c[0], c[1], root[1][0]], -176 c.xpath('//b')) -
177 -
178 - def test_xpath_ns(self): -
179 tree = self.parse('<a xmlns="uri:a"><b></b></a>') -180 root = tree.getroot() -181 self.assertEqual( -182 [root[0]], -183 tree.xpath('//foo:b', namespaces={'foo': 'uri:a'})) -184 self.assertEqual( -185 [], -186 tree.xpath('//foo:b', namespaces={'foo': 'uri:c'})) -187 self.assertEqual( -188 [root[0]], -189 root.xpath('//baz:b', namespaces={'baz': 'uri:a'})) -
190 -
191 - def test_xpath_ns_none(self): -
192 tree = self.parse('<a xmlns="uri:a"><b></b></a>') -193 root = tree.getroot() -194 self.assertRaises( -195 TypeError, -196 root.xpath, '//b', namespaces={None: 'uri:a'}) -
197 -
198 - def test_xpath_ns_empty(self): -
199 tree = self.parse('<a xmlns="uri:a"><b></b></a>') -200 root = tree.getroot() -201 self.assertRaises( -202 TypeError, -203 root.xpath, '//b', namespaces={'': 'uri:a'}) -
204 -
205 - def test_xpath_error(self): -
206 tree = self.parse('<a/>') -207 self.assertRaises(etree.XPathEvalError, tree.xpath, '\\fad') -
208 -
209 - def test_xpath_class_error(self): -
210 self.assertRaises(SyntaxError, etree.XPath, '\\fad') -211 self.assertRaises(etree.XPathSyntaxError, etree.XPath, '\\fad') -
212 -
213 - def test_xpath_prefix_error(self): -
214 tree = self.parse('<a/>') -215 self.assertRaises(etree.XPathEvalError, tree.xpath, '/fa:d') -
216 -
218 tree = self.parse('<a/>') -219 xpath = etree.XPath("/fa:d") -220 self.assertRaises(etree.XPathEvalError, xpath, tree) -
221 -
222 - def test_elementtree_getpath(self): -
223 a = etree.Element("a") -224 b = etree.SubElement(a, "b") -225 c = etree.SubElement(a, "c") -226 d1 = etree.SubElement(c, "d") -227 d2 = etree.SubElement(c, "d") -228 -229 tree = etree.ElementTree(a) -230 self.assertEqual('/a/c/d', -231 tree.getpath(d2)[:6]) -232 self.assertEqual([d2], -233 tree.xpath(tree.getpath(d2))) -
234 -
236 a = etree.Element("a") -237 b = etree.SubElement(a, "b") -238 c = etree.SubElement(a, "c") -239 d1 = etree.SubElement(c, "d") -240 d2 = etree.SubElement(c, "d") -241 -242 tree = etree.ElementTree(c) -243 self.assertEqual('/c/d', -244 tree.getpath(d2)[:4]) -245 self.assertEqual([d2], -246 tree.xpath(tree.getpath(d2))) -
247 -
248 - def test_xpath_evaluator(self): -
249 tree = self.parse('<a><b><c></c></b></a>') -250 e = etree.XPathEvaluator(tree) -251 root = tree.getroot() -252 self.assertEqual( -253 [root], -254 e('//a')) -
255 -
256 - def test_xpath_evaluator_tree(self): -
257 tree = self.parse('<a><b><c></c></b></a>') -258 child_tree = etree.ElementTree(tree.getroot()[0]) -259 e = etree.XPathEvaluator(child_tree) -260 self.assertEqual( -261 [], -262 e('a')) -263 root = child_tree.getroot() -264 self.assertEqual( -265 [root[0]], -266 e('c')) -
267 -
269 tree = self.parse('<a><b><c></c></b></a>') -270 child_tree = etree.ElementTree(tree.getroot()[0]) -271 e = etree.XPathEvaluator(child_tree) -272 self.assertEqual( -273 [], -274 e('/a')) -275 root = child_tree.getroot() -276 self.assertEqual( -277 [root], -278 e('/b')) -279 self.assertEqual( -280 [], -281 e('/c')) -
282 -
284 tree = self.parse('<a><b><c></c></b></a>') -285 root = tree.getroot() -286 e = etree.XPathEvaluator(root[0]) -287 self.assertEqual( -288 [root[0][0]], -289 e('c')) -
290 -
291 - def test_xpath_extensions(self): -
292 def foo(evaluator, a): -293 return 'hello %s' % a -
294 extension = {(None, 'foo'): foo} -295 tree = self.parse('<a><b></b></a>') -296 e = etree.XPathEvaluator(tree, extensions=[extension]) -297 self.assertEqual( -298 "hello you", e("foo('you')")) -299 -
301 def foo(evaluator, a, b): -302 return "hello %s and %s" % (a, b) -
303 extension = {(None, 'foo'): foo} -304 tree = self.parse('<a><b></b></a>') -305 e = etree.XPathEvaluator(tree, extensions=[extension]) -306 self.assertRaises(TypeError, e, "foo('you')") -307 -
309 def foo(evaluator, a): -310 return 1/0 -
311 extension = {(None, 'foo'): foo} -312 tree = self.parse('<a/>') -313 e = etree.XPathEvaluator(tree, extensions=[extension]) -314 self.assertRaises(ZeroDivisionError, e, "foo('test')") -315 -
317 def f(evaluator, arg): -318 r = etree.Element('results') -319 b = etree.SubElement(r, 'result') -320 b.text = 'Hoi' -321 b = etree.SubElement(r, 'result') -322 b.text = 'Dag' -323 return r -
324 -325 x = self.parse('<a/>') -326 e = etree.XPathEvaluator(x, extensions=[{(None, 'foo'): f}]) -327 r = e("foo('World')/result") -328 self.assertEqual(2, len(r)) -329 self.assertEqual('Hoi', r[0].text) -330 self.assertEqual('Dag', r[1].text) -331 -
333 def f(evaluator, nodes): -334 r = etree.SubElement(nodes[0], 'results') -335 b = etree.SubElement(r, 'result') -336 b.text = 'Hoi' -337 b = etree.SubElement(r, 'result') -338 b.text = 'Dag' -339 return r -
340 -341 x = self.parse('<a/>') -342 e = etree.XPathEvaluator(x, extensions=[{(None, 'foo'): f}]) -343 r = e("foo(/*)/result") -344 self.assertEqual(2, len(r)) -345 self.assertEqual('Hoi', r[0].text) -346 self.assertEqual('Dag', r[1].text) -347 -
349 def f(evaluator, nodes): -350 r = etree.Element('results') -351 b = etree.SubElement(r, 'result') -352 b.text = 'Hoi' -353 b = etree.SubElement(r, 'result') -354 b.text = 'Dag' -355 r.append(nodes[0]) -356 return r -
357 -358 x = self.parse('<result>Honk</result>') -359 e = etree.XPathEvaluator(x, extensions=[{(None, 'foo'): f}]) -360 r = e("foo(/*)/result") -361 self.assertEqual(3, len(r)) -362 self.assertEqual('Hoi', r[0].text) -363 self.assertEqual('Dag', r[1].text) -364 self.assertEqual('Honk', r[2].text) -365 -
366 - def test_xpath_context_node(self): -
367 tree = self.parse('<root><a/><b><c/></b></root>') -368 -369 check_call = [] -370 def check_context(ctxt, nodes): -371 self.assertEqual(len(nodes), 1) -372 check_call.append(nodes[0].tag) -373 self.assertEqual(ctxt.context_node, nodes[0]) -374 return True -
375 -376 find = etree.XPath("//*[p:foo(.)]", -377 namespaces={'p' : 'ns'}, -378 extensions=[{('ns', 'foo') : check_context}]) -379 find(tree) -380 -381 check_call.sort() -382 self.assertEqual(check_call, ["a", "b", "c", "root"]) -383 -
385 tree = self.parse('<root><a/><b><c/></b></root>') -386 -387 check_call = {} -388 def check_context(ctxt, nodes): -389 self.assertEqual(len(nodes), 1) -390 tag = nodes[0].tag -391 # empty during the "b" call, a "b" during the "c" call -392 check_call[tag] = ctxt.eval_context.get("b") -393 ctxt.eval_context[tag] = tag -394 return True -
395 -396 find = etree.XPath("//b[p:foo(.)]/c[p:foo(.)]", -397 namespaces={'p' : 'ns'}, -398 extensions=[{('ns', 'foo') : check_context}]) -399 result = find(tree) -400 -401 self.assertEqual(result, [tree.getroot()[1][0]]) -402 self.assertEqual(check_call, {'b':None, 'c':'b'}) -403 -
405 tree = self.parse('<root><a/><b><c/></b></root>') -406 -407 check_call = {} -408 def check_context(ctxt): -409 check_call["done"] = True -410 # context must be empty for each new evaluation -411 self.assertEqual(len(ctxt.eval_context), 0) -412 ctxt.eval_context["test"] = True -413 return True -
414 -415 find = etree.XPath("//b[p:foo()]", -416 namespaces={'p' : 'ns'}, -417 extensions=[{('ns', 'foo') : check_context}]) -418 result = find(tree) -419 -420 self.assertEqual(result, [tree.getroot()[1]]) -421 self.assertEqual(check_call["done"], True) -422 -423 check_call.clear() -424 find = etree.XPath("//b[p:foo()]", -425 namespaces={'p' : 'ns'}, -426 extensions=[{('ns', 'foo') : check_context}]) -427 result = find(tree) -428 -429 self.assertEqual(result, [tree.getroot()[1]]) -430 self.assertEqual(check_call["done"], True) -431 -
432 - def test_xpath_variables(self): -
433 x = self.parse('<a attr="true"/>') -434 e = etree.XPathEvaluator(x) -435 -436 expr = "/a[@attr=$aval]" -437 r = e(expr, aval=1) -438 self.assertEqual(0, len(r)) -439 -440 r = e(expr, aval="true") -441 self.assertEqual(1, len(r)) -442 self.assertEqual("true", r[0].get('attr')) -443 -444 r = e(expr, aval=True) -445 self.assertEqual(1, len(r)) -446 self.assertEqual("true", r[0].get('attr')) -
447 -
449 x = self.parse('<a attr="true"/>') -450 e = etree.XPathEvaluator(x) -451 -452 element = etree.Element("test-el") -453 etree.SubElement(element, "test-sub") -454 expr = "$value" -455 r = e(expr, value=element) -456 self.assertEqual(1, len(r)) -457 self.assertEqual(element.tag, r[0].tag) -458 self.assertEqual(element[0].tag, r[0][0].tag) -
459 -
460 - def test_xpath_extensions_mix(self): -
461 x = self.parse('<a attr="true"><test/></a>') -462 -463 class LocalException(Exception): -464 pass -
465 -466 def foo(evaluator, a, varval): -467 etree.Element("DUMMY") -468 if varval == 0: -469 raise LocalException -470 elif varval == 1: -471 return () -472 elif varval == 2: -473 return None -474 elif varval == 3: -475 return a[0][0] -476 a = a[0] -477 if a.get("attr") == str(varval): -478 return a -479 else: -480 return etree.Element("NODE") -481 -482 extension = {(None, 'foo'): foo} -483 e = etree.XPathEvaluator(x, extensions=[extension]) -484 del x -485 -486 self.assertRaises(LocalException, e, "foo(., 0)") -487 self.assertRaises(LocalException, e, "foo(., $value)", value=0) -488 -489 r = e("foo(., $value)", value=1) -490 self.assertEqual(len(r), 0) -491 -492 r = e("foo(., 1)") -493 self.assertEqual(len(r), 0) -494 -495 r = e("foo(., $value)", value=2) -496 self.assertEqual(len(r), 0) -497 -498 r = e("foo(., $value)", value=3) -499 self.assertEqual(len(r), 1) -500 self.assertEqual(r[0].tag, "test") -501 -502 r = e("foo(., $value)", value="false") -503 self.assertEqual(len(r), 1) -504 self.assertEqual(r[0].tag, "NODE") -505 -506 r = e("foo(., 'false')") -507 self.assertEqual(len(r), 1) -508 self.assertEqual(r[0].tag, "NODE") -509 -510 r = e("foo(., 'true')") -511 self.assertEqual(len(r), 1) -512 self.assertEqual(r[0].tag, "a") -513 self.assertEqual(r[0][0].tag, "test") -514 -515 r = e("foo(., $value)", value="true") -516 self.assertEqual(len(r), 1) -517 self.assertEqual(r[0].tag, "a") -518 -519 self.assertRaises(LocalException, e, "foo(., 0)") -520 self.assertRaises(LocalException, e, "foo(., $value)", value=0) -521 -522 -
523 -class ETreeXPathClassTestCase(HelperTestCase): -
524 "Tests for the XPath class" -
525 - def test_xpath_compile_doc(self): -
526 x = self.parse('<a attr="true"/>') -527 -528 expr = etree.XPath("/a[@attr != 'true']") -529 r = expr(x) -530 self.assertEqual(0, len(r)) -531 -532 expr = etree.XPath("/a[@attr = 'true']") -533 r = expr(x) -534 self.assertEqual(1, len(r)) -535 -536 expr = etree.XPath( expr.path ) -537 r = expr(x) -538 self.assertEqual(1, len(r)) -
539 -
540 - def test_xpath_compile_element(self): -
541 x = self.parse('<a><b/><c/></a>') -542 root = x.getroot() -543 -544 expr = etree.XPath("./b") -545 r = expr(root) -546 self.assertEqual(1, len(r)) -547 self.assertEqual('b', r[0].tag) -548 -549 expr = etree.XPath("./*") -550 r = expr(root) -551 self.assertEqual(2, len(r)) -
552 -
553 - def test_xpath_compile_vars(self): -
554 x = self.parse('<a attr="true"/>') -555 -556 expr = etree.XPath("/a[@attr=$aval]") -557 r = expr(x, aval=False) -558 self.assertEqual(0, len(r)) -559 -560 r = expr(x, aval=True) -561 self.assertEqual(1, len(r)) -
562 -
563 - def test_xpath_compile_error(self): -
564 self.assertRaises(SyntaxError, etree.XPath, '\\fad') -
565 -
567 self.assertRaises(ValueError, etree.XPath('*'), etree.ElementTree()) -
568 -569 -
570 -class ETreeXPathExsltTestCase(HelperTestCase): -
571 "Tests for the EXSLT support in XPath (requires libxslt 1.1.25+)" -572 -573 NSMAP = dict( -574 date = "http://exslt.org/dates-and-times", -575 math = "http://exslt.org/math", -576 set = "http://exslt.org/sets", -577 str = "http://exslt.org/strings", -578 ) -579 -
581 tree = self.parse('<a><b>2009-11-12</b><b>2008-12-11</b></a>') -582 -583 match_dates = tree.xpath('//b[date:year(string()) = 2009]', -584 namespaces=self.NSMAP) -585 self.assertTrue(match_dates, str(match_dates)) -586 self.assertEqual(len(match_dates), 1, str(match_dates)) -587 self.assertEqual(match_dates[0].text, '2009-11-12') -
588 -
590 tree = self.parse('<a><b>2009-11-12</b><b>2008-12-11</b></a>') -591 -592 aligned_date = tree.xpath( -593 'str:align(string(//b[1]), "%s", "center")' % ('-'*20), -594 namespaces=self.NSMAP) -595 self.assertTrue(aligned_date, str(aligned_date)) -596 self.assertEqual(aligned_date, '-----2009-11-12-----') -
597 -598 -
599 -class ETreeETXPathClassTestCase(HelperTestCase): -
600 "Tests for the ETXPath class" -
601 - def test_xpath_compile_ns(self): -
602 x = self.parse('<a><b xmlns="nsa"/><b xmlns="nsb"/></a>') -603 -604 expr = etree.ETXPath("/a/{nsa}b") -605 r = expr(x) -606 self.assertEqual(1, len(r)) -607 self.assertEqual('{nsa}b', r[0].tag) -608 -609 expr = etree.ETXPath("/a/{nsb}b") -610 r = expr(x) -611 self.assertEqual(1, len(r)) -612 self.assertEqual('{nsb}b', r[0].tag) -
613 -614 # disabled this test as non-ASCII characters in namespace URIs are -615 # not acceptable -
617 x = self.parse(_bytes('<a><b xmlns="http://nsa/\\uf8d2"/><b xmlns="http://nsb/\\uf8d1"/></a>' -618 ).decode("unicode_escape")) -619 -620 expr = etree.ETXPath(_bytes("/a/{http://nsa/\\uf8d2}b").decode("unicode_escape")) -621 r = expr(x) -622 self.assertEqual(1, len(r)) -623 self.assertEqual(_bytes('{http://nsa/\\uf8d2}b').decode("unicode_escape"), r[0].tag) -624 -625 expr = etree.ETXPath(_bytes("/a/{http://nsb/\\uf8d1}b").decode("unicode_escape")) -626 r = expr(x) -627 self.assertEqual(1, len(r)) -628 self.assertEqual(_bytes('{http://nsb/\\uf8d1}b').decode("unicode_escape"), r[0].tag) -
629 -630 SAMPLE_XML = etree.parse(BytesIO(""" -631 <body> -632 <tag>text</tag> -633 <section> -634 <tag>subtext</tag> -635 </section> -636 <tag /> -637 <tag /> -638 </body> -639 """)) -640 -
641 -def tag(elem): -
642 return elem.tag -
643 -
644 -def tag_or_value(elem): -
645 return getattr(elem, 'tag', elem) -
646 -
647 -def stringTest(ctxt, s1): -
648 return "Hello "+s1 -
649 -
650 -def stringListTest(ctxt, s1): -
651 return ["Hello "] + list(s1) + ["!"] -
652 -
653 -def floatTest(ctxt, f1): -
654 return f1+4 -
655 -
656 -def booleanTest(ctxt, b1): -
657 return not b1 -
658 -
659 -def setTest(ctxt, st1): -
660 return st1[0] -
661 -
662 -def setTest2(ctxt, st1): -
663 return st1[0:2] -
664 -
665 -def argsTest1(ctxt, s, f, b, st): -
666 return ", ".join(map(str, (s, f, b, list(map(tag, st))))) -
667 -
668 -def argsTest2(ctxt, st1, st2): -
669 st1.extend(st2) -670 return st1 -
671 -
672 -def resultTypesTest(ctxt): -
673 return [None,None] -
674 -
675 -def resultTypesTest2(ctxt): -
676 return resultTypesTest -
677 -678 uri = "http://www.example.com/" -679 -680 extension = {(None, 'stringTest'): stringTest, -681 (None, 'stringListTest'): stringListTest, -682 (None, 'floatTest'): floatTest, -683 (None, 'booleanTest'): booleanTest, -684 (None, 'setTest'): setTest, -685 (None, 'setTest2'): setTest2, -686 (None, 'argsTest1'): argsTest1, -687 (None, 'argsTest2'): argsTest2, -688 (None, 'resultTypesTest'): resultTypesTest, -689 (None, 'resultTypesTest2'): resultTypesTest2,} -690 -
691 -def xpath(): -
692 """ -693 Test xpath extension functions. -694 -695 >>> root = SAMPLE_XML -696 >>> e = etree.XPathEvaluator(root, extensions=[extension]) -697 >>> e("stringTest('you')") -698 'Hello you' -699 >>> e(_bytes("stringTest('\\\\xe9lan')").decode("unicode_escape")) -700 u'Hello \\xe9lan' -701 >>> e("stringTest('you','there')") #doctest: +ELLIPSIS -702 Traceback (most recent call last): -703 ... -704 TypeError: stringTest() takes... 2 ...arguments ... -705 >>> e("floatTest(2)") -706 6.0 -707 >>> e("booleanTest(true())") -708 False -709 >>> list(map(tag, e("setTest(/body/tag)"))) -710 ['tag'] -711 >>> list(map(tag, e("setTest2(/body/*)"))) -712 ['tag', 'section'] -713 >>> list(map(tag_or_value, e("stringListTest(/body/tag)"))) -714 ['Hello ', 'tag', 'tag', 'tag', '!'] -715 >>> e("argsTest1('a',1.5,true(),/body/tag)") -716 "a, 1.5, True, ['tag', 'tag', 'tag']" -717 >>> list(map(tag, e("argsTest2(/body/tag, /body/section)"))) -718 ['tag', 'section', 'tag', 'tag'] -719 >>> e("resultTypesTest()") -720 Traceback (most recent call last): -721 ... -722 XPathResultError: This is not a supported node-set result: None -723 >>> try: -724 ... e("resultTypesTest2()") -725 ... except etree.XPathResultError: -726 ... print("Got error") -727 Got error -728 """ -
729 -730 if sys.version_info[0] >= 3: -731 xpath.__doc__ = xpath.__doc__.replace(" u'", " '") -732 xpath.__doc__ = xpath.__doc__.replace(" XPathResultError", -733 " lxml.etree.XPathResultError") -734 xpath.__doc__ = xpath.__doc__.replace(" exactly 2 arguments", -735 " exactly 2 positional arguments") -736 -
737 -def test_suite(): -
738 suite = unittest.TestSuite() -739 suite.addTests([unittest.makeSuite(ETreeXPathTestCase)]) -740 suite.addTests([unittest.makeSuite(ETreeXPathClassTestCase)]) -741 if etree.LIBXSLT_COMPILED_VERSION >= (1,1,25): -742 suite.addTests([unittest.makeSuite(ETreeXPathExsltTestCase)]) -743 suite.addTests([unittest.makeSuite(ETreeETXPathClassTestCase)]) -744 suite.addTests([doctest.DocTestSuite()]) -745 suite.addTests( -746 [make_doctest('../../../doc/xpathxslt.txt')]) -747 return suite -
748 -749 if __name__ == '__main__': -750 print('to test use test.py %s' % __file__) -751 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html b/doc/html/api/lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html deleted file mode 100644 index 3375776a..00000000 --- a/doc/html/api/lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html +++ /dev/null @@ -1,379 +0,0 @@ - - - - - lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xpathevaluator :: - Class ETreeETXPathClassTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeETXPathClassTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeETXPathClassTestCase
-
- -
-Tests for the ETXPath class - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_xpath_compile_ns(self) - source code - -
- -
-   - - - - - - -
_test_xpath_compile_unicode(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html b/doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html deleted file mode 100644 index 2863483b..00000000 --- a/doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xpathevaluator :: - Class ETreeXPathClassTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeXPathClassTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeXPathClassTestCase
-
- -
-Tests for the XPath class - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_xpath_compile_doc(self) - source code - -
- -
-   - - - - - - -
test_xpath_compile_element(self) - source code - -
- -
-   - - - - - - -
test_xpath_compile_vars(self) - source code - -
- -
-   - - - - - - -
test_xpath_compile_error(self) - source code - -
- -
-   - - - - - - -
test_xpath_elementtree_error(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html b/doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html deleted file mode 100644 index ee442a21..00000000 --- a/doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html +++ /dev/null @@ -1,429 +0,0 @@ - - - - - lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xpathevaluator :: - Class ETreeXPathExsltTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeXPathExsltTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeXPathExsltTestCase
-
- -
-Tests for the EXSLT support in XPath (requires libxslt 1.1.25+) - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_xpath_exslt_functions_date(self) - source code - -
- -
-   - - - - - - -
test_xpath_exslt_functions_strings(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - NSMAP = {'date': 'http://exslt.org/dates-and-times', 'math': '... -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Class Variable Details[hide private]
-
- -
- -
-

NSMAP

- -
-
-
-
Value:
-
-{'date': 'http://exslt.org/dates-and-times',
- 'math': 'http://exslt.org/math',
- 'set': 'http://exslt.org/sets',
- 'str': 'http://exslt.org/strings'}
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html b/doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html deleted file mode 100644 index 72333c3e..00000000 --- a/doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html +++ /dev/null @@ -1,1051 +0,0 @@ - - - - - lxml.tests.test_xpathevaluator.ETreeXPathTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xpathevaluator :: - Class ETreeXPathTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeXPathTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeXPathTestCase
-
- -
-XPath tests etree - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_xpath_boolean(self) - source code - -
- -
-   - - - - - - -
test_xpath_number(self) - source code - -
- -
-   - - - - - - -
test_xpath_string(self) - source code - -
- -
-   - - - - - - -
test_xpath_document_root(self) - source code - -
- -
-   - - - - - - -
test_xpath_namespace(self) - source code - -
- -
-   - - - - - - -
test_xpath_namespace_empty(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_elements(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_nothing(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_text(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_text_parent(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_text_parent_no_smart_strings(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_unicode_text_parent(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_attribute(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_attribute_parent(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_attribute_parent_no_smart_strings(self) - source code - -
- -
-   - - - - - - -
test_xpath_text_from_other_document(self) - source code - -
- -
-   - - - - - - -
test_xpath_list_comment(self) - source code - -
- -
-   - - - - - - -
test_rel_xpath_boolean(self) - source code - -
- -
-   - - - - - - -
test_rel_xpath_list_elements(self) - source code - -
- -
-   - - - - - - -
test_xpath_ns(self) - source code - -
- -
-   - - - - - - -
test_xpath_ns_none(self) - source code - -
- -
-   - - - - - - -
test_xpath_ns_empty(self) - source code - -
- -
-   - - - - - - -
test_xpath_error(self) - source code - -
- -
-   - - - - - - -
test_xpath_class_error(self) - source code - -
- -
-   - - - - - - -
test_xpath_prefix_error(self) - source code - -
- -
-   - - - - - - -
test_xpath_class_prefix_error(self) - source code - -
- -
-   - - - - - - -
test_elementtree_getpath(self) - source code - -
- -
-   - - - - - - -
test_elementtree_getpath_partial(self) - source code - -
- -
-   - - - - - - -
test_xpath_evaluator(self) - source code - -
- -
-   - - - - - - -
test_xpath_evaluator_tree(self) - source code - -
- -
-   - - - - - - -
test_xpath_evaluator_tree_absolute(self) - source code - -
- -
-   - - - - - - -
test_xpath_evaluator_element(self) - source code - -
- -
-   - - - - - - -
test_xpath_extensions(self) - source code - -
- -
-   - - - - - - -
test_xpath_extensions_wrong_args(self) - source code - -
- -
-   - - - - - - -
test_xpath_extensions_error(self) - source code - -
- -
-   - - - - - - -
test_xpath_extensions_nodes(self) - source code - -
- -
-   - - - - - - -
test_xpath_extensions_nodes_append(self) - source code - -
- -
-   - - - - - - -
test_xpath_extensions_nodes_append2(self) - source code - -
- -
-   - - - - - - -
test_xpath_context_node(self) - source code - -
- -
-   - - - - - - -
test_xpath_eval_context_propagation(self) - source code - -
- -
-   - - - - - - -
test_xpath_eval_context_clear(self) - source code - -
- -
-   - - - - - - -
test_xpath_variables(self) - source code - -
- -
-   - - - - - - -
test_xpath_variables_nodeset(self) - source code - -
- -
-   - - - - - - -
test_xpath_extensions_mix(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xslt-module.html b/doc/html/api/lxml.tests.test_xslt-module.html deleted file mode 100644 index 81388127..00000000 --- a/doc/html/api/lxml.tests.test_xslt-module.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - lxml.tests.test_xslt - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xslt - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module test_xslt

source code

-Test cases related to XSLT processing - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - unicode
- str(object='') -> string -
-   - - basestring
- str(object='') -> string -
-   - - ETreeXSLTTestCase
- XSLT tests etree -
-   - - ETreeEXSLTTestCase
- EXSLT tests -
-   - - ETreeXSLTExtFuncTestCase
- Tests for XPath extension functions in XSLT. -
-   - - ETreeXSLTExtElementTestCase
- Tests for extension elements in XSLT. -
-   - - Py3XSLTTestCase
- XSLT tests for etree under Python 3 -
- - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
test_suite() - source code - -
- -
- - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - this_dir = '/home/stefan/source/Python/lxml/lxml-release/src/l... -
-   - - is_python3 = False -
-   - - __package__ = 'lxml.tests' -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

this_dir

- -
-
-
-
Value:
-
-'/home/stefan/source/Python/lxml/lxml-release/src/lxml/tests'
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xslt-pysrc.html b/doc/html/api/lxml.tests.test_xslt-pysrc.html deleted file mode 100644 index bab2e461..00000000 --- a/doc/html/api/lxml.tests.test_xslt-pysrc.html +++ /dev/null @@ -1,4522 +0,0 @@ - - - - - lxml.tests.test_xslt - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xslt - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.tests.test_xslt

-
-   1  # -*- coding: utf-8 -*- 
-   2   
-   3  """ 
-   4  Test cases related to XSLT processing 
-   5  """ 
-   6   
-   7  import io 
-   8  import sys 
-   9  import copy 
-  10  import gzip 
-  11  import os.path 
-  12  import unittest 
-  13  import contextlib 
-  14  from textwrap import dedent 
-  15  from tempfile import NamedTemporaryFile 
-  16   
-  17  this_dir = os.path.dirname(__file__) 
-  18  if this_dir not in sys.path: 
-  19      sys.path.insert(0, this_dir) # needed for Py3 
-  20   
-  21  is_python3 = sys.version_info[0] >= 3 
-  22   
-  23  try: 
-  24      unicode 
-  25  except NameError: # Python 3 
-  26      unicode = str 
-  27   
-  28  try: 
-  29      basestring 
-  30  except NameError: # Python 3 
-  31      basestring = str 
-  32   
-  33  from .common_imports import etree, BytesIO, HelperTestCase, fileInTestDir 
-  34  from .common_imports import doctest, _bytes, _str, make_doctest, skipif 
-
35 - 36 -class ETreeXSLTTestCase(HelperTestCase): -
37 """XSLT tests etree""" - 38 -
39 - def test_xslt(self): -
40 tree = self.parse('<a><b>B</b><c>C</c></a>') - 41 style = self.parse('''\ - 42 <xsl:stylesheet version="1.0" - 43 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 44 <xsl:template match="*" /> - 45 <xsl:template match="/"> - 46 <foo><xsl:value-of select="/a/b/text()" /></foo> - 47 </xsl:template> - 48 </xsl:stylesheet>''') - 49 - 50 st = etree.XSLT(style) - 51 res = st(tree) - 52 self.assertEqual('''\ - 53 <?xml version="1.0"?> - 54 <foo>B</foo> - 55 ''', - 56 str(res)) -
57 -
59 self.assertRaises(ValueError, etree.XSLT, etree.ElementTree()) -
60 -
61 - def test_xslt_input_none(self): -
62 self.assertRaises(TypeError, etree.XSLT, None) -
63 -
65 style = self.parse('''\ - 66 <xsl:stylesheet version="1.0" - 67 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 68 <xsl:stylesheet /> - 69 </xsl:stylesheet>''') - 70 - 71 self.assertRaises( - 72 etree.XSLTParseError, etree.XSLT, style) -
73 -
74 - def test_xslt_copy(self): -
75 tree = self.parse('<a><b>B</b><c>C</c></a>') - 76 style = self.parse('''\ - 77 <xsl:stylesheet version="1.0" - 78 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 79 <xsl:template match="*" /> - 80 <xsl:template match="/"> - 81 <foo><xsl:value-of select="/a/b/text()" /></foo> - 82 </xsl:template> - 83 </xsl:stylesheet>''') - 84 - 85 transform = etree.XSLT(style) - 86 res = transform(tree) - 87 self.assertEqual('''\ - 88 <?xml version="1.0"?> - 89 <foo>B</foo> - 90 ''', - 91 str(res)) - 92 - 93 transform_copy = copy.deepcopy(transform) - 94 res = transform_copy(tree) - 95 self.assertEqual('''\ - 96 <?xml version="1.0"?> - 97 <foo>B</foo> - 98 ''', - 99 str(res)) - 100 - 101 transform = etree.XSLT(style) - 102 res = transform(tree) - 103 self.assertEqual('''\ - 104 <?xml version="1.0"?> - 105 <foo>B</foo> - 106 ''', - 107 str(res)) -
108 - 109 @contextlib.contextmanager -
110 - def _xslt_setup( - 111 self, encoding='UTF-16', expected_encoding=None, - 112 expected="""<?xml version="1.0" encoding="%(ENCODING)s"?><foo>\\uF8D2</foo>"""): -
113 tree = self.parse(_bytes('<a><b>\\uF8D2</b><c>\\uF8D2</c></a>' - 114 ).decode("unicode_escape")) - 115 style = self.parse('''\ - 116 <xsl:stylesheet version="1.0" - 117 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 118 <xsl:output encoding="%(ENCODING)s"/> - 119 <xsl:template match="/"> - 120 <foo><xsl:value-of select="/a/b/text()" /></foo> - 121 </xsl:template> - 122 </xsl:stylesheet>''' % {'ENCODING': encoding}) - 123 - 124 st = etree.XSLT(style) - 125 res = st(tree) - 126 expected = _bytes(dedent(expected).strip()).decode("unicode_escape").replace('\n', '') % { - 127 'ENCODING': expected_encoding or encoding, - 128 } - 129 - 130 data = [res] - 131 yield data - 132 self.assertEqual(expected, data[0].replace('\n', '')) -
133 -
134 - def test_xslt_utf8(self): -
135 with self._xslt_setup(encoding='UTF-8') as res: - 136 res[0] = unicode(bytes(res[0]), 'UTF-8') - 137 assert 'UTF-8' in res[0] -
138 -
139 - def test_xslt_encoding(self): -
140 with self._xslt_setup() as res: - 141 res[0] = unicode(bytes(res[0]), 'UTF-16') - 142 assert 'UTF-16' in res[0] -
143 -
144 - def test_xslt_encoding_override(self): -
145 with self._xslt_setup(encoding='UTF-8', expected_encoding='UTF-16') as res: - 146 f = BytesIO() - 147 res[0].write(f, encoding='UTF-16') - 148 if is_python3: - 149 output = str(f.getvalue(), 'UTF-16') - 150 else: - 151 output = unicode(str(f.getvalue()), 'UTF-16') - 152 res[0] = output.replace("'", '"') -
153 -
155 with self._xslt_setup() as res: - 156 f = BytesIO() - 157 res[0].write_output(f) - 158 res[0] = f.getvalue().decode('UTF-16') -
159 -
161 class Writer(object): - 162 def write(self, data): - 163 raise ValueError("FAILED!") -
164 - 165 try: - 166 with self._xslt_setup() as res: - 167 res[0].write_output(Writer()) - 168 except ValueError as exc: - 169 self.assertTrue("FAILED!" in str(exc), exc) - 170 else: - 171 self.assertTrue(False, "exception not raised") - 172 -
173 - def test_xslt_write_output_file(self): -
174 with self._xslt_setup() as res: - 175 f = NamedTemporaryFile(delete=False) - 176 try: - 177 try: - 178 res[0].write_output(f) - 179 finally: - 180 f.close() - 181 with io.open(f.name, encoding='UTF-16') as f: - 182 res[0] = f.read() - 183 finally: - 184 os.unlink(f.name) -
185 -
187 with self._xslt_setup() as res: - 188 f = NamedTemporaryFile(delete=False) - 189 try: - 190 try: - 191 res[0].write_output(f.name, compression=9) - 192 finally: - 193 f.close() - 194 with contextlib.closing(gzip.GzipFile(f.name)) as f: - 195 res[0] = f.read().decode("UTF-16") - 196 finally: - 197 os.unlink(f.name) -
198 -
199 - def test_xslt_unicode(self): -
200 expected = ''' - 201 <?xml version="1.0"?> - 202 <foo>\\uF8D2</foo> - 203 ''' - 204 with self._xslt_setup(expected=expected) as res: - 205 res[0] = unicode(res[0]) -
206 -
208 tree = self.parse(_bytes('<a><b>\\uF8D2</b><c>\\uF8D2</c></a>' - 209 ).decode("unicode_escape")) - 210 style = self.parse('''\ - 211 <xsl:stylesheet version="1.0" - 212 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 213 <xsl:output encoding="UTF-16" standalone="no"/> - 214 <xsl:template match="/"> - 215 <foo><xsl:value-of select="/a/b/text()" /></foo> - 216 </xsl:template> - 217 </xsl:stylesheet>''') - 218 - 219 st = etree.XSLT(style) - 220 res = st(tree) - 221 expected = _bytes('''\ - 222 <?xml version="1.0" standalone="no"?> - 223 <foo>\\uF8D2</foo> - 224 ''').decode("unicode_escape") - 225 self.assertEqual(expected, - 226 unicode(res)) -
227 -
228 - def test_xslt_input(self): -
229 style = self.parse('''\ - 230 <xsl:stylesheet version="1.0" - 231 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 232 <xsl:template match="*" /> - 233 <xsl:template match="/"> - 234 <foo><xsl:value-of select="/a/b/text()" /></foo> - 235 </xsl:template> - 236 </xsl:stylesheet>''') - 237 - 238 st = etree.XSLT(style) - 239 st = etree.XSLT(style.getroot()) -
240 -
241 - def test_xslt_input_partial_doc(self): -
242 style = self.parse('''\ - 243 <otherroot> - 244 <xsl:stylesheet version="1.0" - 245 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 246 <xsl:template match="*" /> - 247 <xsl:template match="/"> - 248 <foo><xsl:value-of select="/a/b/text()" /></foo> - 249 </xsl:template> - 250 </xsl:stylesheet> - 251 </otherroot>''') - 252 - 253 self.assertRaises(etree.XSLTParseError, etree.XSLT, style) - 254 root_node = style.getroot() - 255 self.assertRaises(etree.XSLTParseError, etree.XSLT, root_node) - 256 st = etree.XSLT(root_node[0]) -
257 -
258 - def test_xslt_broken(self): -
259 style = self.parse('''\ - 260 <xsl:stylesheet version="1.0" - 261 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 262 <xsl:foo /> - 263 </xsl:stylesheet>''') - 264 self.assertRaises(etree.XSLTParseError, - 265 etree.XSLT, style) -
266 -
267 - def test_xslt_parsing_error_log(self): -
268 tree = self.parse('<a/>') - 269 style = self.parse('''\ - 270 <xsl:stylesheet version="1.0" - 271 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 272 <xsl:foo /> - 273 </xsl:stylesheet>''') - 274 self.assertRaises(etree.XSLTParseError, - 275 etree.XSLT, style) - 276 exc = None - 277 try: - 278 etree.XSLT(style) - 279 except etree.XSLTParseError as e: - 280 exc = e - 281 else: - 282 self.assertFalse(True, "XSLT processing should have failed but didn't") - 283 self.assertTrue(exc is not None) - 284 self.assertTrue(len(exc.error_log)) - 285 for error in exc.error_log: - 286 self.assertTrue(':ERROR:XSLT:' in str(error)) -
287 -
288 - def test_xslt_apply_error_log(self): -
289 tree = self.parse('<a/>') - 290 style = self.parse('''\ - 291 <xsl:stylesheet version="1.0" - 292 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 293 <xsl:template match="a"> - 294 <xsl:copy> - 295 <xsl:message terminate="yes">FAIL</xsl:message> - 296 </xsl:copy> - 297 </xsl:template> - 298 </xsl:stylesheet>''') - 299 self.assertRaises(etree.XSLTApplyError, - 300 etree.XSLT(style), tree) - 301 - 302 transform = etree.XSLT(style) - 303 exc = None - 304 try: - 305 transform(tree) - 306 except etree.XSLTApplyError as e: - 307 exc = e - 308 else: - 309 self.assertFalse(True, "XSLT processing should have failed but didn't") - 310 - 311 self.assertTrue(exc is not None) - 312 self.assertTrue(len(exc.error_log)) - 313 self.assertEqual(len(transform.error_log), len(exc.error_log)) - 314 for error in exc.error_log: - 315 self.assertTrue(':ERROR:XSLT:' in str(error)) - 316 for error in transform.error_log: - 317 self.assertTrue(':ERROR:XSLT:' in str(error)) -
318 -
319 - def test_xslt_parameters(self): -
320 tree = self.parse('<a><b>B</b><c>C</c></a>') - 321 style = self.parse('''\ - 322 <xsl:stylesheet version="1.0" - 323 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 324 <xsl:template match="/"> - 325 <foo><xsl:value-of select="$bar" /></foo> - 326 </xsl:template> - 327 </xsl:stylesheet>''') - 328 - 329 st = etree.XSLT(style) - 330 res = st(tree, bar="'Bar'") - 331 self.assertEqual('''\ - 332 <?xml version="1.0"?> - 333 <foo>Bar</foo> - 334 ''', - 335 str(res)) -
336 -
337 - def test_xslt_string_parameters(self): -
338 tree = self.parse('<a><b>B</b><c>C</c></a>') - 339 style = self.parse('''\ - 340 <xsl:stylesheet version="1.0" - 341 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 342 <xsl:template match="/"> - 343 <foo><xsl:value-of select="$bar" /></foo> - 344 </xsl:template> - 345 </xsl:stylesheet>''') - 346 - 347 st = etree.XSLT(style) - 348 res = st(tree, bar=etree.XSLT.strparam('''it's me, "Bar"''')) - 349 self.assertEqual('''\ - 350 <?xml version="1.0"?> - 351 <foo>it's me, "Bar"</foo> - 352 ''', - 353 str(res)) -
354 -
355 - def test_xslt_parameter_invalid(self): -
356 tree = self.parse('<a><b>B</b><c>C</c></a>') - 357 style = self.parse('''\ - 358 <xsl:stylesheet version="1.0" - 359 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 360 <xsl:param name="bar"/> - 361 <xsl:template match="/"> - 362 <foo><xsl:value-of select="$bar" /></foo> - 363 </xsl:template> - 364 </xsl:stylesheet>''') - 365 - 366 st = etree.XSLT(style) - 367 res = self.assertRaises(etree.XSLTApplyError, - 368 st, tree, bar="<test/>") - 369 res = self.assertRaises(etree.XSLTApplyError, - 370 st, tree, bar="....") -
371 -
372 - def test_xslt_parameter_missing(self): -
373 # apply() without needed parameter will lead to XSLTApplyError - 374 tree = self.parse('<a><b>B</b><c>C</c></a>') - 375 style = self.parse('''\ - 376 <xsl:stylesheet version="1.0" - 377 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 378 <xsl:template match="/"> - 379 <foo><xsl:value-of select="$bar" /></foo> - 380 </xsl:template> - 381 </xsl:stylesheet>''') - 382 - 383 st = etree.XSLT(style) - 384 # at least libxslt 1.1.28 produces this error, earlier ones (e.g. 1.1.18) might not ... - 385 self.assertRaises(etree.XSLTApplyError, st.apply, tree) -
386 -
388 tree = self.parse('<a><b>B</b><c>C</c></a>') - 389 style = self.parse('''\ - 390 <xsl:stylesheet version="1.0" - 391 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 392 <xsl:template match="*" /> - 393 <xsl:template match="/"> - 394 <foo><xsl:value-of select="$bar" /></foo> - 395 <foo><xsl:value-of select="$baz" /></foo> - 396 </xsl:template> - 397 </xsl:stylesheet>''') - 398 - 399 st = etree.XSLT(style) - 400 res = st(tree, bar="'Bar'", baz="'Baz'") - 401 self.assertEqual('''\ - 402 <?xml version="1.0"?> - 403 <foo>Bar</foo><foo>Baz</foo> - 404 ''', - 405 str(res)) -
406 -
407 - def test_xslt_parameter_xpath(self): -
408 tree = self.parse('<a><b>B</b><c>C</c></a>') - 409 style = self.parse('''\ - 410 <xsl:stylesheet version="1.0" - 411 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 412 <xsl:template match="*" /> - 413 <xsl:template match="/"> - 414 <foo><xsl:value-of select="$bar" /></foo> - 415 </xsl:template> - 416 </xsl:stylesheet>''') - 417 - 418 st = etree.XSLT(style) - 419 res = st(tree, bar="/a/b/text()") - 420 self.assertEqual('''\ - 421 <?xml version="1.0"?> - 422 <foo>B</foo> - 423 ''', - 424 str(res)) -
425 -
427 tree = self.parse('<a><b>B</b><c>C</c></a>') - 428 style = self.parse('''\ - 429 <xsl:stylesheet version="1.0" - 430 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 431 <xsl:template match="*" /> - 432 <xsl:template match="/"> - 433 <foo><xsl:value-of select="$bar" /></foo> - 434 </xsl:template> - 435 </xsl:stylesheet>''') - 436 - 437 st = etree.XSLT(style) - 438 res = st(tree, bar=etree.XPath("/a/b/text()")) - 439 self.assertEqual('''\ - 440 <?xml version="1.0"?> - 441 <foo>B</foo> - 442 ''', - 443 str(res)) -
444 -
446 tree = self.parse('<a><b>B</b><c>C</c></a>') - 447 style = self.parse('''\ - 448 <xsl:stylesheet version="1.0" - 449 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 450 <xsl:param name="bar" select="'Default'" /> - 451 <xsl:template match="*" /> - 452 <xsl:template match="/"> - 453 <foo><xsl:value-of select="$bar" /></foo> - 454 </xsl:template> - 455 </xsl:stylesheet>''') - 456 - 457 st = etree.XSLT(style) - 458 res = st(tree, bar="'Bar'") - 459 self.assertEqual('''\ - 460 <?xml version="1.0"?> - 461 <foo>Bar</foo> - 462 ''', - 463 str(res)) - 464 res = st(tree) - 465 self.assertEqual('''\ - 466 <?xml version="1.0"?> - 467 <foo>Default</foo> - 468 ''', - 469 str(res)) -
470 -
471 - def test_xslt_html_output(self): -
472 tree = self.parse('<a><b>B</b><c>C</c></a>') - 473 style = self.parse('''\ - 474 <xsl:stylesheet version="1.0" - 475 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 476 <xsl:output method="html"/> - 477 <xsl:strip-space elements="*"/> - 478 <xsl:template match="/"> - 479 <html><body><xsl:value-of select="/a/b/text()" /></body></html> - 480 </xsl:template> - 481 </xsl:stylesheet>''') - 482 - 483 st = etree.XSLT(style) - 484 res = st(tree) - 485 self.assertEqual('<html><body>B</body></html>', - 486 str(res).strip()) -
487 -
488 - def test_xslt_include(self): -
489 tree = etree.parse(fileInTestDir('test1.xslt')) - 490 st = etree.XSLT(tree) -
491 -
493 f = open(fileInTestDir('test1.xslt'), 'rb') - 494 tree = etree.parse(f) - 495 f.close() - 496 st = etree.XSLT(tree) -
497 -
499 xml = '<a/>' - 500 xslt = '''\ - 501 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - 502 <xsl:template match="/"> - 503 <response>Some text</response> - 504 </xsl:template> - 505 </xsl:stylesheet> - 506 ''' - 507 source = self.parse(xml) - 508 styledoc = self.parse(xslt) - 509 style = etree.XSLT(styledoc) - 510 result = style(source) - 511 - 512 etree.tostring(result.getroot()) - 513 - 514 source = self.parse(xml) - 515 styledoc = self.parse(xslt) - 516 style = etree.XSLT(styledoc) - 517 result = style(source) - 518 - 519 etree.tostring(result.getroot()) -
520 -
521 - def test_xslt_repeat_transform(self): -
522 xml = '<a/>' - 523 xslt = '''\ - 524 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - 525 <xsl:template match="/"> - 526 <response>Some text</response> - 527 </xsl:template> - 528 </xsl:stylesheet> - 529 ''' - 530 source = self.parse(xml) - 531 styledoc = self.parse(xslt) - 532 transform = etree.XSLT(styledoc) - 533 result = transform(source) - 534 result = transform(source) - 535 etree.tostring(result.getroot()) - 536 result = transform(source) - 537 etree.tostring(result.getroot()) - 538 str(result) - 539 - 540 result1 = transform(source) - 541 result2 = transform(source) - 542 self.assertEqual(str(result1), str(result2)) - 543 result = transform(source) - 544 str(result) -
545 -
546 - def test_xslt_empty(self): -
547 # could segfault if result contains "empty document" - 548 xml = '<blah/>' - 549 xslt = ''' - 550 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - 551 <xsl:template match="/" /> - 552 </xsl:stylesheet> - 553 ''' - 554 - 555 source = self.parse(xml) - 556 styledoc = self.parse(xslt) - 557 style = etree.XSLT(styledoc) - 558 result = style(source) - 559 self.assertEqual('', str(result)) -
560 -
561 - def test_xslt_message(self): -
562 xml = '<blah/>' - 563 xslt = ''' - 564 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - 565 <xsl:template match="/"> - 566 <xsl:message>TEST TEST TEST</xsl:message> - 567 </xsl:template> - 568 </xsl:stylesheet> - 569 ''' - 570 - 571 source = self.parse(xml) - 572 styledoc = self.parse(xslt) - 573 style = etree.XSLT(styledoc) - 574 result = style(source) - 575 self.assertEqual('', str(result)) - 576 self.assertTrue("TEST TEST TEST" in [entry.message - 577 for entry in style.error_log]) -
578 -
579 - def test_xslt_message_terminate(self): -
580 xml = '<blah/>' - 581 xslt = ''' - 582 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - 583 <xsl:template match="/"> - 584 <xsl:message terminate="yes">TEST TEST TEST</xsl:message> - 585 </xsl:template> - 586 </xsl:stylesheet> - 587 ''' - 588 - 589 source = self.parse(xml) - 590 styledoc = self.parse(xslt) - 591 style = etree.XSLT(styledoc) - 592 - 593 self.assertRaises(etree.XSLTApplyError, style, source) - 594 self.assertTrue("TEST TEST TEST" in [entry.message - 595 for entry in style.error_log]) -
596 -
597 - def test_xslt_shortcut(self): -
598 tree = self.parse('<a><b>B</b><c>C</c></a>') - 599 style = self.parse('''\ - 600 <xsl:stylesheet version="1.0" - 601 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 602 <xsl:template match="*" /> - 603 <xsl:template match="/"> - 604 <doc> - 605 <foo><xsl:value-of select="$bar" /></foo> - 606 <foo><xsl:value-of select="$baz" /></foo> - 607 </doc> - 608 </xsl:template> - 609 </xsl:stylesheet>''') - 610 - 611 result = tree.xslt(style, bar="'Bar'", baz="'Baz'") - 612 self.assertEqual( - 613 _bytes('<doc><foo>Bar</foo><foo>Baz</foo></doc>'), - 614 etree.tostring(result.getroot())) -
615 -
616 - def test_multiple_elementrees(self): -
617 tree = self.parse('<a><b>B</b><c>C</c></a>') - 618 style = self.parse('''\ - 619 <xsl:stylesheet version="1.0" - 620 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 621 <xsl:template match="a"><A><xsl:apply-templates/></A></xsl:template> - 622 <xsl:template match="b"><B><xsl:apply-templates/></B></xsl:template> - 623 <xsl:template match="c"><C><xsl:apply-templates/></C></xsl:template> - 624 </xsl:stylesheet>''') - 625 - 626 self.assertEqual(self._rootstring(tree), - 627 _bytes('<a><b>B</b><c>C</c></a>')) - 628 result = tree.xslt(style) - 629 self.assertEqual(self._rootstring(tree), - 630 _bytes('<a><b>B</b><c>C</c></a>')) - 631 self.assertEqual(self._rootstring(result), - 632 _bytes('<A><B>B</B><C>C</C></A>')) - 633 - 634 b_tree = etree.ElementTree(tree.getroot()[0]) - 635 self.assertEqual(self._rootstring(b_tree), - 636 _bytes('<b>B</b>')) - 637 result = b_tree.xslt(style) - 638 self.assertEqual(self._rootstring(tree), - 639 _bytes('<a><b>B</b><c>C</c></a>')) - 640 self.assertEqual(self._rootstring(result), - 641 _bytes('<B>B</B>')) - 642 - 643 c_tree = etree.ElementTree(tree.getroot()[1]) - 644 self.assertEqual(self._rootstring(c_tree), - 645 _bytes('<c>C</c>')) - 646 result = c_tree.xslt(style) - 647 self.assertEqual(self._rootstring(tree), - 648 _bytes('<a><b>B</b><c>C</c></a>')) - 649 self.assertEqual(self._rootstring(result), - 650 _bytes('<C>C</C>')) -
651 -
652 - def test_xslt_document_XML(self): -
653 # make sure document('') works from parsed strings - 654 xslt = etree.XSLT(etree.XML("""\ - 655 <xsl:stylesheet version="1.0" - 656 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 657 <xsl:template match="/"> - 658 <test>TEXT<xsl:copy-of select="document('')//test"/></test> - 659 </xsl:template> - 660 </xsl:stylesheet> - 661 """)) - 662 result = xslt(etree.XML('<a/>')) - 663 root = result.getroot() - 664 self.assertEqual(root.tag, - 665 'test') - 666 self.assertEqual(root[0].tag, - 667 'test') - 668 self.assertEqual(root[0].text, - 669 'TEXT') - 670 self.assertEqual(root[0][0].tag, - 671 '{http://www.w3.org/1999/XSL/Transform}copy-of') -
672 -
673 - def test_xslt_document_parse(self): -
674 # make sure document('') works from loaded files - 675 xslt = etree.XSLT(etree.parse(fileInTestDir("test-document.xslt"))) - 676 result = xslt(etree.XML('<a/>')) - 677 root = result.getroot() - 678 self.assertEqual(root.tag, - 679 'test') - 680 self.assertEqual(root[0].tag, - 681 '{http://www.w3.org/1999/XSL/Transform}stylesheet') -
682 -
684 # make sure document('') works from loaded files - 685 xslt = etree.XSLT(etree.ElementTree(file=fileInTestDir("test-document.xslt"))) - 686 result = xslt(etree.XML('<a/>')) - 687 root = result.getroot() - 688 self.assertEqual(root.tag, - 689 'test') - 690 self.assertEqual(root[0].tag, - 691 '{http://www.w3.org/1999/XSL/Transform}stylesheet') -
692 -
693 - def test_xslt_document_error(self): -
694 xslt = etree.XSLT(etree.XML("""\ - 695 <xsl:stylesheet version="1.0" - 696 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 697 <xsl:template match="/"> - 698 <test>TEXT<xsl:copy-of select="document('uri:__junkfood__is__evil__')//test"/></test> - 699 </xsl:template> - 700 </xsl:stylesheet> - 701 """)) - 702 - 703 errors = None - 704 try: - 705 xslt(etree.XML('<a/>')) - 706 except etree.XSLTApplyError as exc: - 707 errors = exc.error_log - 708 else: - 709 self.assertFalse(True, "XSLT processing should have failed but didn't") - 710 - 711 self.assertTrue(len(errors)) - 712 for error in errors: - 713 if ':ERROR:XSLT:' in str(error): - 714 break - 715 else: - 716 self.assertFalse(True, 'No XSLT errors found in error log:\n%s' % errors) -
717 -
719 # make sure document('') works when custom resolvers are in use - 720 assertEqual = self.assertEqual - 721 called = {'count' : 0} - 722 class TestResolver(etree.Resolver): - 723 def resolve(self, url, id, context): - 724 assertEqual(url, 'file://ANYTHING') - 725 called['count'] += 1 - 726 return self.resolve_string('<CALLED/>', context) -
727 - 728 parser = etree.XMLParser() - 729 parser.resolvers.add(TestResolver()) - 730 - 731 xslt = etree.XSLT(etree.XML(_bytes("""\ - 732 <xsl:stylesheet version="1.0" - 733 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - 734 xmlns:l="local"> - 735 <xsl:template match="/"> - 736 <test> - 737 <xsl:for-each select="document('')//l:data/l:entry"> - 738 <xsl:copy-of select="document('file://ANYTHING')"/> - 739 <xsl:copy> - 740 <xsl:attribute name="value"> - 741 <xsl:value-of select="."/> - 742 </xsl:attribute> - 743 </xsl:copy> - 744 </xsl:for-each> - 745 </test> - 746 </xsl:template> - 747 <l:data> - 748 <l:entry>A</l:entry> - 749 <l:entry>B</l:entry> - 750 </l:data> - 751 </xsl:stylesheet> - 752 """), parser)) - 753 - 754 self.assertEqual(called['count'], 0) - 755 result = xslt(etree.XML('<a/>')) - 756 self.assertEqual(called['count'], 1) - 757 - 758 root = result.getroot() - 759 self.assertEqual(root.tag, - 760 'test') - 761 self.assertEqual(len(root), 4) - 762 - 763 self.assertEqual(root[0].tag, - 764 'CALLED') - 765 self.assertEqual(root[1].tag, - 766 '{local}entry') - 767 self.assertEqual(root[1].text, - 768 None) - 769 self.assertEqual(root[1].get("value"), - 770 'A') - 771 self.assertEqual(root[2].tag, - 772 'CALLED') - 773 self.assertEqual(root[3].tag, - 774 '{local}entry') - 775 self.assertEqual(root[3].text, - 776 None) - 777 self.assertEqual(root[3].get("value"), - 778 'B') - 779 -
781 assertEqual = self.assertEqual - 782 called = {'count' : 0} - 783 expected_url = None - 784 class TestResolver(etree.Resolver): - 785 def resolve(self, url, id, context): - 786 assertEqual(url, expected_url) - 787 called['count'] += 1 - 788 return self.resolve_string('<CALLED/>', context) -
789 - 790 stylesheet_xml = _bytes("""\ - 791 <xsl:stylesheet version="1.0" - 792 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - 793 xmlns:l="local"> - 794 <xsl:template match="/"> - 795 <xsl:copy-of select="document('test.xml')"/> - 796 </xsl:template> - 797 </xsl:stylesheet> - 798 """) - 799 - 800 parser = etree.XMLParser() - 801 parser.resolvers.add(TestResolver()) - 802 - 803 # test without base_url => relative path only - 804 expected_url = 'test.xml' - 805 xslt = etree.XSLT(etree.XML(stylesheet_xml, parser)) - 806 - 807 self.assertEqual(called['count'], 0) - 808 result = xslt(etree.XML('<a/>')) - 809 self.assertEqual(called['count'], 1) - 810 - 811 # now the same thing with a stylesheet base URL on the filesystem - 812 called['count'] = 0 - 813 expected_url = 'MY/BASE/test.xml' # seems to be the same on Windows - 814 xslt = etree.XSLT(etree.XML( - 815 stylesheet_xml, parser, - 816 base_url=os.path.join('MY', 'BASE', 'FILE'))) - 817 - 818 self.assertEqual(called['count'], 0) - 819 result = xslt(etree.XML('<a/>')) - 820 self.assertEqual(called['count'], 1) - 821 - 822 # now the same thing with a stylesheet base URL - 823 called['count'] = 0 - 824 expected_url = 'http://server.com/BASE/DIR/test.xml' - 825 xslt = etree.XSLT(etree.XML( - 826 stylesheet_xml, parser, - 827 base_url='http://server.com/BASE/DIR/FILE')) - 828 - 829 self.assertEqual(called['count'], 0) - 830 result = xslt(etree.XML('<a/>')) - 831 self.assertEqual(called['count'], 1) - 832 - 833 # now the same thing with a stylesheet base file:// URL - 834 called['count'] = 0 - 835 expected_url = 'file://BASE/DIR/test.xml' - 836 xslt = etree.XSLT(etree.XML( - 837 stylesheet_xml, parser, - 838 base_url='file://BASE/DIR/FILE')) - 839 - 840 self.assertEqual(called['count'], 0) - 841 result = xslt(etree.XML('<a/>')) - 842 self.assertEqual(called['count'], 1) - 843 -
845 access_control = etree.XSLTAccessControl(read_file=True) - 846 xslt = etree.XSLT(etree.parse(fileInTestDir("test-document.xslt")), - 847 access_control=access_control) - 848 result = xslt(etree.XML('<a/>')) - 849 root = result.getroot() - 850 self.assertEqual(root.tag, - 851 'test') - 852 self.assertEqual(root[0].tag, - 853 '{http://www.w3.org/1999/XSL/Transform}stylesheet') -
854 -
856 access_control = etree.XSLTAccessControl(read_file=False) - 857 xslt = etree.XSLT(etree.parse(fileInTestDir("test-document.xslt")), - 858 access_control=access_control) - 859 self.assertRaises(etree.XSLTApplyError, xslt, etree.XML('<a/>')) -
860 -
862 access_control = etree.XSLTAccessControl.DENY_ALL - 863 xslt = etree.XSLT(etree.parse(fileInTestDir("test-document.xslt")), - 864 access_control=access_control) - 865 self.assertRaises(etree.XSLTApplyError, xslt, etree.XML('<a/>')) -
866 -
868 access_control = etree.XSLTAccessControl.DENY_ALL - 869 self.assertTrue(repr(access_control).startswith(type(access_control).__name__)) - 870 self.assertEqual(repr(access_control), repr(access_control)) - 871 self.assertNotEqual(repr(etree.XSLTAccessControl.DENY_ALL), - 872 repr(etree.XSLTAccessControl.DENY_WRITE)) - 873 self.assertNotEqual(repr(etree.XSLTAccessControl.DENY_ALL), - 874 repr(etree.XSLTAccessControl())) -
875 -
876 - def test_xslt_move_result(self): -
877 root = etree.XML(_bytes('''\ - 878 <transform> - 879 <widget displayType="fieldset"/> - 880 </transform>''')) - 881 - 882 xslt = etree.XSLT(etree.XML(_bytes('''\ - 883 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 884 <xsl:output method="html" indent="no"/> - 885 <xsl:template match="/"> - 886 <html> - 887 <xsl:apply-templates/> - 888 </html> - 889 </xsl:template> - 890 - 891 <xsl:template match="widget"> - 892 <xsl:element name="{@displayType}"/> - 893 </xsl:template> - 894 - 895 </xsl:stylesheet>'''))) - 896 - 897 result = xslt(root[0]) - 898 root[:] = result.getroot()[:] - 899 del root # segfaulted before -
900 -
901 - def test_xslt_pi(self): -
902 tree = self.parse('''\ - 903 <?xml version="1.0"?> - 904 <?xml-stylesheet type="text/xsl" href="%s"?> - 905 <a> - 906 <b>B</b> - 907 <c>C</c> - 908 </a>''' % fileInTestDir("test1.xslt")) - 909 - 910 style_root = tree.getroot().getprevious().parseXSL().getroot() - 911 self.assertEqual("{http://www.w3.org/1999/XSL/Transform}stylesheet", - 912 style_root.tag) -
913 -
914 - def test_xslt_pi_embedded_xmlid(self): -
915 # test xml:id dictionary lookup mechanism - 916 tree = self.parse('''\ - 917 <?xml version="1.0"?> - 918 <?xml-stylesheet type="text/xsl" href="#style"?> - 919 <a> - 920 <b>B</b> - 921 <c>C</c> - 922 <xsl:stylesheet version="1.0" xml:id="style" - 923 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 924 <xsl:template match="*" /> - 925 <xsl:template match="/"> - 926 <foo><xsl:value-of select="/a/b/text()" /></foo> - 927 </xsl:template> - 928 </xsl:stylesheet> - 929 </a>''') - 930 - 931 style_root = tree.getroot().getprevious().parseXSL().getroot() - 932 self.assertEqual("{http://www.w3.org/1999/XSL/Transform}stylesheet", - 933 style_root.tag) - 934 - 935 st = etree.XSLT(style_root) - 936 res = st(tree) - 937 self.assertEqual('''\ - 938 <?xml version="1.0"?> - 939 <foo>B</foo> - 940 ''', - 941 str(res)) -
942 -
943 - def test_xslt_pi_embedded_id(self): -
944 # test XPath lookup mechanism - 945 tree = self.parse('''\ - 946 <?xml version="1.0"?> - 947 <?xml-stylesheet type="text/xsl" href="#style"?> - 948 <a> - 949 <b>B</b> - 950 <c>C</c> - 951 </a>''') - 952 - 953 style = self.parse('''\ - 954 <xsl:stylesheet version="1.0" xml:id="style" - 955 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - 956 <xsl:template match="*" /> - 957 <xsl:template match="/"> - 958 <foo><xsl:value-of select="/a/b/text()" /></foo> - 959 </xsl:template> - 960 </xsl:stylesheet> - 961 ''') - 962 - 963 tree.getroot().append(style.getroot()) - 964 - 965 style_root = tree.getroot().getprevious().parseXSL().getroot() - 966 self.assertEqual("{http://www.w3.org/1999/XSL/Transform}stylesheet", - 967 style_root.tag) - 968 - 969 st = etree.XSLT(style_root) - 970 res = st(tree) - 971 self.assertEqual('''\ - 972 <?xml version="1.0"?> - 973 <foo>B</foo> - 974 ''', - 975 str(res)) -
976 -
977 - def test_xslt_pi_get(self): -
978 tree = self.parse('''\ - 979 <?xml version="1.0"?> - 980 <?xml-stylesheet type="text/xsl" href="TEST"?> - 981 <a> - 982 <b>B</b> - 983 <c>C</c> - 984 </a>''') - 985 - 986 pi = tree.getroot().getprevious() - 987 self.assertEqual("TEST", pi.get("href")) -
988 -
989 - def test_xslt_pi_get_all(self): -
990 tree = self.parse('''\ - 991 <?xml version="1.0"?> - 992 <?xml-stylesheet type="text/xsl" href="TEST"?> - 993 <a> - 994 <b>B</b> - 995 <c>C</c> - 996 </a>''') - 997 - 998 pi = tree.getroot().getprevious() - 999 self.assertEqual("TEST", pi.get("href")) -1000 self.assertEqual("text/xsl", pi.get("type")) -1001 self.assertEqual(None, pi.get("motz")) -
1002 -
1004 tree = self.parse('''\ -1005 <?xml version="1.0"?> -1006 <?xml-stylesheet href="TEST" type="text/xsl"?> -1007 <a> -1008 <b>B</b> -1009 <c>C</c> -1010 </a>''') -1011 -1012 pi = tree.getroot().getprevious() -1013 self.assertEqual("TEST", pi.get("href")) -1014 self.assertEqual("text/xsl", pi.get("type")) -1015 self.assertEqual(None, pi.get("motz")) -
1016 -
1017 - def test_xslt_pi_get_unknown(self): -
1018 tree = self.parse('''\ -1019 <?xml version="1.0"?> -1020 <?xml-stylesheet type="text/xsl" href="TEST"?> -1021 <a> -1022 <b>B</b> -1023 <c>C</c> -1024 </a>''') -1025 -1026 pi = tree.getroot().getprevious() -1027 self.assertEqual(None, pi.get("unknownattribute")) -
1028 -
1029 - def test_xslt_pi_set_replace(self): -
1030 tree = self.parse('''\ -1031 <?xml version="1.0"?> -1032 <?xml-stylesheet type="text/xsl" href="TEST"?> -1033 <a> -1034 <b>B</b> -1035 <c>C</c> -1036 </a>''') -1037 -1038 pi = tree.getroot().getprevious() -1039 self.assertEqual("TEST", pi.get("href")) -1040 -1041 pi.set("href", "TEST123") -1042 self.assertEqual("TEST123", pi.get("href")) -
1043 -
1044 - def test_xslt_pi_set_new(self): -
1045 tree = self.parse('''\ -1046 <?xml version="1.0"?> -1047 <?xml-stylesheet type="text/xsl"?> -1048 <a> -1049 <b>B</b> -1050 <c>C</c> -1051 </a>''') -1052 -1053 pi = tree.getroot().getprevious() -1054 self.assertEqual(None, pi.get("href")) -1055 -1056 pi.set("href", "TEST") -1057 self.assertEqual("TEST", pi.get("href")) -
1058 -
1059 -class ETreeEXSLTTestCase(HelperTestCase): -
1060 """EXSLT tests""" -1061 -
1062 - def test_exslt_str(self): -
1063 tree = self.parse('<a><b>B</b><c>C</c></a>') -1064 style = self.parse('''\ -1065 <xsl:stylesheet version="1.0" -1066 xmlns:str="http://exslt.org/strings" -1067 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1068 exclude-result-prefixes="str xsl"> -1069 <xsl:template match="text()"> -1070 <xsl:value-of select="str:align(string(.), '***', 'center')" /> -1071 </xsl:template> -1072 <xsl:template match="*"> -1073 <xsl:copy> -1074 <xsl:apply-templates/> -1075 </xsl:copy> -1076 </xsl:template> -1077 </xsl:stylesheet>''') -1078 -1079 st = etree.XSLT(style) -1080 res = st(tree) -1081 self.assertEqual('''\ -1082 <?xml version="1.0"?> -1083 <a><b>*B*</b><c>*C*</c></a> -1084 ''', -1085 str(res)) -
1086 -
1088 tree = self.parse('<a><b>B</b><c>C</c></a>') -1089 style = self.parse('''\ -1090 <xsl:stylesheet version = "1.0" -1091 xmlns:xsl='http://www.w3.org/1999/XSL/Transform' -1092 xmlns:str="http://exslt.org/strings" -1093 extension-element-prefixes="str"> -1094 -1095 <xsl:template match="/"> -1096 <h1 class="{str:replace('abc', 'b', 'x')}">test</h1> -1097 </xsl:template> -1098 -1099 </xsl:stylesheet>''') -1100 -1101 st = etree.XSLT(style) -1102 res = st(tree) -1103 self.assertEqual(str(res), '''\ -1104 <?xml version="1.0"?> -1105 <h1 class="axc">test</h1> -1106 ''') -
1107 -
1108 - def test_exslt_math(self): -
1109 tree = self.parse('<a><b>B</b><c>C</c></a>') -1110 style = self.parse('''\ -1111 <xsl:stylesheet version="1.0" -1112 xmlns:math="http://exslt.org/math" -1113 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1114 exclude-result-prefixes="math xsl"> -1115 <xsl:template match="*"> -1116 <xsl:copy> -1117 <xsl:attribute name="pi"> -1118 <xsl:value-of select="math:constant('PI', count(*)+2)"/> -1119 </xsl:attribute> -1120 <xsl:apply-templates/> -1121 </xsl:copy> -1122 </xsl:template> -1123 </xsl:stylesheet>''') -1124 -1125 st = etree.XSLT(style) -1126 res = st(tree) -1127 self.assertEqual('''\ -1128 <?xml version="1.0"?> -1129 <a pi="3.14"><b pi="3">B</b><c pi="3">C</c></a> -1130 ''', -1131 str(res)) -
1132 -
1133 - def test_exslt_regexp_test(self): -
1134 xslt = etree.XSLT(etree.XML(_bytes("""\ -1135 <xsl:stylesheet version="1.0" -1136 xmlns:regexp="http://exslt.org/regular-expressions" -1137 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1138 <xsl:template match="*"> -1139 <test><xsl:copy-of select="*[regexp:test(string(.), '8.')]"/></test> -1140 </xsl:template> -1141 </xsl:stylesheet> -1142 """))) -1143 result = xslt(etree.XML(_bytes('<a><b>123</b><b>098</b><b>987</b></a>'))) -1144 root = result.getroot() -1145 self.assertEqual(root.tag, -1146 'test') -1147 self.assertEqual(len(root), 1) -1148 self.assertEqual(root[0].tag, -1149 'b') -1150 self.assertEqual(root[0].text, -1151 '987') -
1152 -
1153 - def test_exslt_regexp_replace(self): -
1154 xslt = etree.XSLT(etree.XML("""\ -1155 <xsl:stylesheet version="1.0" -1156 xmlns:regexp="http://exslt.org/regular-expressions" -1157 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1158 <xsl:template match="*"> -1159 <test> -1160 <xsl:copy-of select="regexp:replace(string(.), 'd.', '', 'XX')"/> -1161 <xsl:text>-</xsl:text> -1162 <xsl:copy-of select="regexp:replace(string(.), 'd.', 'gi', 'XX')"/> -1163 </test> -1164 </xsl:template> -1165 </xsl:stylesheet> -1166 """)) -1167 result = xslt(etree.XML(_bytes('<a>abdCdEeDed</a>'))) -1168 root = result.getroot() -1169 self.assertEqual(root.tag, -1170 'test') -1171 self.assertEqual(len(root), 0) -1172 self.assertEqual(root.text, 'abXXdEeDed-abXXXXeXXd') -
1173 -
1174 - def test_exslt_regexp_match(self): -
1175 xslt = etree.XSLT(etree.XML("""\ -1176 <xsl:stylesheet version="1.0" -1177 xmlns:regexp="http://exslt.org/regular-expressions" -1178 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1179 <xsl:template match="*"> -1180 <test> -1181 <test1><xsl:copy-of select="regexp:match(string(.), 'd.')"/></test1> -1182 <test2><xsl:copy-of select="regexp:match(string(.), 'd.', 'g')"/></test2> -1183 <test2i><xsl:copy-of select="regexp:match(string(.), 'd.', 'gi')"/></test2i> -1184 </test> -1185 </xsl:template> -1186 </xsl:stylesheet> -1187 """)) -1188 result = xslt(etree.XML(_bytes('<a>abdCdEeDed</a>'))) -1189 root = result.getroot() -1190 self.assertEqual(root.tag, 'test') -1191 self.assertEqual(len(root), 3) -1192 -1193 self.assertEqual(len(root[0]), 1) -1194 self.assertEqual(root[0][0].tag, 'match') -1195 self.assertEqual(root[0][0].text, 'dC') -1196 -1197 self.assertEqual(len(root[1]), 2) -1198 self.assertEqual(root[1][0].tag, 'match') -1199 self.assertEqual(root[1][0].text, 'dC') -1200 self.assertEqual(root[1][1].tag, 'match') -1201 self.assertEqual(root[1][1].text, 'dE') -1202 -1203 self.assertEqual(len(root[2]), 3) -1204 self.assertEqual(root[2][0].tag, 'match') -1205 self.assertEqual(root[2][0].text, 'dC') -1206 self.assertEqual(root[2][1].tag, 'match') -1207 self.assertEqual(root[2][1].text, 'dE') -1208 self.assertEqual(root[2][2].tag, 'match') -1209 self.assertEqual(root[2][2].text, 'De') -
1210 -
1212 xslt = etree.XSLT(etree.XML(_bytes("""\ -1213 <xsl:stylesheet version="1.0" -1214 xmlns:regexp="http://exslt.org/regular-expressions" -1215 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1216 <xsl:template match="/"> -1217 <test> -1218 <xsl:for-each select="regexp:match( -1219 '123abc567', '([0-9]+)([a-z]+)([0-9]+)' )"> -1220 <test1><xsl:value-of select="."/></test1> -1221 </xsl:for-each> -1222 </test> -1223 </xsl:template> -1224 </xsl:stylesheet> -1225 """))) -1226 result = xslt(etree.XML(_bytes('<a/>'))) -1227 root = result.getroot() -1228 self.assertEqual(root.tag, 'test') -1229 self.assertEqual(len(root), 4) -1230 -1231 self.assertEqual(root[0].text, "123abc567") -1232 self.assertEqual(root[1].text, "123") -1233 self.assertEqual(root[2].text, "abc") -1234 self.assertEqual(root[3].text, "567") -
1235 -
1236 - def test_exslt_regexp_match1(self): -
1237 # taken from http://www.exslt.org/regexp/functions/match/index.html -1238 xslt = etree.XSLT(etree.XML(_bytes("""\ -1239 <xsl:stylesheet version="1.0" -1240 xmlns:regexp="http://exslt.org/regular-expressions" -1241 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1242 <xsl:template match="/"> -1243 <test> -1244 <xsl:for-each select="regexp:match( -1245 'http://www.bayes.co.uk/xml/index.xml?/xml/utils/rechecker.xml', -1246 '(\\w+):\\/\\/([^/:]+)(:\\d*)?([^# ]*)')"> -1247 <test1><xsl:value-of select="."/></test1> -1248 </xsl:for-each> -1249 </test> -1250 </xsl:template> -1251 </xsl:stylesheet> -1252 """))) -1253 result = xslt(etree.XML(_bytes('<a/>'))) -1254 root = result.getroot() -1255 self.assertEqual(root.tag, 'test') -1256 self.assertEqual(len(root), 5) -1257 -1258 self.assertEqual( -1259 root[0].text, -1260 "http://www.bayes.co.uk/xml/index.xml?/xml/utils/rechecker.xml") -1261 self.assertEqual( -1262 root[1].text, -1263 "http") -1264 self.assertEqual( -1265 root[2].text, -1266 "www.bayes.co.uk") -1267 self.assertFalse(root[3].text) -1268 self.assertEqual( -1269 root[4].text, -1270 "/xml/index.xml?/xml/utils/rechecker.xml") -
1271 -
1272 - def test_exslt_regexp_match2(self): -
1273 # taken from http://www.exslt.org/regexp/functions/match/index.html -1274 xslt = etree.XSLT(self.parse("""\ -1275 <xsl:stylesheet version="1.0" -1276 xmlns:regexp="http://exslt.org/regular-expressions" -1277 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1278 <xsl:template match="/"> -1279 <test> -1280 <xsl:for-each select="regexp:match( -1281 'This is a test string', '(\\w+)', 'g')"> -1282 <test1><xsl:value-of select="."/></test1> -1283 </xsl:for-each> -1284 </test> -1285 </xsl:template> -1286 </xsl:stylesheet> -1287 """)) -1288 result = xslt(etree.XML(_bytes('<a/>'))) -1289 root = result.getroot() -1290 self.assertEqual(root.tag, 'test') -1291 self.assertEqual(len(root), 5) -1292 -1293 self.assertEqual(root[0].text, "This") -1294 self.assertEqual(root[1].text, "is") -1295 self.assertEqual(root[2].text, "a") -1296 self.assertEqual(root[3].text, "test") -1297 self.assertEqual(root[4].text, "string") -
1298 -
1299 - def _test_exslt_regexp_match3(self): -
1300 # taken from http://www.exslt.org/regexp/functions/match/index.html -1301 # THIS IS NOT SUPPORTED! -1302 xslt = etree.XSLT(etree.XML(_bytes("""\ -1303 <xsl:stylesheet version="1.0" -1304 xmlns:regexp="http://exslt.org/regular-expressions" -1305 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1306 <xsl:template match="/"> -1307 <test> -1308 <xsl:for-each select="regexp:match( -1309 'This is a test string', '([a-z])+ ', 'g')"> -1310 <test1><xsl:value-of select="."/></test1> -1311 </xsl:for-each> -1312 </test> -1313 </xsl:template> -1314 </xsl:stylesheet> -1315 """))) -1316 result = xslt(etree.XML(_bytes('<a/>'))) -1317 root = result.getroot() -1318 self.assertEqual(root.tag, 'test') -1319 self.assertEqual(len(root), 4) -1320 -1321 self.assertEqual(root[0].text, "his") -1322 self.assertEqual(root[1].text, "is") -1323 self.assertEqual(root[2].text, "a") -1324 self.assertEqual(root[3].text, "test") -
1325 -
1326 - def _test_exslt_regexp_match4(self): -
1327 # taken from http://www.exslt.org/regexp/functions/match/index.html -1328 # THIS IS NOT SUPPORTED! -1329 xslt = etree.XSLT(etree.XML(_bytes("""\ -1330 <xsl:stylesheet version="1.0" -1331 xmlns:regexp="http://exslt.org/regular-expressions" -1332 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1333 <xsl:template match="/"> -1334 <test> -1335 <xsl:for-each select="regexp:match( -1336 'This is a test string', '([a-z])+ ', 'gi')"> -1337 <test1><xsl:value-of select="."/></test1> -1338 </xsl:for-each> -1339 </test> -1340 </xsl:template> -1341 </xsl:stylesheet> -1342 """))) -1343 result = xslt(etree.XML(_bytes('<a/>'))) -1344 root = result.getroot() -1345 self.assertEqual(root.tag, 'test') -1346 self.assertEqual(len(root), 4) -1347 -1348 self.assertEqual(root[0].text, "This") -1349 self.assertEqual(root[1].text, "is") -1350 self.assertEqual(root[2].text, "a") -1351 self.assertEqual(root[3].text, "test") -
1352 -
1353 -1354 -class ETreeXSLTExtFuncTestCase(HelperTestCase): -
1355 """Tests for XPath extension functions in XSLT.""" -1356 -
1357 - def test_extensions1(self): -
1358 tree = self.parse('<a><b>B</b></a>') -1359 style = self.parse('''\ -1360 <xsl:stylesheet version="1.0" -1361 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1362 xmlns:myns="testns" -1363 exclude-result-prefixes="myns"> -1364 <xsl:template match="a"><A><xsl:value-of select="myns:mytext(b)"/></A></xsl:template> -1365 </xsl:stylesheet>''') -1366 -1367 def mytext(ctxt, values): -1368 return 'X' * len(values) -
1369 -1370 result = tree.xslt(style, {('testns', 'mytext') : mytext}) -1371 self.assertEqual(self._rootstring(result), -1372 _bytes('<A>X</A>')) -
1373 -
1374 - def test_extensions2(self): -
1375 tree = self.parse('<a><b>B</b></a>') -1376 style = self.parse('''\ -1377 <xsl:stylesheet version="1.0" -1378 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1379 xmlns:myns="testns" -1380 exclude-result-prefixes="myns"> -1381 <xsl:template match="a"><A><xsl:value-of select="myns:mytext(b)"/></A></xsl:template> -1382 </xsl:stylesheet>''') -1383 -1384 def mytext(ctxt, values): -1385 return 'X' * len(values) -
1386 -1387 namespace = etree.FunctionNamespace('testns') -1388 namespace['mytext'] = mytext -1389 -1390 result = tree.xslt(style) -1391 self.assertEqual(self._rootstring(result), -1392 _bytes('<A>X</A>')) -1393 -
1395 tree = self.parse('<a><b>B</b><b/></a>') -1396 style = self.parse('''\ -1397 <xsl:stylesheet version="1.0" -1398 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1399 xmlns:myns="testns" -1400 exclude-result-prefixes="myns"> -1401 <xsl:template match="a"> -1402 <xsl:variable name="content"> -1403 <xsl:apply-templates/> -1404 </xsl:variable> -1405 <A><xsl:value-of select="myns:mytext($content)"/></A> -1406 </xsl:template> -1407 <xsl:template match="b"><xsl:copy>BBB</xsl:copy></xsl:template> -1408 </xsl:stylesheet>''') -1409 -1410 def mytext(ctxt, values): -1411 for value in values: -1412 self.assertTrue(hasattr(value, 'tag'), -1413 "%s is not an Element" % type(value)) -1414 self.assertEqual(value.tag, 'b') -1415 self.assertEqual(value.text, 'BBB') -1416 return 'X'.join([el.tag for el in values]) -
1417 -1418 namespace = etree.FunctionNamespace('testns') -1419 namespace['mytext'] = mytext -1420 -1421 result = tree.xslt(style) -1422 self.assertEqual(self._rootstring(result), -1423 _bytes('<A>bXb</A>')) -1424 -
1425 - def test_xpath_on_context_node(self): -
1426 tree = self.parse('<a><b>B<c/>C</b><b/></a>') -1427 style = self.parse('''\ -1428 <xsl:stylesheet version="1.0" -1429 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1430 xmlns:myns="testns" -1431 exclude-result-prefixes="myns"> -1432 <xsl:template match="b"> -1433 <A><xsl:value-of select="myns:myext()"/></A> -1434 </xsl:template> -1435 </xsl:stylesheet>''') -1436 -1437 def extfunc(ctxt): -1438 text_content = ctxt.context_node.xpath('text()') -1439 return 'x'.join(text_content) -
1440 -1441 namespace = etree.FunctionNamespace('testns') -1442 namespace['myext'] = extfunc -1443 -1444 result = tree.xslt(style) -1445 self.assertEqual(self._rootstring(result), -1446 _bytes('<A>BxC</A>')) -1447 -
1449 # LP ticket 1354652 -1450 class Resolver(etree.Resolver): -1451 def resolve(self, system_url, public_id, context): -1452 assert system_url == 'extdoc.xml' -1453 return self.resolve_string(b'<a><b>B<c/>C</b><b/></a>', context) -
1454 -1455 parser = etree.XMLParser() -1456 parser.resolvers.add(Resolver()) -1457 -1458 tree = self.parse(b'<a><b/><b/></a>') -1459 transform = etree.XSLT(self.parse(b'''\ -1460 <xsl:stylesheet version="1.0" -1461 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1462 xmlns:mypre="testns" -1463 exclude-result-prefixes="mypre"> -1464 <xsl:template match="b"> -1465 <B><xsl:value-of select="mypre:myext()"/></B> -1466 </xsl:template> -1467 <xsl:template match="a"> -1468 <A><xsl:apply-templates select="document('extdoc.xml')//b" /></A> -1469 </xsl:template> -1470 </xsl:stylesheet>''', parser=parser)) -1471 -1472 def extfunc(ctxt): -1473 text_content = ctxt.context_node.xpath('text()') -1474 return 'x'.join(text_content) -1475 -1476 namespace = etree.FunctionNamespace('testns') -1477 namespace['myext'] = extfunc -1478 -1479 result = transform(tree) -1480 self.assertEqual(self._rootstring(result), -1481 _bytes('<A><B>BxC</B><B/></A>')) -1482 -
1483 -1484 -class ETreeXSLTExtElementTestCase(HelperTestCase): -
1485 """Tests for extension elements in XSLT.""" -1486 -
1487 - def test_extension_element(self): -
1488 tree = self.parse('<a><b>B</b></a>') -1489 style = self.parse('''\ -1490 <xsl:stylesheet version="1.0" -1491 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1492 xmlns:myns="testns" -1493 extension-element-prefixes="myns" -1494 exclude-result-prefixes="myns"> -1495 <xsl:template match="a"> -1496 <A><myns:myext>b</myns:myext></A> -1497 </xsl:template> -1498 </xsl:stylesheet>''') -1499 -1500 class MyExt(etree.XSLTExtension): -1501 def execute(self, context, self_node, input_node, output_parent): -1502 child = etree.Element(self_node.text) -1503 child.text = 'X' -1504 output_parent.append(child) -
1505 -1506 extensions = { ('testns', 'myext') : MyExt() } -1507 -1508 result = tree.xslt(style, extensions=extensions) -1509 self.assertEqual(self._rootstring(result), -1510 _bytes('<A><b>X</b></A>')) -1511 -
1513 tree = self.parse('<a><b>B</b></a>') -1514 style = self.parse('''\ -1515 <xsl:stylesheet version="1.0" -1516 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1517 xmlns:myns="testns" -1518 extension-element-prefixes="myns" -1519 exclude-result-prefixes="myns"> -1520 <xsl:template match="/"> -1521 <A><myns:myext>b</myns:myext></A> -1522 </xsl:template> -1523 </xsl:stylesheet>''') -1524 -1525 tags = [] -1526 -1527 class MyExt(etree.XSLTExtension): -1528 def execute(self, context, self_node, input_node, output_parent): -1529 tags.append(input_node.tag) -
1530 -1531 extensions = { ('testns', 'myext') : MyExt() } -1532 -1533 result = tree.xslt(style, extensions=extensions) -1534 self.assertEqual(tags, ['a']) -1535 -
1537 tree = self.parse('<?test toast?><a><!--a comment--><?another pi?></a>') -1538 style = self.parse('''\ -1539 <xsl:stylesheet version="1.0" -1540 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1541 xmlns:myns="testns" -1542 extension-element-prefixes="myns" -1543 exclude-result-prefixes="myns"> -1544 <xsl:template match="/"> -1545 <ROOT><xsl:apply-templates /></ROOT> -1546 </xsl:template> -1547 <xsl:template match="comment()"> -1548 <A><myns:myext>b</myns:myext></A> -1549 </xsl:template> -1550 <xsl:template match="processing-instruction()"> -1551 <A><myns:myext>b</myns:myext></A> -1552 </xsl:template> -1553 </xsl:stylesheet>''') -1554 -1555 text = [] -1556 -1557 class MyExt(etree.XSLTExtension): -1558 def execute(self, context, self_node, input_node, output_parent): -1559 text.append(input_node.text) -
1560 -1561 extensions = { ('testns', 'myext') : MyExt() } -1562 -1563 result = tree.xslt(style, extensions=extensions) -1564 self.assertEqual(text, ['toast', 'a comment', 'pi']) -1565 -
1567 # currently not supported -1568 tree = self.parse('<a test="A"><b attr="B"/></a>') -1569 style = self.parse('''\ -1570 <xsl:stylesheet version="1.0" -1571 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1572 xmlns:myns="testns" -1573 extension-element-prefixes="myns" -1574 exclude-result-prefixes="myns"> -1575 <xsl:template match="@test"> -1576 <A><myns:myext>b</myns:myext></A> -1577 </xsl:template> -1578 <xsl:template match="@attr"> -1579 <A><myns:myext>b</myns:myext></A> -1580 </xsl:template> -1581 </xsl:stylesheet>''') -1582 -1583 text = [] -1584 -1585 class MyExt(etree.XSLTExtension): -1586 def execute(self, context, self_node, attr_value, output_parent): -1587 text.append(attr_value) -
1588 -1589 extensions = { ('testns', 'myext') : MyExt() } -1590 -1591 result = tree.xslt(style, extensions=extensions) -1592 self.assertEqual(text, ['A', 'B']) -1593 -
1595 tree = self.parse('<a><b>B</b></a>') -1596 style = self.parse('''\ -1597 <xsl:stylesheet version="1.0" -1598 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1599 xmlns:myns="testns" -1600 extension-element-prefixes="myns"> -1601 <xsl:template match="a"> -1602 <A><myns:myext><x>X</x><y>Y</y><z/></myns:myext></A> -1603 </xsl:template> -1604 </xsl:stylesheet>''') -1605 -1606 class MyExt(etree.XSLTExtension): -1607 def execute(self, context, self_node, input_node, output_parent): -1608 output_parent.extend(list(self_node)[1:]) -
1609 -1610 extensions = { ('testns', 'myext') : MyExt() } -1611 -1612 result = tree.xslt(style, extensions=extensions) -1613 self.assertEqual(self._rootstring(result), -1614 _bytes('<A><y>Y</y><z/></A>')) -1615 -
1617 tree = self.parse('<a><b>B</b></a>') -1618 style = self.parse('''\ -1619 <xsl:stylesheet version="1.0" -1620 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1621 xmlns:myns="testns" -1622 extension-element-prefixes="myns"> -1623 <xsl:template match="a"> -1624 <A><myns:myext><x>X</x><y>Y</y><z/></myns:myext></A> -1625 </xsl:template> -1626 <xsl:template match="x" /> -1627 <xsl:template match="z">XYZ</xsl:template> -1628 </xsl:stylesheet>''') -1629 -1630 class MyExt(etree.XSLTExtension): -1631 def execute(self, context, self_node, input_node, output_parent): -1632 for child in self_node: -1633 for result in self.apply_templates(context, child): -1634 if isinstance(result, basestring): -1635 el = etree.Element("T") -1636 el.text = result -1637 else: -1638 el = result -1639 output_parent.append(el) -
1640 -1641 extensions = { ('testns', 'myext') : MyExt() } -1642 -1643 result = tree.xslt(style, extensions=extensions) -1644 self.assertEqual(self._rootstring(result), -1645 _bytes('<A><T>Y</T><T>XYZ</T></A>')) -1646 -
1648 tree = self.parse('<a><b>B</b></a>') -1649 style = self.parse('''\ -1650 <xsl:stylesheet version="1.0" -1651 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1652 xmlns:myns="testns" -1653 extension-element-prefixes="myns"> -1654 <xsl:template match="a"> -1655 <A><myns:myext><x>X</x><y>Y</y><z/></myns:myext></A> -1656 </xsl:template> -1657 <xsl:template match="x"><X/></xsl:template> -1658 <xsl:template match="z">XYZ</xsl:template> -1659 </xsl:stylesheet>''') -1660 -1661 class MyExt(etree.XSLTExtension): -1662 def execute(self, context, self_node, input_node, output_parent): -1663 for child in self_node: -1664 for result in self.apply_templates(context, child, -1665 elements_only=True): -1666 assert not isinstance(result, basestring) -1667 output_parent.append(result) -
1668 -1669 extensions = { ('testns', 'myext') : MyExt() } -1670 -1671 result = tree.xslt(style, extensions=extensions) -1672 self.assertEqual(self._rootstring(result), -1673 _bytes('<A><X/></A>')) -1674 -
1676 tree = self.parse('<a><b>B</b></a>') -1677 style = self.parse('''\ -1678 <xsl:stylesheet version="1.0" -1679 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1680 xmlns:myns="testns" -1681 extension-element-prefixes="myns"> -1682 <xsl:template match="a"> -1683 <A><myns:myext><x>X</x><y>Y</y><z/></myns:myext></A> -1684 </xsl:template> -1685 <xsl:template match="x"><X/></xsl:template> -1686 <xsl:template match="y"><xsl:text> </xsl:text></xsl:template> -1687 <xsl:template match="z">XYZ</xsl:template> -1688 </xsl:stylesheet>''') -1689 -1690 class MyExt(etree.XSLTExtension): -1691 def execute(self, context, self_node, input_node, output_parent): -1692 for child in self_node: -1693 for result in self.apply_templates(context, child, -1694 remove_blank_text=True): -1695 if isinstance(result, basestring): -1696 assert result.strip() -1697 el = etree.Element("T") -1698 el.text = result -1699 else: -1700 el = result -1701 output_parent.append(el) -
1702 -1703 extensions = { ('testns', 'myext') : MyExt() } -1704 -1705 result = tree.xslt(style, extensions=extensions) -1706 self.assertEqual(self._rootstring(result), -1707 _bytes('<A><X/><T>XYZ</T></A>')) -1708 -
1710 tree = self.parse('<a><b>B</b></a>') -1711 style = self.parse('''\ -1712 <xsl:stylesheet version="1.0" -1713 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1714 xmlns:myns="testns" -1715 extension-element-prefixes="myns"> -1716 <xsl:template match="a"> -1717 <A><myns:myext><x>X</x><y>Y</y><z/></myns:myext></A> -1718 </xsl:template> -1719 <xsl:template match="x" /> -1720 <xsl:template match="z">XYZ</xsl:template> -1721 </xsl:stylesheet>''') -1722 -1723 class MyExt(etree.XSLTExtension): -1724 def execute(self, context, self_node, input_node, output_parent): -1725 for child in self_node: -1726 self.apply_templates(context, child, output_parent) -
1727 -1728 extensions = { ('testns', 'myext') : MyExt() } -1729 -1730 result = tree.xslt(style, extensions=extensions) -1731 self.assertEqual(self._rootstring(result), -1732 _bytes('<A>YXYZ</A>')) -1733 -
1735 tree = self.parse('<a><b>B</b></a>') -1736 style = self.parse('''\ -1737 <xsl:stylesheet version="1.0" -1738 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1739 xmlns:myns="testns" -1740 extension-element-prefixes="myns"> -1741 <xsl:template match="a"> -1742 <myns:myext><x>X</x><y>Y</y><z/></myns:myext> -1743 </xsl:template> -1744 <xsl:template match="x"><xsl:processing-instruction name="test">TEST</xsl:processing-instruction></xsl:template> -1745 <xsl:template match="y"><Y>XYZ</Y></xsl:template> -1746 <xsl:template match="z"><xsl:comment>TEST</xsl:comment></xsl:template> -1747 </xsl:stylesheet>''') -1748 -1749 class MyExt(etree.XSLTExtension): -1750 def execute(self, context, self_node, input_node, output_parent): -1751 for child in self_node: -1752 self.apply_templates(context, child, output_parent) -
1753 -1754 extensions = { ('testns', 'myext') : MyExt() } -1755 -1756 result = tree.xslt(style, extensions=extensions) -1757 self.assertEqual(etree.tostring(result), -1758 _bytes('<?test TEST?><Y>XYZ</Y><!--TEST-->')) -1759 -
1761 tree = self.parse('<a><b>E</b></a>') -1762 style = self.parse('''\ -1763 <xsl:stylesheet version="1.0" -1764 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1765 xmlns:myns="testns" -1766 extension-element-prefixes="myns"> -1767 <xsl:template match="a"> -1768 <xsl:variable name="testvar">yo</xsl:variable> -1769 <A> -1770 <myns:myext> -1771 <xsl:attribute name="attr"> -1772 <xsl:value-of select="$testvar" /> -1773 </xsl:attribute> -1774 <B> -1775 <xsl:choose> -1776 <xsl:when test="1 = 2"><C/></xsl:when> -1777 <xsl:otherwise><D><xsl:value-of select="b/text()" /></D></xsl:otherwise> -1778 </xsl:choose> -1779 </B> -1780 </myns:myext> -1781 </A> -1782 </xsl:template> -1783 </xsl:stylesheet>''') -1784 -1785 class MyExt(etree.XSLTExtension): -1786 def execute(self, context, self_node, input_node, output_parent): -1787 el = etree.Element('MY') -1788 self.process_children(context, el) -1789 output_parent.append(el) -
1790 -1791 extensions = { ('testns', 'myext') : MyExt() } -1792 -1793 result = tree.xslt(style, extensions=extensions) -1794 self.assertEqual(self._rootstring(result), -1795 _bytes('<A><MYattr="yo"><B><D>E</D></B></MY></A>')) -1796 -
1798 tree = self.parse('<a/>') -1799 style = self.parse('''\ -1800 <xsl:stylesheet version="1.0" -1801 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1802 xmlns:myns="testns" -1803 extension-element-prefixes="myns"> -1804 <xsl:template match="a"> -1805 <myns:myext> -1806 <A/> -1807 </myns:myext> -1808 </xsl:template> -1809 </xsl:stylesheet>''') -1810 -1811 class MyExt(etree.XSLTExtension): -1812 def execute(self, context, self_node, input_node, output_parent): -1813 self.process_children(context, output_parent) -
1814 -1815 extensions = { ('testns', 'myext') : MyExt() } -1816 -1817 result = tree.xslt(style, extensions=extensions) -1818 self.assertEqual(self._rootstring(result), -1819 _bytes('<A/>')) -1820 -
1822 tree = self.parse('<a/>') -1823 style = self.parse('''\ -1824 <xsl:stylesheet version="1.0" -1825 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1826 xmlns:myns="testns" -1827 extension-element-prefixes="myns"> -1828 <xsl:template match="a"> -1829 <myns:myext> -1830 <A/> -1831 </myns:myext> -1832 </xsl:template> -1833 </xsl:stylesheet>''') -1834 -1835 class MyExt(etree.XSLTExtension): -1836 def execute(self, context, self_node, input_node, output_parent): -1837 self.process_children(context, self_node) -
1838 -1839 extensions = { ('testns', 'myext') : MyExt() } -1840 -1841 self.assertRaises(TypeError, tree.xslt, style, extensions=extensions) -1842 -
1844 tree = self.parse('<a/>') -1845 style = self.parse('''\ -1846 <xsl:stylesheet version="1.0" -1847 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1848 xmlns:myns="testns" -1849 extension-element-prefixes="myns"> -1850 <xsl:template match="a"> -1851 <myns:myext> -1852 <A><myns:myext><B/></myns:myext></A> -1853 </myns:myext> -1854 </xsl:template> -1855 </xsl:stylesheet>''') -1856 -1857 class MyExt(etree.XSLTExtension): -1858 callback_call_counter = 0 -1859 def execute(self, context, self_node, input_node, output_parent): -1860 self.callback_call_counter += 1 -1861 el = etree.Element('MY', n=str(self.callback_call_counter)) -1862 self.process_children(context, el) -1863 output_parent.append(el) -
1864 -1865 extensions = { ('testns', 'myext') : MyExt() } -1866 -1867 result = tree.xslt(style, extensions=extensions) -1868 self.assertEqual(self._rootstring(result), -1869 _bytes('<MYn="1"><A><MYn="2"><B/></MY></A></MY>')) -1870 -
1872 tree = self.parse('<a><b>B</b></a>') -1873 style = self.parse('''\ -1874 <xsl:stylesheet version="1.0" -1875 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" -1876 xmlns:myns="testns" -1877 extension-element-prefixes="myns" -1878 exclude-result-prefixes="myns"> -1879 <xsl:template match="a"> -1880 <A><myns:myext>b</myns:myext></A> -1881 </xsl:template> -1882 </xsl:stylesheet>''') -1883 -1884 class MyError(Exception): -1885 pass -
1886 -1887 class MyExt(etree.XSLTExtension): -1888 def execute(self, context, self_node, input_node, output_parent): -1889 raise MyError("expected!") -1890 -1891 extensions = { ('testns', 'myext') : MyExt() } -1892 self.assertRaises(MyError, tree.xslt, style, extensions=extensions) -1893 -1894 # FIXME: DISABLED - implementation seems to be broken -1895 # if someone cares enough about this feature, I take pull requests that fix it. -
1897 tree = self.parse("""\ -1898 <text> -1899 <par>This is <format>arbitrary</format> text in a paragraph</par> -1900 </text>""") -1901 style = self.parse("""\ -1902 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="my" extension-element-prefixes="my" version="1.0"> -1903 <xsl:template match="par"> -1904 <my:par><xsl:apply-templates /></my:par> -1905 </xsl:template> -1906 <xsl:template match="format"> -1907 <my:format><xsl:apply-templates /></my:format> -1908 </xsl:template> -1909 </xsl:stylesheet> -1910 """) -1911 test = self -1912 calls = [] -1913 -1914 class ExtMyPar(etree.XSLTExtension): -1915 def execute(self, context, self_node, input_node, output_parent): -1916 calls.append('par') -1917 p = etree.Element("p") -1918 p.attrib["style"] = "color:red" -1919 self.process_children(context, p) -1920 output_parent.append(p) -
1921 -1922 class ExtMyFormat(etree.XSLTExtension): -1923 def execute(self, context, self_node, input_node, output_parent): -1924 calls.append('format') -1925 content = self.process_children(context) -1926 test.assertEqual(1, len(content)) -1927 test.assertEqual('arbitrary', content[0]) -1928 test.assertEqual('This is ', output_parent.text) -1929 output_parent.text += '*-%s-*' % content[0] -1930 -1931 extensions = {("my", "par"): ExtMyPar(), ("my", "format"): ExtMyFormat()} -1932 transform = etree.XSLT(style, extensions=extensions) -1933 result = transform(tree) -1934 self.assertEqual(['par', 'format'], calls) -1935 self.assertEqual( -1936 b'<p style="color:red">This is *-arbitrary-* text in a paragraph</p>\n', -1937 etree.tostring(result)) -1938 -
1939 -1940 -class Py3XSLTTestCase(HelperTestCase): -
1941 """XSLT tests for etree under Python 3""" -1942 -1943 pytestmark = skipif('sys.version_info < (3,0)') -1944 -
1945 - def test_xslt_result_bytes(self): -
1946 tree = self.parse('<a><b>B</b><c>C</c></a>') -1947 style = self.parse('''\ -1948 <xsl:stylesheet version="1.0" -1949 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1950 <xsl:template match="*" /> -1951 <xsl:template match="/"> -1952 <foo><xsl:value-of select="/a/b/text()" /></foo> -1953 </xsl:template> -1954 </xsl:stylesheet>''') -1955 -1956 st = etree.XSLT(style) -1957 res = st(tree) -1958 self.assertEqual(_bytes('''\ -1959 <?xml version="1.0"?> -1960 <foo>B</foo> -1961 '''), -1962 bytes(res)) -
1963 -
1964 - def test_xslt_result_bytearray(self): -
1965 tree = self.parse('<a><b>B</b><c>C</c></a>') -1966 style = self.parse('''\ -1967 <xsl:stylesheet version="1.0" -1968 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1969 <xsl:template match="*" /> -1970 <xsl:template match="/"> -1971 <foo><xsl:value-of select="/a/b/text()" /></foo> -1972 </xsl:template> -1973 </xsl:stylesheet>''') -1974 -1975 st = etree.XSLT(style) -1976 res = st(tree) -1977 self.assertEqual(_bytes('''\ -1978 <?xml version="1.0"?> -1979 <foo>B</foo> -1980 '''), -1981 bytearray(res)) -
1982 -
1983 - def test_xslt_result_memoryview(self): -
1984 tree = self.parse('<a><b>B</b><c>C</c></a>') -1985 style = self.parse('''\ -1986 <xsl:stylesheet version="1.0" -1987 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -1988 <xsl:template match="*" /> -1989 <xsl:template match="/"> -1990 <foo><xsl:value-of select="/a/b/text()" /></foo> -1991 </xsl:template> -1992 </xsl:stylesheet>''') -1993 -1994 st = etree.XSLT(style) -1995 res = st(tree) -1996 self.assertEqual(_bytes('''\ -1997 <?xml version="1.0"?> -1998 <foo>B</foo> -1999 '''), -2000 bytes(memoryview(res))) -
2001 -
2002 -2003 -def test_suite(): -
2004 suite = unittest.TestSuite() -2005 suite.addTests([unittest.makeSuite(ETreeXSLTTestCase)]) -2006 suite.addTests([unittest.makeSuite(ETreeEXSLTTestCase)]) -2007 suite.addTests([unittest.makeSuite(ETreeXSLTExtFuncTestCase)]) -2008 suite.addTests([unittest.makeSuite(ETreeXSLTExtElementTestCase)]) -2009 if is_python3: -2010 suite.addTests([unittest.makeSuite(Py3XSLTTestCase)]) -2011 suite.addTests( -2012 [make_doctest('../../../doc/extensions.txt')]) -2013 suite.addTests( -2014 [make_doctest('../../../doc/xpathxslt.txt')]) -2015 return suite -
2016 -2017 if __name__ == '__main__': -2018 print('to test use test.py %s' % __file__) -2019 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html b/doc/html/api/lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html deleted file mode 100644 index 0453beb4..00000000 --- a/doc/html/api/lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html +++ /dev/null @@ -1,523 +0,0 @@ - - - - - lxml.tests.test_xslt.ETreeEXSLTTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xslt :: - Class ETreeEXSLTTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeEXSLTTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeEXSLTTestCase
-
- -
-EXSLT tests - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_exslt_str(self) - source code - -
- -
-   - - - - - - -
test_exslt_str_attribute_replace(self) - source code - -
- -
-   - - - - - - -
test_exslt_math(self) - source code - -
- -
-   - - - - - - -
test_exslt_regexp_test(self) - source code - -
- -
-   - - - - - - -
test_exslt_regexp_replace(self) - source code - -
- -
-   - - - - - - -
test_exslt_regexp_match(self) - source code - -
- -
-   - - - - - - -
test_exslt_regexp_match_groups(self) - source code - -
- -
-   - - - - - - -
test_exslt_regexp_match1(self) - source code - -
- -
-   - - - - - - -
test_exslt_regexp_match2(self) - source code - -
- -
-   - - - - - - -
_test_exslt_regexp_match3(self) - source code - -
- -
-   - - - - - - -
_test_exslt_regexp_match4(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html b/doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html deleted file mode 100644 index 887a8a79..00000000 --- a/doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html +++ /dev/null @@ -1,603 +0,0 @@ - - - - - lxml.tests.test_xslt.ETreeXSLTExtElementTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xslt :: - Class ETreeXSLTExtElementTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeXSLTExtElementTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeXSLTExtElementTestCase
-
- -
-Tests for extension elements in XSLT. - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_extension_element(self) - source code - -
- -
-   - - - - - - -
test_extension_element_doc_context(self) - source code - -
- -
-   - - - - - - -
test_extension_element_comment_pi_context(self) - source code - -
- -
-   - - - - - - -
_test_extension_element_attribute_context(self) - source code - -
- -
-   - - - - - - -
test_extension_element_content(self) - source code - -
- -
-   - - - - - - -
test_extension_element_apply_templates(self) - source code - -
- -
-   - - - - - - -
test_extension_element_apply_templates_elements_only(self) - source code - -
- -
-   - - - - - - -
test_extension_element_apply_templates_remove_blank_text(self) - source code - -
- -
-   - - - - - - -
test_extension_element_apply_templates_target_node(self) - source code - -
- -
-   - - - - - - -
test_extension_element_apply_templates_target_node_doc(self) - source code - -
- -
-   - - - - - - -
test_extension_element_process_children(self) - source code - -
- -
-   - - - - - - -
test_extension_element_process_children_to_append_only(self) - source code - -
- -
-   - - - - - - -
test_extension_element_process_children_to_read_only_raise(self) - source code - -
- -
-   - - - - - - -
test_extension_element_process_children_with_subextension_element(self) - source code - -
- -
-   - - - - - - -
test_extension_element_raise(self) - source code - -
- -
-   - - - - - - -
_test_multiple_extension_elements_with_output_parent(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html b/doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html deleted file mode 100644 index 69fe844d..00000000 --- a/doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xslt :: - Class ETreeXSLTExtFuncTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeXSLTExtFuncTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeXSLTExtFuncTestCase
-
- -
-Tests for XPath extension functions in XSLT. - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_extensions1(self) - source code - -
- -
-   - - - - - - -
test_extensions2(self) - source code - -
- -
-   - - - - - - -
test_variable_result_tree_fragment(self) - source code - -
- -
-   - - - - - - -
test_xpath_on_context_node(self) - source code - -
- -
-   - - - - - - -
test_xpath_on_foreign_context_node(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xslt.ETreeXSLTTestCase-class.html b/doc/html/api/lxml.tests.test_xslt.ETreeXSLTTestCase-class.html deleted file mode 100644 index c684c8f0..00000000 --- a/doc/html/api/lxml.tests.test_xslt.ETreeXSLTTestCase-class.html +++ /dev/null @@ -1,1319 +0,0 @@ - - - - - lxml.tests.test_xslt.ETreeXSLTTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xslt :: - Class ETreeXSLTTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ETreeXSLTTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               ETreeXSLTTestCase
-
- -
-XSLT tests etree - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_xslt(self) - source code - -
- -
-   - - - - - - -
test_xslt_elementtree_error(self) - source code - -
- -
-   - - - - - - -
test_xslt_input_none(self) - source code - -
- -
-   - - - - - - -
test_xslt_invalid_stylesheet(self) - source code - -
- -
-   - - - - - - -
test_xslt_copy(self) - source code - -
- -
-   - - - - - - -
_xslt_setup(*args, - **kwds) - source code - -
- -
-   - - - - - - -
test_xslt_utf8(self) - source code - -
- -
-   - - - - - - -
test_xslt_encoding(self) - source code - -
- -
-   - - - - - - -
test_xslt_encoding_override(self) - source code - -
- -
-   - - - - - - -
test_xslt_write_output_bytesio(self) - source code - -
- -
-   - - - - - - -
test_xslt_write_output_failure(self) - source code - -
- -
-   - - - - - - -
test_xslt_write_output_file(self) - source code - -
- -
-   - - - - - - -
test_xslt_write_output_file_path(self) - source code - -
- -
-   - - - - - - -
test_xslt_unicode(self) - source code - -
- -
-   - - - - - - -
test_xslt_unicode_standalone(self) - source code - -
- -
-   - - - - - - -
test_xslt_input(self) - source code - -
- -
-   - - - - - - -
test_xslt_input_partial_doc(self) - source code - -
- -
-   - - - - - - -
test_xslt_broken(self) - source code - -
- -
-   - - - - - - -
test_xslt_parsing_error_log(self) - source code - -
- -
-   - - - - - - -
test_xslt_apply_error_log(self) - source code - -
- -
-   - - - - - - -
test_xslt_parameters(self) - source code - -
- -
-   - - - - - - -
test_xslt_string_parameters(self) - source code - -
- -
-   - - - - - - -
test_xslt_parameter_invalid(self) - source code - -
- -
-   - - - - - - -
test_xslt_parameter_missing(self) - source code - -
- -
-   - - - - - - -
test_xslt_multiple_parameters(self) - source code - -
- -
-   - - - - - - -
test_xslt_parameter_xpath(self) - source code - -
- -
-   - - - - - - -
test_xslt_parameter_xpath_object(self) - source code - -
- -
-   - - - - - - -
test_xslt_default_parameters(self) - source code - -
- -
-   - - - - - - -
test_xslt_html_output(self) - source code - -
- -
-   - - - - - - -
test_xslt_include(self) - source code - -
- -
-   - - - - - - -
test_xslt_include_from_filelike(self) - source code - -
- -
-   - - - - - - -
test_xslt_multiple_transforms(self) - source code - -
- -
-   - - - - - - -
test_xslt_repeat_transform(self) - source code - -
- -
-   - - - - - - -
test_xslt_empty(self) - source code - -
- -
-   - - - - - - -
test_xslt_message(self) - source code - -
- -
-   - - - - - - -
test_xslt_message_terminate(self) - source code - -
- -
-   - - - - - - -
test_xslt_shortcut(self) - source code - -
- -
-   - - - - - - -
test_multiple_elementrees(self) - source code - -
- -
-   - - - - - - -
test_xslt_document_XML(self) - source code - -
- -
-   - - - - - - -
test_xslt_document_parse(self) - source code - -
- -
-   - - - - - - -
test_xslt_document_elementtree(self) - source code - -
- -
-   - - - - - - -
test_xslt_document_error(self) - source code - -
- -
-   - - - - - - -
test_xslt_document_XML_resolver(self) - source code - -
- -
-   - - - - - - -
test_xslt_resolver_url_building(self) - source code - -
- -
-   - - - - - - -
test_xslt_document_parse_allow(self) - source code - -
- -
-   - - - - - - -
test_xslt_document_parse_deny(self) - source code - -
- -
-   - - - - - - -
test_xslt_document_parse_deny_all(self) - source code - -
- -
-   - - - - - - -
test_xslt_access_control_repr(self) - source code - -
- -
-   - - - - - - -
test_xslt_move_result(self) - source code - -
- -
-   - - - - - - -
test_xslt_pi(self) - source code - -
- -
-   - - - - - - -
test_xslt_pi_embedded_xmlid(self) - source code - -
- -
-   - - - - - - -
test_xslt_pi_embedded_id(self) - source code - -
- -
-   - - - - - - -
test_xslt_pi_get(self) - source code - -
- -
-   - - - - - - -
test_xslt_pi_get_all(self) - source code - -
- -
-   - - - - - - -
test_xslt_pi_get_all_reversed(self) - source code - -
- -
-   - - - - - - -
test_xslt_pi_get_unknown(self) - source code - -
- -
-   - - - - - - -
test_xslt_pi_set_replace(self) - source code - -
- -
-   - - - - - - -
test_xslt_pi_set_new(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

_xslt_setup(*args, - **kwds) -

-
source code  -
- - -
-
Decorators:
-
    -
  • @contextlib.contextmanager
  • -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.tests.test_xslt.Py3XSLTTestCase-class.html b/doc/html/api/lxml.tests.test_xslt.Py3XSLTTestCase-class.html deleted file mode 100644 index bb7a3de4..00000000 --- a/doc/html/api/lxml.tests.test_xslt.Py3XSLTTestCase-class.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - - lxml.tests.test_xslt.Py3XSLTTestCase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Package tests :: - Module test_xslt :: - Class Py3XSLTTestCase - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Py3XSLTTestCase

source code

-
-               object --+        
-                        |        
-   unittest.case.TestCase --+    
-                            |    
-common_imports.HelperTestCase --+
-                                |
-                               Py3XSLTTestCase
-
- -
-XSLT tests for etree under Python 3 - - - - - - - - - - -
- - - - - -
Nested Classes[hide private]
-
-

Inherited from unittest.case.TestCase: - failureException -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
test_xslt_result_bytes(self) - source code - -
- -
-   - - - - - - -
test_xslt_result_bytearray(self) - source code - -
- -
-   - - - - - - -
test_xslt_result_memoryview(self) - source code - -
- -
-

Inherited from common_imports.HelperTestCase: - parse, - tearDown -

-

Inherited from common_imports.HelperTestCase (private): - _rootstring -

-

Inherited from unittest.case.TestCase: - __call__, - __eq__, - __hash__, - __init__, - __ne__, - __repr__, - __str__, - addCleanup, - addTypeEqualityFunc, - assertAlmostEqual, - assertAlmostEquals, - assertDictContainsSubset, - assertDictEqual, - assertEqual, - assertEquals, - assertFalse, - assertGreater, - assertGreaterEqual, - assertIn, - assertIs, - assertIsInstance, - assertIsNone, - assertIsNot, - assertIsNotNone, - assertItemsEqual, - assertLess, - assertLessEqual, - assertListEqual, - assertMultiLineEqual, - assertNotAlmostEqual, - assertNotAlmostEquals, - assertNotEqual, - assertNotEquals, - assertNotIn, - assertNotIsInstance, - assertNotRegexpMatches, - assertRaises, - assertRaisesRegexp, - assertRegexpMatches, - assertSequenceEqual, - assertSetEqual, - assertTrue, - assertTupleEqual, - assert_, - countTestCases, - debug, - defaultTestResult, - doCleanups, - fail, - failIf, - failIfAlmostEqual, - failIfEqual, - failUnless, - failUnlessAlmostEqual, - failUnlessEqual, - failUnlessRaises, - id, - run, - setUp, - shortDescription, - skipTest -

-

Inherited from unittest.case.TestCase (private): - _addSkip, - _baseAssertEqual, - _deprecate, - _formatMessage, - _getAssertEqualityFunc, - _truncateMessage -

-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Class Methods[hide private]
-
-

Inherited from unittest.case.TestCase: - setUpClass, - tearDownClass -

-
- - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - pytestmark = <lxml.tests.common_imports.skipif object> -
-

Inherited from unittest.case.TestCase: - longMessage, - maxDiff -

-

Inherited from unittest.case.TestCase (private): - _classSetupFailed, - _diffThreshold -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.usedoctest-module.html b/doc/html/api/lxml.usedoctest-module.html deleted file mode 100644 index a0b407fc..00000000 --- a/doc/html/api/lxml.usedoctest-module.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - lxml.usedoctest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module usedoctest - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module usedoctest

source code

-

Doctest module for XML comparison.

-

Usage:

-
->>> import lxml.usedoctest
->>> # now do your XML doctests ...
-
-

See lxml.doctestcompare

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/lxml.usedoctest-pysrc.html b/doc/html/api/lxml.usedoctest-pysrc.html deleted file mode 100644 index 2bba7d3e..00000000 --- a/doc/html/api/lxml.usedoctest-pysrc.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - lxml.usedoctest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package lxml :: - Module usedoctest - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module lxml.usedoctest

-
- 1  """Doctest module for XML comparison. 
- 2   
- 3  Usage:: 
- 4   
- 5     >>> import lxml.usedoctest 
- 6     >>> # now do your XML doctests ... 
- 7   
- 8  See `lxml.doctestcompare` 
- 9  """ 
-10   
-11  from lxml import doctestcompare 
-12   
-13  doctestcompare.temp_install(del_module=__name__) 
-14   
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/mimetools.Message-class.html b/doc/html/api/mimetools.Message-class.html deleted file mode 100644 index f05bebdc..00000000 --- a/doc/html/api/mimetools.Message-class.html +++ /dev/null @@ -1,386 +0,0 @@ - - - - - mimetools.Message - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - mimetools :: - Message :: - Class Message - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Message

-
-rfc822.Message --+
-                 |
-                Message
-
- -
-A derived class of rfc822.Message that knows about MIME headers and -contains some hooks for decoding encoded and multipart messages. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - fp, - seekable=1)
- Initialize the class instance and read the headers.
- - -
- -
-   - - - - - - -
getencoding(self) - - -
- -
-   - - - - - - -
getmaintype(self) - - -
- -
-   - - - - - - -
getparam(self, - name) - - -
- -
-   - - - - - - -
getparamnames(self) - - -
- -
-   - - - - - - -
getplist(self) - - -
- -
-   - - - - - - -
getsubtype(self) - - -
- -
-   - - - - - - -
gettype(self) - - -
- -
-   - - - - - - -
parseplist(self) - - -
- -
-   - - - - - - -
parsetype(self) - - -
- -
-

Inherited from rfc822.Message: - __contains__, - __delitem__, - __getitem__, - __iter__, - __len__, - __setitem__, - __str__, - get, - getaddr, - getaddrlist, - getallmatchingheaders, - getdate, - getdate_tz, - getfirstmatchingheader, - getheader, - getheaders, - getrawheader, - has_key, - iscomment, - isheader, - islast, - items, - keys, - readheaders, - rewindbody, - setdefault, - values -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - fp, - seekable=1) -
(Constructor) -

-
  -
- - Initialize the class instance and read the headers. -
-
Overrides: - rfc822.Message.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/module-tree.html b/doc/html/api/module-tree.html deleted file mode 100644 index ddc94b77..00000000 --- a/doc/html/api/module-tree.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - Module Hierarchy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
- [ Module Hierarchy - | Class Hierarchy ] -

-

Module Hierarchy

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/redirect.html b/doc/html/api/redirect.html deleted file mode 100644 index 4b62b2c0..00000000 --- a/doc/html/api/redirect.html +++ /dev/null @@ -1,38 +0,0 @@ -Epydoc Redirect Page - - - - - - - - -

Epydoc Auto-redirect page

- -

When javascript is enabled, this page will redirect URLs of -the form redirect.html#dotted.name to the -documentation for the object with the given fully-qualified -dotted name.

-

 

- - - - - diff --git a/doc/html/api/str-class.html b/doc/html/api/str-class.html deleted file mode 100644 index 138b1536..00000000 --- a/doc/html/api/str-class.html +++ /dev/null @@ -1,1651 +0,0 @@ - - - - - str - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - str :: - Class str - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class str

-
-object --+    
-         |    
-basestring --+
-             |
-            str
-
- -
Known Subclasses:
-
- -
- -
-

str(object='') -> string

-

Return a nice string representation of the object. -If the argument is a string, the return value is the same object.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__add__(x, - y)
- x+y
- - -
- -
-   - - - - - - -
__contains__(x, - y)
- y in x
- - -
- -
-   - - - - - - -
__eq__(x, - y)
- x==y
- - -
- -
- string - - - - - - -
__format__(S, - format_spec)
- Return a formatted version of S as described by format_spec.
- - -
- -
-   - - - - - - -
__ge__(x, - y)
- x>=y
- - -
- -
-   - - - - - - -
__getattribute__(...)
- x.__getattribute__('name') <==> x.name
- - -
- -
-   - - - - - - -
__getitem__(x, - y)
- x[y]
- - -
- -
-   - - - - - - -
__getnewargs__(...) - - -
- -
-   - - - - - - -
__getslice__(x, - i, - j)
- x[i:j]
- - -
- -
-   - - - - - - -
__gt__(x, - y)
- x>y
- - -
- -
-   - - - - - - -
__hash__(x)
- hash(x)
- - -
- -
-   - - - - - - -
__le__(x, - y)
- x<=y
- - -
- -
-   - - - - - - -
__len__(x)
- len(x)
- - -
- -
-   - - - - - - -
__lt__(x, - y)
- x<y
- - -
- -
-   - - - - - - -
__mod__(x, - y)
- x%y
- - -
- -
-   - - - - - - -
__mul__(x, - n)
- x*n
- - -
- -
-   - - - - - - -
__ne__(x, - y)
- x!=y
- - -
- -
- a new object with type S, a subtype of T - - - - - - -
__new__(T, - S, - ...) - - -
- -
-   - - - - - - -
__repr__(x)
- repr(x)
- - -
- -
-   - - - - - - -
__rmod__(x, - y)
- y%x
- - -
- -
-   - - - - - - -
__rmul__(x, - n)
- n*x
- - -
- -
- size of S in memory, in bytes - - - - - - -
__sizeof__(S)
- size of object in memory, in bytes
- - -
- -
-   - - - - - - -
__str__(x)
- str(x)
- - -
- -
-   - - - - - - -
_formatter_field_name_split(...) - - -
- -
-   - - - - - - -
_formatter_parser(...) - - -
- -
- string - - - - - - -
capitalize(S)
- Return a copy of the string S with only its first character -capitalized.
- - -
- -
- string - - - - - - -
center(S, - width, - fillchar=...)
- Return S centered in a string of length width. Padding is -done using the specified fill character (default is a space)
- - -
- -
- int - - - - - - -
count(S, - sub, - start=..., - end=...)
- Return the number of non-overlapping occurrences of substring sub in -string S[start:end]. Optional arguments start and end are interpreted -as in slice notation.
- - -
- -
- object - - - - - - -
decode(S, - encoding=..., - errors=...)
- Decodes S using the codec registered for encoding. encoding defaults -to the default encoding. errors may be given to set a different error -handling scheme. Default is 'strict' meaning that encoding errors raise -a UnicodeDecodeError. Other possible values are 'ignore' and 'replace' -as well as any other name registered with codecs.register_error that is -able to handle UnicodeDecodeErrors.
- - -
- -
- object - - - - - - -
encode(S, - encoding=..., - errors=...)
- Encodes S using the codec registered for encoding. encoding defaults -to the default encoding. errors may be given to set a different error -handling scheme. Default is 'strict' meaning that encoding errors raise -a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and -'xmlcharrefreplace' as well as any other name registered with -codecs.register_error that is able to handle UnicodeEncodeErrors.
- - -
- -
- bool - - - - - - -
endswith(S, - suffix, - start=..., - end=...)
- Return True if S ends with the specified suffix, False otherwise. -With optional start, test S beginning at that position. -With optional end, stop comparing S at that position. -suffix can also be a tuple of strings to try.
- - -
- -
- string - - - - - - -
expandtabs(S, - tabsize=...)
- Return a copy of S where all tab characters are expanded using spaces. -If tabsize is not given, a tab size of 8 characters is assumed.
- - -
- -
- int - - - - - - -
find(S, - sub, - start=... , - end=...)
- Return the lowest index in S where substring sub is found, -such that sub is contained within S[start:end]. Optional -arguments start and end are interpreted as in slice notation.
- - -
- -
- string - - - - - - -
format(S, - *args, - **kwargs)
- Return a formatted version of S, using substitutions from args and kwargs. -The substitutions are identified by braces ('{' and '}').
- - -
- -
- int - - - - - - -
index(S, - sub, - start=... , - end=...)
- Like S.find() but raise ValueError when the substring is not found.
- - -
- -
- bool - - - - - - -
isalnum(S)
- Return True if all characters in S are alphanumeric -and there is at least one character in S, False otherwise.
- - -
- -
- bool - - - - - - -
isalpha(S)
- Return True if all characters in S are alphabetic -and there is at least one character in S, False otherwise.
- - -
- -
- bool - - - - - - -
isdigit(S)
- Return True if all characters in S are digits -and there is at least one character in S, False otherwise.
- - -
- -
- bool - - - - - - -
islower(S)
- Return True if all cased characters in S are lowercase and there is -at least one cased character in S, False otherwise.
- - -
- -
- bool - - - - - - -
isspace(S)
- Return True if all characters in S are whitespace -and there is at least one character in S, False otherwise.
- - -
- -
- bool - - - - - - -
istitle(S)
- Return True if S is a titlecased string and there is at least one -character in S, i.e. uppercase characters may only follow uncased -characters and lowercase characters only cased ones. Return False -otherwise.
- - -
- -
- bool - - - - - - -
isupper(S)
- Return True if all cased characters in S are uppercase and there is -at least one cased character in S, False otherwise.
- - -
- -
- string - - - - - - -
join(S, - iterable)
- Return a string which is the concatenation of the strings in the -iterable. The separator between elements is S.
- - -
- -
- string - - - - - - -
ljust(S, - width, - fillchar=...)
- Return S left-justified in a string of length width. Padding is -done using the specified fill character (default is a space).
- - -
- -
- string - - - - - - -
lower(S)
- Return a copy of the string S converted to lowercase.
- - -
- -
- string or unicode - - - - - - -
lstrip(S, - chars=...)
- Return a copy of the string S with leading whitespace removed. -If chars is given and not None, remove characters in chars instead. -If chars is unicode, S will be converted to unicode before stripping
- - -
- -
- (head, sep, tail) - - - - - - -
partition(S, - sep)
- Search for the separator sep in S, and return the part before it, -the separator itself, and the part after it. If the separator is not -found, return S and two empty strings.
- - -
- -
- string - - - - - - -
replace(S, - old, - new, - count=...)
- Return a copy of string S with all occurrences of substring -old replaced by new. If the optional argument count is -given, only the first count occurrences are replaced.
- - -
- -
- int - - - - - - -
rfind(S, - sub, - start=... , - end=...)
- Return the highest index in S where substring sub is found, -such that sub is contained within S[start:end]. Optional -arguments start and end are interpreted as in slice notation.
- - -
- -
- int - - - - - - -
rindex(S, - sub, - start=... , - end=...)
- Like S.rfind() but raise ValueError when the substring is not found.
- - -
- -
- string - - - - - - -
rjust(S, - width, - fillchar=...)
- Return S right-justified in a string of length width. Padding is -done using the specified fill character (default is a space)
- - -
- -
- (head, sep, tail) - - - - - - -
rpartition(S, - sep)
- Search for the separator sep in S, starting at the end of S, and return -the part before it, the separator itself, and the part after it. If the -separator is not found, return two empty strings and S.
- - -
- -
- list of strings - - - - - - -
rsplit(S, - sep=... , - maxsplit=...)
- Return a list of the words in the string S, using sep as the -delimiter string, starting at the end of the string and working -to the front. If maxsplit is given, at most maxsplit splits are -done. If sep is not specified or is None, any whitespace string -is a separator.
- - -
- -
- string or unicode - - - - - - -
rstrip(S, - chars=...)
- Return a copy of the string S with trailing whitespace removed. -If chars is given and not None, remove characters in chars instead. -If chars is unicode, S will be converted to unicode before stripping
- - -
- -
- list of strings - - - - - - -
split(S, - sep=... , - maxsplit=...)
- Return a list of the words in the string S, using sep as the -delimiter string. If maxsplit is given, at most maxsplit -splits are done. If sep is not specified or is None, any -whitespace string is a separator and empty strings are removed -from the result.
- - -
- -
- list of strings - - - - - - -
splitlines(S, - keepends=False)
- Return a list of the lines in S, breaking at line boundaries. -Line breaks are not included in the resulting list unless keepends -is given and true.
- - -
- -
- bool - - - - - - -
startswith(S, - prefix, - start=..., - end=...)
- Return True if S starts with the specified prefix, False otherwise. -With optional start, test S beginning at that position. -With optional end, stop comparing S at that position. -prefix can also be a tuple of strings to try.
- - -
- -
- string or unicode - - - - - - -
strip(S, - chars=...)
- Return a copy of the string S with leading and trailing -whitespace removed. -If chars is given and not None, remove characters in chars instead. -If chars is unicode, S will be converted to unicode before stripping
- - -
- -
- string - - - - - - -
swapcase(S)
- Return a copy of the string S with uppercase characters -converted to lowercase and vice versa.
- - -
- -
- string - - - - - - -
title(S)
- Return a titlecased version of S, i.e. words start with uppercase -characters, all remaining cased characters have lowercase.
- - -
- -
- string - - - - - - -
translate(S, - table, - deletechars=...)
- Return a copy of the string S, where all characters occurring -in the optional argument deletechars are removed, and the -remaining characters have been mapped through the given -translation table, which must be a string of length 256 or None. -If the table argument is None, no translation is applied and -the operation simply removes the characters in deletechars.
- - -
- -
- string - - - - - - -
upper(S)
- Return a copy of the string S converted to uppercase.
- - -
- -
- string - - - - - - -
zfill(S, - width)
- Pad a numeric string S with zeros on the left, to fill a field -of the specified width. The string S is never truncated.
- - -
- -
-

Inherited from object: - __delattr__, - __init__, - __reduce__, - __reduce_ex__, - __setattr__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__format__(S, - format_spec) -

-
  -
- - Return a formatted version of S as described by format_spec. -
-
Returns: string
-
Overrides: - object.__format__ -
-
-
-
- -
- -
- - -
-

__getattribute__(...) -

-
  -
- - x.__getattribute__('name') <==> x.name -
-
Overrides: - object.__getattribute__ -
-
-
-
- -
- -
- - -
-

__getslice__(x, - i, - j) -
(Slicling operator) -

-
  -
- -

x[i:j]

-

Use of negative indices is not supported.

-
-
-
-
- -
- -
- - -
-

__hash__(x) -
(Hashing function) -

-
  -
- - hash(x) -
-
Overrides: - object.__hash__ -
-
-
-
- -
- -
- - -
-

__new__(T, - S, - ...) -

-
  -
- - -
-
Returns: a new object with type S, a subtype of T
-
Overrides: - object.__new__ -
-
-
-
- -
- -
- - -
-

__repr__(x) -
(Representation operator) -

-
  -
- - repr(x) -
-
Overrides: - object.__repr__ -
-
-
-
- -
- -
- - -
-

__sizeof__(S) -

-
  -
- - size of object in memory, in bytes -
-
Returns: size of S in memory, in bytes
-
Overrides: - object.__sizeof__ -
-
-
-
- -
- -
- - -
-

__str__(x) -
(Informal representation operator) -

-
  -
- - str(x) -
-
Overrides: - object.__str__ -
-
-
-
- -
- -
- - -
-

find(S, - sub, - start=... , - end=...) -

-
  -
- -

Return the lowest index in S where substring sub is found, -such that sub is contained within S[start:end]. Optional -arguments start and end are interpreted as in slice notation.

-

Return -1 on failure.

-
-
Returns: int
-
-
-
- -
- -
- - -
-

rfind(S, - sub, - start=... , - end=...) -

-
  -
- -

Return the highest index in S where substring sub is found, -such that sub is contained within S[start:end]. Optional -arguments start and end are interpreted as in slice notation.

-

Return -1 on failure.

-
-
Returns: int
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/toc-everything.html b/doc/html/api/toc-everything.html deleted file mode 100644 index 2d1c86ed..00000000 --- a/doc/html/api/toc-everything.html +++ /dev/null @@ -1,1352 +0,0 @@ - - - - - Everything - - - - - -

Everything

-
-

All Classes

- abc.ABCMeta
cssselect.parser.SelectorError
cssselect.parser.SelectorSyntaxError
cssselect.xpath.ExpressionError
cssselect.xpath.XPathExpr
exceptions.AssertionError
lxml.ElementInclude.FatalIncludeError
lxml.builder.ElementMaker
lxml.cssselect.CSSSelector
- - lxml.doctestcompare.LHTMLOutputChecker
lxml.doctestcompare.LXMLOutputChecker
- - lxml.etree.AttributeBasedElementClassLookup
lxml.etree.C14NError
lxml.etree.CDATA
lxml.etree.CommentBase
lxml.etree.CustomElementClassLookup
lxml.etree.DTD
lxml.etree.DTDError
lxml.etree.DTDParseError
lxml.etree.DTDValidateError
- lxml.etree.DocumentInvalid
lxml.etree.ETCompatXMLParser
lxml.etree.ETXPath
lxml.etree.ElementBase
- lxml.etree.ElementClassLookup
lxml.etree.ElementDefaultClassLookup
- lxml.etree.ElementNamespaceClassLookup
- lxml.etree.EntityBase
lxml.etree.Error
lxml.etree.ErrorDomains
lxml.etree.ErrorLevels
lxml.etree.ErrorTypes
lxml.etree.FallbackElementClassLookup
lxml.etree.HTMLParser
- lxml.etree.LxmlError
lxml.etree.LxmlRegistryError
lxml.etree.LxmlSyntaxError
lxml.etree.NamespaceRegistryError
lxml.etree.PIBase
lxml.etree.ParseError
lxml.etree.ParserBasedElementClassLookup
lxml.etree.ParserError
lxml.etree.PyErrorLog
lxml.etree.PythonElementClassLookup
lxml.etree.QName
lxml.etree.RelaxNG
lxml.etree.RelaxNGError
lxml.etree.RelaxNGErrorTypes
lxml.etree.RelaxNGParseError
lxml.etree.RelaxNGValidateError
lxml.etree.Resolver
lxml.etree.Schematron
lxml.etree.SchematronError
lxml.etree.SchematronParseError
lxml.etree.SchematronValidateError
lxml.etree.SerialisationError
- lxml.etree.TreeBuilder
lxml.etree.XInclude
lxml.etree.XIncludeError
lxml.etree.XMLParser
- lxml.etree.XMLSchema
lxml.etree.XMLSchemaError
lxml.etree.XMLSchemaParseError
lxml.etree.XMLSchemaValidateError
lxml.etree.XMLSyntaxError
lxml.etree.XPath
lxml.etree.XPathDocumentEvaluator
- lxml.etree.XPathError
lxml.etree.XPathEvalError
lxml.etree.XPathFunctionError
lxml.etree.XPathResultError
lxml.etree.XPathSyntaxError
lxml.etree.XSLT
lxml.etree.XSLTAccessControl
lxml.etree.XSLTApplyError
lxml.etree.XSLTError
lxml.etree.XSLTExtension
lxml.etree.XSLTExtensionError
lxml.etree.XSLTParseError
lxml.etree.XSLTSaveError
- - - - - - - - - - - - - - - - - - - - - - - - - - - lxml.etree.iterparse
lxml.etree.iterwalk
- - - - - - - - - - - - - - - - - - - - - - - lxml.html.clean.Cleaner
- - - - - - - lxml.html.formfill.DefaultErrorCreator
lxml.html.formfill.FormNotFound
lxml.html.html5parser.HTMLParser
lxml.html.html5parser.XHTMLParser
- lxml.isoschematron.Schematron
lxml.objectify.BoolElement
lxml.objectify.ElementMaker
lxml.objectify.FloatElement
lxml.objectify.IntElement
lxml.objectify.LongElement
lxml.objectify.NoneElement
lxml.objectify.NumberElement
lxml.objectify.ObjectPath
lxml.objectify.ObjectifiedDataElement
lxml.objectify.ObjectifiedElement
lxml.objectify.ObjectifyElementClassLookup
lxml.objectify.PyType
lxml.objectify.StringElement
lxml.sax.ElementTreeContentHandler
lxml.sax.ElementTreeProducer
lxml.sax.SaxError
lxml.tests.common_imports.HelperTestCase
lxml.tests.common_imports.LargeFileLike
lxml.tests.common_imports.LargeFileLikeUnicode
lxml.tests.common_imports.SillyFileLike
lxml.tests.common_imports.skipif
lxml.tests.dummy_http_server.HTTPRequestCollector
lxml.tests.dummy_http_server.WebServer
- lxml.tests.test_builder.BuilderTestCase
lxml.tests.test_classlookup.ClassLookupTestCase
lxml.tests.test_classlookup.ProxyTestCase
lxml.tests.test_css.CSSTestCase
lxml.tests.test_doctestcompare.DoctestCompareTest
lxml.tests.test_doctestcompare.DummyInput
lxml.tests.test_dtd.ETreeDtdTestCase
lxml.tests.test_elementpath.EtreeElementPathTestCase
lxml.tests.test_elementtree.CElementTreeTestCase
lxml.tests.test_elementtree.ETreePullTestCase
lxml.tests.test_elementtree.ETreeTestCase
lxml.tests.test_elementtree.ElementTreeTestCase
- - lxml.tests.test_errors.ErrorTestCase
lxml.tests.test_etree.ETreeC14NTestCase
lxml.tests.test_etree.ETreeErrorLogTest
lxml.tests.test_etree.ETreeOnlyTestCase
lxml.tests.test_etree.ETreeWriteTestCase
lxml.tests.test_etree.ETreeXIncludeTestCase
lxml.tests.test_etree.ElementIncludeTestCase
lxml.tests.test_etree.XMLPullParserTest
- lxml.tests.test_external_document.ExternalDocumentTestCase
lxml.tests.test_htmlparser.HtmlParserTestCase
lxml.tests.test_http_io.HttpIOTestCase
lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase
lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase
lxml.tests.test_incremental_xmlfile.HtmlFileTestCase
lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase
lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike
lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase
lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase
- lxml.tests.test_io.ETreeIOTestCase
lxml.tests.test_io.ElementTreeIOTestCase
- lxml.tests.test_isoschematron.ETreeISOSchematronTestCase
lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase
lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class
lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class
lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class
lxml.tests.test_objectify.ObjectifyTestCase
lxml.tests.test_pyclasslookup.PyClassLookupTestCase
lxml.tests.test_relaxng.ETreeRelaxNGTestCase
lxml.tests.test_relaxng.RelaxNGCompactTestCase
lxml.tests.test_sax.ETreeSaxTestCase
lxml.tests.test_schematron.ETreeSchematronTestCase
lxml.tests.test_threading.ThreadPipelineTestCase
lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker
lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker
lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker
lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker
lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker
lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker
lxml.tests.test_threading.ThreadPipelineTestCase.Validate
lxml.tests.test_threading.ThreadPipelineTestCase.Worker
lxml.tests.test_threading.ThreadingTestCase
lxml.tests.test_unicode.EncodingsTestCase
lxml.tests.test_unicode.UnicodeTestCase
lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase
lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver
lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase
lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase
lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase
lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase
lxml.tests.test_xpathevaluator.ETreeXPathTestCase
lxml.tests.test_xslt.ETreeEXSLTTestCase
lxml.tests.test_xslt.ETreeXSLTExtElementTestCase
lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase
lxml.tests.test_xslt.ETreeXSLTTestCase
lxml.tests.test_xslt.Py3XSLTTestCase
mimetools.Message
str
xml.etree.ElementTree.Element
xml.etree.ElementTree.ElementTree
xml.etree.ElementTree.ParseError
xml.etree.ElementTree.QName
xml.etree.ElementTree.TreeBuilder
xml.etree.ElementTree.XMLParser
xml.etree.ElementTree._IterParseIterator
xml.etree.ElementTree._SimpleElementPath

All Functions

- - - - lxml.ElementInclude.default_loader
lxml.ElementInclude.include
- lxml.builder.__reduce_cython__
lxml.builder.__setstate_cython__
- - - lxml.doctestcompare.install
- - lxml.doctestcompare.temp_install
lxml.etree.Comment
lxml.etree.Element
lxml.etree.ElementTree
lxml.etree.Entity
lxml.etree.Extension
lxml.etree.FunctionNamespace
lxml.etree.HTML
lxml.etree.PI
lxml.etree.SubElement
lxml.etree.XML
lxml.etree.XMLDTDID
lxml.etree.XMLID
lxml.etree.XPathEvaluator
- lxml.etree.cleanup_namespaces
lxml.etree.clear_error_log
lxml.etree.dump
lxml.etree.fromstring
lxml.etree.fromstringlist
lxml.etree.get_default_parser
lxml.etree.iselement
lxml.etree.parse
lxml.etree.parseid
lxml.etree.register_namespace
lxml.etree.set_default_parser
lxml.etree.set_element_class_lookup
lxml.etree.strip_attributes
lxml.etree.strip_elements
lxml.etree.strip_tags
lxml.etree.tostring
lxml.etree.tostringlist
lxml.etree.tounicode
lxml.etree.use_global_python_log
lxml.get_include
lxml.html.ElementSoup.parse
lxml.html.builder.CLASS
lxml.html.builder.FOR
- - - - - - - lxml.html.clean.autolink
lxml.html.clean.autolink_html
lxml.html.clean.clean_html
lxml.html.clean.word_break
lxml.html.clean.word_break_html
- - - - - - - - - - - - - - - lxml.html.diff.html_annotate
- lxml.html.diff.htmldiff
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - lxml.html.formfill.fill_form
lxml.html.formfill.fill_form_html
lxml.html.formfill.insert_errors
lxml.html.formfill.insert_errors_html
- - lxml.html.html5parser.document_fromstring
lxml.html.html5parser.fragment_fromstring
lxml.html.html5parser.fragments_fromstring
lxml.html.html5parser.fromstring
lxml.html.html5parser.parse
- - - - lxml.html.soupparser.convert_tree
lxml.html.soupparser.fromstring
- lxml.html.soupparser.parse
- - - lxml.isoschematron.stylesheet_params
lxml.objectify.DataElement
lxml.objectify.Element
lxml.objectify.XML
- - - - lxml.objectify.annotate
lxml.objectify.deannotate
lxml.objectify.dump
lxml.objectify.enable_recursive_str
lxml.objectify.fromstring
lxml.objectify.getRegisteredTypes
lxml.objectify.makeparser
lxml.objectify.parse
lxml.objectify.pyannotate
lxml.objectify.pytypename
lxml.objectify.set_default_parser
lxml.objectify.set_pytype_attribute_tag
lxml.objectify.xsiannotate
- lxml.sax.saxify
- - - - - - lxml.tests.common_imports.canonicalize
lxml.tests.common_imports.fileInTestDir
lxml.tests.common_imports.fileUrlInTestDir
lxml.tests.common_imports.filter_by_version
lxml.tests.common_imports.make_doctest
lxml.tests.common_imports.make_version_tuple
lxml.tests.common_imports.path2url
lxml.tests.common_imports.readFileInTestDir
lxml.tests.common_imports.read_file
lxml.tests.common_imports.unentitify
lxml.tests.common_imports.write_to_file
lxml.tests.dummy_http_server.build_web_server
lxml.tests.dummy_http_server.webserver
lxml.tests.selftest.bad_find
lxml.tests.selftest.bug_xmltoolkit25
lxml.tests.selftest.bug_xmltoolkit28
lxml.tests.selftest.check_element
lxml.tests.selftest.check_element_tree
lxml.tests.selftest.check_mapping
lxml.tests.selftest.check_string
lxml.tests.selftest.check_string_or_none
lxml.tests.selftest.encoding
lxml.tests.selftest.find
lxml.tests.selftest.fix_compatibility
lxml.tests.selftest.interface
lxml.tests.selftest.iterators
lxml.tests.selftest.iterparse
lxml.tests.selftest.namespace
lxml.tests.selftest.normalize_crlf
lxml.tests.selftest.parsefile
lxml.tests.selftest.parseliteral
lxml.tests.selftest.qname
lxml.tests.selftest.serialize
lxml.tests.selftest.simpleops
lxml.tests.selftest.stdout
lxml.tests.selftest.summarize
lxml.tests.selftest.summarize_list
lxml.tests.selftest.writefile
lxml.tests.selftest.writestring
lxml.tests.selftest.xinclude
lxml.tests.selftest.xinclude_default
lxml.tests.selftest.xinclude_loader
lxml.tests.selftest.xpath_tokenizer
lxml.tests.selftest2.attrib
lxml.tests.selftest2.cdata
lxml.tests.selftest2.check_element
lxml.tests.selftest2.check_element_tree
lxml.tests.selftest2.check_mapping
lxml.tests.selftest2.check_string
lxml.tests.selftest2.copy
lxml.tests.selftest2.element
lxml.tests.selftest2.encoding
lxml.tests.selftest2.find
lxml.tests.selftest2.makeelement
lxml.tests.selftest2.parsefile
lxml.tests.selftest2.qname
lxml.tests.selftest2.serialize
lxml.tests.selftest2.stdout
lxml.tests.selftest2.summarize
lxml.tests.selftest2.summarize_list
lxml.tests.selftest2.unserialize
lxml.tests.selftest2.writefile
lxml.tests.test_builder.test_suite
lxml.tests.test_classlookup.test_suite
lxml.tests.test_css.test_suite
lxml.tests.test_doctestcompare.indent
lxml.tests.test_doctestcompare.test_suite
lxml.tests.test_dtd.test_suite
lxml.tests.test_elementpath.normalize_crlf
lxml.tests.test_elementpath.summarize
lxml.tests.test_elementpath.summarize_list
lxml.tests.test_elementpath.test_suite
lxml.tests.test_elementtree.test_suite
lxml.tests.test_errors.test_suite
lxml.tests.test_etree.test_suite
lxml.tests.test_etree.tmpfile
lxml.tests.test_external_document.test_suite
lxml.tests.test_htmlparser.test_suite
lxml.tests.test_http_io.test_suite
lxml.tests.test_incremental_xmlfile.test_suite
lxml.tests.test_io.test_suite
lxml.tests.test_isoschematron.test_suite
lxml.tests.test_nsclasses.test_suite
lxml.tests.test_objectify.test_suite
lxml.tests.test_pyclasslookup.test_suite
lxml.tests.test_relaxng.test_suite
lxml.tests.test_sax.test_suite
lxml.tests.test_schematron.test_suite
lxml.tests.test_threading.test_suite
lxml.tests.test_unicode.test_suite
lxml.tests.test_xmlschema.test_suite
lxml.tests.test_xpathevaluator.argsTest1
lxml.tests.test_xpathevaluator.argsTest2
lxml.tests.test_xpathevaluator.booleanTest
lxml.tests.test_xpathevaluator.floatTest
lxml.tests.test_xpathevaluator.resultTypesTest
lxml.tests.test_xpathevaluator.resultTypesTest2
lxml.tests.test_xpathevaluator.setTest
lxml.tests.test_xpathevaluator.setTest2
lxml.tests.test_xpathevaluator.stringListTest
lxml.tests.test_xpathevaluator.stringTest
lxml.tests.test_xpathevaluator.tag
lxml.tests.test_xpathevaluator.tag_or_value
lxml.tests.test_xpathevaluator.test_suite
lxml.tests.test_xpathevaluator.xpath
lxml.tests.test_xslt.test_suite

All Variables

- lxml.ElementInclude.XINCLUDE
lxml.ElementInclude.XINCLUDE_FALLBACK
lxml.ElementInclude.XINCLUDE_INCLUDE
lxml.ElementInclude.XINCLUDE_ITER_TAG
lxml.ElementInclude.__package__
lxml.__package__
lxml.builder.E
lxml.builder.__package__
lxml.builder.__pyx_capi__
lxml.builder.__test__
- - lxml.doctestcompare.NOPARSE_MARKUP
lxml.doctestcompare.PARSE_HTML
lxml.doctestcompare.PARSE_XML
- - - - - - lxml.etree.DEBUG
lxml.etree.LIBXML_COMPILED_VERSION
lxml.etree.LIBXML_VERSION
lxml.etree.LIBXSLT_COMPILED_VERSION
lxml.etree.LIBXSLT_VERSION
lxml.etree.LXML_VERSION
- - - - - - - - - - - - - - - - lxml.html.builder.A
lxml.html.builder.ABBR
lxml.html.builder.ACRONYM
lxml.html.builder.ADDRESS
lxml.html.builder.APPLET
lxml.html.builder.AREA
lxml.html.builder.B
lxml.html.builder.BASE
lxml.html.builder.BASEFONT
lxml.html.builder.BDO
lxml.html.builder.BIG
lxml.html.builder.BLOCKQUOTE
lxml.html.builder.BODY
lxml.html.builder.BR
lxml.html.builder.BUTTON
lxml.html.builder.CAPTION
lxml.html.builder.CENTER
lxml.html.builder.CITE
lxml.html.builder.CODE
lxml.html.builder.COL
lxml.html.builder.COLGROUP
lxml.html.builder.DD
lxml.html.builder.DEL
lxml.html.builder.DFN
lxml.html.builder.DIR
lxml.html.builder.DIV
lxml.html.builder.DL
lxml.html.builder.DT
lxml.html.builder.E
lxml.html.builder.EM
lxml.html.builder.FIELDSET
lxml.html.builder.FONT
lxml.html.builder.FORM
lxml.html.builder.FRAME
lxml.html.builder.FRAMESET
lxml.html.builder.H1
lxml.html.builder.H2
lxml.html.builder.H3
lxml.html.builder.H4
lxml.html.builder.H5
lxml.html.builder.H6
lxml.html.builder.HEAD
lxml.html.builder.HR
lxml.html.builder.HTML
lxml.html.builder.I
lxml.html.builder.IFRAME
lxml.html.builder.IMG
lxml.html.builder.INPUT
lxml.html.builder.INS
lxml.html.builder.ISINDEX
lxml.html.builder.KBD
lxml.html.builder.LABEL
lxml.html.builder.LEGEND
lxml.html.builder.LI
lxml.html.builder.LINK
lxml.html.builder.MAP
lxml.html.builder.MENU
lxml.html.builder.META
lxml.html.builder.NOFRAMES
lxml.html.builder.NOSCRIPT
lxml.html.builder.OBJECT
lxml.html.builder.OL
lxml.html.builder.OPTGROUP
lxml.html.builder.OPTION
lxml.html.builder.P
lxml.html.builder.PARAM
lxml.html.builder.PRE
lxml.html.builder.Q
lxml.html.builder.S
lxml.html.builder.SAMP
lxml.html.builder.SCRIPT
lxml.html.builder.SELECT
lxml.html.builder.SMALL
lxml.html.builder.SPAN
lxml.html.builder.STRIKE
lxml.html.builder.STRONG
lxml.html.builder.STYLE
lxml.html.builder.SUB
lxml.html.builder.SUP
lxml.html.builder.TABLE
lxml.html.builder.TBODY
lxml.html.builder.TD
lxml.html.builder.TEXTAREA
lxml.html.builder.TFOOT
lxml.html.builder.TH
lxml.html.builder.THEAD
lxml.html.builder.TITLE
lxml.html.builder.TR
lxml.html.builder.TT
lxml.html.builder.U
lxml.html.builder.UL
lxml.html.builder.VAR
lxml.html.builder.__package__
- - - - - - - - - - - - - - - lxml.html.clean.clean
lxml.html.defs.__package__
lxml.html.defs.block_tags
lxml.html.defs.deprecated_tags
lxml.html.defs.empty_tags
lxml.html.defs.event_attrs
lxml.html.defs.font_style_tags
lxml.html.defs.form_tags
lxml.html.defs.frame_tags
lxml.html.defs.general_block_tags
lxml.html.defs.head_tags
lxml.html.defs.html5_tags
lxml.html.defs.link_attrs
lxml.html.defs.list_tags
lxml.html.defs.nonstandard_tags
lxml.html.defs.phrase_tags
lxml.html.defs.safe_attrs
lxml.html.defs.special_inline_tags
lxml.html.defs.table_tags
lxml.html.defs.tags
lxml.html.defs.top_level_tags
- - - - - - - - - - - lxml.html.find_class
lxml.html.find_rel_links
- - - - - - - lxml.html.html5parser.__package__
lxml.html.html5parser.html_parser
lxml.html.html5parser.xhtml_parser
- lxml.html.iterlinks
lxml.html.make_links_absolute
lxml.html.resolve_base_href
lxml.html.rewrite_links
- - - lxml.includes.__package__
- - - - - - - - lxml.isoschematron.extract_rng
lxml.isoschematron.extract_xsd
lxml.isoschematron.iso_abstract_expand
lxml.isoschematron.iso_dsdl_include
lxml.isoschematron.iso_svrl_for_xslt1
lxml.isoschematron.schematron_schema_valid
lxml.isoschematron.svrl_validation_errors
lxml.objectify.E
lxml.objectify.PYTYPE_ATTRIBUTE
- - lxml.pyclasslookup.__package__
lxml.sax.__package__
lxml.tests.__package__
lxml.tests.common_imports.CET_VERSION
lxml.tests.common_imports.ET_VERSION
lxml.tests.common_imports.IS_PYPY
lxml.tests.common_imports.IS_PYTHON2
lxml.tests.common_imports.IS_PYTHON3
lxml.tests.common_imports.__package__
- lxml.tests.common_imports.doctest_parser
lxml.tests.common_imports.unichr_escape
lxml.tests.dummy_http_server.__package__
lxml.tests.selftest.ENTITY_XML
lxml.tests.selftest.SAMPLE_XML
lxml.tests.selftest.XINCLUDE
lxml.tests.selftest.__package__
lxml.tests.selftest2.ENTITY_XML
lxml.tests.selftest2.SAMPLE_XML
lxml.tests.selftest2.SAMPLE_XML_NS
lxml.tests.selftest2.__package__
lxml.tests.test_builder.__package__
lxml.tests.test_builder.this_dir
lxml.tests.test_classlookup.__package__
lxml.tests.test_classlookup.this_dir
lxml.tests.test_classlookup.xml_str
lxml.tests.test_css.HTML
lxml.tests.test_css.__package__
lxml.tests.test_doctestcompare.__package__
lxml.tests.test_dtd.__package__
lxml.tests.test_dtd.this_dir
lxml.tests.test_elementpath.__package__
lxml.tests.test_elementtree.ElementTreePullTestCase
lxml.tests.test_elementtree.__package__
lxml.tests.test_elementtree.cElementTree
lxml.tests.test_elementtree.this_dir
lxml.tests.test_errors.__package__
lxml.tests.test_errors.this_dir
lxml.tests.test_etree.__package__
lxml.tests.test_external_document.DESTRUCTOR_NAME
lxml.tests.test_external_document.DOC_NAME
lxml.tests.test_external_document.__package__
lxml.tests.test_htmlparser.__package__
lxml.tests.test_htmlparser.this_dir
lxml.tests.test_http_io.__package__
lxml.tests.test_http_io.this_dir
lxml.tests.test_incremental_xmlfile.__package__
lxml.tests.test_incremental_xmlfile.this_dir
lxml.tests.test_io.__package__
lxml.tests.test_io.this_dir
lxml.tests.test_isoschematron.__package__
lxml.tests.test_isoschematron.this_dir
lxml.tests.test_nsclasses.__package__
lxml.tests.test_nsclasses.this_dir
lxml.tests.test_objectify.DEFAULT_NSMAP
lxml.tests.test_objectify.PYTYPE_NAMESPACE
lxml.tests.test_objectify.TREE_PYTYPE
lxml.tests.test_objectify.XML_SCHEMA_INSTANCE_NS
lxml.tests.test_objectify.XML_SCHEMA_INSTANCE_TYPE_ATTR
lxml.tests.test_objectify.XML_SCHEMA_NIL_ATTR
lxml.tests.test_objectify.XML_SCHEMA_NS
lxml.tests.test_objectify.__package__
lxml.tests.test_objectify.objectclass2pytype
lxml.tests.test_objectify.objectclass2xsitype
lxml.tests.test_objectify.pytype2objclass
lxml.tests.test_objectify.this_dir
lxml.tests.test_objectify.v
lxml.tests.test_objectify.xml_str
lxml.tests.test_objectify.xsitype2objclass
lxml.tests.test_pyclasslookup.__package__
lxml.tests.test_pyclasslookup.this_dir
lxml.tests.test_pyclasslookup.xml_str
lxml.tests.test_relaxng.__package__
lxml.tests.test_relaxng.rnc2rng
lxml.tests.test_relaxng.this_dir
lxml.tests.test_sax.__package__
lxml.tests.test_sax.this_dir
lxml.tests.test_schematron.__package__
lxml.tests.test_schematron.this_dir
lxml.tests.test_threading.__package__
lxml.tests.test_threading.this_dir
lxml.tests.test_unicode.__package__
lxml.tests.test_unicode.ascii_uni
lxml.tests.test_unicode.invalid_tag
lxml.tests.test_unicode.klingon
lxml.tests.test_unicode.this_dir
lxml.tests.test_unicode.uni
lxml.tests.test_unicode.uxml
lxml.tests.test_xmlschema.__package__
lxml.tests.test_xmlschema.this_dir
lxml.tests.test_xpathevaluator.SAMPLE_XML
lxml.tests.test_xpathevaluator.__package__
lxml.tests.test_xpathevaluator.extension
lxml.tests.test_xpathevaluator.this_dir
lxml.tests.test_xpathevaluator.uri
lxml.tests.test_xslt.__package__
lxml.tests.test_xslt.is_python3
lxml.tests.test_xslt.this_dir
xml.etree.ElementTree.HTML_EMPTY
xml.etree.ElementTree.VERSION
xml.etree.ElementTree.__package__
xml.etree.ElementTree._namespace_map
xml.etree.ElementTree._serialize

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml-module.html b/doc/html/api/toc-lxml-module.html deleted file mode 100644 index 3c341473..00000000 --- a/doc/html/api/toc-lxml-module.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - lxml - - - - - -

Module lxml

-
-

Functions

- get_include

Variables

- __package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.ElementInclude-module.html b/doc/html/api/toc-lxml.ElementInclude-module.html deleted file mode 100644 index 726f455f..00000000 --- a/doc/html/api/toc-lxml.ElementInclude-module.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - ElementInclude - - - - - -

Module ElementInclude

-
-

Classes

- FatalIncludeError

Functions

- - - - default_loader
include

Variables

- XINCLUDE
XINCLUDE_FALLBACK
XINCLUDE_INCLUDE
XINCLUDE_ITER_TAG
__package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.builder-module.html b/doc/html/api/toc-lxml.builder-module.html deleted file mode 100644 index e2b93285..00000000 --- a/doc/html/api/toc-lxml.builder-module.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - builder - - - - - -

Module builder

-
-

Classes

- ElementMaker
basestring
unicode

Functions

- - __reduce_cython__
__setstate_cython__

Variables

- E
__package__
__pyx_capi__
__test__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.cssselect-module.html b/doc/html/api/toc-lxml.cssselect-module.html deleted file mode 100644 index bbfaec1f..00000000 --- a/doc/html/api/toc-lxml.cssselect-module.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - cssselect - - - - - -

Module cssselect

-
-

Classes

- CSSSelector
ExpressionError
- - SelectorError
SelectorSyntaxError

Functions

- -

Variables

- -
- ns
-
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.doctestcompare-module.html b/doc/html/api/toc-lxml.doctestcompare-module.html deleted file mode 100644 index 79b9a7e1..00000000 --- a/doc/html/api/toc-lxml.doctestcompare-module.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - doctestcompare - - - - - -

Module doctestcompare

-
-

Classes

- LHTMLOutputChecker
LXMLOutputChecker
-

Functions

- - - install
-
- strip
- temp_install

Variables

- NOPARSE_MARKUP
PARSE_HTML
PARSE_XML
- - - - - -
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.etree-module.html b/doc/html/api/toc-lxml.etree-module.html deleted file mode 100644 index b3343dd8..00000000 --- a/doc/html/api/toc-lxml.etree-module.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - - etree - - - - - -

Module etree

-
-

Classes

- - AttributeBasedElementClassLookup
C14NError
CDATA
CommentBase
CustomElementClassLookup
DTD
DTDError
DTDParseError
DTDValidateError
- DocumentInvalid
ETCompatXMLParser
ETXPath
ElementBase
- ElementClassLookup
ElementDefaultClassLookup
- ElementNamespaceClassLookup
- EntityBase
Error
ErrorDomains
ErrorLevels
ErrorTypes
FallbackElementClassLookup
HTMLParser
- LxmlError
LxmlRegistryError
LxmlSyntaxError
NamespaceRegistryError
PIBase
ParseError
ParserBasedElementClassLookup
ParserError
PyErrorLog
PythonElementClassLookup
QName
RelaxNG
RelaxNGError
RelaxNGErrorTypes
RelaxNGParseError
RelaxNGValidateError
Resolver
Schematron
SchematronError
SchematronParseError
SchematronValidateError
SerialisationError
- TreeBuilder
XInclude
XIncludeError
XMLParser
- XMLSchema
XMLSchemaError
XMLSchemaParseError
XMLSchemaValidateError
XMLSyntaxError
XMLTreeBuilder
XPath
XPathDocumentEvaluator
- XPathError
XPathEvalError
XPathFunctionError
XPathResultError
XPathSyntaxError
XSLT
XSLTAccessControl
XSLTApplyError
XSLTError
XSLTExtension
XSLTExtensionError
XSLTParseError
XSLTSaveError
- - - - - - - - - - - - - - - - - - - - - - - - - - - iterparse
iterwalk
-

Functions

- Comment
Element
ElementTree
Entity
Extension
FunctionNamespace
HTML
PI
ProcessingInstruction
SubElement
XML
XMLDTDID
XMLID
XPathEvaluator
- cleanup_namespaces
clear_error_log
dump
fromstring
fromstringlist
get_default_parser
iselement
parse
parseid
register_namespace
set_default_parser
set_element_class_lookup
strip_attributes
strip_elements
strip_tags
tostring
tostringlist
tounicode
use_global_python_log

Variables

- DEBUG
LIBXML_COMPILED_VERSION
LIBXML_VERSION
LIBXSLT_COMPILED_VERSION
LIBXSLT_VERSION
LXML_VERSION
- - - -
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html-module.html b/doc/html/api/toc-lxml.html-module.html deleted file mode 100644 index a5bfc471..00000000 --- a/doc/html/api/toc-lxml.html-module.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - html - - - - - -

Module html

-
-

Classes

- - - - - - - - - - - - - - - - - - - - - - -

Functions

- Element
- - - - - - - - -
- _nons
- - - - document_fromstring
fragment_fromstring
fragments_fromstring
fromstring
- - open_in_browser
parse
submit_form
tostring
-

Variables

- - - - - - - - - - - find_class
find_rel_links
- iterlinks
make_links_absolute
resolve_base_href
rewrite_links
-
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html.ElementSoup-module.html b/doc/html/api/toc-lxml.html.ElementSoup-module.html deleted file mode 100644 index 1a7167a7..00000000 --- a/doc/html/api/toc-lxml.html.ElementSoup-module.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - ElementSoup - - - - - -

Module ElementSoup

-
-

Functions

- convert_tree
parse

Variables

- - -
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html.builder-module.html b/doc/html/api/toc-lxml.html.builder-module.html deleted file mode 100644 index 05a4e98f..00000000 --- a/doc/html/api/toc-lxml.html.builder-module.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - builder - - - - - -

Module builder

-
-

Functions

- CLASS
FOR

Variables

- A
ABBR
ACRONYM
ADDRESS
APPLET
AREA
B
BASE
BASEFONT
BDO
BIG
BLOCKQUOTE
BODY
BR
BUTTON
CAPTION
CENTER
CITE
CODE
COL
COLGROUP
DD
DEL
DFN
DIR
DIV
DL
DT
E
EM
FIELDSET
FONT
FORM
FRAME
FRAMESET
H1
H2
H3
H4
H5
H6
HEAD
HR
HTML
I
IFRAME
IMG
INPUT
INS
ISINDEX
KBD
LABEL
LEGEND
LI
LINK
MAP
MENU
META
NOFRAMES
NOSCRIPT
OBJECT
OL
OPTGROUP
OPTION
P
PARAM
PRE
Q
S
SAMP
SCRIPT
SELECT
SMALL
SPAN
STRIKE
STRONG
STYLE
SUB
SUP
TABLE
TBODY
TD
TEXTAREA
TFOOT
TH
THEAD
TITLE
TR
TT
U
UL
VAR
__package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html.clean-module.html b/doc/html/api/toc-lxml.html.clean-module.html deleted file mode 100644 index 3bcb674a..00000000 --- a/doc/html/api/toc-lxml.html.clean-module.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - clean - - - - - -

Module clean

-
-

Classes

- Cleaner
- bytes
- -

Functions

- - - - - - - - autolink
autolink_html
clean_html
- unichr
- word_break
word_break_html

Variables

- - - - - - - - - - - - - - - - clean

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html.defs-module.html b/doc/html/api/toc-lxml.html.defs-module.html deleted file mode 100644 index 2dfcfc17..00000000 --- a/doc/html/api/toc-lxml.html.defs-module.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - defs - - - - - -

Module defs

-
-

Variables

- __package__
block_tags
deprecated_tags
empty_tags
event_attrs
font_style_tags
form_tags
frame_tags
general_block_tags
head_tags
html5_tags
link_attrs
list_tags
nonstandard_tags
phrase_tags
safe_attrs
special_inline_tags
table_tags
tags
top_level_tags

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html.diff-module.html b/doc/html/api/toc-lxml.html.diff-module.html deleted file mode 100644 index 71b779ea..00000000 --- a/doc/html/api/toc-lxml.html.diff-module.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - diff - - - - - -

Module diff

-
-

Classes

- - - - - - - -
- token
-

Functions

- - - - - - - - - - - - - - - - html_annotate
- htmldiff
- - - - - - - - - - - - - - - - - -

Variables

- - - - - - - - - - - -
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html.formfill-module.html b/doc/html/api/toc-lxml.html.formfill-module.html deleted file mode 100644 index 66748497..00000000 --- a/doc/html/api/toc-lxml.html.formfill-module.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - formfill - - - - - -

Module formfill

-
-

Classes

- DefaultErrorCreator
FormNotFound
-

Functions

- -
- _check
- - - - - - - - - - fill_form
fill_form_html
insert_errors
insert_errors_html

Variables

- - - - - -
- _tag
- -
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html.html5parser-module.html b/doc/html/api/toc-lxml.html.html5parser-module.html deleted file mode 100644 index 1200a413..00000000 --- a/doc/html/api/toc-lxml.html.html5parser-module.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - html5parser - - - - - -

Module html5parser

-
-

Classes

- HTMLParser
XHTMLParser

Functions

- - - document_fromstring
fragment_fromstring
fragments_fromstring
fromstring
parse

Variables

- __package__
html_parser
xhtml_parser

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html.soupparser-module.html b/doc/html/api/toc-lxml.html.soupparser-module.html deleted file mode 100644 index fff1b4f1..00000000 --- a/doc/html/api/toc-lxml.html.soupparser-module.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - soupparser - - - - - -

Module soupparser

-
-

Classes

- -

Functions

- - -
- _parse
- - convert_tree
fromstring
- parse
-
- unichr
-

Variables

- - -
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.html.usedoctest-module.html b/doc/html/api/toc-lxml.html.usedoctest-module.html deleted file mode 100644 index ee5971fe..00000000 --- a/doc/html/api/toc-lxml.html.usedoctest-module.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - usedoctest - - - - - -

Module usedoctest

-
-
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.includes-module.html b/doc/html/api/toc-lxml.includes-module.html deleted file mode 100644 index 1bed2a82..00000000 --- a/doc/html/api/toc-lxml.includes-module.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - includes - - - - - -

Module includes

-
-

Variables

- __package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.isoschematron-module.html b/doc/html/api/toc-lxml.isoschematron-module.html deleted file mode 100644 index b9828e42..00000000 --- a/doc/html/api/toc-lxml.isoschematron-module.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - isoschematron - - - - - -

Module isoschematron

-
-

Classes

- Schematron
- -

Functions

- - stylesheet_params

Variables

- - - - - - - - - extract_rng
extract_xsd
iso_abstract_expand
iso_dsdl_include
iso_svrl_for_xslt1
schematron_schema_valid
svrl_validation_errors

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.objectify-module.html b/doc/html/api/toc-lxml.objectify-module.html deleted file mode 100644 index 66c92d53..00000000 --- a/doc/html/api/toc-lxml.objectify-module.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - objectify - - - - - -

Module objectify

-
-

Classes

- BoolElement
ElementMaker
FloatElement
IntElement
LongElement
NoneElement
NumberElement
ObjectPath
ObjectifiedDataElement
ObjectifiedElement
ObjectifyElementClassLookup
PyType
StringElement

Functions

- DataElement
Element
SubElement
XML
- - - - annotate
deannotate
dump
enable_recursive_str
fromstring
getRegisteredTypes
makeparser
parse
pyannotate
pytypename
set_default_parser
set_pytype_attribute_tag
xsiannotate

Variables

- E
PYTYPE_ATTRIBUTE
- -
-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.pyclasslookup-module.html b/doc/html/api/toc-lxml.pyclasslookup-module.html deleted file mode 100644 index fbbebb29..00000000 --- a/doc/html/api/toc-lxml.pyclasslookup-module.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - pyclasslookup - - - - - -

Module pyclasslookup

-
-

Variables

- __package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.sax-module.html b/doc/html/api/toc-lxml.sax-module.html deleted file mode 100644 index 07b37a6b..00000000 --- a/doc/html/api/toc-lxml.sax-module.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - sax - - - - - -

Module sax

-
-

Classes

- ElementTreeContentHandler
ElementTreeProducer
SaxError

Functions

- - saxify

Variables

- __package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests-module.html b/doc/html/api/toc-lxml.tests-module.html deleted file mode 100644 index d21a924e..00000000 --- a/doc/html/api/toc-lxml.tests-module.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - tests - - - - - -

Module tests

-
-

Variables

- __package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.common_imports-module.html b/doc/html/api/toc-lxml.tests.common_imports-module.html deleted file mode 100644 index 545bf4aa..00000000 --- a/doc/html/api/toc-lxml.tests.common_imports-module.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - common_imports - - - - - -

Module common_imports

-
-

Classes

- HelperTestCase
LargeFileLike
LargeFileLikeUnicode
SillyFileLike
skipif

Functions

-
- _bytes
- - - - -
- _str
- canonicalize
fileInTestDir
fileUrlInTestDir
filter_by_version
make_doctest
make_version_tuple
path2url
readFileInTestDir
read_file
unentitify
write_to_file

Variables

- CET_VERSION
ET_VERSION
IS_PYPY
IS_PYTHON2
IS_PYTHON3
__package__
- doctest_parser
unichr_escape

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.dummy_http_server-module.html b/doc/html/api/toc-lxml.tests.dummy_http_server-module.html deleted file mode 100644 index 2fdeef0e..00000000 --- a/doc/html/api/toc-lxml.tests.dummy_http_server-module.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - dummy_http_server - - - - - -

Module dummy_http_server

-
-

Classes

- HTTPRequestCollector
WebServer
-

Functions

- build_web_server
webserver

Variables

- __package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.selftest-module.html b/doc/html/api/toc-lxml.tests.selftest-module.html deleted file mode 100644 index b0bdf61b..00000000 --- a/doc/html/api/toc-lxml.tests.selftest-module.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - selftest - - - - - -

Module selftest

-
-

Functions

- bad_find
bug_xmltoolkit25
bug_xmltoolkit28
check_element
check_element_tree
check_mapping
check_string
check_string_or_none
encoding
find
fix_compatibility
interface
iterators
iterparse
namespace
normalize_crlf
parsefile
parseliteral
qname
serialize
simpleops
stdout
summarize
summarize_list
writefile
writestring
xinclude
xinclude_default
xinclude_loader
xpath_tokenizer

Variables

- ENTITY_XML
SAMPLE_XML
XINCLUDE
__package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.selftest2-module.html b/doc/html/api/toc-lxml.tests.selftest2-module.html deleted file mode 100644 index 69adb51f..00000000 --- a/doc/html/api/toc-lxml.tests.selftest2-module.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - selftest2 - - - - - -

Module selftest2

-
-

Functions

- attrib
cdata
check_element
check_element_tree
check_mapping
check_string
copy
element
encoding
find
makeelement
parsefile
qname
serialize
stdout
summarize
summarize_list
unserialize
writefile

Variables

- ENTITY_XML
SAMPLE_XML
SAMPLE_XML_NS
__package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_builder-module.html b/doc/html/api/toc-lxml.tests.test_builder-module.html deleted file mode 100644 index c2f5a102..00000000 --- a/doc/html/api/toc-lxml.tests.test_builder-module.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - test_builder - - - - - -

Module test_builder

-
-

Classes

- BuilderTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_classlookup-module.html b/doc/html/api/toc-lxml.tests.test_classlookup-module.html deleted file mode 100644 index db47ad0a..00000000 --- a/doc/html/api/toc-lxml.tests.test_classlookup-module.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - test_classlookup - - - - - -

Module test_classlookup

-
-

Classes

- ClassLookupTestCase
ProxyTestCase

Functions

- test_suite

Variables

- __package__
this_dir
xml_str

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_css-module.html b/doc/html/api/toc-lxml.tests.test_css-module.html deleted file mode 100644 index 05606f2f..00000000 --- a/doc/html/api/toc-lxml.tests.test_css-module.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - test_css - - - - - -

Module test_css

-
-

Classes

- CSSTestCase

Functions

- test_suite

Variables

- HTML
__package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_doctestcompare-module.html b/doc/html/api/toc-lxml.tests.test_doctestcompare-module.html deleted file mode 100644 index d74b9efb..00000000 --- a/doc/html/api/toc-lxml.tests.test_doctestcompare-module.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - test_doctestcompare - - - - - -

Module test_doctestcompare

-
-

Classes

- DoctestCompareTest
DummyInput

Functions

- indent
test_suite

Variables

- __package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_dtd-module.html b/doc/html/api/toc-lxml.tests.test_dtd-module.html deleted file mode 100644 index e7a946f1..00000000 --- a/doc/html/api/toc-lxml.tests.test_dtd-module.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - test_dtd - - - - - -

Module test_dtd

-
-

Classes

- ETreeDtdTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_elementpath-module.html b/doc/html/api/toc-lxml.tests.test_elementpath-module.html deleted file mode 100644 index ea87fc9c..00000000 --- a/doc/html/api/toc-lxml.tests.test_elementpath-module.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - test_elementpath - - - - - -

Module test_elementpath

-
-

Classes

- EtreeElementPathTestCase

Functions

- normalize_crlf
summarize
summarize_list
test_suite

Variables

- __package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_elementtree-module.html b/doc/html/api/toc-lxml.tests.test_elementtree-module.html deleted file mode 100644 index 9d19dd4d..00000000 --- a/doc/html/api/toc-lxml.tests.test_elementtree-module.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - test_elementtree - - - - - -

Module test_elementtree

-
-

Classes

- CElementTreeTestCase
ETreePullTestCase
ETreeTestCase
ElementTreeTestCase
- -

Functions

- test_suite

Variables

- ElementTreePullTestCase
__package__
cElementTree
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_errors-module.html b/doc/html/api/toc-lxml.tests.test_errors-module.html deleted file mode 100644 index 53d0dfb5..00000000 --- a/doc/html/api/toc-lxml.tests.test_errors-module.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - test_errors - - - - - -

Module test_errors

-
-

Classes

- ErrorTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_etree-module.html b/doc/html/api/toc-lxml.tests.test_etree-module.html deleted file mode 100644 index d825ce10..00000000 --- a/doc/html/api/toc-lxml.tests.test_etree-module.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - test_etree - - - - - -

Module test_etree

-
-

Classes

- ETreeC14NTestCase
ETreeErrorLogTest
ETreeOnlyTestCase
ETreeWriteTestCase
ETreeXIncludeTestCase
ElementIncludeTestCase
XMLPullParserTest
-

Functions

- test_suite
tmpfile

Variables

- __package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_external_document-module.html b/doc/html/api/toc-lxml.tests.test_external_document-module.html deleted file mode 100644 index 84259481..00000000 --- a/doc/html/api/toc-lxml.tests.test_external_document-module.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - test_external_document - - - - - -

Module test_external_document

-
-

Classes

- ExternalDocumentTestCase

Functions

- test_suite

Variables

- DESTRUCTOR_NAME
DOC_NAME
__package__

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_htmlparser-module.html b/doc/html/api/toc-lxml.tests.test_htmlparser-module.html deleted file mode 100644 index cd47cb4f..00000000 --- a/doc/html/api/toc-lxml.tests.test_htmlparser-module.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - test_htmlparser - - - - - -

Module test_htmlparser

-
-

Classes

- HtmlParserTestCase
unicode

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_http_io-module.html b/doc/html/api/toc-lxml.tests.test_http_io-module.html deleted file mode 100644 index 67e9c043..00000000 --- a/doc/html/api/toc-lxml.tests.test_http_io-module.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - test_http_io - - - - - -

Module test_http_io

-
-

Classes

- HttpIOTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_incremental_xmlfile-module.html b/doc/html/api/toc-lxml.tests.test_incremental_xmlfile-module.html deleted file mode 100644 index 8a23b765..00000000 --- a/doc/html/api/toc-lxml.tests.test_incremental_xmlfile-module.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - test_incremental_xmlfile - - - - - -

Module test_incremental_xmlfile

-
-

Classes

- AsyncXmlFileTestCase
BytesIOXmlFileTestCase
HtmlFileTestCase
SimpleFileLikeXmlFileTestCase
TempPathXmlFileTestCase
TempXmlFileTestCase
-

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_io-module.html b/doc/html/api/toc-lxml.tests.test_io-module.html deleted file mode 100644 index b7006530..00000000 --- a/doc/html/api/toc-lxml.tests.test_io-module.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - test_io - - - - - -

Module test_io

-
-

Classes

- ETreeIOTestCase
ElementTreeIOTestCase
-

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_isoschematron-module.html b/doc/html/api/toc-lxml.tests.test_isoschematron-module.html deleted file mode 100644 index b82c7fa1..00000000 --- a/doc/html/api/toc-lxml.tests.test_isoschematron-module.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - test_isoschematron - - - - - -

Module test_isoschematron

-
-

Classes

- ETreeISOSchematronTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_nsclasses-module.html b/doc/html/api/toc-lxml.tests.test_nsclasses-module.html deleted file mode 100644 index 733c6e7e..00000000 --- a/doc/html/api/toc-lxml.tests.test_nsclasses-module.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - test_nsclasses - - - - - -

Module test_nsclasses

-
-

Classes

- ETreeNamespaceClassesTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_objectify-module.html b/doc/html/api/toc-lxml.tests.test_objectify-module.html deleted file mode 100644 index 014216c7..00000000 --- a/doc/html/api/toc-lxml.tests.test_objectify-module.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - test_objectify - - - - - -

Module test_objectify

-
-

Classes

- ObjectifyTestCase

Functions

- test_suite

Variables

- DEFAULT_NSMAP
PYTYPE_NAMESPACE
TREE_PYTYPE
XML_SCHEMA_INSTANCE_NS
XML_SCHEMA_INSTANCE_TYPE_ATTR
XML_SCHEMA_NIL_ATTR
XML_SCHEMA_NS
__package__
objectclass2pytype
objectclass2xsitype
pytype2objclass
this_dir
v
xml_str
xsitype2objclass

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_pyclasslookup-module.html b/doc/html/api/toc-lxml.tests.test_pyclasslookup-module.html deleted file mode 100644 index 9841ca02..00000000 --- a/doc/html/api/toc-lxml.tests.test_pyclasslookup-module.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - test_pyclasslookup - - - - - -

Module test_pyclasslookup

-
-

Classes

- PyClassLookupTestCase

Functions

- test_suite

Variables

- __package__
this_dir
xml_str

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_relaxng-module.html b/doc/html/api/toc-lxml.tests.test_relaxng-module.html deleted file mode 100644 index 39b755ee..00000000 --- a/doc/html/api/toc-lxml.tests.test_relaxng-module.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - test_relaxng - - - - - -

Module test_relaxng

-
-

Classes

- ETreeRelaxNGTestCase
RelaxNGCompactTestCase

Functions

- test_suite

Variables

- __package__
rnc2rng
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_sax-module.html b/doc/html/api/toc-lxml.tests.test_sax-module.html deleted file mode 100644 index 8e796111..00000000 --- a/doc/html/api/toc-lxml.tests.test_sax-module.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - test_sax - - - - - -

Module test_sax

-
-

Classes

- ETreeSaxTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_schematron-module.html b/doc/html/api/toc-lxml.tests.test_schematron-module.html deleted file mode 100644 index a51a892e..00000000 --- a/doc/html/api/toc-lxml.tests.test_schematron-module.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - test_schematron - - - - - -

Module test_schematron

-
-

Classes

- ETreeSchematronTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_threading-module.html b/doc/html/api/toc-lxml.tests.test_threading-module.html deleted file mode 100644 index 710e1c78..00000000 --- a/doc/html/api/toc-lxml.tests.test_threading-module.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - test_threading - - - - - -

Module test_threading

-
-

Classes

- ThreadPipelineTestCase
ThreadingTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_unicode-module.html b/doc/html/api/toc-lxml.tests.test_unicode-module.html deleted file mode 100644 index e38efa89..00000000 --- a/doc/html/api/toc-lxml.tests.test_unicode-module.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - test_unicode - - - - - -

Module test_unicode

-
-

Classes

- EncodingsTestCase
UnicodeTestCase
unicode

Functions

- test_suite

Variables

- __package__
ascii_uni
invalid_tag
klingon
this_dir
uni
uxml

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_xmlschema-module.html b/doc/html/api/toc-lxml.tests.test_xmlschema-module.html deleted file mode 100644 index cdc9c517..00000000 --- a/doc/html/api/toc-lxml.tests.test_xmlschema-module.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - test_xmlschema - - - - - -

Module test_xmlschema

-
-

Classes

- ETreeXMLSchemaResolversTestCase
ETreeXMLSchemaTestCase

Functions

- test_suite

Variables

- __package__
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_xpathevaluator-module.html b/doc/html/api/toc-lxml.tests.test_xpathevaluator-module.html deleted file mode 100644 index 7753fef5..00000000 --- a/doc/html/api/toc-lxml.tests.test_xpathevaluator-module.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - test_xpathevaluator - - - - - -

Module test_xpathevaluator

-
-

Classes

- ETreeETXPathClassTestCase
ETreeXPathClassTestCase
ETreeXPathExsltTestCase
ETreeXPathTestCase

Functions

- argsTest1
argsTest2
booleanTest
floatTest
resultTypesTest
resultTypesTest2
setTest
setTest2
stringListTest
stringTest
tag
tag_or_value
test_suite
xpath

Variables

- SAMPLE_XML
__package__
extension
this_dir
uri

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.tests.test_xslt-module.html b/doc/html/api/toc-lxml.tests.test_xslt-module.html deleted file mode 100644 index 5c40e735..00000000 --- a/doc/html/api/toc-lxml.tests.test_xslt-module.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - test_xslt - - - - - -

Module test_xslt

-
-

Classes

- ETreeEXSLTTestCase
ETreeXSLTExtElementTestCase
ETreeXSLTExtFuncTestCase
ETreeXSLTTestCase
Py3XSLTTestCase
basestring
unicode

Functions

- test_suite

Variables

- __package__
is_python3
this_dir

-[hide private] - - - - diff --git a/doc/html/api/toc-lxml.usedoctest-module.html b/doc/html/api/toc-lxml.usedoctest-module.html deleted file mode 100644 index ee5971fe..00000000 --- a/doc/html/api/toc-lxml.usedoctest-module.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - usedoctest - - - - - -

Module usedoctest

-
-
-[hide private] - - - - diff --git a/doc/html/api/toc-xml.etree.ElementTree-module.html b/doc/html/api/toc-xml.etree.ElementTree-module.html deleted file mode 100644 index a90ac01a..00000000 --- a/doc/html/api/toc-xml.etree.ElementTree-module.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - ElementTree - - - - - -

Module ElementTree

-
-

Classes

- Element
ElementTree
ParseError
QName
TreeBuilder
XMLParser
XMLTreeBuilder
_Element
_ElementInterface
_IterParseIterator
_SimpleElementPath

Functions

- Comment
PI
ProcessingInstruction
SubElement
XML
XMLID
_encode
_escape_attrib
_escape_attrib_html
_escape_cdata
_namespaces
_raise_serialization_error
_serialize_html
_serialize_text
_serialize_xml
dump
fromstring
fromstringlist
iselement
iterparse
parse
register_namespace
tostring
tostringlist

Variables

- HTML_EMPTY
VERSION
__package__
_namespace_map
_serialize

-[hide private] - - - - diff --git a/doc/html/api/toc.html b/doc/html/api/toc.html deleted file mode 100644 index abb29a06..00000000 --- a/doc/html/api/toc.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - Table of Contents - - - - - -

Table of Contents

-
- Everything -
-

Modules

- lxml
lxml.ElementInclude
lxml.builder
lxml.cssselect
lxml.doctestcompare
lxml.etree
lxml.html
lxml.html.ElementSoup
lxml.html.builder
lxml.html.clean
lxml.html.defs
lxml.html.diff
lxml.html.formfill
lxml.html.html5parser
lxml.html.soupparser
lxml.html.usedoctest
lxml.includes
lxml.isoschematron
lxml.objectify
lxml.pyclasslookup
lxml.sax
lxml.tests
lxml.tests.common_imports
lxml.tests.dummy_http_server
lxml.tests.selftest
lxml.tests.selftest2
lxml.tests.test_builder
lxml.tests.test_classlookup
lxml.tests.test_css
lxml.tests.test_doctestcompare
lxml.tests.test_dtd
lxml.tests.test_elementpath
lxml.tests.test_elementtree
lxml.tests.test_errors
lxml.tests.test_etree
lxml.tests.test_external_document
lxml.tests.test_htmlparser
lxml.tests.test_http_io
lxml.tests.test_incremental_xmlfile
lxml.tests.test_io
lxml.tests.test_isoschematron
lxml.tests.test_nsclasses
lxml.tests.test_objectify
lxml.tests.test_pyclasslookup
lxml.tests.test_relaxng
lxml.tests.test_sax
lxml.tests.test_schematron
lxml.tests.test_threading
lxml.tests.test_unicode
lxml.tests.test_xmlschema
lxml.tests.test_xpathevaluator
lxml.tests.test_xslt
lxml.usedoctest
xml.etree.ElementTree

- [hide private] - - - - diff --git a/doc/html/api/xml.etree.ElementTree-module.html b/doc/html/api/xml.etree.ElementTree-module.html deleted file mode 100644 index 38807848..00000000 --- a/doc/html/api/xml.etree.ElementTree-module.html +++ /dev/null @@ -1,806 +0,0 @@ - - - - - xml.etree.ElementTree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package xml :: - Package etree :: - Module ElementTree - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module ElementTree

source code

-hash(x) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
-   - - Element -
-   - - ElementTree -
-   - - ParseError -
-   - - QName -
-   - - TreeBuilder -
-   - - XMLParser -
-   - - XMLTreeBuilder -
-   - - _Element -
-   - - _ElementInterface -
-   - - _IterParseIterator -
-   - - _SimpleElementPath -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Functions[hide private]
-
-   - - - - - - -
Comment(text=None) - source code - -
- -
-   - - - - - - -
PI(target, - text=None) - source code - -
- -
-   - - - - - - -
ProcessingInstruction(target, - text=None) - source code - -
- -
-   - - - - - - -
SubElement(parent, - tag, - attrib={}, - **extra) - source code - -
- -
-   - - - - - - -
XML(text, - parser=None) - source code - -
- -
-   - - - - - - -
XMLID(text, - parser=None) - source code - -
- -
-   - - - - - - -
_encode(text, - encoding) - source code - -
- -
-   - - - - - - -
_escape_attrib(text, - encoding) - source code - -
- -
-   - - - - - - -
_escape_attrib_html(text, - encoding) - source code - -
- -
-   - - - - - - -
_escape_cdata(text, - encoding) - source code - -
- -
-   - - - - - - -
_namespaces(elem, - encoding, - default_namespace=None) - source code - -
- -
-   - - - - - - -
_raise_serialization_error(text) - source code - -
- -
-   - - - - - - -
_serialize_html(write, - elem, - encoding, - qnames, - namespaces) - source code - -
- -
-   - - - - - - -
_serialize_text(write, - elem, - encoding) - source code - -
- -
-   - - - - - - -
_serialize_xml(write, - elem, - encoding, - qnames, - namespaces) - source code - -
- -
-   - - - - - - -
dump(elem) - source code - -
- -
-   - - - - - - -
fromstring(text, - parser=None) - source code - -
- -
-   - - - - - - -
fromstringlist(sequence, - parser=None) - source code - -
- -
-   - - - - - - -
iselement(element) - source code - -
- -
-   - - - - - - -
iterparse(source, - events=None, - parser=None) - source code - -
- -
-   - - - - - - -
parse(source, - parser=None) - source code - -
- -
-   - - - - - - -
register_namespace(prefix, - uri) - source code - -
- -
-   - - - - - - -
tostring(element, - encoding=None, - method=None) - source code - -
- -
-   - - - - - - -
tostringlist(element, - encoding=None, - method=None) - source code - -
- -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Variables[hide private]
-
-   - - HTML_EMPTY = set(['area', 'base', 'basefont', 'br', 'col', 'fr... -
-   - - VERSION = '1.3.0' -
-   - - __package__ = 'xml.etree' -
-   - - _namespace_map = {'http://purl.org/dc/elements/1.1/': 'dc', 'h... -
-   - - _serialize = {'html': <__builtin__.function object>, 'text': <... -
- - - - - - -
- - - - - -
Variables Details[hide private]
-
- -
- -
-

HTML_EMPTY

- -
-
-
-
Value:
-
-set(['area',
-     'base',
-     'basefont',
-     'br',
-     'col',
-     'frame',
-     'hr',
-     'img',
-...
-
-
-
-
-
- -
- -
-

_namespace_map

- -
-
-
-
Value:
-
-{'http://purl.org/dc/elements/1.1/': 'dc',
- 'http://schemas.xmlsoap.org/wsdl/': 'wsdl',
- 'http://www.w3.org/1999/02/22-rdf-syntax-ns#': 'rdf',
- 'http://www.w3.org/1999/xhtml': 'html',
- 'http://www.w3.org/2001/XMLSchema': 'xs',
- 'http://www.w3.org/2001/XMLSchema-instance': 'xsi',
- 'http://www.w3.org/XML/1998/namespace': 'xml'}
-
-
-
-
-
- -
- -
-

_serialize

- -
-
-
-
Value:
-
-{'html': <__builtin__.function object>,
- 'text': <__builtin__.function object>,
- 'xml': <__builtin__.function object>}
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/xml.etree.ElementTree-pysrc.html b/doc/html/api/xml.etree.ElementTree-pysrc.html deleted file mode 100644 index 486f3dc6..00000000 --- a/doc/html/api/xml.etree.ElementTree-pysrc.html +++ /dev/null @@ -1,3196 +0,0 @@ - - - - - xml.etree.ElementTree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Package xml :: - Package etree :: - Module ElementTree - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module xml.etree.ElementTree

-
-   1  # 
-   2  # ElementTree 
-   3  # $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $ 
-   4  # 
-   5  # light-weight XML support for Python 2.3 and later. 
-   6  # 
-   7  # history (since 1.2.6): 
-   8  # 2005-11-12 fl   added tostringlist/fromstringlist helpers 
-   9  # 2006-07-05 fl   merged in selected changes from the 1.3 sandbox 
-  10  # 2006-07-05 fl   removed support for 2.1 and earlier 
-  11  # 2007-06-21 fl   added deprecation/future warnings 
-  12  # 2007-08-25 fl   added doctype hook, added parser version attribute etc 
-  13  # 2007-08-26 fl   added new serializer code (better namespace handling, etc) 
-  14  # 2007-08-27 fl   warn for broken /tag searches on tree level 
-  15  # 2007-09-02 fl   added html/text methods to serializer (experimental) 
-  16  # 2007-09-05 fl   added method argument to tostring/tostringlist 
-  17  # 2007-09-06 fl   improved error handling 
-  18  # 2007-09-13 fl   added itertext, iterfind; assorted cleanups 
-  19  # 2007-12-15 fl   added C14N hooks, copy method (experimental) 
-  20  # 
-  21  # Copyright (c) 1999-2008 by Fredrik Lundh.  All rights reserved. 
-  22  # 
-  23  # fredrik@pythonware.com 
-  24  # http://www.pythonware.com 
-  25  # 
-  26  # -------------------------------------------------------------------- 
-  27  # The ElementTree toolkit is 
-  28  # 
-  29  # Copyright (c) 1999-2008 by Fredrik Lundh 
-  30  # 
-  31  # By obtaining, using, and/or copying this software and/or its 
-  32  # associated documentation, you agree that you have read, understood, 
-  33  # and will comply with the following terms and conditions: 
-  34  # 
-  35  # Permission to use, copy, modify, and distribute this software and 
-  36  # its associated documentation for any purpose and without fee is 
-  37  # hereby granted, provided that the above copyright notice appears in 
-  38  # all copies, and that both that copyright notice and this permission 
-  39  # notice appear in supporting documentation, and that the name of 
-  40  # Secret Labs AB or the author not be used in advertising or publicity 
-  41  # pertaining to distribution of the software without specific, written 
-  42  # prior permission. 
-  43  # 
-  44  # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD 
-  45  # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- 
-  46  # ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR 
-  47  # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
-  48  # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
-  49  # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
-  50  # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
-  51  # OF THIS SOFTWARE. 
-  52  # -------------------------------------------------------------------- 
-  53   
-  54  # Licensed to PSF under a Contributor Agreement. 
-  55  # See http://www.python.org/psf/license for licensing details. 
-  56   
-  57  __all__ = [ 
-  58      # public symbols 
-  59      "Comment", 
-  60      "dump", 
-  61      "Element", "ElementTree", 
-  62      "fromstring", "fromstringlist", 
-  63      "iselement", "iterparse", 
-  64      "parse", "ParseError", 
-  65      "PI", "ProcessingInstruction", 
-  66      "QName", 
-  67      "SubElement", 
-  68      "tostring", "tostringlist", 
-  69      "TreeBuilder", 
-  70      "VERSION", 
-  71      "XML", 
-  72      "XMLParser", "XMLTreeBuilder", 
-  73      ] 
-  74   
-  75  VERSION = "1.3.0" 
-  76   
-  77  ## 
-  78  # The <b>Element</b> type is a flexible container object, designed to 
-  79  # store hierarchical data structures in memory. The type can be 
-  80  # described as a cross between a list and a dictionary. 
-  81  # <p> 
-  82  # Each element has a number of properties associated with it: 
-  83  # <ul> 
-  84  # <li>a <i>tag</i>. This is a string identifying what kind of data 
-  85  # this element represents (the element type, in other words).</li> 
-  86  # <li>a number of <i>attributes</i>, stored in a Python dictionary.</li> 
-  87  # <li>a <i>text</i> string.</li> 
-  88  # <li>an optional <i>tail</i> string.</li> 
-  89  # <li>a number of <i>child elements</i>, stored in a Python sequence</li> 
-  90  # </ul> 
-  91  # 
-  92  # To create an element instance, use the {@link #Element} constructor 
-  93  # or the {@link #SubElement} factory function. 
-  94  # <p> 
-  95  # The {@link #ElementTree} class can be used to wrap an element 
-  96  # structure, and convert it from and to XML. 
-  97  ## 
-  98   
-  99  import sys 
- 100  import re 
- 101  import warnings 
- 102   
- 103   
-
104 -class _SimpleElementPath(object): -
105 # emulate pre-1.2 find/findtext/findall behaviour -
106 - def find(self, element, tag, namespaces=None): -
107 for elem in element: - 108 if elem.tag == tag: - 109 return elem - 110 return None -
111 - def findtext(self, element, tag, default=None, namespaces=None): -
112 elem = self.find(element, tag) - 113 if elem is None: - 114 return default - 115 return elem.text or "" -
116 - def iterfind(self, element, tag, namespaces=None): -
117 if tag[:3] == ".//": - 118 for elem in element.iter(tag[3:]): - 119 yield elem - 120 for elem in element: - 121 if elem.tag == tag: - 122 yield elem -
123 - def findall(self, element, tag, namespaces=None): -
124 return list(self.iterfind(element, tag, namespaces)) -
125 - 126 try: - 127 from . import ElementPath - 128 except ImportError: - 129 ElementPath = _SimpleElementPath() - 130 - 131 ## - 132 # Parser error. This is a subclass of <b>SyntaxError</b>. - 133 # <p> - 134 # In addition to the exception value, an exception instance contains a - 135 # specific exception code in the <b>code</b> attribute, and the line and - 136 # column of the error in the <b>position</b> attribute. - 137 -
138 -class ParseError(SyntaxError): -
139 pass -
140 - 141 # -------------------------------------------------------------------- - 142 - 143 ## - 144 # Checks if an object appears to be a valid element object. - 145 # - 146 # @param An element instance. - 147 # @return A true value if this is an element object. - 148 # @defreturn flag - 149 -
150 -def iselement(element): -
151 # FIXME: not sure about this; might be a better idea to look - 152 # for tag/attrib/text attributes - 153 return isinstance(element, Element) or hasattr(element, "tag") -
154 - 155 ## - 156 # Element class. This class defines the Element interface, and - 157 # provides a reference implementation of this interface. - 158 # <p> - 159 # The element name, attribute names, and attribute values can be - 160 # either ASCII strings (ordinary Python strings containing only 7-bit - 161 # ASCII characters) or Unicode strings. - 162 # - 163 # @param tag The element name. - 164 # @param attrib An optional dictionary, containing element attributes. - 165 # @param **extra Additional attributes, given as keyword arguments. - 166 # @see Element - 167 # @see SubElement - 168 # @see Comment - 169 # @see ProcessingInstruction - 170 -
171 -class Element(object): -
172 # <tag attrib>text<child/>...</tag>tail - 173 - 174 ## - 175 # (Attribute) Element tag. - 176 - 177 tag = None - 178 - 179 ## - 180 # (Attribute) Element attribute dictionary. Where possible, use - 181 # {@link #Element.get}, - 182 # {@link #Element.set}, - 183 # {@link #Element.keys}, and - 184 # {@link #Element.items} to access - 185 # element attributes. - 186 - 187 attrib = None - 188 - 189 ## - 190 # (Attribute) Text before first subelement. This is either a - 191 # string or the value None. Note that if there was no text, this - 192 # attribute may be either None or an empty string, depending on - 193 # the parser. - 194 - 195 text = None - 196 - 197 ## - 198 # (Attribute) Text after this element's end tag, but before the - 199 # next sibling element's start tag. This is either a string or - 200 # the value None. Note that if there was no text, this attribute - 201 # may be either None or an empty string, depending on the parser. - 202 - 203 tail = None # text after end tag, if any - 204 - 205 # constructor - 206 -
207 - def __init__(self, tag, attrib={}, **extra): -
208 attrib = attrib.copy() - 209 attrib.update(extra) - 210 self.tag = tag - 211 self.attrib = attrib - 212 self._children = [] -
213 -
214 - def __repr__(self): -
215 return "<Element %s at 0x%x>" % (repr(self.tag), id(self)) -
216 - 217 ## - 218 # Creates a new element object of the same type as this element. - 219 # - 220 # @param tag Element tag. - 221 # @param attrib Element attributes, given as a dictionary. - 222 # @return A new element instance. - 223 -
224 - def makeelement(self, tag, attrib): -
225 return self.__class__(tag, attrib) -
226 - 227 ## - 228 # (Experimental) Copies the current element. This creates a - 229 # shallow copy; subelements will be shared with the original tree. - 230 # - 231 # @return A new element instance. - 232 -
233 - def copy(self): -
234 elem = self.makeelement(self.tag, self.attrib) - 235 elem.text = self.text - 236 elem.tail = self.tail - 237 elem[:] = self - 238 return elem -
239 - 240 ## - 241 # Returns the number of subelements. Note that this only counts - 242 # full elements; to check if there's any content in an element, you - 243 # have to check both the length and the <b>text</b> attribute. - 244 # - 245 # @return The number of subelements. - 246 -
247 - def __len__(self): -
248 return len(self._children) -
249 -
250 - def __nonzero__(self): -
251 warnings.warn( - 252 "The behavior of this method will change in future versions. " - 253 "Use specific 'len(elem)' or 'elem is not None' test instead.", - 254 FutureWarning, stacklevel=2 - 255 ) - 256 return len(self._children) != 0 # emulate old behaviour, for now -
257 - 258 ## - 259 # Returns the given subelement, by index. - 260 # - 261 # @param index What subelement to return. - 262 # @return The given subelement. - 263 # @exception IndexError If the given element does not exist. - 264 -
265 - def __getitem__(self, index): -
266 return self._children[index] -
267 - 268 ## - 269 # Replaces the given subelement, by index. - 270 # - 271 # @param index What subelement to replace. - 272 # @param element The new element value. - 273 # @exception IndexError If the given element does not exist. - 274 -
275 - def __setitem__(self, index, element): -
276 # if isinstance(index, slice): - 277 # for elt in element: - 278 # assert iselement(elt) - 279 # else: - 280 # assert iselement(element) - 281 self._children[index] = element -
282 - 283 ## - 284 # Deletes the given subelement, by index. - 285 # - 286 # @param index What subelement to delete. - 287 # @exception IndexError If the given element does not exist. - 288 -
289 - def __delitem__(self, index): -
290 del self._children[index] -
291 - 292 ## - 293 # Adds a subelement to the end of this element. In document order, - 294 # the new element will appear after the last existing subelement (or - 295 # directly after the text, if it's the first subelement), but before - 296 # the end tag for this element. - 297 # - 298 # @param element The element to add. - 299 -
300 - def append(self, element): -
301 # assert iselement(element) - 302 self._children.append(element) -
303 - 304 ## - 305 # Appends subelements from a sequence. - 306 # - 307 # @param elements A sequence object with zero or more elements. - 308 # @since 1.3 - 309 -
310 - def extend(self, elements): -
311 # for element in elements: - 312 # assert iselement(element) - 313 self._children.extend(elements) -
314 - 315 ## - 316 # Inserts a subelement at the given position in this element. - 317 # - 318 # @param index Where to insert the new subelement. - 319 -
320 - def insert(self, index, element): -
321 # assert iselement(element) - 322 self._children.insert(index, element) -
323 - 324 ## - 325 # Removes a matching subelement. Unlike the <b>find</b> methods, - 326 # this method compares elements based on identity, not on tag - 327 # value or contents. To remove subelements by other means, the - 328 # easiest way is often to use a list comprehension to select what - 329 # elements to keep, and use slice assignment to update the parent - 330 # element. - 331 # - 332 # @param element What element to remove. - 333 # @exception ValueError If a matching element could not be found. - 334 -
335 - def remove(self, element): -
336 # assert iselement(element) - 337 self._children.remove(element) -
338 - 339 ## - 340 # (Deprecated) Returns all subelements. The elements are returned - 341 # in document order. - 342 # - 343 # @return A list of subelements. - 344 # @defreturn list of Element instances - 345 -
346 - def getchildren(self): -
347 warnings.warn( - 348 "This method will be removed in future versions. " - 349 "Use 'list(elem)' or iteration over elem instead.", - 350 DeprecationWarning, stacklevel=2 - 351 ) - 352 return self._children -
353 - 354 ## - 355 # Finds the first matching subelement, by tag name or path. - 356 # - 357 # @param path What element to look for. - 358 # @keyparam namespaces Optional namespace prefix map. - 359 # @return The first matching element, or None if no element was found. - 360 # @defreturn Element or None - 361 -
362 - def find(self, path, namespaces=None): -
363 return ElementPath.find(self, path, namespaces) -
364 - 365 ## - 366 # Finds text for the first matching subelement, by tag name or path. - 367 # - 368 # @param path What element to look for. - 369 # @param default What to return if the element was not found. - 370 # @keyparam namespaces Optional namespace prefix map. - 371 # @return The text content of the first matching element, or the - 372 # default value no element was found. Note that if the element - 373 # is found, but has no text content, this method returns an - 374 # empty string. - 375 # @defreturn string - 376 -
377 - def findtext(self, path, default=None, namespaces=None): -
378 return ElementPath.findtext(self, path, default, namespaces) -
379 - 380 ## - 381 # Finds all matching subelements, by tag name or path. - 382 # - 383 # @param path What element to look for. - 384 # @keyparam namespaces Optional namespace prefix map. - 385 # @return A list or other sequence containing all matching elements, - 386 # in document order. - 387 # @defreturn list of Element instances - 388 -
389 - def findall(self, path, namespaces=None): -
390 return ElementPath.findall(self, path, namespaces) -
391 - 392 ## - 393 # Finds all matching subelements, by tag name or path. - 394 # - 395 # @param path What element to look for. - 396 # @keyparam namespaces Optional namespace prefix map. - 397 # @return An iterator or sequence containing all matching elements, - 398 # in document order. - 399 # @defreturn a generated sequence of Element instances - 400 -
401 - def iterfind(self, path, namespaces=None): -
402 return ElementPath.iterfind(self, path, namespaces) -
403 - 404 ## - 405 # Resets an element. This function removes all subelements, clears - 406 # all attributes, and sets the <b>text</b> and <b>tail</b> attributes - 407 # to None. - 408 -
409 - def clear(self): -
410 self.attrib.clear() - 411 self._children = [] - 412 self.text = self.tail = None -
413 - 414 ## - 415 # Gets an element attribute. Equivalent to <b>attrib.get</b>, but - 416 # some implementations may handle this a bit more efficiently. - 417 # - 418 # @param key What attribute to look for. - 419 # @param default What to return if the attribute was not found. - 420 # @return The attribute value, or the default value, if the - 421 # attribute was not found. - 422 # @defreturn string or None - 423 -
424 - def get(self, key, default=None): -
425 return self.attrib.get(key, default) -
426 - 427 ## - 428 # Sets an element attribute. Equivalent to <b>attrib[key] = value</b>, - 429 # but some implementations may handle this a bit more efficiently. - 430 # - 431 # @param key What attribute to set. - 432 # @param value The attribute value. - 433 -
434 - def set(self, key, value): -
435 self.attrib[key] = value -
436 - 437 ## - 438 # Gets a list of attribute names. The names are returned in an - 439 # arbitrary order (just like for an ordinary Python dictionary). - 440 # Equivalent to <b>attrib.keys()</b>. - 441 # - 442 # @return A list of element attribute names. - 443 # @defreturn list of strings - 444 -
445 - def keys(self): -
446 return self.attrib.keys() -
447 - 448 ## - 449 # Gets element attributes, as a sequence. The attributes are - 450 # returned in an arbitrary order. Equivalent to <b>attrib.items()</b>. - 451 # - 452 # @return A list of (name, value) tuples for all attributes. - 453 # @defreturn list of (string, string) tuples - 454 -
455 - def items(self): -
456 return self.attrib.items() -
457 - 458 ## - 459 # Creates a tree iterator. The iterator loops over this element - 460 # and all subelements, in document order, and returns all elements - 461 # with a matching tag. - 462 # <p> - 463 # If the tree structure is modified during iteration, new or removed - 464 # elements may or may not be included. To get a stable set, use the - 465 # list() function on the iterator, and loop over the resulting list. - 466 # - 467 # @param tag What tags to look for (default is to return all elements). - 468 # @return An iterator containing all the matching elements. - 469 # @defreturn iterator - 470 -
471 - def iter(self, tag=None): -
472 if tag == "*": - 473 tag = None - 474 if tag is None or self.tag == tag: - 475 yield self - 476 for e in self._children: - 477 for e in e.iter(tag): - 478 yield e -
479 - 480 # compatibility -
481 - def getiterator(self, tag=None): -
482 # Change for a DeprecationWarning in 1.4 - 483 warnings.warn( - 484 "This method will be removed in future versions. " - 485 "Use 'elem.iter()' or 'list(elem.iter())' instead.", - 486 PendingDeprecationWarning, stacklevel=2 - 487 ) - 488 return list(self.iter(tag)) -
489 - 490 ## - 491 # Creates a text iterator. The iterator loops over this element - 492 # and all subelements, in document order, and returns all inner - 493 # text. - 494 # - 495 # @return An iterator containing all inner text. - 496 # @defreturn iterator - 497 -
498 - def itertext(self): -
499 tag = self.tag - 500 if not isinstance(tag, basestring) and tag is not None: - 501 return - 502 if self.text: - 503 yield self.text - 504 for e in self: - 505 for s in e.itertext(): - 506 yield s - 507 if e.tail: - 508 yield e.tail -
509 - 510 # compatibility - 511 _Element = _ElementInterface = Element - 512 - 513 ## - 514 # Subelement factory. This function creates an element instance, and - 515 # appends it to an existing element. - 516 # <p> - 517 # The element name, attribute names, and attribute values can be - 518 # either 8-bit ASCII strings or Unicode strings. - 519 # - 520 # @param parent The parent element. - 521 # @param tag The subelement name. - 522 # @param attrib An optional dictionary, containing element attributes. - 523 # @param **extra Additional attributes, given as keyword arguments. - 524 # @return An element instance. - 525 # @defreturn Element - 526 -
527 -def SubElement(parent, tag, attrib={}, **extra): -
528 attrib = attrib.copy() - 529 attrib.update(extra) - 530 element = parent.makeelement(tag, attrib) - 531 parent.append(element) - 532 return element -
533 - 534 ## - 535 # Comment element factory. This factory function creates a special - 536 # element that will be serialized as an XML comment by the standard - 537 # serializer. - 538 # <p> - 539 # The comment string can be either an 8-bit ASCII string or a Unicode - 540 # string. - 541 # - 542 # @param text A string containing the comment string. - 543 # @return An element instance, representing a comment. - 544 # @defreturn Element - 545 -
546 -def Comment(text=None): -
547 element = Element(Comment) - 548 element.text = text - 549 return element -
550 - 551 ## - 552 # PI element factory. This factory function creates a special element - 553 # that will be serialized as an XML processing instruction by the standard - 554 # serializer. - 555 # - 556 # @param target A string containing the PI target. - 557 # @param text A string containing the PI contents, if any. - 558 # @return An element instance, representing a PI. - 559 # @defreturn Element - 560 -
561 -def ProcessingInstruction(target, text=None): -
562 element = Element(ProcessingInstruction) - 563 element.text = target - 564 if text: - 565 element.text = element.text + " " + text - 566 return element -
567 - 568 PI = ProcessingInstruction - 569 - 570 ## - 571 # QName wrapper. This can be used to wrap a QName attribute value, in - 572 # order to get proper namespace handling on output. - 573 # - 574 # @param text A string containing the QName value, in the form {uri}local, - 575 # or, if the tag argument is given, the URI part of a QName. - 576 # @param tag Optional tag. If given, the first argument is interpreted as - 577 # a URI, and this argument is interpreted as a local name. - 578 # @return An opaque object, representing the QName. - 579 -
580 -class QName(object): -
581 - def __init__(self, text_or_uri, tag=None): -
582 if tag: - 583 text_or_uri = "{%s}%s" % (text_or_uri, tag) - 584 self.text = text_or_uri -
585 - def __str__(self): -
586 return self.text -
587 - def __hash__(self): -
588 return hash(self.text) -
589 - def __cmp__(self, other): -
590 if isinstance(other, QName): - 591 return cmp(self.text, other.text) - 592 return cmp(self.text, other) -
593 - 594 # -------------------------------------------------------------------- - 595 - 596 ## - 597 # ElementTree wrapper class. This class represents an entire element - 598 # hierarchy, and adds some extra support for serialization to and from - 599 # standard XML. - 600 # - 601 # @param element Optional root element. - 602 # @keyparam file Optional file handle or file name. If given, the - 603 # tree is initialized with the contents of this XML file. - 604 -
605 -class ElementTree(object): -
606 -
607 - def __init__(self, element=None, file=None): -
608 # assert element is None or iselement(element) - 609 self._root = element # first node - 610 if file: - 611 self.parse(file) -
612 - 613 ## - 614 # Gets the root element for this tree. - 615 # - 616 # @return An element instance. - 617 # @defreturn Element - 618 -
619 - def getroot(self): -
620 return self._root -
621 - 622 ## - 623 # Replaces the root element for this tree. This discards the - 624 # current contents of the tree, and replaces it with the given - 625 # element. Use with care. - 626 # - 627 # @param element An element instance. - 628 -
629 - def _setroot(self, element): -
630 # assert iselement(element) - 631 self._root = element -
632 - 633 ## - 634 # Loads an external XML document into this element tree. - 635 # - 636 # @param source A file name or file object. If a file object is - 637 # given, it only has to implement a <b>read(n)</b> method. - 638 # @keyparam parser An optional parser instance. If not given, the - 639 # standard {@link XMLParser} parser is used. - 640 # @return The document root element. - 641 # @defreturn Element - 642 # @exception ParseError If the parser fails to parse the document. - 643 -
644 - def parse(self, source, parser=None): -
645 close_source = False - 646 if not hasattr(source, "read"): - 647 source = open(source, "rb") - 648 close_source = True - 649 try: - 650 if not parser: - 651 parser = XMLParser(target=TreeBuilder()) - 652 while 1: - 653 data = source.read(65536) - 654 if not data: - 655 break - 656 parser.feed(data) - 657 self._root = parser.close() - 658 return self._root - 659 finally: - 660 if close_source: - 661 source.close() -
662 - 663 ## - 664 # Creates a tree iterator for the root element. The iterator loops - 665 # over all elements in this tree, in document order. - 666 # - 667 # @param tag What tags to look for (default is to return all elements) - 668 # @return An iterator. - 669 # @defreturn iterator - 670 -
671 - def iter(self, tag=None): -
672 # assert self._root is not None - 673 return self._root.iter(tag) -
674 - 675 # compatibility -
676 - def getiterator(self, tag=None): -
677 # Change for a DeprecationWarning in 1.4 - 678 warnings.warn( - 679 "This method will be removed in future versions. " - 680 "Use 'tree.iter()' or 'list(tree.iter())' instead.", - 681 PendingDeprecationWarning, stacklevel=2 - 682 ) - 683 return list(self.iter(tag)) -
684 - 685 ## - 686 # Same as getroot().find(path), starting at the root of the - 687 # tree. - 688 # - 689 # @param path What element to look for. - 690 # @keyparam namespaces Optional namespace prefix map. - 691 # @return The first matching element, or None if no element was found. - 692 # @defreturn Element or None - 693 -
694 - def find(self, path, namespaces=None): -
695 # assert self._root is not None - 696 if path[:1] == "/": - 697 path = "." + path - 698 warnings.warn( - 699 "This search is broken in 1.3 and earlier, and will be " - 700 "fixed in a future version. If you rely on the current " - 701 "behaviour, change it to %r" % path, - 702 FutureWarning, stacklevel=2 - 703 ) - 704 return self._root.find(path, namespaces) -
705 - 706 ## - 707 # Same as getroot().findtext(path), starting at the root of the tree. - 708 # - 709 # @param path What element to look for. - 710 # @param default What to return if the element was not found. - 711 # @keyparam namespaces Optional namespace prefix map. - 712 # @return The text content of the first matching element, or the - 713 # default value no element was found. Note that if the element - 714 # is found, but has no text content, this method returns an - 715 # empty string. - 716 # @defreturn string - 717 -
718 - def findtext(self, path, default=None, namespaces=None): -
719 # assert self._root is not None - 720 if path[:1] == "/": - 721 path = "." + path - 722 warnings.warn( - 723 "This search is broken in 1.3 and earlier, and will be " - 724 "fixed in a future version. If you rely on the current " - 725 "behaviour, change it to %r" % path, - 726 FutureWarning, stacklevel=2 - 727 ) - 728 return self._root.findtext(path, default, namespaces) -
729 - 730 ## - 731 # Same as getroot().findall(path), starting at the root of the tree. - 732 # - 733 # @param path What element to look for. - 734 # @keyparam namespaces Optional namespace prefix map. - 735 # @return A list or iterator containing all matching elements, - 736 # in document order. - 737 # @defreturn list of Element instances - 738 -
739 - def findall(self, path, namespaces=None): -
740 # assert self._root is not None - 741 if path[:1] == "/": - 742 path = "." + path - 743 warnings.warn( - 744 "This search is broken in 1.3 and earlier, and will be " - 745 "fixed in a future version. If you rely on the current " - 746 "behaviour, change it to %r" % path, - 747 FutureWarning, stacklevel=2 - 748 ) - 749 return self._root.findall(path, namespaces) -
750 - 751 ## - 752 # Finds all matching subelements, by tag name or path. - 753 # Same as getroot().iterfind(path). - 754 # - 755 # @param path What element to look for. - 756 # @keyparam namespaces Optional namespace prefix map. - 757 # @return An iterator or sequence containing all matching elements, - 758 # in document order. - 759 # @defreturn a generated sequence of Element instances - 760 -
761 - def iterfind(self, path, namespaces=None): -
762 # assert self._root is not None - 763 if path[:1] == "/": - 764 path = "." + path - 765 warnings.warn( - 766 "This search is broken in 1.3 and earlier, and will be " - 767 "fixed in a future version. If you rely on the current " - 768 "behaviour, change it to %r" % path, - 769 FutureWarning, stacklevel=2 - 770 ) - 771 return self._root.iterfind(path, namespaces) -
772 - 773 ## - 774 # Writes the element tree to a file, as XML. - 775 # - 776 # @def write(file, **options) - 777 # @param file A file name, or a file object opened for writing. - 778 # @param **options Options, given as keyword arguments. - 779 # @keyparam encoding Optional output encoding (default is US-ASCII). - 780 # @keyparam xml_declaration Controls if an XML declaration should - 781 # be added to the file. Use False for never, True for always, - 782 # None for only if not US-ASCII or UTF-8. None is default. - 783 # @keyparam default_namespace Sets the default XML namespace (for "xmlns"). - 784 # @keyparam method Optional output method ("xml", "html", "text" or - 785 # "c14n"; default is "xml"). - 786 -
787 - def write(self, file_or_filename, - 788 # keyword arguments - 789 encoding=None, - 790 xml_declaration=None, - 791 default_namespace=None, - 792 method=None): -
793 # assert self._root is not None - 794 if not method: - 795 method = "xml" - 796 elif method not in _serialize: - 797 # FIXME: raise an ImportError for c14n if ElementC14N is missing? - 798 raise ValueError("unknown method %r" % method) - 799 if hasattr(file_or_filename, "write"): - 800 file = file_or_filename - 801 else: - 802 file = open(file_or_filename, "wb") - 803 write = file.write - 804 if not encoding: - 805 if method == "c14n": - 806 encoding = "utf-8" - 807 else: - 808 encoding = "us-ascii" - 809 elif xml_declaration or (xml_declaration is None and - 810 encoding not in ("utf-8", "us-ascii")): - 811 if method == "xml": - 812 write("<?xml version='1.0' encoding='%s'?>\n" % encoding) - 813 if method == "text": - 814 _serialize_text(write, self._root, encoding) - 815 else: - 816 qnames, namespaces = _namespaces( - 817 self._root, encoding, default_namespace - 818 ) - 819 serialize = _serialize[method] - 820 serialize(write, self._root, encoding, qnames, namespaces) - 821 if file_or_filename is not file: - 822 file.close() -
823 -
824 - def write_c14n(self, file): -
825 # lxml.etree compatibility. use output method instead - 826 return self.write(file, method="c14n") -
827 - 828 # -------------------------------------------------------------------- - 829 # serialization support - 830 -
831 -def _namespaces(elem, encoding, default_namespace=None): -
832 # identify namespaces used in this tree - 833 - 834 # maps qnames to *encoded* prefix:local names - 835 qnames = {None: None} - 836 - 837 # maps uri:s to prefixes - 838 namespaces = {} - 839 if default_namespace: - 840 namespaces[default_namespace] = "" - 841 - 842 def encode(text): - 843 return text.encode(encoding) -
844 - 845 def add_qname(qname): - 846 # calculate serialized qname representation - 847 try: - 848 if qname[:1] == "{": - 849 uri, tag = qname[1:].rsplit("}", 1) - 850 prefix = namespaces.get(uri) - 851 if prefix is None: - 852 prefix = _namespace_map.get(uri) - 853 if prefix is None: - 854 prefix = "ns%d" % len(namespaces) - 855 if prefix != "xml": - 856 namespaces[uri] = prefix - 857 if prefix: - 858 qnames[qname] = encode("%s:%s" % (prefix, tag)) - 859 else: - 860 qnames[qname] = encode(tag) # default element - 861 else: - 862 if default_namespace: - 863 # FIXME: can this be handled in XML 1.0? - 864 raise ValueError( - 865 "cannot use non-qualified names with " - 866 "default_namespace option" - 867 ) - 868 qnames[qname] = encode(qname) - 869 except TypeError: - 870 _raise_serialization_error(qname) - 871 - 872 # populate qname and namespaces table - 873 try: - 874 iterate = elem.iter - 875 except AttributeError: - 876 iterate = elem.getiterator # cET compatibility - 877 for elem in iterate(): - 878 tag = elem.tag - 879 if isinstance(tag, QName): - 880 if tag.text not in qnames: - 881 add_qname(tag.text) - 882 elif isinstance(tag, basestring): - 883 if tag not in qnames: - 884 add_qname(tag) - 885 elif tag is not None and tag is not Comment and tag is not PI: - 886 _raise_serialization_error(tag) - 887 for key, value in elem.items(): - 888 if isinstance(key, QName): - 889 key = key.text - 890 if key not in qnames: - 891 add_qname(key) - 892 if isinstance(value, QName) and value.text not in qnames: - 893 add_qname(value.text) - 894 text = elem.text - 895 if isinstance(text, QName) and text.text not in qnames: - 896 add_qname(text.text) - 897 return qnames, namespaces - 898 -
899 -def _serialize_xml(write, elem, encoding, qnames, namespaces): -
900 tag = elem.tag - 901 text = elem.text - 902 if tag is Comment: - 903 write("<!--%s-->" % _encode(text, encoding)) - 904 elif tag is ProcessingInstruction: - 905 write("<?%s?>" % _encode(text, encoding)) - 906 else: - 907 tag = qnames[tag] - 908 if tag is None: - 909 if text: - 910 write(_escape_cdata(text, encoding)) - 911 for e in elem: - 912 _serialize_xml(write, e, encoding, qnames, None) - 913 else: - 914 write("<" + tag) - 915 items = elem.items() - 916 if items or namespaces: - 917 if namespaces: - 918 for v, k in sorted(namespaces.items(), - 919 key=lambda x: x[1]): # sort on prefix - 920 if k: - 921 k = ":" + k - 922 write(" xmlns%s=\"%s\"" % ( - 923 k.encode(encoding), - 924 _escape_attrib(v, encoding) - 925 )) - 926 for k, v in sorted(items): # lexical order - 927 if isinstance(k, QName): - 928 k = k.text - 929 if isinstance(v, QName): - 930 v = qnames[v.text] - 931 else: - 932 v = _escape_attrib(v, encoding) - 933 write(" %s=\"%s\"" % (qnames[k], v)) - 934 if text or len(elem): - 935 write(">") - 936 if text: - 937 write(_escape_cdata(text, encoding)) - 938 for e in elem: - 939 _serialize_xml(write, e, encoding, qnames, None) - 940 write("</" + tag + ">") - 941 else: - 942 write(" />") - 943 if elem.tail: - 944 write(_escape_cdata(elem.tail, encoding)) -
945 - 946 HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr", - 947 "img", "input", "isindex", "link", "meta", "param") - 948 - 949 try: - 950 HTML_EMPTY = set(HTML_EMPTY) - 951 except NameError: - 952 pass - 953 -
954 -def _serialize_html(write, elem, encoding, qnames, namespaces): -
955 tag = elem.tag - 956 text = elem.text - 957 if tag is Comment: - 958 write("<!--%s-->" % _escape_cdata(text, encoding)) - 959 elif tag is ProcessingInstruction: - 960 write("<?%s?>" % _escape_cdata(text, encoding)) - 961 else: - 962 tag = qnames[tag] - 963 if tag is None: - 964 if text: - 965 write(_escape_cdata(text, encoding)) - 966 for e in elem: - 967 _serialize_html(write, e, encoding, qnames, None) - 968 else: - 969 write("<" + tag) - 970 items = elem.items() - 971 if items or namespaces: - 972 if namespaces: - 973 for v, k in sorted(namespaces.items(), - 974 key=lambda x: x[1]): # sort on prefix - 975 if k: - 976 k = ":" + k - 977 write(" xmlns%s=\"%s\"" % ( - 978 k.encode(encoding), - 979 _escape_attrib(v, encoding) - 980 )) - 981 for k, v in sorted(items): # lexical order - 982 if isinstance(k, QName): - 983 k = k.text - 984 if isinstance(v, QName): - 985 v = qnames[v.text] - 986 else: - 987 v = _escape_attrib_html(v, encoding) - 988 # FIXME: handle boolean attributes - 989 write(" %s=\"%s\"" % (qnames[k], v)) - 990 write(">") - 991 ltag = tag.lower() - 992 if text: - 993 if ltag == "script" or ltag == "style": - 994 write(_encode(text, encoding)) - 995 else: - 996 write(_escape_cdata(text, encoding)) - 997 for e in elem: - 998 _serialize_html(write, e, encoding, qnames, None) - 999 if ltag not in HTML_EMPTY: -1000 write("</" + tag + ">") -1001 if elem.tail: -1002 write(_escape_cdata(elem.tail, encoding)) -
1003 -
1004 -def _serialize_text(write, elem, encoding): -
1005 for part in elem.itertext(): -1006 write(part.encode(encoding)) -1007 if elem.tail: -1008 write(elem.tail.encode(encoding)) -
1009 -1010 _serialize = { -1011 "xml": _serialize_xml, -1012 "html": _serialize_html, -1013 "text": _serialize_text, -1014 # this optional method is imported at the end of the module -1015 # "c14n": _serialize_c14n, -1016 } -1017 -1018 ## -1019 # Registers a namespace prefix. The registry is global, and any -1020 # existing mapping for either the given prefix or the namespace URI -1021 # will be removed. -1022 # -1023 # @param prefix Namespace prefix. -1024 # @param uri Namespace uri. Tags and attributes in this namespace -1025 # will be serialized with the given prefix, if at all possible. -1026 # @exception ValueError If the prefix is reserved, or is otherwise -1027 # invalid. -1028 -
1029 -def register_namespace(prefix, uri): -
1030 if re.match("ns\d+$", prefix): -1031 raise ValueError("Prefix format reserved for internal use") -1032 for k, v in _namespace_map.items(): -1033 if k == uri or v == prefix: -1034 del _namespace_map[k] -1035 _namespace_map[uri] = prefix -
1036 -1037 _namespace_map = { -1038 # "well-known" namespace prefixes -1039 "http://www.w3.org/XML/1998/namespace": "xml", -1040 "http://www.w3.org/1999/xhtml": "html", -1041 "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", -1042 "http://schemas.xmlsoap.org/wsdl/": "wsdl", -1043 # xml schema -1044 "http://www.w3.org/2001/XMLSchema": "xs", -1045 "http://www.w3.org/2001/XMLSchema-instance": "xsi", -1046 # dublin core -1047 "http://purl.org/dc/elements/1.1/": "dc", -1048 } -1049 -
1050 -def _raise_serialization_error(text): -
1051 raise TypeError( -1052 "cannot serialize %r (type %s)" % (text, type(text).__name__) -1053 ) -
1054 -
1055 -def _encode(text, encoding): -
1056 try: -1057 return text.encode(encoding, "xmlcharrefreplace") -1058 except (TypeError, AttributeError): -1059 _raise_serialization_error(text) -
1060 -
1061 -def _escape_cdata(text, encoding): -
1062 # escape character data -1063 try: -1064 # it's worth avoiding do-nothing calls for strings that are -1065 # shorter than 500 character, or so. assume that's, by far, -1066 # the most common case in most applications. -1067 if "&" in text: -1068 text = text.replace("&", "&amp;") -1069 if "<" in text: -1070 text = text.replace("<", "&lt;") -1071 if ">" in text: -1072 text = text.replace(">", "&gt;") -1073 return text.encode(encoding, "xmlcharrefreplace") -1074 except (TypeError, AttributeError): -1075 _raise_serialization_error(text) -
1076 -
1077 -def _escape_attrib(text, encoding): -
1078 # escape attribute value -1079 try: -1080 if "&" in text: -1081 text = text.replace("&", "&amp;") -1082 if "<" in text: -1083 text = text.replace("<", "&lt;") -1084 if ">" in text: -1085 text = text.replace(">", "&gt;") -1086 if "\"" in text: -1087 text = text.replace("\"", "&quot;") -1088 if "\n" in text: -1089 text = text.replace("\n", "&#10;") -1090 return text.encode(encoding, "xmlcharrefreplace") -1091 except (TypeError, AttributeError): -1092 _raise_serialization_error(text) -
1093 -
1094 -def _escape_attrib_html(text, encoding): -
1095 # escape attribute value -1096 try: -1097 if "&" in text: -1098 text = text.replace("&", "&amp;") -1099 if ">" in text: -1100 text = text.replace(">", "&gt;") -1101 if "\"" in text: -1102 text = text.replace("\"", "&quot;") -1103 return text.encode(encoding, "xmlcharrefreplace") -1104 except (TypeError, AttributeError): -1105 _raise_serialization_error(text) -
1106 -1107 # -------------------------------------------------------------------- -1108 -1109 ## -1110 # Generates a string representation of an XML element, including all -1111 # subelements. -1112 # -1113 # @param element An Element instance. -1114 # @keyparam encoding Optional output encoding (default is US-ASCII). -1115 # @keyparam method Optional output method ("xml", "html", "text" or -1116 # "c14n"; default is "xml"). -1117 # @return An encoded string containing the XML data. -1118 # @defreturn string -1119 -
1120 -def tostring(element, encoding=None, method=None): -
1121 class dummy: -1122 pass -
1123 data = [] -1124 file = dummy() -1125 file.write = data.append -1126 ElementTree(element).write(file, encoding, method=method) -1127 return "".join(data) -1128 -1129 ## -1130 # Generates a string representation of an XML element, including all -1131 # subelements. The string is returned as a sequence of string fragments. -1132 # -1133 # @param element An Element instance. -1134 # @keyparam encoding Optional output encoding (default is US-ASCII). -1135 # @keyparam method Optional output method ("xml", "html", "text" or -1136 # "c14n"; default is "xml"). -1137 # @return A sequence object containing the XML data. -1138 # @defreturn sequence -1139 # @since 1.3 -1140 -
1141 -def tostringlist(element, encoding=None, method=None): -
1142 class dummy: -1143 pass -
1144 data = [] -1145 file = dummy() -1146 file.write = data.append -1147 ElementTree(element).write(file, encoding, method=method) -1148 # FIXME: merge small fragments into larger parts -1149 return data -1150 -1151 ## -1152 # Writes an element tree or element structure to sys.stdout. This -1153 # function should be used for debugging only. -1154 # <p> -1155 # The exact output format is implementation dependent. In this -1156 # version, it's written as an ordinary XML file. -1157 # -1158 # @param elem An element tree or an individual element. -1159 -
1160 -def dump(elem): -
1161 # debugging -1162 if not isinstance(elem, ElementTree): -1163 elem = ElementTree(elem) -1164 elem.write(sys.stdout) -1165 tail = elem.getroot().tail -1166 if not tail or tail[-1] != "\n": -1167 sys.stdout.write("\n") -
1168 -1169 # -------------------------------------------------------------------- -1170 # parsing -1171 -1172 ## -1173 # Parses an XML document into an element tree. -1174 # -1175 # @param source A filename or file object containing XML data. -1176 # @param parser An optional parser instance. If not given, the -1177 # standard {@link XMLParser} parser is used. -1178 # @return An ElementTree instance -1179 -
1180 -def parse(source, parser=None): -
1181 tree = ElementTree() -1182 tree.parse(source, parser) -1183 return tree -
1184 -1185 ## -1186 # Parses an XML document into an element tree incrementally, and reports -1187 # what's going on to the user. -1188 # -1189 # @param source A filename or file object containing XML data. -1190 # @param events A list of events to report back. If omitted, only "end" -1191 # events are reported. -1192 # @param parser An optional parser instance. If not given, the -1193 # standard {@link XMLParser} parser is used. -1194 # @return A (event, elem) iterator. -1195 -
1196 -def iterparse(source, events=None, parser=None): -
1197 close_source = False -1198 if not hasattr(source, "read"): -1199 source = open(source, "rb") -1200 close_source = True -1201 try: -1202 if not parser: -1203 parser = XMLParser(target=TreeBuilder()) -1204 return _IterParseIterator(source, events, parser, close_source) -1205 except: -1206 if close_source: -1207 source.close() -1208 raise -
1209 -
1210 -class _IterParseIterator(object): -
1211 -
1212 - def __init__(self, source, events, parser, close_source=False): -
1213 self._file = source -1214 self._close_file = close_source -1215 self._events = [] -1216 self._index = 0 -1217 self._error = None -1218 self.root = self._root = None -1219 self._parser = parser -1220 # wire up the parser for event reporting -1221 parser = self._parser._parser -1222 append = self._events.append -1223 if events is None: -1224 events = ["end"] -1225 for event in events: -1226 if event == "start": -1227 try: -1228 parser.ordered_attributes = 1 -1229 parser.specified_attributes = 1 -1230 def handler(tag, attrib_in, event=event, append=append, -1231 start=self._parser._start_list): -1232 append((event, start(tag, attrib_in))) -
1233 parser.StartElementHandler = handler -1234 except AttributeError: -1235 def handler(tag, attrib_in, event=event, append=append, -1236 start=self._parser._start): -1237 append((event, start(tag, attrib_in))) -
1238 parser.StartElementHandler = handler -1239 elif event == "end": -1240 def handler(tag, event=event, append=append, -1241 end=self._parser._end): -1242 append((event, end(tag))) -1243 parser.EndElementHandler = handler -1244 elif event == "start-ns": -1245 def handler(prefix, uri, event=event, append=append): -1246 try: -1247 uri = (uri or "").encode("ascii") -1248 except UnicodeError: -1249 pass -1250 append((event, (prefix or "", uri or ""))) -1251 parser.StartNamespaceDeclHandler = handler -1252 elif event == "end-ns": -1253 def handler(prefix, event=event, append=append): -1254 append((event, None)) -1255 parser.EndNamespaceDeclHandler = handler -1256 else: -1257 raise ValueError("unknown event %r" % event) -1258 -
1259 - def next(self): -
1260 try: -1261 while 1: -1262 try: -1263 item = self._events[self._index] -1264 self._index += 1 -1265 return item -1266 except IndexError: -1267 pass -1268 if self._error: -1269 e = self._error -1270 self._error = None -1271 raise e -1272 if self._parser is None: -1273 self.root = self._root -1274 break -1275 # load event buffer -1276 del self._events[:] -1277 self._index = 0 -1278 data = self._file.read(16384) -1279 if data: -1280 try: -1281 self._parser.feed(data) -1282 except SyntaxError as exc: -1283 self._error = exc -1284 else: -1285 self._root = self._parser.close() -1286 self._parser = None -1287 except: -1288 if self._close_file: -1289 self._file.close() -1290 raise -1291 if self._close_file: -1292 self._file.close() -1293 raise StopIteration -
1294 -
1295 - def __iter__(self): -
1296 return self -
1297 -1298 ## -1299 # Parses an XML document from a string constant. This function can -1300 # be used to embed "XML literals" in Python code. -1301 # -1302 # @param source A string containing XML data. -1303 # @param parser An optional parser instance. If not given, the -1304 # standard {@link XMLParser} parser is used. -1305 # @return An Element instance. -1306 # @defreturn Element -1307 -
1308 -def XML(text, parser=None): -
1309 if not parser: -1310 parser = XMLParser(target=TreeBuilder()) -1311 parser.feed(text) -1312 return parser.close() -
1313 -1314 ## -1315 # Parses an XML document from a string constant, and also returns -1316 # a dictionary which maps from element id:s to elements. -1317 # -1318 # @param source A string containing XML data. -1319 # @param parser An optional parser instance. If not given, the -1320 # standard {@link XMLParser} parser is used. -1321 # @return A tuple containing an Element instance and a dictionary. -1322 # @defreturn (Element, dictionary) -1323 -
1324 -def XMLID(text, parser=None): -
1325 if not parser: -1326 parser = XMLParser(target=TreeBuilder()) -1327 parser.feed(text) -1328 tree = parser.close() -1329 ids = {} -1330 for elem in tree.iter(): -1331 id = elem.get("id") -1332 if id: -1333 ids[id] = elem -1334 return tree, ids -
1335 -1336 ## -1337 # Parses an XML document from a string constant. Same as {@link #XML}. -1338 # -1339 # @def fromstring(text) -1340 # @param source A string containing XML data. -1341 # @return An Element instance. -1342 # @defreturn Element -1343 -1344 fromstring = XML -1345 -1346 ## -1347 # Parses an XML document from a sequence of string fragments. -1348 # -1349 # @param sequence A list or other sequence containing XML data fragments. -1350 # @param parser An optional parser instance. If not given, the -1351 # standard {@link XMLParser} parser is used. -1352 # @return An Element instance. -1353 # @defreturn Element -1354 # @since 1.3 -1355 -
1356 -def fromstringlist(sequence, parser=None): -
1357 if not parser: -1358 parser = XMLParser(target=TreeBuilder()) -1359 for text in sequence: -1360 parser.feed(text) -1361 return parser.close() -
1362 -1363 # -------------------------------------------------------------------- -1364 -1365 ## -1366 # Generic element structure builder. This builder converts a sequence -1367 # of {@link #TreeBuilder.start}, {@link #TreeBuilder.data}, and {@link -1368 # #TreeBuilder.end} method calls to a well-formed element structure. -1369 # <p> -1370 # You can use this class to build an element structure using a custom XML -1371 # parser, or a parser for some other XML-like format. -1372 # -1373 # @param element_factory Optional element factory. This factory -1374 # is called to create new Element instances, as necessary. -1375 -
1376 -class TreeBuilder(object): -
1377 -
1378 - def __init__(self, element_factory=None): -
1379 self._data = [] # data collector -1380 self._elem = [] # element stack -1381 self._last = None # last element -1382 self._tail = None # true if we're after an end tag -1383 if element_factory is None: -1384 element_factory = Element -1385 self._factory = element_factory -
1386 -1387 ## -1388 # Flushes the builder buffers, and returns the toplevel document -1389 # element. -1390 # -1391 # @return An Element instance. -1392 # @defreturn Element -1393 -
1394 - def close(self): -
1395 assert len(self._elem) == 0, "missing end tags" -1396 assert self._last is not None, "missing toplevel element" -1397 return self._last -
1398 -
1399 - def _flush(self): -
1400 if self._data: -1401 if self._last is not None: -1402 text = "".join(self._data) -1403 if self._tail: -1404 assert self._last.tail is None, "internal error (tail)" -1405 self._last.tail = text -1406 else: -1407 assert self._last.text is None, "internal error (text)" -1408 self._last.text = text -1409 self._data = [] -
1410 -1411 ## -1412 # Adds text to the current element. -1413 # -1414 # @param data A string. This should be either an 8-bit string -1415 # containing ASCII text, or a Unicode string. -1416 -
1417 - def data(self, data): -
1418 self._data.append(data) -
1419 -1420 ## -1421 # Opens a new element. -1422 # -1423 # @param tag The element name. -1424 # @param attrib A dictionary containing element attributes. -1425 # @return The opened element. -1426 # @defreturn Element -1427 -
1428 - def start(self, tag, attrs): -
1429 self._flush() -1430 self._last = elem = self._factory(tag, attrs) -1431 if self._elem: -1432 self._elem[-1].append(elem) -1433 self._elem.append(elem) -1434 self._tail = 0 -1435 return elem -
1436 -1437 ## -1438 # Closes the current element. -1439 # -1440 # @param tag The element name. -1441 # @return The closed element. -1442 # @defreturn Element -1443 -
1444 - def end(self, tag): -
1445 self._flush() -1446 self._last = self._elem.pop() -1447 assert self._last.tag == tag,\ -1448 "end tag mismatch (expected %s, got %s)" % ( -1449 self._last.tag, tag) -1450 self._tail = 1 -1451 return self._last -
1452 -1453 ## -1454 # Element structure builder for XML source data, based on the -1455 # <b>expat</b> parser. -1456 # -1457 # @keyparam target Target object. If omitted, the builder uses an -1458 # instance of the standard {@link #TreeBuilder} class. -1459 # @keyparam html Predefine HTML entities. This flag is not supported -1460 # by the current implementation. -1461 # @keyparam encoding Optional encoding. If given, the value overrides -1462 # the encoding specified in the XML file. -1463 # @see #ElementTree -1464 # @see #TreeBuilder -1465 -
1466 -class XMLParser(object): -
1467 -
1468 - def __init__(self, html=0, target=None, encoding=None): -
1469 try: -1470 from xml.parsers import expat -1471 except ImportError: -1472 try: -1473 import pyexpat as expat -1474 except ImportError: -1475 raise ImportError( -1476 "No module named expat; use SimpleXMLTreeBuilder instead" -1477 ) -1478 parser = expat.ParserCreate(encoding, "}") -1479 if target is None: -1480 target = TreeBuilder() -1481 # underscored names are provided for compatibility only -1482 self.parser = self._parser = parser -1483 self.target = self._target = target -1484 self._error = expat.error -1485 self._names = {} # name memo cache -1486 # callbacks -1487 parser.DefaultHandlerExpand = self._default -1488 parser.StartElementHandler = self._start -1489 parser.EndElementHandler = self._end -1490 parser.CharacterDataHandler = self._data -1491 # optional callbacks -1492 parser.CommentHandler = self._comment -1493 parser.ProcessingInstructionHandler = self._pi -1494 # let expat do the buffering, if supported -1495 try: -1496 self._parser.buffer_text = 1 -1497 except AttributeError: -1498 pass -1499 # use new-style attribute handling, if supported -1500 try: -1501 self._parser.ordered_attributes = 1 -1502 self._parser.specified_attributes = 1 -1503 parser.StartElementHandler = self._start_list -1504 except AttributeError: -1505 pass -1506 self._doctype = None -1507 self.entity = {} -1508 try: -1509 self.version = "Expat %d.%d.%d" % expat.version_info -1510 except AttributeError: -1511 pass # unknown -
1512 -
1513 - def _raiseerror(self, value): -
1514 err = ParseError(value) -1515 err.code = value.code -1516 err.position = value.lineno, value.offset -1517 raise err -
1518 -
1519 - def _fixtext(self, text): -
1520 # convert text string to ascii, if possible -1521 try: -1522 return text.encode("ascii") -1523 except UnicodeError: -1524 return text -
1525 -
1526 - def _fixname(self, key): -
1527 # expand qname, and convert name string to ascii, if possible -1528 try: -1529 name = self._names[key] -1530 except KeyError: -1531 name = key -1532 if "}" in name: -1533 name = "{" + name -1534 self._names[key] = name = self._fixtext(name) -1535 return name -
1536 -
1537 - def _start(self, tag, attrib_in): -
1538 fixname = self._fixname -1539 fixtext = self._fixtext -1540 tag = fixname(tag) -1541 attrib = {} -1542 for key, value in attrib_in.items(): -1543 attrib[fixname(key)] = fixtext(value) -1544 return self.target.start(tag, attrib) -
1545 -
1546 - def _start_list(self, tag, attrib_in): -
1547 fixname = self._fixname -1548 fixtext = self._fixtext -1549 tag = fixname(tag) -1550 attrib = {} -1551 if attrib_in: -1552 for i in range(0, len(attrib_in), 2): -1553 attrib[fixname(attrib_in[i])] = fixtext(attrib_in[i+1]) -1554 return self.target.start(tag, attrib) -
1555 -
1556 - def _data(self, text): -
1557 return self.target.data(self._fixtext(text)) -
1558 -
1559 - def _end(self, tag): -
1560 return self.target.end(self._fixname(tag)) -
1561 -
1562 - def _comment(self, data): -
1563 try: -1564 comment = self.target.comment -1565 except AttributeError: -1566 pass -1567 else: -1568 return comment(self._fixtext(data)) -
1569 -
1570 - def _pi(self, target, data): -
1571 try: -1572 pi = self.target.pi -1573 except AttributeError: -1574 pass -1575 else: -1576 return pi(self._fixtext(target), self._fixtext(data)) -
1577 -
1578 - def _default(self, text): -
1579 prefix = text[:1] -1580 if prefix == "&": -1581 # deal with undefined entities -1582 try: -1583 self.target.data(self.entity[text[1:-1]]) -1584 except KeyError: -1585 from xml.parsers import expat -1586 err = expat.error( -1587 "undefined entity %s: line %d, column %d" % -1588 (text, self._parser.ErrorLineNumber, -1589 self._parser.ErrorColumnNumber) -1590 ) -1591 err.code = 11 # XML_ERROR_UNDEFINED_ENTITY -1592 err.lineno = self._parser.ErrorLineNumber -1593 err.offset = self._parser.ErrorColumnNumber -1594 raise err -1595 elif prefix == "<" and text[:9] == "<!DOCTYPE": -1596 self._doctype = [] # inside a doctype declaration -1597 elif self._doctype is not None: -1598 # parse doctype contents -1599 if prefix == ">": -1600 self._doctype = None -1601 return -1602 text = text.strip() -1603 if not text: -1604 return -1605 self._doctype.append(text) -1606 n = len(self._doctype) -1607 if n > 2: -1608 type = self._doctype[1] -1609 if type == "PUBLIC" and n == 4: -1610 name, type, pubid, system = self._doctype -1611 elif type == "SYSTEM" and n == 3: -1612 name, type, system = self._doctype -1613 pubid = None -1614 else: -1615 return -1616 if pubid: -1617 pubid = pubid[1:-1] -1618 if hasattr(self.target, "doctype"): -1619 self.target.doctype(name, pubid, system[1:-1]) -1620 elif self.doctype is not self._XMLParser__doctype: -1621 # warn about deprecated call -1622 self._XMLParser__doctype(name, pubid, system[1:-1]) -1623 self.doctype(name, pubid, system[1:-1]) -1624 self._doctype = None -
1625 -1626 ## -1627 # (Deprecated) Handles a doctype declaration. -1628 # -1629 # @param name Doctype name. -1630 # @param pubid Public identifier. -1631 # @param system System identifier. -1632 -
1633 - def doctype(self, name, pubid, system): -
1634 """This method of XMLParser is deprecated.""" -1635 warnings.warn( -1636 "This method of XMLParser is deprecated. Define doctype() " -1637 "method on the TreeBuilder target.", -1638 DeprecationWarning, -1639 ) -
1640 -1641 # sentinel, if doctype is redefined in a subclass -1642 __doctype = doctype -1643 -1644 ## -1645 # Feeds data to the parser. -1646 # -1647 # @param data Encoded data. -1648 -
1649 - def feed(self, data): -
1650 try: -1651 self._parser.Parse(data, 0) -1652 except self._error, v: -1653 self._raiseerror(v) -
1654 -1655 ## -1656 # Finishes feeding data to the parser. -1657 # -1658 # @return An element structure. -1659 # @defreturn Element -1660 -
1661 - def close(self): -
1662 try: -1663 self._parser.Parse("", 1) # end of data -1664 except self._error, v: -1665 self._raiseerror(v) -1666 tree = self.target.close() -1667 del self.target, self._parser # get rid of circular references -1668 return tree -
1669 -1670 # compatibility -1671 XMLTreeBuilder = XMLParser -1672 -1673 # workaround circular import. -1674 try: -1675 from ElementC14N import _serialize_c14n -1676 _serialize["c14n"] = _serialize_c14n -1677 except ImportError: -1678 pass -1679 -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/xml.etree.ElementTree.Element-class.html b/doc/html/api/xml.etree.ElementTree.Element-class.html deleted file mode 100644 index 57010c6e..00000000 --- a/doc/html/api/xml.etree.ElementTree.Element-class.html +++ /dev/null @@ -1,752 +0,0 @@ - - - - - xml.etree.ElementTree.Element - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - xml :: - etree :: - ElementTree :: - Element :: - Class Element - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class Element

source code

-
-object --+
-         |
-        Element
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__delitem__(self, - index) - source code - -
- -
-   - - - - - - -
__getitem__(self, - index) - source code - -
- -
-   - - - - - - -
__init__(self, - tag, - attrib={}, - **extra)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__len__(self) - source code - -
- -
-   - - - - - - -
__nonzero__(self) - source code - -
- -
-   - - - - - - -
__repr__(self)
- repr(x)
- source code - -
- -
-   - - - - - - -
__setitem__(self, - index, - element) - source code - -
- -
-   - - - - - - -
append(self, - element) - source code - -
- -
-   - - - - - - -
clear(self) - source code - -
- -
-   - - - - - - -
copy(self) - source code - -
- -
-   - - - - - - -
extend(self, - elements) - source code - -
- -
-   - - - - - - -
find(self, - path, - namespaces=None) - source code - -
- -
-   - - - - - - -
findall(self, - path, - namespaces=None) - source code - -
- -
-   - - - - - - -
findtext(self, - path, - default=None, - namespaces=None) - source code - -
- -
-   - - - - - - -
get(self, - key, - default=None) - source code - -
- -
-   - - - - - - -
getchildren(self) - source code - -
- -
-   - - - - - - -
getiterator(self, - tag=None) - source code - -
- -
-   - - - - - - -
insert(self, - index, - element) - source code - -
- -
-   - - - - - - -
items(self) - source code - -
- -
-   - - - - - - -
iter(self, - tag=None) - source code - -
- -
-   - - - - - - -
iterfind(self, - path, - namespaces=None) - source code - -
- -
-   - - - - - - -
itertext(self) - source code - -
- -
-   - - - - - - -
keys(self) - source code - -
- -
-   - - - - - - -
makeelement(self, - tag, - attrib) - source code - -
- -
-   - - - - - - -
remove(self, - element) - source code - -
- -
-   - - - - - - -
set(self, - key, - value) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - - - - - - - - - - -
- - - - - -
Class Variables[hide private]
-
-   - - attrib = None
- hash(x) -
-   - - tag = None
- hash(x) -
-   - - tail = None
- hash(x) -
-   - - text = None
- hash(x) -
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - tag, - attrib={}, - **extra) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__repr__(self) -
(Representation operator) -

-
source code  -
- - repr(x) -
-
Overrides: - object.__repr__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/xml.etree.ElementTree.ElementTree-class.html b/doc/html/api/xml.etree.ElementTree.ElementTree-class.html deleted file mode 100644 index 0706da71..00000000 --- a/doc/html/api/xml.etree.ElementTree.ElementTree-class.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - - xml.etree.ElementTree.ElementTree - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - xml :: - etree :: - ElementTree :: - ElementTree :: - Class ElementTree - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ElementTree

source code

-
-object --+
-         |
-        ElementTree
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - element=None, - file=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
_setroot(self, - element) - source code - -
- -
-   - - - - - - -
find(self, - path, - namespaces=None) - source code - -
- -
-   - - - - - - -
findall(self, - path, - namespaces=None) - source code - -
- -
-   - - - - - - -
findtext(self, - path, - default=None, - namespaces=None) - source code - -
- -
-   - - - - - - -
getiterator(self, - tag=None) - source code - -
- -
-   - - - - - - -
getroot(self) - source code - -
- -
-   - - - - - - -
iter(self, - tag=None) - source code - -
- -
-   - - - - - - -
iterfind(self, - path, - namespaces=None) - source code - -
- -
-   - - - - - - -
parse(self, - source, - parser=None) - source code - -
- -
-   - - - - - - -
write(self, - file_or_filename, - encoding=None, - xml_declaration=None, - default_namespace=None, - method=None) - source code - -
- -
-   - - - - - - -
write_c14n(self, - file) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - element=None, - file=None) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/xml.etree.ElementTree.ParseError-class.html b/doc/html/api/xml.etree.ElementTree.ParseError-class.html deleted file mode 100644 index 9e9c67dc..00000000 --- a/doc/html/api/xml.etree.ElementTree.ParseError-class.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - xml.etree.ElementTree.ParseError - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - xml :: - etree :: - ElementTree :: - ParseError :: - Class ParseError - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class ParseError

source code

-
-              object --+                
-                       |                
-exceptions.BaseException --+            
-                           |            
-        exceptions.Exception --+        
-                               |        
-        exceptions.StandardError --+    
-                                   |    
-              exceptions.SyntaxError --+
-                                       |
-                                      ParseError
-
- -
- - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-

Inherited from exceptions.SyntaxError: - __init__, - __new__, - __str__ -

-

Inherited from exceptions.BaseException: - __delattr__, - __getattribute__, - __getitem__, - __getslice__, - __reduce__, - __repr__, - __setattr__, - __setstate__, - __unicode__ -

-

Inherited from object: - __format__, - __hash__, - __reduce_ex__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from exceptions.SyntaxError: - filename, - lineno, - msg, - offset, - print_file_and_line, - text -

-

Inherited from exceptions.BaseException: - args, - message -

-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/xml.etree.ElementTree.QName-class.html b/doc/html/api/xml.etree.ElementTree.QName-class.html deleted file mode 100644 index 674067f2..00000000 --- a/doc/html/api/xml.etree.ElementTree.QName-class.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - xml.etree.ElementTree.QName - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - xml :: - etree :: - ElementTree :: - QName :: - Class QName - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class QName

source code

-
-object --+
-         |
-        QName
-
- -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__cmp__(self, - other) - source code - -
- -
-   - - - - - - -
__hash__(self)
- hash(x)
- source code - -
- -
-   - - - - - - -
__init__(self, - text_or_uri, - tag=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__str__(self)
- str(x)
- source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__hash__(self) -
(Hashing function) -

-
source code  -
- - hash(x) -
-
Overrides: - object.__hash__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__init__(self, - text_or_uri, - tag=None) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
- -
- -
- - -
-

__str__(self) -
(Informal representation operator) -

-
source code  -
- - str(x) -
-
Overrides: - object.__str__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/xml.etree.ElementTree.TreeBuilder-class.html b/doc/html/api/xml.etree.ElementTree.TreeBuilder-class.html deleted file mode 100644 index d7b21aa1..00000000 --- a/doc/html/api/xml.etree.ElementTree.TreeBuilder-class.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - xml.etree.ElementTree.TreeBuilder - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - xml :: - etree :: - ElementTree :: - TreeBuilder :: - Class TreeBuilder - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class TreeBuilder

source code

-
-object --+
-         |
-        TreeBuilder
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - element_factory=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
_flush(self) - source code - -
- -
-   - - - - - - -
close(self) - source code - -
- -
-   - - - - - - -
data(self, - data) - source code - -
- -
-   - - - - - - -
end(self, - tag) - source code - -
- -
-   - - - - - - -
start(self, - tag, - attrs) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - element_factory=None) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/xml.etree.ElementTree.XMLParser-class.html b/doc/html/api/xml.etree.ElementTree.XMLParser-class.html deleted file mode 100644 index c650da6e..00000000 --- a/doc/html/api/xml.etree.ElementTree.XMLParser-class.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - xml.etree.ElementTree.XMLParser - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - xml :: - etree :: - ElementTree :: - XMLParser :: - Class XMLParser - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class XMLParser

source code

-
-object --+
-         |
-        XMLParser
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__doctype(self, - name, - pubid, - system)
- This method of XMLParser is deprecated.
- source code - -
- -
-   - - - - - - -
__init__(self, - html=0, - target=None, - encoding=None)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
_comment(self, - data) - source code - -
- -
-   - - - - - - -
_data(self, - text) - source code - -
- -
-   - - - - - - -
_default(self, - text) - source code - -
- -
-   - - - - - - -
_end(self, - tag) - source code - -
- -
-   - - - - - - -
_fixname(self, - key) - source code - -
- -
-   - - - - - - -
_fixtext(self, - text) - source code - -
- -
-   - - - - - - -
_pi(self, - target, - data) - source code - -
- -
-   - - - - - - -
_raiseerror(self, - value) - source code - -
- -
-   - - - - - - -
_start(self, - tag, - attrib_in) - source code - -
- -
-   - - - - - - -
_start_list(self, - tag, - attrib_in) - source code - -
- -
-   - - - - - - -
close(self) - source code - -
- -
-   - - - - - - -
doctype(self, - name, - pubid, - system)
- This method of XMLParser is deprecated.
- source code - -
- -
-   - - - - - - -
feed(self, - data) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - html=0, - target=None, - encoding=None) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/xml.etree.ElementTree._IterParseIterator-class.html b/doc/html/api/xml.etree.ElementTree._IterParseIterator-class.html deleted file mode 100644 index 92943406..00000000 --- a/doc/html/api/xml.etree.ElementTree._IterParseIterator-class.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - xml.etree.ElementTree._IterParseIterator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - xml :: - etree :: - ElementTree :: - _IterParseIterator :: - Class _IterParseIterator - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _IterParseIterator

source code

-
-object --+
-         |
-        _IterParseIterator
-
- -
- - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
__init__(self, - source, - events, - parser, - close_source=False)
- x.__init__(...) initializes x; see help(type(x)) for signature
- source code - -
- -
-   - - - - - - -
__iter__(self) - source code - -
- -
-   - - - - - - -
next(self) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
- -
- - -
-

__init__(self, - source, - events, - parser, - close_source=False) -
(Constructor) -

-
source code  -
- - x.__init__(...) initializes x; see help(type(x)) for signature -
-
Overrides: - object.__init__ -
(inherited documentation)
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/api/xml.etree.ElementTree._SimpleElementPath-class.html b/doc/html/api/xml.etree.ElementTree._SimpleElementPath-class.html deleted file mode 100644 index c2e8200a..00000000 --- a/doc/html/api/xml.etree.ElementTree._SimpleElementPath-class.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - xml.etree.ElementTree._SimpleElementPath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - xml :: - etree :: - ElementTree :: - _SimpleElementPath :: - Class _SimpleElementPath - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class _SimpleElementPath

source code

-
-object --+
-         |
-        _SimpleElementPath
-
- -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - - - - - -
find(self, - element, - tag, - namespaces=None) - source code - -
- -
-   - - - - - - -
findall(self, - element, - tag, - namespaces=None) - source code - -
- -
-   - - - - - - -
findtext(self, - element, - tag, - default=None, - namespaces=None) - source code - -
- -
-   - - - - - - -
iterfind(self, - element, - tag, - namespaces=None) - source code - -
- -
-

Inherited from object: - __delattr__, - __format__, - __getattribute__, - __hash__, - __init__, - __new__, - __reduce__, - __reduce_ex__, - __repr__, - __setattr__, - __sizeof__, - __str__, - __subclasshook__ -

-
- - - - - - - - - -
- - - - - -
Properties[hide private]
-
-

Inherited from object: - __class__ -

-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/doc/html/build.html b/doc/html/build.html deleted file mode 100644 index 3ed5ce28..00000000 --- a/doc/html/build.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - -How to build lxml from source - - - -
-

How to build lxml from source

- -

To build lxml from source, you need libxml2 and libxslt properly -installed, including the header files. These are likely shipped in -separate -dev or -devel packages like libxml2-dev, which -you must install before trying to build lxml.

- -
-

Cython

-

The lxml.etree and lxml.objectify modules are written in Cython. -Since we distribute the Cython-generated .c files with lxml releases, -however, you do not need Cython to build lxml from the normal release -sources. We even encourage you to not install Cython for a normal -release build, as the generated C code can vary quite heavily between -Cython versions, which may or may not generate correct code for lxml. -The pre-generated release sources were tested and therefore are known -to work.

-

So, if you want a reliable build of lxml, we suggest to a) use a -source release of lxml and b) disable or uninstall Cython for the -build.

-

Only if you are interested in building lxml from a checkout of the -developer sources (e.g. to test a bug fix that has not been release -yet) or if you want to be an lxml developer, then you do need a -working Cython installation. You can use pip to install it:

-
-pip install -r requirements.txt
-
-

https://github.com/lxml/lxml/blob/master/requirements.txt

-

lxml currently requires at least Cython 0.20, later release versions -should work as well.

-
-
-

Github, git and hg

-

The lxml package is developed in a repository on Github using -Mercurial and the hg-git plugin. You can retrieve the current -developer version using:

-
-hg clone git+ssh://git@github.com/lxml/lxml.git lxml
-
-

Or, using git:

-
-git clone ssh://git@github.com/lxml/lxml.git lxml
-
-

This will create a directory lxml and download the source into it, -including the complete development history. Don't be afraid, the -repository download is fairly quick. You can also browse the -lxml repository through the web or download a ZIP archive with the -latest master branch.

-
-
-

Building the sources

-

Clone the source repository as described above (or download -the source tar-ball and unpack it) and then type:

-
-python setup.py build
-
-

or:

-
-python setup.py bdist_egg     # requires 'setuptools' or 'distribute'
-
-

To (re-)build the C sources with Cython, you must additionally pass the -option --with-cython:

-
-python setup.py build --with-cython
-
-

If you want to test lxml from the source directory, it is better to build it -in-place like this:

-
-python setup.py build_ext -i --with-cython
-
-

or, in Unix-like environments:

-
-make inplace
-
-

To speed up the build in test environments (e.g. on a continuous -integration server), set the CFLAGS environment variable to -disable C compiler optimisations (e.g. "-O0" for gcc, that's -minus-oh-zero), for example:

-
-CFLAGS="-O0"  make inplace
-
-

If you get errors about missing header files (e.g. Python.h or -libxml/xmlversion.h) then you need to make sure the development -packages of Python, libxml2 and libxslt are properly installed. On -Linux distributions, they are usually called something like -libxml2-dev or libxslt-devel. If these packages were -installed in non-standard places, try passing the following option to -setup.py to make sure the right config is found:

-
-python setup.py build --with-xslt-config=/path/to/xslt-config
-
-

If this doesn't help, you may have to add the location of the header -files to the include path like:

-
-python setup.py build_ext -i  -I /usr/include/libxml2
-
-

where the file is in /usr/include/libxml2/libxml/xmlversion.h

-

To use lxml.etree in-place, you can place lxml's src directory -on your Python module search path (PYTHONPATH) and then import -lxml.etree to play with it:

-
-# cd lxml
-# PYTHONPATH=src python
-Python 2.7.2
-Type "help", "copyright", "credits" or "license" for more information.
->>> from lxml import etree
->>>
-
-

To make sure everything gets recompiled cleanly after changes, you can -run make clean or delete the file src/lxml/etree.c.

-
-
-

Running the tests and reporting errors

-

The source distribution (tgz) and the source repository contain a test -suite for lxml. You can run it from the top-level directory:

-
-python test.py
-
-

Note that the test script only tests the in-place build (see distutils -building above), as it searches the src directory. You can use the -following one-step command to trigger an in-place build and test it:

-
-make test
-
-

This also runs the ElementTree and cElementTree compatibility tests. To call -them separately, make sure you have lxml on your PYTHONPATH first, then run:

-
-python selftest.py
-
-

and:

-
-python selftest2.py
-
-

If the tests give failures, errors, or worse, segmentation faults, we'd really -like to know. Please contact us on the mailing list, and please specify -the version of lxml, libxml2, libxslt and Python you were using, as well as -your operating system type (Linux, Windows, MacOS-X, ...).

-
-
-

Building an egg or wheel

-

This is the procedure to make an lxml egg or wheel for your platform. -It assumes that you have setuptools or distribute installed, as well -as the wheel package.

-

First, download the lxml-x.y.tar.gz release. This contains the pregenerated -C files so that you can be sure you build exactly from the release sources. -Unpack them and cd into the resulting directory. Then, to build a wheel, -simply run the command

-
-python setup.py bdist_wheel
-
-

or, to build a statically linked wheel with all of libxml2, libxslt and -friends compiled in, run

-
-python setup.py bdist_wheel --static-deps
-

The resulting .whl file will be written into the dist directory.

-

To build an egg file, run

-
-python setup.py build_egg
-
-

If you are on a Unix-like platform, you can first build the extension modules -using

-
-python setup.py build
-
-

and then cd into the directory build/lib.your.platform to call -strip on any .so file you find there. This reduces the size of -the binary distribution considerably. Then, from the package root directory, -call

-
-python setup.py bdist_egg
-
-

This will quickly package the pre-built packages into an egg file and -drop it into the dist directory.

-
-
-

Building lxml on MacOS-X

-

Apple regularly ships new system releases with horribly outdated -system libraries. This is specifically the case for libxml2 and -libxslt, where the system provided versions used to be too old -to even build lxml for a long time.

-

While the Unix environment in MacOS-X makes it relatively easy to -install Unix/Linux style package management tools and new software, it -actually seems to be hard to get libraries set up for exclusive usage -that MacOS-X ships in an older version. Alternative distributions -(like macports) install their libraries in addition to the system -libraries, but the compiler and the runtime loader on MacOS still sees -the system libraries before the new libraries. This can lead to -undebuggable crashes where the newer library seems to be loaded but -the older system library is used.

-

Apple discourages static building against libraries, which would help -working around this problem. Apple does not ship static library -binaries with its system and several package management systems follow -this decision. Therefore, building static binaries requires building -the dependencies first. The setup.py script does this -automatically when you call it like this:

-
-python setup.py build --static-deps
-
-

This will download and build the latest versions of libxml2 and -libxslt from the official FTP download site. If you want to use -specific versions, or want to prevent any online access, you can -download both tar.gz release files yourself, place them into a -subdirectory libs in the lxml distribution, and call setup.py -with the desired target versions like this:

-
-python setup.py build --static-deps \
-       --libxml2-version=2.9.1 \
-       --libxslt-version=1.1.28 \
-
-sudo python setup.py install
-
-

Instead of build, you can use any target, like bdist_egg -if you want to use setuptools to build an installable egg, or -bdist_wheel for a wheel package.

-

Note that this also works with pip. Since you can't pass -command line options in this case, you have to use an environment -variable instead:

-
-STATIC_DEPS=true pip install lxml
-
-

To install the package into the system Python package directory, -run the installation with "sudo":

-
-STATIC_DEPS=true sudo pip install lxml
-
-

The STATICBUILD environment variable is handled equivalently to -the STATIC_DEPS variable, but is used by some other extension -packages, too.

-

If you decide to do a non-static build, you may also have to install -the command line tools in addition to the XCode build environment. -They are available as a restricted download from here:

-

https://developer.apple.com/downloads/index.action?=command%20line%20tools#

-

Without them, the compiler may not find the necessary header files of -the XML libraries, according to the second comment in this ticket:

-

https://bugs.launchpad.net/lxml/+bug/1244094

-
-
-

Static linking on Windows

-

Most operating systems have proper package management that makes installing -current versions of libxml2 and libxslt easy. The most famous exception is -Microsoft Windows, which entirely lacks these capabilities. To work around -the limits of this platform, lxml's installation can download pre-built -packages of the dependencies and build statically against them. Assuming -you have a proper C compiler setup to build Python extensions, this should -work:

-
-python setup.py bdist_wininst --static-deps
-
-

It should create a windows installer in the pkg directory.

-
-
-

Building Debian packages from SVN sources

-

Andreas Pakulat proposed the following approach.

-
    -
  • apt-get source lxml
  • -
  • remove the unpacked directory
  • -
  • tar.gz the lxml SVN version and replace the orig.tar.gz that lies in the -directory
  • -
  • check md5sum of created tar.gz file and place new sum and size in dsc file
  • -
  • do dpkg-source -x lxml-[VERSION].dsc and cd into the newly created directory
  • -
  • run dch -i and add a comment like "use trunk version", this will -increase the debian version number so apt/dpkg won't get confused
  • -
  • run dpkg-buildpackage -rfakeroot -us -uc to build the package
  • -
-

In case dpkg-buildpackage tells you that some dependencies are missing, you -can either install them manually or run apt-get build-dep lxml.

-

That will give you .deb packages in the parent directory which can be -installed using dpkg -i.

-
-
- - - \ No newline at end of file diff --git a/doc/html/capi.html b/doc/html/capi.html deleted file mode 100644 index 917299a2..00000000 --- a/doc/html/capi.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - -The public C-API of lxml.etree - - - -
-

The public C-API of lxml.etree

- -

As of version 1.1, lxml.etree provides a public C-API. This allows external -C extensions to efficiently access public functions and classes of lxml, -without going through the Python API.

-

The API is described in the file etreepublic.pxd, which is directly -c-importable by extension modules implemented in Pyrex or Cython.

- -
-

Passing generated trees through Python

-

This is the most simple way to integrate with lxml. It does not require -any C-level integration but uses a Python function to wrap an externally -generated libxml2 document in lxml.

-

The external module that creates the libxml2 tree must pack the document -pointer into a PyCapsule -object. This can then be passed into lxml with the function -lxml.etree.adopt_external_document(). It also takes an optional lxml -parser instance to associate with the document, in order to configure the -Element class lookup, relative URL lookups, etc.

-

See the API reference -for further details.

-

The same functionality is available as part of the public C-API in form -of the C function adoptExternalDocument().

-
-
-

Writing external modules in Cython

-

This is the easiest way of extending lxml at the C level. A Cython -(or Pyrex) module should start like this:

-
-# My Cython extension
-
-# import the public functions and classes of lxml.etree
-cimport etreepublic as cetree
-
-# import the lxml.etree module in Python
-cdef object etree
-from lxml import etree
-
-# initialize the access to the C-API of lxml.etree
-cetree.import_lxml__etree()
-
-

From this line on, you can access all public functions of lxml.etree -from the cetree namespace like this:

-
-# build a tag name from namespace and element name
-py_tag = cetree.namespacedNameFromNsName("http://some/url", "myelement")
-
-

Public lxml classes are easily subclassed. For example, to implement -and set a new default element class, you can write Cython code like -the following:

-
-from etreepublic cimport ElementBase
-cdef class NewElementClass(ElementBase):
-     def set_value(self, myval):
-         self.set("my_attribute", myval)
-
-etree.set_element_class_lookup(
-     etree.DefaultElementClassLookup(element=NewElementClass))
-
-
-
-

Writing external modules in C

-

If you really feel like it, you can also interface with lxml.etree straight -from C code. All you have to do is include the header file for the public -API, import the lxml.etree module and then call the import function:

-
/* My C extension */
-
-/* common includes */
-#include "Python.h"
-#include "stdio.h"
-#include "string.h"
-#include "stdarg.h"
-#include "libxml/xmlversion.h"
-#include "libxml/encoding.h"
-#include "libxml/hash.h"
-#include "libxml/tree.h"
-#include "libxml/xmlIO.h"
-#include "libxml/xmlsave.h"
-#include "libxml/globals.h"
-#include "libxml/xmlstring.h"
-
-/* lxml.etree specific includes */
-#include "lxml-version.h"
-#include "etree_defs.h"
-#include "etree.h"
-
-/* setup code */
-import_lxml__etree()
-
-

Note that including etree.h does not automatically include the -header files it requires. Note also that the above list of common -includes may not be sufficient.

-
-
- - - \ No newline at end of file diff --git a/doc/html/changes-4.2.3.html b/doc/html/changes-4.2.3.html deleted file mode 100644 index 105f0ec0..00000000 --- a/doc/html/changes-4.2.3.html +++ /dev/null @@ -1,3382 +0,0 @@ - - - - - - -lxml changelog - - - -
-

lxml changelog

- -
-

4.2.3 (2018-06-27)

-
-

Bugs fixed

-
    -
  • Reverted GH#265: lxml links against zlib as a shared library again.
  • -
-
-
-
-

4.2.2 (2018-06-22)

-
-

Bugs fixed

-
    -
  • GH#266: Fix sporadic crash during GC when parse-time schema validation is used -and the parser participates in a reference cycle. -Original patch by Julien Greard.
  • -
  • GH#265: lxml no longer links against zlib as a shared library, only on static builds. -Patch by Nehal J Wani.
  • -
-
-
-
-

4.2.1 (2018-03-21)

-
-

Bugs fixed

-
    -
  • LP#1755825: iterwalk() failed to return the 'start' event for the initial -element if a tag selector is used.
  • -
  • LP#1756314: Failure to import 4.2.0 into PyPy due to a missing library symbol.
  • -
  • LP#1727864, GH#258: Add "-isysroot" linker option on MacOS as needed by XCode 9.
  • -
-
-
-
-

4.2.0 (2018-03-13)

-
-

Features added

-
    -
  • GH#255: SelectElement.value returns more standard-compliant and -browser-like defaults for non-multi-selects. If no option is selected, the -value of the first option is returned (instead of None). If multiple options -are selected, the value of the last one is returned (instead of that of the -first one). If no options are present (not standard-compliant) -SelectElement.value still returns None.
  • -
  • GH#261: The HTMLParser() now supports the huge_tree option. -Patch by stranac.
  • -
-
-
-

Bugs fixed

-
    -
  • LP#1551797: Some XSLT messages were not captured by the transform error log.
  • -
  • LP#1737825: Crash at shutdown after an interrupted iterparse run with XMLSchema -validation.
  • -
-
-
-

Other changes

-
-
-
-

4.1.1 (2017-11-04)

-
    -
  • Rebuild with Cython 0.27.3 to improve support for Py3.7.
  • -
-
-
-

4.1.0 (2017-10-13)

-
-

Features added

-
    -
  • ElementPath supports text predicates for current node, like "[.='text']".
  • -
  • ElementPath allows spaces in predicates.
  • -
  • Custom Element classes and XPath functions can now be registered with a -decorator rather than explicit dict assignments.
  • -
  • Static Linux wheels are now built with link time optimisation (LTO) enabled. -This should have a beneficial impact on the overall performance by providing -a tighter compiler integration between lxml and libxml2/libxslt.
  • -
-
-
-

Bugs fixed

-
    -
  • LP#1722776: Requesting non-Element objects like comments from a document with -PythonElementClassLookup could fail with a TypeError.
  • -
-
-
-
-

4.0.0 (2017-09-17)

-
-

Features added

-
    -
  • The ElementPath implementation is now compiled using Cython, -which speeds up the .find*() methods quite significantly.
  • -
  • The modules lxml.builder, lxml.html.diff and lxml.html.clean -are also compiled using Cython in order to speed them up.
  • -
  • xmlfile() supports async coroutines using async with and await.
  • -
  • iterwalk() has a new method skip_subtree() that prevents walking into -the descendants of the current element.
  • -
  • RelaxNG.from_rnc_string() accepts a base_url argument to -allow relative resource lookups.
  • -
  • The XSLT result object has a new method .write_output(file) that serialises -output data into a file according to the <xsl:output> configuration.
  • -
-
-
-

Bugs fixed

-
    -
  • GH#251: HTML comments were handled incorrectly by the soupparser. -Patch by mozbugbox.

    -
  • -
  • LP#1654544: The html5parser no longer passes the useChardet option -if the input is a Unicode string, unless explicitly requested. When parsing -files, the default is to enable it when a URL or file path is passed (because -the file is then opened in binary mode), and to disable it when reading from -a file(-like) object.

    -

    Note: This is a backwards incompatible change of the default configuration. -If your code parses byte strings/streams and depends on character detection, -please pass the option guess_charset=True explicitly, which already worked -in older lxml versions.

    -
  • -
  • LP#1703810: etree.fromstring() failed to parse UTF-32 data with BOM.

    -
  • -
  • LP#1526522: Some RelaxNG errors were not reported in the error log.

    -
  • -
  • LP#1567526: Empty and plain text input raised a TypeError in soupparser.

    -
  • -
  • LP#1710429: Uninitialised variable usage in HTML diff.

    -
  • -
  • LP#1415643: The closing tags context manager in xmlfile() could continue -to output end tags even after writing failed with an exception.

    -
  • -
  • LP#1465357: xmlfile.write() now accepts and ignores None as input argument.

    -
  • -
  • Compilation under Py3.7-pre failed due to a modified function signature.

    -
  • -
-
-
-

Other changes

-
    -
  • The main module source files were renamed from lxml.*.pyx to plain -*.pyx (e.g. etree.pyx) to simplify their handling in the build -process. Care was taken to keep the old header files as fallbacks for -code that compiles against the public C-API of lxml, but it might still -be worth validating that third-party code does not notice this change.
  • -
-
-
-
-

3.8.0 (2017-06-03)

-
-

Features added

-
    -
  • ElementTree.write() has a new option doctype that writes out a -doctype string before the serialisation, in the same way as tostring().
  • -
  • GH#220: xmlfile allows switching output methods at an element level. -Patch by Burak Arslan.
  • -
  • LP#1595781, GH#240: added a PyCapsule Python API and C-level API for -passing externally generated libxml2 documents into lxml.
  • -
  • GH#244: error log entries have a new property path with an XPath -expression (if known, None otherwise) that points to the tree element -responsible for the error. Patch by Bob Kline.
  • -
  • The namespace prefix mapping that can be used in ElementPath now injects -a default namespace when passing a None prefix.
  • -
-
-
-

Bugs fixed

-
    -
  • GH#238: Character escapes were not hex-encoded in the xmlfile serialiser. -Patch by matejcik.
  • -
  • GH#229: fix for externally created XML documents. Patch by Theodore Dubois.
  • -
  • LP#1665241, GH#228: Form data handling in lxml.html no longer strips the -option values specified in form attributes but only the text values. -Patch by Ashish Kulkarni.
  • -
  • LP#1551797: revert previous fix for XSLT error logging as it breaks -multi-threaded XSLT processing.
  • -
  • LP#1673355, GH#233: fromstring() html5parser failed to parse byte strings.
  • -
-
-
-

Other changes

-
    -
  • The previously undocumented docstring option in ElementTree.write() -produces a deprecation warning and will eventually be removed.
  • -
-
-
-
-

3.7.4 (2017-??-??)

-
-

Bugs fixed

-
    -
  • LP#1551797: revert previous fix for XSLT error logging as it breaks -multi-threaded XSLT processing.
  • -
  • LP#1673355, GH#233: fromstring() html5parser failed to parse byte strings.
  • -
-
-
-
-

3.7.3 (2017-02-18)

-
-

Bugs fixed

-
    -
  • GH#218 was ineffective in Python 3.
  • -
  • GH#222: lxml.html.submit_form() failed in Python 3. -Patch by Jakub Wilk.
  • -
-
-
-
-

3.7.2 (2017-01-08)

-
    -
  • GH#220: xmlfile allows switching output methods at an element level. -Patch by Burak Arslan.
  • -
-
-

Bugs fixed

-
    -
  • Work around installation problems in recent Python 2.7 versions -due to FTP download failures.
  • -
  • GH#219: xmlfile.element() was not properly quoting attribute values. -Patch by Burak Arslan.
  • -
  • GH#218: xmlfile.element() was not properly escaping text content of -script/style tags. Patch by Burak Arslan.
  • -
-
-
-
-

3.7.1 (2016-12-23)

-
    -
  • No source changes, issued only to solve problems with the -binary packages released for 3.7.0.
  • -
-
-
-

3.7.0 (2016-12-10)

-
-

Features added

-
    -
  • GH#217: XMLSyntaxError now behaves more like its SyntaxError -baseclass. Patch by Philipp A.
  • -
  • GH#216: HTMLParser() now supports the same collect_ids parameter -as XMLParser(). Patch by Burak Arslan.
  • -
  • GH#210: Allow specifying a serialisation method in xmlfile.write(). -Patch by Burak Arslan.
  • -
  • GH#203: New option default_doctype in HTMLParser that allows -disabling the automatic doctype creation. Patch by Shadab Zafar.
  • -
  • GH#201: Calling the method .set('attrname') without value argument -(or None) on HTML elements creates an attribute without value that -serialises like <div attrname></div>. Patch by Daniel Holth.
  • -
  • GH#197: Ignore form input fields in form_values() when they are -marked as disabled in HTML. Patch by Kristian Klemon.
  • -
-
-
-

Bugs fixed

-
    -
  • GH#206: File name and line number were missing from XSLT error messages. -Patch by Marcus Brinkmann.
  • -
-
-
-

Other changes

-
    -
  • Log entries no longer allow anything but plain string objects as message text -and file name.
  • -
  • zlib is included in the list of statically built libraries.
  • -
-
-
-
-

3.6.4 (2016-08-20)

- -
-
-

3.6.3 (2016-08-18)

-
    -
  • LP#1614603: change linker flags to build multi-linux wheels
  • -
-
-
-

3.6.2 (2016-08-18)

-
    -
  • LP#1614603: release without source changes to provide cleanly built Linux wheels
  • -
-
-
-

3.6.1 (2016-07-24)

-
-

Features added

-
    -
  • GH#180: Separate option inline_style for Cleaner that only removes style -attributes instead of all styles. Patch by Christian Pedersen.
  • -
  • GH#196: Windows build support for Python 3.5. Contribution by Maximilian Hils.
  • -
-
-
-

Bugs fixed

-
    -
  • GH#199: Exclude file fields from FormElement.form_values (as browsers do). -Patch by Tomas Divis.
  • -
  • GH#198, LP#1568167: Try to provide base URL from Resolver.resolve_string(). -Patch by Michael van Tellingen.
  • -
  • GH#191: More accurate float serialisation in objectify.FloatElement. -Patch by Holger Joukl.
  • -
  • LP#1551797: Repair XSLT error logging. Patch by Marcus Brinkmann.
  • -
-
-
-
-

3.6.0 (2016-03-17)

-
-

Features added

-
    -
  • GH#187: Now supports (only) version 5.x and later of PyPy. -Patch by Armin Rigo.
  • -
  • GH#181: Direct support for .rnc files in RelaxNG() if rnc2rng -is installed. Patch by Dirkjan Ochtman.
  • -
-
-
-

Bugs fixed

-
    -
  • GH#189: Static builds honour FTP proxy configurations when downloading -the external libs. Patch by Youhei Sakurai.
  • -
  • GH#186: Soupparser failed to process entities in Python 3.x. -Patch by Duncan Morris.
  • -
  • GH#185: Rare encoding related TypeError on import was fixed. -Patch by Petr Demin.
  • -
-
-
-
-

3.5.0 (2015-11-13)

-
-

Bugs fixed

-
    -
  • Unicode string results failed XPath queries in PyPy.
  • -
  • LP#1497051: HTML target parser failed to terminate on exceptions -and continued parsing instead.
  • -
  • Deprecated API usage in doctestcompare.
  • -
-
-
-
-

3.5.0b1 (2015-09-18)

-
-

Features added

-
    -
  • cleanup_namespaces() accepts a new argument keep_ns_prefixes -that does not remove definitions of the provided prefix-namespace -mapping from the tree.
  • -
  • cleanup_namespaces() accepts a new argument top_nsmap that -moves definitions of the provided prefix-namespace mapping to the -top of the tree.
  • -
  • LP#1490451: Element objects gained a cssselect() method as -known from lxml.html. Patch by Simon Sapin.
  • -
  • API functions and methods behave and look more like Python functions, -which allows introspection on them etc. One side effect to be aware of -is that the functions now bind as methods when assigned to a class -variable. A quick fix is to wrap them in staticmethod() (as for -normal Python functions).
  • -
  • ISO-Schematron support gained an option error_finder that allows -passing a filter function for picking validation errors from reports.
  • -
  • LP#1243600: Elements in lxml.html gained a classes property -that provides a set-like interface to the class attribute. -Original patch by masklinn.
  • -
  • LP#1341964: The soupparser now handles DOCTYPE declarations, comments -and processing instructions outside of the root element. -Patch by Olli Pottonen.
  • -
  • LP#1421512: The docinfo of a tree was made editable to allow -setting and removing the public ID and system ID of the DOCTYPE. -Patch by Olli Pottonen.
  • -
  • LP#1442427: More work-arounds for quirks and bugs in pypy and pypy3.
  • -
  • lxml.html.soupparser now uses BeautifulSoup version 4 instead -of version 3 if available.
  • -
-
-
-

Bugs fixed

-
    -
  • Memory errors that occur during tree adaptations (e.g. moving subtrees -to foreign documents) could leave the tree in a crash prone state.
  • -
  • Calling process_children() in an XSLT extension element without -an output_parent argument failed with a TypeError. -Fix by Jens Tröger.
  • -
  • GH#162: Image data in HTML data URLs is considered safe and -no longer removed by lxml.html.clean JavaScript cleaner.
  • -
  • GH#166: Static build could link libraries in wrong order.
  • -
  • GH#172: Rely a bit more on libxml2 for encoding detection rather than -rolling our own in some cases. Patch by Olli Pottonen.
  • -
  • GH#159: Validity checks for names and string content were tightened -to detect the use of illegal characters early. Patch by Olli Pottonen.
  • -
  • LP#1421921: Comments/PIs before the DOCTYPE declaration were not -serialised. Patch by Olli Pottonen.
  • -
  • LP#659367: Some HTML DOCTYPE declarations were not serialised. -Patch by Olli Pottonen.
  • -
  • LP#1238503: lxml.doctestcompare is now consistent with stdlib's doctest -in how it uses + and - to refer to unexpected and missing output.
  • -
  • Empty prefixes are explicitly rejected when a namespace mapping is used -with ElementPath to avoid hiding bugs in user code.
  • -
  • Several problems with PyPy were fixed by switching to Cython 0.23.
  • -
-
-
-
-

3.4.4 (2015-04-25)

-
-

Bugs fixed

-
    -
  • An ElementTree compatibility test added in lxml 3.4.3 that failed in -Python 3.4+ was removed again.
  • -
-
-
-
-

3.4.3 (2015-04-15)

-
-

Bugs fixed

-
    -
  • Expression cache in ElementPath was ignored. Fix by Changaco.
  • -
  • LP#1426868: Passing a default namespace and a prefixed namespace mapping -as nsmap into xmlfile.element() raised a TypeError.
  • -
  • LP#1421927: DOCTYPE system URLs were incorrectly quoted when containing -double quotes. Patch by Olli Pottonen.
  • -
  • LP#1419354: meta-redirect URLs were incorrectly processed by -iterlinks() if preceded by whitespace.
  • -
-
-
-
-

3.4.2 (2015-02-07)

-
-

Bugs fixed

-
    -
  • LP#1415907: Crash when creating an XMLSchema from a non-root element -of an XML document.
  • -
  • LP#1369362: HTML cleaning failed when hitting processing instructions -with pseudo-attributes.
  • -
  • CDATA() wrapped content was rejected for tail text.
  • -
  • CDATA sections were not serialised as tail text of the top-level element.
  • -
-
-
-
-

3.4.1 (2014-11-20)

-
-

Features added

-
    -
  • New htmlfile HTML generator to accompany the incremental xmlfile -serialisation API. Patch by Burak Arslan.
  • -
-
-
-

Bugs fixed

-
    -
  • lxml.sax.ElementTreeContentHandler did not initialise its superclass.
  • -
-
-
-
-

3.4.0 (2014-09-10)

-
-

Features added

-
    -
  • xmlfile(buffered=False) disables output buffering and flushes the -content after each API operation (starting/ending element blocks or writes). -A new method xf.flush() can alternatively be used to explicitly flush -the output.
  • -
  • lxml.html.document_fromstring has a new option ensure_head_body=True -which will add an empty head and/or body element to the result document if -missing.
  • -
  • lxml.html.iterlinks now returns links inside meta refresh tags.
  • -
  • New XMLParser option collect_ids=False to disable ID hash table -creation. This can substantially speed up parsing of documents with many -different IDs that are not used.
  • -
  • The parser uses per-document hash tables for XML IDs. This reduces the -load of the global parser dict and speeds up parsing for documents with -many different IDs.
  • -
  • ElementTree.getelementpath(element) returns a structural ElementPath -expression for the given element, which can be used for lookups later.
  • -
  • xmlfile() accepts a new argument close=True to close file(-like) -objects after writing to them. Before, xmlfile() only closed the file -if it had opened it internally.
  • -
  • Allow "bytearray" type for ASCII text input.
  • -
-
-
-

Bugs fixed

-
-
-

Other changes

-
    -
  • LP#400588: decoding errors have become hard errors even in recovery mode. -Previously, they could lead to an internal tree representation in a mixed -encoding state, which lead to very late errors or even silently incorrect -behaviour during tree traversal or serialisation.
  • -
  • Requires Python 2.6, 2.7, 3.2 or later. No longer supports -Python 2.4, 2.5 and 3.1, use lxml 3.3.x for those.
  • -
  • Requires libxml2 2.7.0 or later and libxslt 1.1.23 or later, -use lxml 3.3.x with older versions.
  • -
-
-
-
-

3.3.6 (2014-08-28)

-
-

Bugs fixed

-
    -
  • Prevent tree cycle creation when adding Elements as siblings.
  • -
  • LP#1361948: crash when deallocating Element siblings without parent.
  • -
  • LP#1354652: crash when traversing internally loaded documents in XSLT -extension functions.
  • -
-
-
-
-

3.3.5 (2014-04-18)

-
-

Bugs fixed

-
    -
  • HTML cleaning could fail to strip javascript links that mix control -characters into the link scheme.
  • -
-
-
-
-

3.3.4 (2014-04-03)

-
-

Features added

-
    -
  • Source line numbers above 65535 are available on Elements when -using libxml2 2.9 or later.
  • -
-
-
-

Bugs fixed

-
    -
  • lxml.html.fragment_fromstring() failed for bytes input in Py3.
  • -
-
-
-

Other changes

-
-
-
-

3.3.3 (2014-03-04)

-
-

Bugs fixed

-
    -
  • LP#1287118: Crash when using Element subtypes with __slots__.
  • -
-
-
-

Other changes

-
    -
  • The internal classes _LogEntry and _Attrib can no longer be -subclassed from Python code.
  • -
-
-
-
-

3.3.2 (2014-02-26)

-
-

Bugs fixed

-
    -
  • The properties resolvers and version, as well as the methods -set_element_class_lookup() and makeelement(), were lost from -iterparse objects in 3.3.0.
  • -
  • LP#1222132: instances of XMLSchema, Schematron and RelaxNG -did not clear their local error_log before running a validation.
  • -
  • LP#1238500: lxml.doctestcompare mixed up "expected" and "actual" in -attribute values.
  • -
  • Some file I/O tests were failing in MS-Windows due to non-portable temp -file usage. Initial patch by Gabi Davar.
  • -
  • LP#910014: duplicate IDs in a document were not reported by DTD validation.
  • -
  • LP#1185332: tostring(method="html") did not use HTML serialisation -semantics for trailing tail text. Initial patch by Sylvain Viollon.
  • -
  • LP#1281139: .attrib value of Comments lost its mutation methods -in 3.3.0. Even though it is empty and immutable, it should still -provide the same interface as that returned for Elements.
  • -
-
-
-
-

3.3.1 (2014-02-12)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • LP#1014290: HTML documents parsed with parser.feed() failed to find -elements during tag iteration.
  • -
  • LP#1273709: Building in PyPy failed due to missing support for -PyUnicode_Compare() and PyByteArray_*() in PyPy's C-API.
  • -
  • LP#1274413: Compilation in MSVC failed due to missing "stdint.h" standard -header file.
  • -
  • LP#1274118: iterparse() failed to parse BOM prefixed files.
  • -
-
-
-

Other changes

-
-
-
-

3.3.0 (2014-01-26)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • The heuristic that distinguishes file paths from URLs was tightened -to produce less false negatives.
  • -
-
-
-

Other changes

-
-
-
-

3.3.0beta5 (2014-01-18)

-
-

Features added

-
    -
  • The PEP 393 unicode parsing support gained a fallback for wchar strings -which might still be somewhat common on Windows systems.
  • -
-
-
-

Bugs fixed

-
    -
  • Several error handling problems were fixed throughout the code base that -could previously lead to exceptions being silently swallowed or not -properly reported.
  • -
  • The C-API function appendChild() is now deprecated as it does not -propagate exceptions (its return type is void). The new function -appendChildToElement() was added as a safe replacement.
  • -
  • Passing a string into fromstringlist() raises an exception instead of -parsing the string character by character.
  • -
-
-
-

Other changes

-
    -
  • Document cleanup code was simplified using the new GC features in -Cython 0.20.
  • -
-
-
-
-

3.3.0beta4 (2014-01-12)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • The (empty) value returned by the attrib property of Entity and Comment -objects was mutable.
  • -
  • Element class lookup wasn't available for the new pull parsers or when using -a custom parser target.
  • -
  • Setting Element attributes on instantiation with both the attrib argument -and keyword arguments could modify the mapping passed as attrib.
  • -
  • LP#1266171: DTDs instantiated from internal/external subsets (i.e. through -the docinfo property) lost their attribute declarations.
  • -
-
-
-

Other changes

-
    -
  • Built with Cython 0.20pre (gitrev 012ae82eb) to prepare support for -Python 3.4.
  • -
-
-
-
-

3.3.0beta3 (2014-01-02)

-
-

Features added

-
    -
  • Unicode string parsing was optimised for Python 3.3 (PEP 393).
  • -
-
-
-

Bugs fixed

-
    -
  • HTML parsing of Unicode strings could misdecode the input on some platforms.
  • -
  • Crash in xmlfile() when closing open elements out of order in an error case.
  • -
-
-
-

Other changes

-
-
-
-

3.3.0beta2 (2013-12-20)

-
-

Features added

-
    -
  • iterparse() supports the recover option.
  • -
-
-
-

Bugs fixed

-
    -
  • Crash in iterparse() for HTML parsing.
  • -
  • Crash in target parsing with attributes.
  • -
-
-
-

Other changes

-
    -
  • The safety check in the read-only tree implementation (e.g. used by -PythonElementClassLookup) raises a more appropriate ReferenceError -for illegal access after tree disposal instead of an AssertionError. -This should only impact test code that specifically checks the original -behaviour.
  • -
-
-
-
-

3.3.0beta1 (2013-12-12)

-
-

Features added

-
    -
  • New option handle_failures in make_links_absolute() and -resolve_base_href() (lxml.html) that enables ignoring or -discarding links that fail to parse as URLs.
  • -
  • New parser classes XMLPullParser and HTMLPullParser for -incremental parsing, as implemented for ElementTree in Python 3.4.
  • -
  • iterparse() enables recovery mode by default for HTML parsing -(html=True).
  • -
-
-
-

Bugs fixed

-
    -
  • LP#1255132: crash when trying to run validation over non-Element (e.g. -comment or PI).
  • -
  • Error messages in the log and in exception messages that originated -from libxml2 could accidentally be picked up from preceding warnings -instead of the actual error.
  • -
  • The ElementMaker in lxml.objectify did not accept a dict as -argument for adding attributes to the element it's building. This -works as in lxml.builder now.
  • -
  • LP#1228881: repr(XSLTAccessControl) failed in Python 3.
  • -
  • Raise ValueError when trying to append an Element to itself or -to one of its own descendants, instead of running into an infinite -loop.
  • -
  • LP#1206077: htmldiff discarded whitespace from the output.
  • -
  • Compressed plain-text serialisation to file-like objects was broken.
  • -
  • lxml.html.formfill: Fix textarea form filling. -The textarea used to be cleared before the new content was set, -which removed the name attribute.
  • -
-
-
-

Other changes

-
    -
  • Some basic API classes use freelists internally for faster -instantiation. This can speed up some iterparse() scenarios, -for example.
  • -
  • iterparse() was rewritten to use the new *PullParser -classes internally instead of being a parser itself.
  • -
-
-
-
-

3.2.5 (2014-01-02)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Crash in xmlfile() when closing open elements out of order in an error case.
  • -
  • Crash in target parsing with attributes.
  • -
  • LP#1255132: crash when trying to run validation over non-Element (e.g. -comment or PI).
  • -
-
-
-

Other changes

-
-
-
-

3.2.4 (2013-11-07)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Memory leak when creating an XPath evaluator in a thread.
  • -
  • LP#1228881: repr(XSLTAccessControl) failed in Python 3.
  • -
  • Raise ValueError when trying to append an Element to itself or -to one of its own descendants.
  • -
  • LP#1206077: htmldiff discarded whitespace from the output.
  • -
  • Compressed plain-text serialisation to file-like objects was broken.
  • -
-
-
-

Other changes

-
-
-
-

3.2.3 (2013-07-28)

-
-

Bugs fixed

-
    -
  • Fix support for Python 2.4 which was lost in 3.2.2.
  • -
-
-
-
-

3.2.2 (2013-07-28)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • LP#1185701: spurious XMLSyntaxError after finishing iterparse().
  • -
  • Crash in lxml.objectify during xsi annotation.
  • -
-
-
-

Other changes

-
    -
  • Return values of user provided element class lookup methods are now -validated against the type of the XML node they represent to prevent -API class mismatches.
  • -
-
-
-
-

3.2.1 (2013-05-11)

-
-

Features added

-
    -
  • The methods apply_templates() and process_children() of XSLT -extension elements have gained two new boolean options elements_only -and remove_blank_text that discard either all strings or whitespace-only -strings from the result list.
  • -
-
-
-

Bugs fixed

-
    -
  • When moving Elements to another tree, the namespace cleanup mechanism -no longer drops namespace prefixes from attributes for which it finds -a default namespace declaration, to prevent them from appearing as -unnamespaced attributes after serialisation.
  • -
  • Returning non-type objects from a custom class lookup method could lead -to a crash.
  • -
  • Instantiating and using subtypes of Comments and ProcessingInstructions -crashed.
  • -
-
-
-

Other changes

-
-
-
-

3.2.0 (2013-04-28)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • LP#690319: Leading whitespace could change the behaviour of the string -parsing functions in lxml.html.
  • -
  • LP#599318: The string parsing functions in lxml.html are more robust -in the face of uncommon HTML content like framesets or missing body tags. -Patch by Stefan Seelmann.
  • -
  • LP#712941: I/O errors while trying to access files with paths that contain -non-ASCII characters could raise UnicodeDecodeError instead of properly -reporting the IOError.
  • -
  • LP#673205: Parsing from in-memory strings disabled network access in the -default parser and made subsequent attempts to parse from a URL fail.
  • -
  • LP#971754: lxml.html.clean appends 'nofollow' to 'rel' attributes instead -of overwriting the current value.
  • -
  • LP#715687: lxml.html.clean no longer discards scripts that are explicitly -allowed by the user provided whitelist. Patch by Christine Koppelt.
  • -
-
-
-

Other changes

-
-
-
-

3.1.2 (2013-04-12)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • LP#1136509: Passing attributes through the namespace-unaware API of -the sax bridge (i.e. the handler.startElement() method) failed -with a TypeError. Patch by Mike Bayer.
  • -
  • LP#1123074: Fix serialisation error in XSLT output when converting -the result tree to a Unicode string.
  • -
  • GH#105: Replace illegal usage of xmlBufLength() in libxml2 2.9.0 -by properly exported API function xmlBufUse().
  • -
-
-
-

Other changes

-
-
-
-

3.1.1 (2013-03-29)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • LP#1160386: Write access to lxml.html.FormElement.fields raised -an AttributeError in Py3.
  • -
  • Illegal memory access during cleanup in incremental xmlfile writer.
  • -
-
-
-

Other changes

-
    -
  • The externally useless class lxml.etree._BaseParser was removed -from the module dict.
  • -
-
-
-
-

3.1.0 (2013-02-10)

-
-

Features added

-
    -
  • GH#89: lxml.html.clean allows overriding the set of attributes that it -considers 'safe'. Patch by Francis Devereux.
  • -
-
-
-

Bugs fixed

-
    -
  • LP#1104370: copy.copy(el.attrib) raised an exception. It now returns -a copy of the attributes as a plain Python dict.
  • -
  • GH#95: When used with namespace prefixes, the el.find*() methods -always used the first namespace mapping that was provided for each -path expression instead of using the one that was actually passed -in for the current run.
  • -
  • LP#1092521, GH#91: Fix undefined C symbol in Python runtimes compiled -without threading support. Patch by Ulrich Seidl.
  • -
-
-
-

Other changes

-
-
-
-

3.1beta1 (2012-12-21)

-
-

Features added

-
    -
  • New build-time option --with-unicode-strings for Python 2 that -makes the API always return Unicode strings for names and text -instead of byte strings for plain ASCII content.
  • -
  • New incremental XML file writing API etree.xmlfile().
  • -
  • E factory in lxml.objectify is callable to simplify the creation of -tags with non-identifier names without having to resort to getattr().
  • -
-
-
-

Bugs fixed

-
    -
  • When starting from a non-namespaced element in lxml.objectify, searching -for a child without explicitly specifying a namespace incorrectly found -namespaced elements with the requested local name, instead of restricting -the search to non-namespaced children.
  • -
  • GH#85: Deprecation warnings were fixed for Python 3.x.
  • -
  • GH#33: lxml.html.fromstring() failed to accept bytes input in Py3.
  • -
  • LP#1080792: Static build of libxml2 2.9.0 failed due to missing file.
  • -
-
-
-

Other changes

-
    -
  • The externally useless class _ObjectifyElementMakerCaller was -removed from the module API of lxml.objectify.
  • -
  • LP#1075622: lxml.builder is faster for adding text to elements with -many children. Patch by Anders Hammarquist.
  • -
-
-
-
-

3.0.2 (2012-12-14)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Fix crash during interpreter shutdown by switching to Cython 0.17.3 for building.
  • -
-
-
-

Other changes

-
-
-
-

3.0.1 (2012-10-14)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • LP#1065924: Element proxies could disappear during garbage collection -in PyPy without proper cleanup.
  • -
  • GH#71: Failure to work with libxml2 2.6.x.
  • -
  • LP#1065139: static MacOS-X build failed in Py3.
  • -
-
-
-

Other changes

-
-
-
-

3.0 (2012-10-08)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • End-of-file handling was incorrect in iterparse() when reading from -a low-level C file stream and failed in libxml2 2.9.0 due to its -improved consistency checks.
  • -
-
-
-

Other changes

-
    -
  • The build no longer uses Cython by default unless the generated C files -are missing. To use Cython, pass the option "--with-cython". To ignore -the fatal build error when Cython is required but not available (e.g. to -run special setup.py commands that do not actually run a build), pass -"--without-cython".
  • -
-
-
-
-

3.0beta1 (2012-09-26)

-
-

Features added

-
    -
  • Python level access to (optional) libxml2 memory debugging features -to simplify debugging of memory leaks etc.
  • -
-
-
-

Bugs fixed

-
    -
  • Fix a memory leak in XPath by switching to Cython 0.17.1.
  • -
  • Some tests were adapted to work with PyPy.
  • -
-
-
-

Other changes

-
    -
  • The code was adapted to work with the upcoming libxml2 2.9.0 release.
  • -
-
-
-
-

3.0alpha2 (2012-08-23)

-
-

Features added

-
    -
  • The .iter() method of elements now accepts tag arguments like -"{*}name" to search for elements with a given local name in any -namespace. With this addition, all combinations of wildcards now work -as expected: -"{ns}name", "{}name", "{*}name", "{ns}*", "{}*" -and "{*}*". Note that "name" is equivalent to "{}name", -but "*" is "{*}*". -The same change applies to the .getiterator(), .itersiblings(), -.iterancestors(), .iterdescendants(), .iterchildren() -and .itertext() methods;the strip_attributes(), -strip_elements() and strip_tags() functions as well as the -iterparse() class. Patch by Simon Sapin.
  • -
  • C14N allows specifying the inclusive prefixes to be promoted -to top-level during exclusive serialisation.
  • -
-
-
-

Bugs fixed

-
    -
  • Passing long Unicode strings into the feed() parser interface -failed to read the entire string.
  • -
-
-
-

Other changes

-
-
-
-

3.0alpha1 (2012-07-31)

-
-

Features added

-
    -
  • Initial support for building in PyPy (through cpyext).
  • -
  • DTD objects gained an API that allows read access to their -declarations.
  • -
  • xpathgrep.py gained support for parsing line-by-line (e.g. -from grep output) and for surrounding the output with a new root -tag.
  • -
  • E-factory in lxml.builder accepts subtypes of known data -types (such as string subtypes) when building elements around them.
  • -
  • Tree iteration and iterparse() with a selective tag -argument supports passing a set of tags. Tree nodes will be -returned by the iterators if they match any of the tags.
  • -
-
-
-

Bugs fixed

-
    -
  • The .find*() methods in lxml.objectify no longer use XPath -internally, which makes them faster in many cases (especially when -short circuiting after a single or couple of elements) and fixes -some behavioural differences compared to lxml.etree. Note that -this means that they no longer support arbitrary XPath expressions -but only the subset that the ElementPath language supports. -The previous implementation was also redundant with the normal -XPath support, which can be used as a replacement.
  • -
  • el.find('*') could accidentally return a comment or processing -instruction that happened to be in the wrong spot. (Same for the -other .find*() methods.)
  • -
  • The error logging is less intrusive and avoids a global setup where -possible.
  • -
  • Fixed undefined names in html5lib parser.
  • -
  • xpathgrep.py did not work in Python 3.
  • -
  • Element.attrib.update() did not accept an attrib of -another Element as parameter.
  • -
  • For subtypes of ElementBase that make the .text or .tail -properties immutable (as in objectify, for example), inserting text -when creating Elements through the E-Factory feature of the class -constructor would fail with an exception, stating that the text -cannot be modified.
  • -
-
-
-

Other changes

-
    -
  • The code base was overhauled to properly use 'const' where the API -of libxml2 and libxslt requests it. This also has an impact on the -public C-API of lxml itself, as defined in etreepublic.pxd, as -well as the provided declarations in the lxml/includes/ directory. -Code that uses these declarations may have to be adapted. On the -plus side, this fixes several C compiler warnings, also for user -code, thus making it easier to spot real problems again.
  • -
  • The functionality of "lxml.cssselect" was moved into a separate PyPI -package called "cssselect". To continue using it, you must install -that package separately. The "lxml.cssselect" module is still -available and provides the same interface, provided the "cssselect" -package can be imported at runtime.
  • -
  • Element attributes passed in as an attrib dict or as keyword -arguments are now sorted by (namespaced) name before being created -to make their order predictable for serialisation and iteration. -Note that adding or deleting attributes afterwards does not take -that order into account, i.e. setting a new attribute appends it -after the existing ones.
  • -
  • Several classes that are for internal use only were removed -from the lxml.etree module dict: -_InputDocument, _ResolverRegistry, _ResolverContext, _BaseContext, -_ExsltRegExp, _IterparseContext, _TempStore, _ExceptionContext, -__ContentOnlyElement, _AttribIterator, _NamespaceRegistry, -_ClassNamespaceRegistry, _FunctionNamespaceRegistry, -_XPathFunctionNamespaceRegistry, _ParserDictionaryContext, -_FileReaderContext, _ParserContext, _PythonSaxParserTarget, -_TargetParserContext, _ReadOnlyProxy, _ReadOnlyPIProxy, -_ReadOnlyEntityProxy, _ReadOnlyElementProxy, _OpaqueNodeWrapper, -_OpaqueDocumentWrapper, _ModifyContentOnlyProxy, -_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy, -_AppendOnlyElementProxy, _SaxParserContext, _FilelikeWriter, -_ParserSchemaValidationContext, _XPathContext, -_XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam
  • -
  • Several internal classes can no longer be inherited from: -_InputDocument, _ResolverRegistry, _ExsltRegExp, _ElementUnicodeResult, -_IterparseContext, _TempStore, _AttribIterator, _ClassNamespaceRegistry, -_XPathFunctionNamespaceRegistry, _ParserDictionaryContext, -_FileReaderContext, _PythonSaxParserTarget, _TargetParserContext, -_ReadOnlyPIProxy, _ReadOnlyEntityProxy, _OpaqueDocumentWrapper, -_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy, -_AppendOnlyElementProxy, _FilelikeWriter, _ParserSchemaValidationContext, -_XPathContext, _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam, -_XSLTResultTree, _XSLTProcessingInstruction
  • -
-
-
-
-

2.3.6 (2012-09-28)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Passing long Unicode strings into the feed() parser interface -failed to read the entire string.
  • -
-
-
-

Other changes

-
-
-
-

2.3.5 (2012-07-31)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Crash when merging text nodes in element.remove().
  • -
  • Crash in sax/target parser when reporting empty doctype.
  • -
-
-
-

Other changes

-
-
-
-

2.3.4 (2012-03-26)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Crash when building an nsmap (Element property) with empty -namespace URIs.
  • -
  • Crash due to race condition when errors (or user messages) occur -during threaded XSLT processing.
  • -
  • XSLT stylesheet compilation could ignore compilation errors.
  • -
-
-
-

Other changes

-
-
-
-

2.3.3 (2012-01-04)

-
-

Features added

-
    -
  • lxml.html.tostring() gained new serialisation options -with_tail and doctype.
  • -
-
-
-

Bugs fixed

-
    -
  • Fixed a crash when using iterparse() for HTML parsing and -requesting start events.
  • -
  • Fixed parsing of more selectors in cssselect. Whitespace before -pseudo-elements and pseudo-classes is significant as it is a -descendant combinator. -"E :pseudo" should parse the same as "E *:pseudo", not "E:pseudo". -Patch by Simon Sapin.
  • -
  • lxml.html.diff no longer raises an exception when hitting -'img' tags without 'src' attribute.
  • -
-
-
-

Other changes

-
-
-
-

2.3.2 (2011-11-11)

-
-

Features added

-
    -
  • lxml.objectify.deannotate() has a new boolean option -cleanup_namespaces to remove the objectify namespace -declarations (and generally clean up the namespace declarations) -after removing the type annotations.
  • -
  • lxml.objectify gained its own SubElement() function as a -copy of etree.SubElement to avoid an otherwise redundant import -of lxml.etree on the user side.
  • -
-
-
-

Bugs fixed

-
    -
  • Fixed the "descendant" bug in cssselect a second time (after a first -fix in lxml 2.3.1). The previous change resulted in a serious -performance regression for the XPath based evaluation of the -translated expression. Note that this breaks the usage of some of -the generated XPath expressions as XSLT location paths that -previously worked in 2.3.1.
  • -
  • Fixed parsing of some selectors in cssselect. Whitespace after combinators -">", "+" and "~" is now correctly ignored. Previously it was parsed as -a descendant combinator. For example, "div> .foo" was parsed the same as -"div>* .foo" instead of "div>.foo". Patch by Simon Sapin.
  • -
-
-
-

Other changes

-
-
-
-

2.3.1 (2011-09-25)

-
-

Features added

-
    -
  • New option kill_tags in lxml.html.clean to remove specific -tags and their content (i.e. their whole subtree).
  • -
  • pi.get() and pi.attrib on processing instructions to parse -pseudo-attributes from the text content of processing instructions.
  • -
  • lxml.get_include() returns a list of include paths that can be -used to compile external C code against lxml.etree. This is -specifically required for statically linked lxml builds when code -needs to compile against the exact same header file versions as lxml -itself.
  • -
  • Resolver.resolve_file() takes an additional option -close_file that configures if the file(-like) object will be -closed after reading or not. By default, the file will be closed, -as the user is not expected to keep a reference to it.
  • -
-
-
-

Bugs fixed

-
    -
  • HTML cleaning didn't remove 'data:' links.
  • -
  • The html5lib parser integration now uses the 'official' -implementation in html5lib itself, which makes it work with newer -releases of the library.
  • -
  • In lxml.sax, endElementNS() could incorrectly reject a plain -tag name when the corresponding start event inferred the same plain -tag name to be in the default namespace.
  • -
  • When an open file-like object is passed into parse() or -iterparse(), the parser will no longer close it after use. This -reverts a change in lxml 2.3 where all files would be closed. It is -the users responsibility to properly close the file(-like) object, -also in error cases.
  • -
  • Assertion error in lxml.html.cleaner when discarding top-level elements.
  • -
  • In lxml.cssselect, use the xpath 'A//B' (short for -'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for -the css descendant selector ('A B'). This makes a few edge cases -like "div *:last-child" consistent with the selector behavior in -WebKit and Firefox, and makes more css expressions valid location -paths (for use in xsl:template match).
  • -
  • In lxml.html, non-selected <option> tags no longer show up in the -collected form values.
  • -
  • Adding/removing <option> values to/from a multiple select form -field properly selects them and unselects them.
  • -
-
-
-

Other changes

-
    -
  • Static builds can specify the download directory with the ---download-dir option.
  • -
-
-
-
-

2.3 (2011-02-06)

-
-

Features added

-
    -
  • When looking for children, lxml.objectify takes '{}tag' as -meaning an empty namespace, as opposed to the parent namespace.
  • -
-
-
-

Bugs fixed

-
    -
  • When finished reading from a file-like object, the parser -immediately calls its .close() method.
  • -
  • When finished parsing, iterparse() immediately closes the input -file.
  • -
  • Work-around for libxml2 bug that can leave the HTML parser in a -non-functional state after parsing a severely broken document (fixed -in libxml2 2.7.8).
  • -
  • marque tag in HTML cleanup code is correctly named marquee.
  • -
-
-
-

Other changes

-
    -
  • Some public functions in the Cython-level C-API have more explicit -return types.
  • -
-
-
-
-

2.3beta1 (2010-09-06)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Crash in newer libxml2 versions when moving elements between -documents that had attributes on replaced XInclude nodes.
  • -
  • XMLID() function was missing the optional parser and -base_url parameters.
  • -
  • Searching for wildcard tags in iterparse() was broken in Py3.
  • -
  • lxml.html.open_in_browser() didn't work in Python 3 due to the -use of os.tempnam. It now takes an optional 'encoding' parameter.
  • -
-
-
-

Other changes

-
-
-
-

2.3alpha2 (2010-07-24)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Crash in XSLT when generating text-only result documents with a -stylesheet created in a different thread.
  • -
-
-
-

Other changes

-
    -
  • repr() of Element objects shows the hex ID with leading 0x -(following ElementTree 1.3).
  • -
-
-
-
-

2.3alpha1 (2010-06-19)

-
-

Features added

-
    -
  • Keyword argument namespaces in lxml.cssselect.CSSSelector() -to pass a prefix-to-namespace mapping for the selector.
  • -
  • New function lxml.etree.register_namespace(prefix, uri) that -globally registers a namespace prefix for a namespace that newly -created Elements in that namespace will use automatically. Follows -ElementTree 1.3.
  • -
  • Support 'unicode' string name as encoding parameter in -tostring(), following ElementTree 1.3.
  • -
  • Support 'c14n' serialisation method in ElementTree.write() and -tostring(), following ElementTree 1.3.
  • -
  • The ElementPath expression syntax (el.find*()) was extended to -match the upcoming ElementTree 1.3 that will ship in the standard -library of Python 3.2/2.7. This includes extended support for -predicates as well as namespace prefixes (as known from XPath).
  • -
  • During regular XPath evaluation, various ESXLT functions are -available within their namespace when using libxslt 1.1.26 or later.
  • -
  • Support passing a readily configured logger instance into -PyErrorLog, instead of a logger name.
  • -
  • On serialisation, the new doctype parameter can be used to -override the DOCTYPE (internal subset) of the document.
  • -
  • New parameter output_parent to XSLTExtension.apply_templates() -to append the resulting content directly to an output element.
  • -
  • XSLTExtension.process_children() to process the content of the -XSLT extension element itself.
  • -
  • ISO-Schematron support based on the de-facto Schematron reference -'skeleton implementation'.
  • -
  • XSLT objects now take XPath object as __call__ stylesheet -parameters.
  • -
  • Enable path caching in ElementPath (el.find*()) to avoid parsing -overhead.
  • -
  • Setting the value of a namespaced attribute always uses a prefixed -namespace instead of the default namespace even if both declare the -same namespace URI. This avoids serialisation problems when an -attribute from a default namespace is set on an element from a -different namespace.
  • -
  • XSLT extension elements: support for XSLT context nodes other than -elements: document root, comments, processing instructions.
  • -
  • Support for strings (in addition to Elements) in node-sets returned -by extension functions.
  • -
  • Forms that lack an action attribute default to the base URL of -the document on submit.
  • -
  • XPath attribute result strings have an attrname property.
  • -
  • Namespace URIs get validated against RFC 3986 at the API level -(required by the XML namespace specification).
  • -
  • Target parsers show their target object in the .target property -(compatible with ElementTree).
  • -
-
-
-

Bugs fixed

-
    -
  • API is hardened against invalid proxy instances to prevent crashes -due to incorrectly instantiated Element instances.
  • -
  • Prevent crash when instantiating CommentBase and friends.
  • -
  • Export ElementTree compatible XML parser class as -XMLTreeBuilder, as it is called in ET 1.2.
  • -
  • ObjectifiedDataElements in lxml.objectify were not hashable. They -now use the hash value of the underlying Python value (string, -number, etc.) to which they compare equal.
  • -
  • Parsing broken fragments in lxml.html could fail if the fragment -contained an orphaned closing '</div>' tag.
  • -
  • Using XSLT extension elements around the root of the output document -crashed.
  • -
  • lxml.cssselect did not distinguish between x[attr="val"] and -x [attr="val"] (with a space). The latter now matches the -attribute independent of the element.
  • -
  • Rewriting multiple links inside of HTML text content could end up -replacing unrelated content as replacements could impact the -reported position of subsequent matches. Modifications are now -simplified by letting the iterlinks() generator in lxml.html -return links in reversed order if they appear inside the same text -node. Thus, replacements and link-internal modifications no longer -change the position of links reported afterwards.
  • -
  • The .value attribute of textarea elements in lxml.html did -not represent the complete raw value (including child tags etc.). It -now serialises the complete content on read and replaces the -complete content by a string on write.
  • -
  • Target parser didn't call .close() on the target object if -parsing failed. Now it is guaranteed that .close() will be -called after parsing, regardless of the outcome.
  • -
-
-
-

Other changes

-
    -
  • Official support for Python 3.1.2 and later.
  • -
  • Static MS Windows builds can now download their dependencies -themselves.
  • -
  • Element.attrib no longer uses a cyclic reference back to its -Element object. It therefore no longer requires the garbage -collector to clean up.
  • -
  • Static builds include libiconv, in addition to libxml2 and libxslt.
  • -
-
-
-
-

2.2.8 (2010-09-02)

-
-

Bugs fixed

-
    -
  • Crash in newer libxml2 versions when moving elements between -documents that had attributes on replaced XInclude nodes.
  • -
  • Import fix for urljoin in Python 3.1+.
  • -
-
-
-
-

2.2.7 (2010-07-24)

-
-

Bugs fixed

-
    -
  • Crash in XSLT when generating text-only result documents with a -stylesheet created in a different thread.
  • -
-
-
-
-

2.2.6 (2010-03-02)

-
-

Bugs fixed

-
    -
  • Fixed several Python 3 regressions by building with Cython 0.11.3.
  • -
-
-
-
-

2.2.5 (2010-02-28)

-
-

Features added

-
    -
  • Support for running XSLT extension elements on the input root node -(e.g. in a template matching on "/").
  • -
-
-
-

Bugs fixed

-
    -
  • Crash in XPath evaluation when reading smart strings from a document -other than the original context document.
  • -
  • Support recent versions of html5lib by not requiring its -XHTMLParser in htmlparser.py anymore.
  • -
  • Manually instantiating the custom element classes in -lxml.objectify could crash.
  • -
  • Invalid XML text characters were not rejected by the API when they -appeared in unicode strings directly after non-ASCII characters.
  • -
  • lxml.html.open_http_urllib() did not work in Python 3.
  • -
  • The functions strip_tags() and strip_elements() in -lxml.etree did not remove all occurrences of a tag in all cases.
  • -
  • Crash in XSLT extension elements when the XSLT context node is not -an element.
  • -
-
-
-
-

2.2.4 (2009-11-11)

-
-

Bugs fixed

-
    -
  • Static build of libxml2/libxslt was broken.
  • -
-
-
-
-

2.2.3 (2009-10-30)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • The resolve_entities option did not work in the incremental feed -parser.
  • -
  • Looking up and deleting attributes without a namespace could hit a -namespaced attribute of the same name instead.
  • -
  • Late errors during calls to SubElement() (e.g. attribute related -ones) could leave a partially initialised element in the tree.
  • -
  • Modifying trees that contain parsed entity references could result -in an infinite loop.
  • -
  • ObjectifiedElement.__setattr__ created an empty-string child element when the -attribute value was rejected as a non-unicode/non-ascii string
  • -
  • Syntax errors in lxml.cssselect could result in misleading error -messages.
  • -
  • Invalid syntax in CSS expressions could lead to an infinite loop in -the parser of lxml.cssselect.
  • -
  • CSS special character escapes were not properly handled in -lxml.cssselect.
  • -
  • CSS Unicode escapes were not properly decoded in lxml.cssselect.
  • -
  • Select options in HTML forms that had no explicit value -attribute were not handled correctly. The HTML standard dictates -that their value is defined by their text content. This is now -supported by lxml.html.
  • -
  • XPath raised a TypeError when finding CDATA sections. This is now -fully supported.
  • -
  • Calling help(lxml.objectify) didn't work at the prompt.
  • -
  • The ElementMaker in lxml.objectify no longer defines the default -namespaces when annotation is disabled.
  • -
  • Feed parser failed to honour the 'recover' option on parse errors.
  • -
  • Diverting the error logging to Python's logging system was broken.
  • -
-
-
-

Other changes

-
-
-
-

2.2.2 (2009-06-21)

-
-

Features added

-
    -
  • New helper functions strip_attributes(), strip_elements(), -strip_tags() in lxml.etree to remove attributes/subtrees/tags -from a subtree.
  • -
-
-
-

Bugs fixed

-
    -
  • Namespace cleanup on subtree insertions could result in missing -namespace declarations (and potentially crashes) if the element -defining a namespace was deleted and the namespace was not used by -the top element of the inserted subtree but only in deeper subtrees.
  • -
  • Raising an exception from a parser target callback didn't always -terminate the parser.
  • -
  • Only {true, false, 1, 0} are accepted as the lexical representation for -BoolElement ({True, False, T, F, t, f} not any more), restoring lxml <= 2.0 -behaviour.
  • -
-
-
-

Other changes

-
-
-
-

2.2.1 (2009-06-02)

-
-

Features added

-
    -
  • Injecting default attributes into a document during XML Schema -validation (also at parse time).
  • -
  • Pass huge_tree parser option to disable parser security -restrictions imposed by libxml2 2.7.
  • -
-
-
-

Bugs fixed

-
    -
  • The script for statically building libxml2 and libxslt didn't work -in Py3.
  • -
  • XMLSchema() also passes invalid schema documents on to libxml2 -for parsing (which could lead to a crash before release 2.6.24).
  • -
-
-
-

Other changes

-
-
-
-

2.2 (2009-03-21)

-
-

Features added

-
    -
  • Support for standalone flag in XML declaration through -tree.docinfo.standalone and by passing standalone=True/False -on serialisation.
  • -
-
-
-

Bugs fixed

-
    -
  • Crash when parsing an XML Schema with external imports from a -filename.
  • -
-
-
-
-

2.2beta4 (2009-02-27)

-
-

Features added

-
    -
  • Support strings and instantiable Element classes as child arguments -to the constructor of custom Element classes.
  • -
  • GZip compression support for serialisation to files and file-like -objects.
  • -
-
-
-

Bugs fixed

-
    -
  • Deep-copying an ElementTree copied neither its sibling PIs and -comments nor its internal/external DTD subsets.
  • -
  • Soupparser failed on broken attributes without values.
  • -
  • Crash in XSLT when overwriting an already defined attribute using -xsl:attribute.
  • -
  • Crash bug in exception handling code under Python 3. This was due -to a problem in Cython, not lxml itself.
  • -
  • lxml.html.FormElement._name() failed for non top-level forms.
  • -
  • TAG special attribute in constructor of custom Element classes -was evaluated incorrectly.
  • -
-
-
-

Other changes

-
    -
  • Official support for Python 3.0.1.
  • -
  • Element.findtext() now returns an empty string instead of None -for Elements without text content.
  • -
-
-
-
-

2.2beta3 (2009-02-17)

-
-

Features added

-
    -
  • XSLT.strparam() class method to wrap quoted string parameters -that require escaping.
  • -
-
-
-

Bugs fixed

-
    -
  • Memory leak in XPath evaluators.
  • -
  • Crash when parsing indented XML in one thread and merging it with -other documents parsed in another thread.
  • -
  • Setting the base attribute in lxml.objectify from a unicode -string failed.
  • -
  • Fixes following changes in Python 3.0.1.
  • -
  • Minor fixes for Python 3.
  • -
-
-
-

Other changes

-
    -
  • The global error log (which is copied into the exception log) is now -local to a thread, which fixes some race conditions.
  • -
  • More robust error handling on serialisation.
  • -
-
-
-
-

2.2beta2 (2009-01-25)

-
-

Bugs fixed

-
    -
  • Potential memory leak on exception handling. This was due to a -problem in Cython, not lxml itself.
  • -
  • iter_links (and related link-rewriting functions) in -lxml.html would interpret CSS like url("link") incorrectly -(treating the quotation marks as part of the link).
  • -
  • Failing import on systems that have an io module.
  • -
-
-
-
-

2.1.5 (2009-01-06)

-
-

Bugs fixed

-
    -
  • Potential memory leak on exception handling. This was due to a -problem in Cython, not lxml itself.
  • -
  • Failing import on systems that have an io module.
  • -
-
-
-
-

2.2beta1 (2008-12-12)

-
-

Features added

-
    -
  • Allow lxml.html.diff.htmldiff to accept Element objects, not -just HTML strings.
  • -
-
-
-

Bugs fixed

-
    -
  • Crash when using an XPath evaluator in multiple threads.
  • -
  • Fixed missing whitespace before Link:... in lxml.html.diff.
  • -
-
-
-

Other changes

-
    -
  • Export lxml.html.parse.
  • -
-
-
-
-

2.1.4 (2008-12-12)

-
-

Bugs fixed

-
    -
  • Crash when using an XPath evaluator in multiple threads.
  • -
-
-
-
-

2.0.11 (2008-12-12)

-
-

Bugs fixed

-
    -
  • Crash when using an XPath evaluator in multiple threads.
  • -
-
-
-
-

2.2alpha1 (2008-11-23)

-
-

Features added

-
    -
  • Support for XSLT result tree fragments in XPath/XSLT extension -functions.
  • -
  • QName objects have new properties namespace and localname.
  • -
  • New options for exclusive C14N and C14N without comments.
  • -
  • Instantiating a custom Element classes creates a new Element.
  • -
-
-
-

Bugs fixed

-
    -
  • XSLT didn't inherit the parse options of the input document.
  • -
  • 0-bytes could slip through the API when used inside of Unicode -strings.
  • -
  • With lxml.html.clean.autolink, links with balanced parenthesis, -that end in a parenthesis, will be linked in their entirety (typical -with Wikipedia links).
  • -
-
-
-

Other changes

-
-
-
-

2.1.3 (2008-11-17)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Ref-count leaks when lxml enters a try-except statement while an -outside exception lives in sys.exc_*(). This was due to a problem in -Cython, not lxml itself.
  • -
  • Parser Unicode decoding errors could get swallowed by other -exceptions.
  • -
  • Name/import errors in some Python modules.
  • -
  • Internal DTD subsets that did not specify a system or public ID were -not serialised and did not appear in the docinfo property of -ElementTrees.
  • -
  • Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.
  • -
  • Test suite fixes for libxml2 2.7.
  • -
  • Resolver.resolve_string() did not work for non-ASCII byte strings.
  • -
  • Resolver.resolve_file() was broken.
  • -
  • Overriding the parser encoding didn't work for many encodings.
  • -
-
-
-

Other changes

-
-
-
-

2.0.10 (2008-11-17)

-
-

Bugs fixed

-
    -
  • Ref-count leaks when lxml enters a try-except statement while an -outside exception lives in sys.exc_*(). This was due to a problem in -Cython, not lxml itself.
  • -
-
-
-
-

2.1.2 (2008-09-05)

-
-

Features added

-
    -
  • lxml.etree now tries to find the absolute path name of files when -parsing from a file-like object. This helps custom resolvers when -resolving relative URLs, as lixbml2 can prepend them with the path -of the source document.
  • -
-
-
-

Bugs fixed

-
    -
  • Memory problem when passing documents between threads.
  • -
  • Target parser did not honour the recover option and raised an -exception instead of calling .close() on the target.
  • -
-
-
-

Other changes

-
-
-
-

2.0.9 (2008-09-05)

-
-

Bugs fixed

-
    -
  • Memory problem when passing documents between threads.
  • -
  • Target parser did not honour the recover option and raised an -exception instead of calling .close() on the target.
  • -
-
-
-
-

2.1.1 (2008-07-24)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Crash when parsing XSLT stylesheets in a thread and using them in -another.
  • -
  • Encoding problem when including text with ElementInclude under -Python 3.
  • -
-
-
-

Other changes

-
-
-
-

2.0.8 (2008-07-24)

-
-

Features added

-
    -
  • lxml.html.rewrite_links() strips links to work around documents -with whitespace in URL attributes.
  • -
-
-
-

Bugs fixed

-
    -
  • Crash when parsing XSLT stylesheets in a thread and using them in -another.
  • -
  • CSS selector parser dropped remaining expression after a function -with parameters.
  • -
-
-
-

Other changes

-
-
-
-

2.1 (2008-07-09)

-
-

Features added

-
    -
  • Smart strings can be switched off in XPath (smart_strings -keyword option).
  • -
  • lxml.html.rewrite_links() strips links to work around documents -with whitespace in URL attributes.
  • -
-
-
-

Bugs fixed

-
    -
  • Custom resolvers were not used for XMLSchema includes/imports and -XInclude processing.
  • -
  • CSS selector parser dropped remaining expression after a function -with parameters.
  • -
-
-
-

Other changes

-
    -
  • objectify.enableRecursiveStr() was removed, use -objectify.enable_recursive_str() instead
  • -
  • Speed-up when running XSLTs on documents from other threads
  • -
-
-
-
-

2.0.7 (2008-06-20)

-
-

Features added

-
    -
  • Pickling ElementTree objects in lxml.objectify.
  • -
-
-
-

Bugs fixed

-
    -
  • Descending dot-separated classes in CSS selectors were not resolved -correctly.
  • -
  • ElementTree.parse() didn't handle target parser result.
  • -
  • Potential threading problem in XInclude.
  • -
  • Crash in Element class lookup classes when the __init__() method of -the super class is not called from Python subclasses.
  • -
-
-
-

Other changes

-
    -
  • Non-ASCII characters in attribute values are no longer escaped on -serialisation.
  • -
-
-
-
-

2.1beta3 (2008-06-19)

-
-

Features added

-
    -
  • Major overhaul of tools/xpathgrep.py script.
  • -
  • Pickling ElementTree objects in lxml.objectify.
  • -
  • Support for parsing from file-like objects that return unicode -strings.
  • -
  • New function etree.cleanup_namespaces(el) that removes unused -namespace declarations from a (sub)tree (experimental).
  • -
  • XSLT results support the buffer protocol in Python 3.
  • -
  • Polymorphic functions in lxml.html that accept either a tree or -a parsable string will return either a UTF-8 encoded byte string, a -unicode string or a tree, based on the type of the input. -Previously, the result was always a byte string or a tree.
  • -
  • Support for Python 2.6 and 3.0 beta.
  • -
  • File name handling now uses a heuristic to convert between byte -strings (usually filenames) and unicode strings (usually URLs).
  • -
  • Parsing from a plain file object frees the GIL under Python 2.x.
  • -
  • Running iterparse() on a plain file (or filename) frees the GIL -on reading under Python 2.x.
  • -
  • Conversion functions html_to_xhtml() and xhtml_to_html() in -lxml.html (experimental).
  • -
  • Most features in lxml.html work for XHTML namespaced tag names -(experimental).
  • -
-
-
-

Bugs fixed

-
    -
  • ElementTree.parse() didn't handle target parser result.
  • -
  • Crash in Element class lookup classes when the __init__() method of -the super class is not called from Python subclasses.
  • -
  • A number of problems related to unicode/byte string conversion of -filenames and error messages were fixed.
  • -
  • Building on MacOS-X now passes the "flat_namespace" option to the C -compiler, which reportedly prevents build quirks and crashes on this -platform.
  • -
  • Windows build was broken.
  • -
  • Rare crash when serialising to a file object with certain encodings.
  • -
-
-
-

Other changes

-
    -
  • Non-ASCII characters in attribute values are no longer escaped on -serialisation.
  • -
  • Passing non-ASCII byte strings or invalid unicode strings as .tag, -namespaces, etc. will result in a ValueError instead of an -AssertionError (just like the tag well-formedness check).
  • -
  • Up to several times faster attribute access (i.e. tree traversal) in -lxml.objectify.
  • -
-
-
-
-

2.0.6 (2008-05-31)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Incorrect evaluation of el.find("tag[child]").
  • -
  • Windows build was broken.
  • -
  • Moving a subtree from a document created in one thread into a -document of another thread could crash when the rest of the source -document is deleted while the subtree is still in use.
  • -
  • Rare crash when serialising to a file object with certain encodings.
  • -
-
-
-

Other changes

-
    -
  • lxml should now build without problems on MacOS-X.
  • -
-
-
-
-

2.1beta2 (2008-05-02)

-
-

Features added

-
    -
  • All parse functions in lxml.html take a parser keyword argument.
  • -
  • lxml.html has a new parser class XHTMLParser and a module -attribute xhtml_parser that provide XML parsers that are -pre-configured for the lxml.html package.
  • -
-
-
-

Bugs fixed

-
    -
  • Moving a subtree from a document created in one thread into a -document of another thread could crash when the rest of the source -document is deleted while the subtree is still in use.
  • -
  • Passing an nsmap when creating an Element will no longer strip -redundantly defined namespace URIs. This prevented the definition -of more than one prefix for a namespace on the same Element.
  • -
-
-
-

Other changes

-
    -
  • If the default namespace is redundantly defined with a prefix on the -same Element, the prefix will now be preferred for subelements and -attributes. This allows users to work around a problem in libxml2 -where attributes from the default namespace could serialise without -a prefix even when they appear on an Element with a different -namespace (i.e. they would end up in the wrong namespace).
  • -
-
-
-
-

2.0.5 (2008-05-01)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Resolving to a filename in custom resolvers didn't work.
  • -
  • lxml did not honour libxslt's second error state "STOPPED", which -let some XSLT errors pass silently.
  • -
  • Memory leak in Schematron with libxml2 >= 2.6.31.
  • -
-
-
-

Other changes

-
-
-
-

2.1beta1 (2008-04-15)

-
-

Features added

-
    -
  • Error logging in Schematron (requires libxml2 2.6.32 or later).
  • -
  • Parser option strip_cdata for normalising or keeping CDATA -sections. Defaults to True as before, thus replacing CDATA -sections by their text content.
  • -
  • CDATA() factory to wrap string content as CDATA section.
  • -
-
-
-

Bugs fixed

-
    -
  • Resolving to a filename in custom resolvers didn't work.
  • -
  • lxml did not honour libxslt's second error state "STOPPED", which -let some XSLT errors pass silently.
  • -
  • Memory leak in Schematron with libxml2 >= 2.6.31.
  • -
  • lxml.etree accepted non well-formed namespace prefix names.
  • -
-
-
-

Other changes

-
    -
  • Major cleanup in internal moveNodeToDocument() function, which -takes care of namespace cleanup when moving elements between -different namespace contexts.
  • -
  • New Elements created through the makeelement() method of an HTML -parser or through lxml.html now end up in a new HTML document -(doctype HTML 4.01 Transitional) instead of a generic XML document. -This mostly impacts the serialisation and the availability of a DTD -context.
  • -
-
-
-
-

2.0.4 (2008-04-13)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • Hanging thread in conjunction with GTK threading.
  • -
  • Crash bug in iterparse when moving elements into other documents.
  • -
  • HTML elements' .cssselect() method was broken.
  • -
  • ElementTree.find*() didn't accept QName objects.
  • -
-
-
-

Other changes

-
-
-
-

2.1alpha1 (2008-03-27)

-
-

Features added

-
    -
  • New event types 'comment' and 'pi' in iterparse().
  • -
  • XSLTAccessControl instances have a property options that -returns a dict of access configuration options.
  • -
  • Constant instances DENY_ALL and DENY_WRITE on -XSLTAccessControl class.
  • -
  • Extension elements for XSLT (experimental!)
  • -
  • Element.base property returns the xml:base or HTML base URL of -an Element.
  • -
  • docinfo.URL property is writable.
  • -
-
-
-

Bugs fixed

-
    -
  • Default encoding for plain text serialisation was different from -that of XML serialisation (UTF-8 instead of ASCII).
  • -
-
-
-

Other changes

-
    -
  • Minor API speed-ups.
  • -
  • The benchmark suite now uses tail text in the trees, which makes the -absolute numbers incomparable to previous results.
  • -
  • Generating the HTML documentation now requires Pygments, which is -used to enable syntax highlighting for the doctest examples.
  • -
-

Most long-time deprecated functions and methods were removed:

-
    -
  • etree.clearErrorLog(), use etree.clear_error_log()

    -
  • -
  • etree.useGlobalPythonLog(), use -etree.use_global_python_log()

    -
  • -
  • etree.ElementClassLookup.setFallback(), use -etree.ElementClassLookup.set_fallback()

    -
  • -
  • etree.getDefaultParser(), use etree.get_default_parser()

    -
  • -
  • etree.setDefaultParser(), use etree.set_default_parser()

    -
  • -
  • etree.setElementClassLookup(), use -etree.set_element_class_lookup()

    -

    Note that parser.setElementClassLookup() has not been removed -yet, although parser.set_element_class_lookup() should be used -instead.

    -
  • -
  • xpath_evaluator.registerNamespace(), use -xpath_evaluator.register_namespace()

    -
  • -
  • xpath_evaluator.registerNamespaces(), use -xpath_evaluator.register_namespaces()

    -
  • -
  • objectify.setPytypeAttributeTag, use -objectify.set_pytype_attribute_tag

    -
  • -
  • objectify.setDefaultParser(), use -objectify.set_default_parser()

    -
  • -
-
-
-
-

2.0.3 (2008-03-26)

-
-

Features added

-
    -
  • soupparser.parse() allows passing keyword arguments on to -BeautifulSoup.
  • -
  • fromstring() method in lxml.html.soupparser.
  • -
-
-
-

Bugs fixed

-
    -
  • lxml.html.diff didn't treat empty tags properly (e.g., -<br>).
  • -
  • Handle entity replacements correctly in target parser.
  • -
  • Crash when using iterparse() with XML Schema validation.
  • -
  • The BeautifulSoup parser (soupparser.py) did not replace entities, -which made them turn up in text content.
  • -
  • Attribute assignment of custom PyTypes in objectify could fail to -correctly serialise the value to a string.
  • -
-
-
-

Other changes

-
    -
  • lxml.html.ElementSoup was replaced by a new module -lxml.html.soupparser with a more consistent API. The old module -remains for compatibility with ElementTree's own ElementSoup module.
  • -
  • Setting the XSLT_CONFIG and XML2_CONFIG environment variables at -build time will let setup.py pick up the xml2-config and -xslt-config scripts from the supplied path name.
  • -
  • Passing --with-xml2-config=/path/to/xml2-config to setup.py will -override the xml2-config script that is used to determine the C -compiler options. The same applies for the --with-xslt-config -option.
  • -
-
-
-
-

2.0.2 (2008-02-22)

-
-

Features added

-
    -
  • Support passing base_url to file parser functions to override -the filename of the file(-like) object.
  • -
-
-
-

Bugs fixed

-
    -
  • The prefix for objectify's pytype namespace was missing from the set -of default prefixes.
  • -
  • Memory leak in Schematron (fixed only for libxml2 2.6.31+).
  • -
  • Error type names in RelaxNG were reported incorrectly.
  • -
  • Slice deletion bug fixed in objectify.
  • -
-
-
-

Other changes

-
    -
  • Enabled doctests for some Python modules (especially lxml.html).
  • -
  • Add a method argument to lxml.html.tostring() -(method="xml" for XHTML output).
  • -
  • Make it clearer that methods like lxml.html.fromstring() take a -base_url argument.
  • -
-
-
-
-

2.0.1 (2008-02-13)

-
-

Features added

-
    -
  • Child iteration in lxml.pyclasslookup.
  • -
  • Loads of new docstrings reflect the signature of functions and -methods to make them visible in API docs and help()
  • -
-
-
-

Bugs fixed

-
    -
  • The module lxml.html.builder was duplicated as -lxml.htmlbuilder
  • -
  • Form elements would return None for form.fields.keys() if there -was an unnamed input field. Now unnamed input fields are completely -ignored.
  • -
  • Setting an element slice in objectify could insert slice-overlapping -elements at the wrong position.
  • -
-
-
-

Other changes

-
    -
  • The generated API documentation was cleaned up and disburdened from -non-public classes etc.
  • -
  • The previously public module lxml.html.setmixin was renamed to -lxml.html._setmixin as it is not an official part of lxml. If -you want to use it, feel free to copy it over to your own source -base.
  • -
  • Passing --with-xslt-config=/path/to/xslt-config to setup.py will -override the xslt-config script that is used to determine the C -compiler options.
  • -
-
-
-
-

2.0 (2008-02-01)

-
-

Features added

-
    -
  • Passing the unicode type as encoding to tostring() will -serialise to unicode. The tounicode() function is now -deprecated.
  • -
  • XMLSchema() and RelaxNG() can parse from StringIO.
  • -
  • makeparser() function in lxml.objectify to create a new -parser with the usual objectify setup.
  • -
  • Plain ASCII XPath string results are no longer forced into unicode -objects as in 2.0beta1, but are returned as plain strings as before.
  • -
  • All XPath string results are 'smart' objects that have a -getparent() method to retrieve their parent Element.
  • -
  • with_tail option in serialiser functions.
  • -
  • More accurate exception messages in validator creation.
  • -
  • Parse-time XML schema validation (schema parser keyword).
  • -
  • XPath string results of the text() function and attribute -selection make their Element container accessible through a -getparent() method. As a side-effect, they are now always -unicode objects (even ASCII strings).
  • -
  • XSLT objects are usable in any thread - at the cost of a deep -copy if they were not created in that thread.
  • -
  • Invalid entity names and character references will be rejected by -the Entity() factory.
  • -
  • entity.text returns the textual representation of the entity, -e.g. &amp;.
  • -
  • New properties position and code on ParseError exception (as -in ET 1.3)
  • -
  • Rich comparison of element.attrib proxies.
  • -
  • ElementTree compatible TreeBuilder class.
  • -
  • Use default prefixes for some common XML namespaces.
  • -
  • lxml.html.clean.Cleaner now allows for a host_whitelist, and -two overridable methods: allow_embedded_url(el, url) and the -more general allow_element(el).
  • -
  • Extended slicing of Elements as in element[1:-1:2], both in -etree and in objectify
  • -
  • Resolvers can now provide a base_url keyword argument when -resolving a document as string data.
  • -
  • When using lxml.doctestcompare you can give the doctest option -NOPARSE_MARKUP (like # doctest: +NOPARSE_MARKUP) to suppress -the special checking for one test.
  • -
  • Separate feed_error_log property for the feed parser interface. -The normal parser interface and iterparse continue to use -error_log.
  • -
  • The normal parsers and the feed parser interface are now separated -and can be used concurrently on the same parser instance.
  • -
  • fromstringlist() and tostringlist() functions as in -ElementTree 1.3
  • -
  • iterparse() accepts an html boolean keyword argument for -parsing with the HTML parser (note that this interface may be -subject to change)
  • -
  • Parsers accept an encoding keyword argument that overrides the encoding -of the parsed documents.
  • -
  • New C-API function hasChild() to test for children
  • -
  • annotate() function in objectify can annotate with Python types and XSI -types in one step. Accompanied by xsiannotate() and pyannotate().
  • -
  • ET.write(), tostring() and tounicode() now accept a keyword -argument method that can be one of 'xml' (or None), 'html' or 'text' to -serialise as XML, HTML or plain text content.
  • -
  • iterfind() method on Elements returns an iterator equivalent to -findall()
  • -
  • itertext() method on Elements
  • -
  • Setting a QName object as value of the .text property or as an attribute -will resolve its prefix in the respective context
  • -
  • ElementTree-like parser target interface as described in -http://effbot.org/elementtree/elementtree-xmlparser.htm
  • -
  • ElementTree-like feed parser interface on XMLParser and HTMLParser -(feed() and close() methods)
  • -
  • Reimplemented objectify.E for better performance and improved -integration with objectify. Provides extended type support based on -registered PyTypes.
  • -
  • XSLT objects now support deep copying
  • -
  • New makeSubElement() C-API function that allows creating a new -subelement straight with text, tail and attributes.
  • -
  • XPath extension functions can now access the current context node -(context.context_node) and use a context dictionary -(context.eval_context) from the context provided in their first -parameter
  • -
  • HTML tag soup parser based on BeautifulSoup in lxml.html.ElementSoup
  • -
  • New module lxml.doctestcompare by Ian Bicking for writing simplified -doctests based on XML/HTML output. Use by importing lxml.usedoctest or -lxml.html.usedoctest from within a doctest.
  • -
  • New module lxml.cssselect by Ian Bicking for selecting Elements with CSS -selectors.
  • -
  • New package lxml.html written by Ian Bicking for advanced HTML -treatment.
  • -
  • Namespace class setup is now local to the ElementNamespaceClassLookup -instance and no longer global.
  • -
  • Schematron validation (incomplete in libxml2)
  • -
  • Additional stringify argument to objectify.PyType() takes a -conversion function to strings to support setting text values from arbitrary -types.
  • -
  • Entity support through an Entity factory and element classes. XML -parsers now have a resolve_entities keyword argument that can be set to -False to keep entities in the document.
  • -
  • column field on error log entries to accompany the line field
  • -
  • Error specific messages in XPath parsing and evaluation -NOTE: for evaluation errors, you will now get an XPathEvalError instead of -an XPathSyntaxError. To catch both, you can except on XPathError
  • -
  • The regular expression functions in XPath now support passing a node-set -instead of a string
  • -
  • Extended type annotation in objectify: new xsiannotate() function
  • -
  • EXSLT RegExp support in standard XPath (not only XSLT)
  • -
-
-
-

Bugs fixed

-
    -
  • Missing import in lxml.html.clean.
  • -
  • Some Python 2.4-isms prevented lxml from building/running under -Python 2.3.
  • -
  • XPath on ElementTrees could crash when selecting the virtual root -node of the ElementTree.
  • -
  • Compilation --without-threading was buggy in alpha5/6.
  • -
  • Memory leak in the parse() function.
  • -
  • Minor bugs in XSLT error message formatting.
  • -
  • Result document memory leak in target parser.
  • -
  • Target parser failed to report comments.
  • -
  • In the lxml.html iter_links method, links in <object> -tags weren't recognized. (Note: plugin-specific link parameters -still aren't recognized.) Also, the <embed> tag, though not -standard, is now included in lxml.html.defs.special_inline_tags.
  • -
  • Using custom resolvers on XSLT stylesheets parsed from a string -could request ill-formed URLs.
  • -
  • With lxml.doctestcompare if you do <tag xmlns="..."> in your -output, it will then be namespace-neutral (before the ellipsis was -treated as a real namespace).
  • -
  • AttributeError in feed parser on parse errors
  • -
  • XML feed parser setup problem
  • -
  • Type annotation for unicode strings in DataElement()
  • -
  • lxml failed to serialise namespace declarations of elements other than the -root node of a tree
  • -
  • Race condition in XSLT where the resolver context leaked between concurrent -XSLT calls
  • -
  • lxml.etree did not check tag/attribute names
  • -
  • The XML parser did not report undefined entities as error
  • -
  • The text in exceptions raised by XML parsers, validators and XPath -evaluators now reports the first error that occurred instead of the last
  • -
  • Passing '' as XPath namespace prefix did not raise an error
  • -
  • Thread safety in XPath evaluators
  • -
-
-
-

Other changes

-
    -
  • Exceptions carry only the part of the error log that is related to -the operation that caused the error.
  • -
  • XMLSchema() and RelaxNG() now enforce passing the source -file/filename through the file keyword argument.
  • -
  • The test suite now skips most doctests under Python 2.3.
  • -
  • make clean no longer removes the .c files (use make -realclean instead)
  • -
  • Minor performance tweaks for Element instantiation and subelement -creation
  • -
  • Various places in the XPath, XSLT and iteration APIs now require -keyword-only arguments.
  • -
  • The argument order in element.itersiblings() was changed to -match the order used in all other iteration methods. The second -argument ('preceding') is now a keyword-only argument.
  • -
  • The getiterator() method on Elements and ElementTrees was -reverted to return an iterator as it did in lxml 1.x. The ET API -specification allows it to return either a sequence or an iterator, -and it traditionally returned a sequence in ET and an iterator in -lxml. However, it is now deprecated in favour of the iter() -method, which should be used in new code wherever possible.
  • -
  • The 'pretty printed' serialisation of ElementTree objects now -inserts newlines at the root level between processing instructions, -comments and the root tag.
  • -
  • A 'pretty printed' serialisation is now terminated with a newline.
  • -
  • Second argument to lxml.etree.Extension() helper is no longer -required, third argument is now a keyword-only argument ns.
  • -
  • lxml.html.tostring takes an encoding argument.
  • -
  • The module source files were renamed to "lxml.*.pyx", such as -"lxml.etree.pyx". This was changed for consistency with the way -Pyrex commonly handles package imports. The main effect is that -classes now know about their fully qualified class name, including -the package name of their module.
  • -
  • Keyword-only arguments in some API functions, especially in the -parsers and serialisers.
  • -
  • Tag name validation in lxml.etree (and lxml.html) now distinguishes -between HTML tags and XML tags based on the parser that was used to -parse or create them. HTML tags no longer reject any non-ASCII -characters in tag names but only spaces and the special characters -<>&/"'.
  • -
  • lxml.etree now emits a warning if you use XPath with libxml2 2.6.27 -(which can crash on certain XPath errors)
  • -
  • Type annotation in objectify now preserves the already annotated type by -default to prevent losing type information that is already there.
  • -
  • element.getiterator() returns a list, use element.iter() to retrieve -an iterator (ElementTree 1.3 compatible behaviour)
  • -
  • objectify.PyType for None is now called "NoneType"
  • -
  • el.getiterator() renamed to el.iter(), following ElementTree 1.3 - -original name is still available as alias
  • -
  • In the public C-API, findOrBuildNodeNs() was replaced by the more -generic findOrBuildNodeNsPrefix
  • -
  • Major refactoring in XPath/XSLT extension function code
  • -
  • Network access in parsers disabled by default
  • -
-
-
-
-

1.3.6 (2007-10-29)

-
-

Bugs fixed

-
    -
  • Backported decref crash fix from 2.0
  • -
  • Well hidden free-while-in-use crash bug in ObjectPath
  • -
-
-
-

Other changes

-
    -
  • The test suites now run gc.collect() in the tearDown() -methods. While this makes them take a lot longer to run, it also -makes it easier to link a specific test to garbage collection -problems that would otherwise appear in later tests.
  • -
-
-
-
-

1.3.5 (2007-10-22)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • lxml.etree could crash when adding more than 10000 namespaces to a -document
  • -
  • lxml failed to serialise namespace declarations of elements other -than the root node of a tree
  • -
-
-
-
-

1.3.4 (2007-08-30)

-
-

Features added

-
    -
  • The ElementMaker in lxml.builder now accepts the keyword arguments -namespace and nsmap to set a namespace and nsmap for the Elements it -creates.
  • -
  • The docinfo on ElementTree objects has new properties internalDTD -and externalDTD that return a DTD object for the internal or external -subset of the document respectively.
  • -
  • Serialising an ElementTree now includes any internal DTD subsets that are -part of the document, as well as comments and PIs that are siblings of the -root node.
  • -
-
-
-

Bugs fixed

-
    -
  • Parsing with the no_network option could fail
  • -
-
-
-

Other changes

-
    -
  • lxml now raises a TagNameWarning about tag names containing ':' instead of -an Error as 1.3.3 did. The reason is that a number of projects currently -misuse the previous lack of tag name validation to generate namespace -prefixes without declaring namespaces. Apart from the danger of generating -broken XML this way, it also breaks most of the namespace-aware tools in -XML, including XPath, XSLT and validation. lxml 1.3.x will continue to -support this bug with a Warning, while lxml 2.0 will be strict about -well-formed tag names (not only regarding ':').
  • -
  • Serialising an Element no longer includes its comment and PI siblings (only -ElementTree serialisation includes them).
  • -
-
-
-
-

1.3.3 (2007-07-26)

-
-

Features added

-
    -
  • ElementTree compatible parser ETCompatXMLParser strips processing -instructions and comments while parsing XML
  • -
  • Parsers now support stripping PIs (keyword argument 'remove_pis')
  • -
  • etree.fromstring() now supports parsing both HTML and XML, depending on -the parser you pass.
  • -
  • Support base_url keyword argument in HTML() and XML()
  • -
-
-
-

Bugs fixed

-
    -
  • Parsing from Python Unicode strings failed on some platforms
  • -
  • Element() did not raise an exception on tag names containing ':'
  • -
  • Element.getiterator(tag) did not accept Comment and -ProcessingInstruction as tags. It also accepts Element now.
  • -
-
-
-
-

1.3.2 (2007-07-03)

-
-

Features added

-
-
-

Bugs fixed

-
    -
  • "deallocating None" crash bug
  • -
-
-
-
-

1.3.1 (2007-07-02)

-
-

Features added

-
    -
  • objectify.DataElement now supports setting values from existing data -elements (not just plain Python types) and reuses defined namespaces etc.
  • -
  • E-factory support for lxml.objectify (objectify.E)
  • -
-
-
-

Bugs fixed

-
    -
  • Better way to prevent crashes in Element proxy cleanup code
  • -
  • objectify.DataElement didn't set up None value correctly
  • -
  • objectify.DataElement didn't check the value against the provided type hints
  • -
  • Reference-counting bug in Element.attrib.pop()
  • -
-
-
-
-

1.3 (2007-06-24)

-
-

Features added

-
    -
  • Module lxml.pyclasslookup module implements an Element class lookup -scheme that can access the entire tree in read-only mode to help determining -a suitable Element class
  • -
  • Parsers take a remove_comments keyword argument that skips over comments
  • -
  • parse() function in objectify, corresponding to XML() etc.
  • -
  • Element.addnext(el) and Element.addprevious(el) methods to support -adding processing instructions and comments around the root node
  • -
  • Element.attrib was missing clear() and pop() methods
  • -
  • Extended type annotation in objectify: cleaner annotation namespace setup -plus new deannotate() function
  • -
  • Support for custom Element class instantiation in lxml.sax: passing a -makeelement function to the ElementTreeContentHandler will reuse the -lookup context of that function
  • -
  • '.' represents empty ObjectPath (identity)
  • -
  • Element.values() to accompany the existing .keys() and .items()
  • -
  • collectAttributes() C-function to build a list of attribute -keys/values/items for a libxml2 node
  • -
  • DTD validator class (like RelaxNG and XMLSchema)
  • -
  • HTML generator helpers by Fredrik Lundh in lxml.htmlbuilder
  • -
  • ElementMaker XML generator by Fredrik Lundh in lxml.builder.E
  • -
  • Support for pickling objectify.ObjectifiedElement objects to XML
  • -
  • update() method on Element.attrib
  • -
  • Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml -a better handling of namespaces when moving elements between documents.
  • -
-
-
-

Bugs fixed

-
    -
  • Removing Elements from a tree could make them lose their namespace -declarations
  • -
  • ElementInclude didn't honour base URL of original document
  • -
  • Replacing the children slice of an Element would cut off the tails of the -original children
  • -
  • Element.getiterator(tag) did not accept Comment and -ProcessingInstruction as tags
  • -
  • API functions now check incoming strings for XML conformity. Zero bytes or -low ASCII characters are no longer accepted (AssertionError).
  • -
  • XSLT parsing failed to pass resolver context on to imported documents
  • -
  • passing '' as namespace prefix in nsmap could be passed through to libxml2
  • -
  • Objectify couldn't handle prefixed XSD type names in xsi:type
  • -
  • More ET compatible behaviour when writing out XML declarations or not
  • -
  • More robust error handling in iterparse()
  • -
  • Documents lost their top-level PIs and comments on serialisation
  • -
  • lxml.sax failed on comments and PIs. Comments are now properly ignored and -PIs are copied.
  • -
  • Possible memory leaks in namespace handling when moving elements between -documents
  • -
-
-
-

Other changes

-
    -
  • major restructuring in the documentation
  • -
-
-
-
-

1.2.1 (2007-02-27)

-
-

Bugs fixed

-
    -
  • Build fixes for MS compiler
  • -
  • Item assignments to special names like element["text"] failed
  • -
  • Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier -to access
  • -
  • The pattern for attribute names in ObjectPath was too restrictive
  • -
-
-
-
-

1.2 (2007-02-20)

-
-

Features added

-
    -
  • Rich comparison of QName objects
  • -
  • Support for regular expressions in benchmark selection
  • -
  • get/set emulation (not .attrib!) for attributes on processing instructions
  • -
  • ElementInclude Python module for ElementTree compatible XInclude processing -that honours custom resolvers registered with the source document
  • -
  • ElementTree.parser property holds the parser used to parse the document
  • -
  • setup.py has been refactored for greater readability and flexibility
  • -
  • --rpath flag to setup.py to induce automatic linking-in of dynamic library -runtime search paths has been renamed to --auto-rpath. This makes it -possible to pass an --rpath directly to distutils; previously this was being -shadowed.
  • -
-
-
-

Bugs fixed

-
    -
  • Element instantiation now uses locks to prevent race conditions with threads
  • -
  • ElementTree.write() did not raise an exception when the file was not writable
  • -
  • Error handling could crash under Python <= 2.4.1 - fixed by disabling thread -support in these environments
  • -
  • Element.find*() did not accept QName objects as path
  • -
-
-
-

Other changes

-
    -
  • code cleanup: redundant _NodeBase super class merged into _Element class -Note: although the impact should be zero in most cases, this change breaks -the compatibility of the public C-API
  • -
-
-
-
-

1.1.2 (2006-10-30)

-
-

Features added

-
    -
  • Data elements in objectify support repr(), which is now used by dump()
  • -
  • Source distribution now ships with a patched Pyrex
  • -
  • New C-API function makeElement() to create new elements with text, -tail, attributes and namespaces
  • -
  • Reuse original parser flags for XInclude
  • -
  • Simplified support for handling XSLT processing instructions
  • -
-
-
-

Bugs fixed

-
    -
  • Parser resources were not freed before the next parser run
  • -
  • Open files and XML strings returned by Python resolvers were not -closed/freed
  • -
  • Crash in the IDDict returned by XMLDTDID
  • -
  • Copying Comments and ProcessingInstructions failed
  • -
  • Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()
  • -
  • Memory leak when garbage collecting tailed root elements
  • -
  • HTML script/style content was not propagated to .text
  • -
  • Show text xincluded between text nodes correctly in .text and .tail
  • -
  • 'integer * objectify.StringElement' operation was not supported
  • -
-
-
-
-

1.1.1 (2006-09-21)

-
-

Features added

-
    -
  • XSLT profiling support (profile_run keyword)
  • -
  • countchildren() method on objectify.ObjectifiedElement
  • -
  • Support custom elements for tree nodes in lxml.objectify
  • -
-
-
-

Bugs fixed

-
    -
  • lxml.objectify failed to support long data values (e.g., "123L")
  • -
  • Error messages from XSLT did not reach XSLT.error_log
  • -
  • Factories objectify.Element() and objectify.DataElement() were missing -attrib and nsmap keyword arguments
  • -
  • Changing the default parser in lxml.objectify did not update the factories -Element() and DataElement()
  • -
  • Let lxml.objectify.Element() always generate tree elements (not data -elements)
  • -
  • Build under Windows failed ('0' bug in patched Pyrex version)
  • -
-
-
-
-

1.1 (2006-09-13)

-
-

Features added

-
    -
  • Comments and processing instructions return '<!-- comment -->' and -'<?pi-target content?>' for repr()
  • -
  • Parsers are now the preferred (and default) place where element class lookup -schemes should be registered. Namespace lookup is no longer supported by -default.
  • -
  • Support for Python 2.5 beta
  • -
  • Unlock the GIL for deep copying documents and for XPath()
  • -
  • New compact keyword argument for parsing read-only documents
  • -
  • Support for parser options in iterparse()
  • -
  • The namespace axis is supported in XPath and returns (prefix, URI) -tuples
  • -
  • The XPath expression "/" now returns an empty list instead of raising an -exception
  • -
  • XML-Object API on top of lxml (lxml.objectify)
  • -
  • Customizable Element class lookup:
      -
    • different pre-implemented lookup mechanisms
    • -
    • support for externally provided lookup functions
    • -
    -
  • -
  • Support for processing instructions (ET-like, not compatible)
  • -
  • Public C-level API for independent extension modules
  • -
  • Module level iterwalk() function as 'iterparse' for trees
  • -
  • Module level iterparse() function similar to ElementTree (see -documentation for differences)
  • -
  • Element.nsmap property returns a mapping of all namespace prefixes known at -the Element to their namespace URI
  • -
  • Reentrant threading support in RelaxNG, XMLSchema and XSLT
  • -
  • Threading support in parsers and serializers:
      -
    • All in-memory operations (tostring, parse(StringIO), etc.) free the GIL
    • -
    • File operations (on file names) free the GIL
    • -
    • Reading from file-like objects frees the GIL and reacquires it for reading
    • -
    • Serialisation to file-like objects is single-threaded (high lock overhead)
    • -
    -
  • -
  • Element iteration over XPath axes:
      -
    • Element.iterdescendants() iterates over the descendants of an element
    • -
    • Element.iterancestors() iterates over the ancestors of an element (from -parent to parent)
    • -
    • Element.itersiblings() iterates over either the following or preceding -siblings of an element
    • -
    • Element.iterchildren() iterates over the children of an element in either -direction
    • -
    • All iterators support the tag keyword argument to restrict the -generated elements
    • -
    -
  • -
  • Element.getnext() and Element.getprevious() return the direct siblings of an -element
  • -
-
-
-

Bugs fixed

-
    -
  • filenames with local 8-bit encoding were not supported
  • -
  • 1.1beta did not compile under Python 2.3
  • -
  • ignore unknown 'pyval' attribute values in objectify
  • -
  • objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists
  • -
  • objectify.ObjectPath.setattr() failed to accept Elements and Lists
  • -
  • XPathSyntaxError now inherits from XPathError
  • -
  • Threading race conditions in RelaxNG and XMLSchema
  • -
  • Crash when mixing elements from XSLT results into other trees, concurrent -XSLT is only allowed when the stylesheet was parsed in the main thread
  • -
  • The EXSLT regexp:match function now works as defined (except for some -differences in the regular expression syntax)
  • -
  • Setting element.text to '' returned None on request, not the empty string
  • -
  • iterparse() could crash on long XML files
  • -
  • Creating documents no longer copies the parser for later URL resolving. For -performance reasons, only a reference is kept. Resolver updates on the -parser will now be reflected by documents that were parsed before the -change. Although this should rarely become visible, it is a behavioral -change from 1.0.
  • -
-
-
-
-

1.0.4 (2006-09-09)

-
-

Features added

-
    -
  • List-like Element.extend() method
  • -
-
-
-

Bugs fixed

-
    -
  • Crash in tail handling in Element.replace()
  • -
-
-
-
-

1.0.3 (2006-08-08)

-
-

Features added

-
    -
  • Element.replace(old, new) method to replace a subelement by another one
  • -
-
-
-

Bugs fixed

-
    -
  • Crash when mixing elements from XSLT results into other trees
  • -
  • Copying/deepcopying did not work for ElementTree objects
  • -
  • Setting an attribute to a non-string value did not raise an exception
  • -
  • Element.remove() deleted the tail text from the removed Element
  • -
-
-
-
-

1.0.2 (2006-06-27)

-
-

Features added

-
    -
  • Support for setting a custom default Element class as opposed to namespace -specific classes (which still override the default class)
  • -
-
-
-

Bugs fixed

-
    -
  • Rare exceptions in Python list functions were not handled
  • -
  • Parsing accepted unicode strings with XML encoding declaration in certain -cases
  • -
  • Parsing 8-bit encoded strings from StringIO objects raised an exception
  • -
  • Module function initThread() was removed - useless (and never worked)
  • -
  • XSLT and parser exception messages include the error line number
  • -
-
-
-
-

1.0.1 (2006-06-09)

-
-

Features added

-
    -
  • Repeated calls to Element.attrib now efficiently return the same instance
  • -
-
-
-

Bugs fixed

-
    -
  • Document deallocation could crash in certain garbage collection scenarios
  • -
  • Extension function calls in XSLT variable declarations could break the -stylesheet and crash on repeated calls
  • -
  • Deep copying Elements could lose namespaces declared in parents
  • -
  • Deep copying Elements did not copy tail
  • -
  • Parsing file(-like) objects failed to load external entities
  • -
  • Parsing 8-bit strings from file(-like) objects raised an exception
  • -
  • xsl:include failed when the stylesheet was parsed from a file-like object
  • -
  • lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()
  • -
  • MSVC compiler complained about long strings (supports only 2048 bytes)
  • -
-
-
-
-

1.0 (2006-06-01)

-
-

Features added

-
    -
  • Element.getiterator() and the findall() methods support finding arbitrary -elements from a namespace (pattern {namespace}*)
  • -
  • Another speedup in tree iteration code
  • -
  • General speedup of Python Element object creation and deallocation
  • -
  • Writing C14N no longer serializes in memory (reduced memory footprint)
  • -
  • PyErrorLog for error logging through the Python logging module
  • -
  • Element.getroottree() returns an ElementTree for the root node of the -document that contains the element.
  • -
  • ElementTree.getpath(element) returns a simple, absolute XPath expression to -find the element in the tree structure
  • -
  • Error logs have a last_error attribute for convenience
  • -
  • Comment texts can be changed through the API
  • -
  • Formatted output via pretty_print keyword in serialization functions
  • -
  • XSLT can block access to file system and network via XSLTAccessControl
  • -
  • ElementTree.write() no longer serializes in memory (reduced memory -footprint)
  • -
  • Speedup of Element.findall(tag) and Element.getiterator(tag)
  • -
  • Support for writing the XML representation of Elements and ElementTrees to -Python unicode strings via etree.tounicode()
  • -
  • Support for writing XSLT results to Python unicode strings via unicode()
  • -
  • Parsing a unicode string no longer copies the string (reduced memory -footprint)
  • -
  • Parsing file-like objects reads chunks rather than the whole file (reduced -memory footprint)
  • -
  • Parsing StringIO objects from the start avoids copying the string (reduced -memory footprint)
  • -
  • Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE -information, original encoding and XML version as seen by the parser
  • -
  • etree module can be compiled without libxslt by commenting out the line -include "xslt.pxi" near the end of the etree.pyx source file
  • -
  • Better error messages in parser exceptions
  • -
  • Error reporting also works in XSLT
  • -
  • Support for custom document loaders (URI resolvers) in parsers and XSLT, -resolvers are registered at parser level
  • -
  • Implementation of exslt:regexp for XSLT based on the Python 're' module, -enabled by default, can be switched off with 'regexp=False' keyword argument
  • -
  • Support for exslt extensions (libexslt) and libxslt extra functions -(node-set, document, write, output)
  • -
  • Substantial speedup in XPath.evaluate()
  • -
  • HTMLParser for parsing (broken) HTML
  • -
  • XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id -implementation of libxml2 (as opposed to ET compatible XMLID)
  • -
-
-
-

Bugs fixed

-
    -
  • Memory leak in Element.__setitem__
  • -
  • Memory leak in Element.attrib.items() and Element.attrib.values()
  • -
  • Memory leak in XPath extension functions
  • -
  • Memory leak in unicode related setup code
  • -
  • Element now raises ValueError on empty tag names
  • -
  • Namespace fixing after moving elements between documents could fail if the -source document was freed too early
  • -
  • Setting namespace-less tag names on namespaced elements ('{ns}t' -> 't') -didn't reset the namespace
  • -
  • Unknown constants from newer libxml2 versions could raise exceptions in the -error handlers
  • -
  • lxml.etree compiles much faster
  • -
  • On libxml2 <= 2.6.22, parsing strings with encoding declaration could fail -in certain cases
  • -
  • Document reference in ElementTree objects was not updated when the root -element was moved to a different document
  • -
  • Running absolute XPath expressions on an Element now evaluates against the -root tree
  • -
  • Evaluating absolute XPath expressions (/*) on an ElementTree could fail
  • -
  • Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree -objects
  • -
  • Removed public function initThreadLogging(), replaced by more general -initThread() which fixes a number of setup problems in threads
  • -
  • Memory leak when using iconv encoders in tostring/write
  • -
  • Deep copying Elements and ElementTrees maintains the document information
  • -
  • Serialization functions raise LookupError for unknown encodings
  • -
  • Memory deallocation crash resulting from deep copying elements
  • -
  • Some ElementTree methods could crash if the root node was not initialized -(neither file nor element passed to the constructor)
  • -
  • Element/SubElement failed to set attribute namespaces from passed attrib -dictionary
  • -
  • tostring() adds an XML declaration for non-ASCII encodings
  • -
  • tostring() failed to serialize encodings that contain 0-bytes
  • -
  • ElementTree.xpath() and XPathDocumentEvaluator were not using the -ElementTree root node as reference point
  • -
  • Calling document('') in XSLT failed to return the stylesheet
  • -
-
-
-
-

0.9.2 (2006-05-10)

-
-

Features added

-
    -
  • Speedup for Element.makeelement(): the new element reuses the original -libxml2 document instead of creating a new empty one
  • -
  • Speedup for reversed() iteration over element children (Py2.4+ only)
  • -
  • ElementTree compatible QName class
  • -
  • RelaxNG and XMLSchema accept any Element, not only ElementTrees
  • -
-
-
-

Bugs fixed

-
    -
  • str(xslt_result) was broken for XSLT output other than UTF-8
  • -
  • Memory leak if write_c14n fails to write the file after conversion
  • -
  • Crash in XMLSchema and RelaxNG when passing non-schema documents
  • -
  • Memory leak in RelaxNG() when RelaxNGParseError is raised
  • -
-
-
-
-

0.9.1 (2006-03-30)

-
-

Features added

-
    -
  • lxml.sax.ElementTreeContentHandler checks closing elements and raises -SaxError on mismatch
  • -
  • lxml.sax.ElementTreeContentHandler supports namespace-less SAX events -(startElement, endElement) and defaults to empty attributes (keyword -argument)
  • -
  • Speedup for repeatedly accessing element tag names
  • -
  • Minor API performance improvements
  • -
-
-
-

Bugs fixed

-
    -
  • Memory deallocation bug when using XSLT output method "html"
  • -
  • sax.py was handling UTF-8 encoded tag names where it shouldn't
  • -
  • lxml.tests package will no longer be installed (is still in source tar)
  • -
-
-
-
-

0.9 (2006-03-20)

-
-

Features added

-
    -
  • Error logging API for libxml2 error messages
  • -
  • Various performance improvements
  • -
  • Benchmark script for lxml, ElementTree and cElementTree
  • -
  • Support for registering extension functions through new FunctionNamespace -class (see doc/extensions.txt)
  • -
  • ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')
  • -
  • Support for variables in XPath expressions (also in XPath class)
  • -
  • XPath class for compiled XPath expressions
  • -
  • XMLID module level function (ElementTree compatible)
  • -
  • XMLParser API for customized libxml2 parser configuration
  • -
  • Support for custom Element classes through new Namespace API (see -doc/namespace_extensions.txt)
  • -
  • Common exception base class LxmlError for module exceptions
  • -
  • real iterator support in iter(Element), Element.getiterator()
  • -
  • XSLT objects are callable, result trees support str()
  • -
  • Added MANIFEST.in for easier creation of RPM files.
  • -
  • 'getparent' method on elements allows navigation to an element's -parent element.
  • -
  • Python core compatible SAX tree builder and SAX event generator. See -doc/sax.txt for more information.
  • -
-
-
-

Bugs fixed

-
    -
  • Segfaults and memory leaks in various API functions of Element
  • -
  • Segfault in XSLT.tostring()
  • -
  • ElementTree objects no longer interfere, Elements can be root of different -ElementTrees at the same time
  • -
  • document('') works in XSLT documents read from files (in-memory documents -cannot support this due to libxslt deficiencies)
  • -
-
-
-
-

0.8 (2005-11-03)

-
-

Features added

-
    -
  • Support for copy.deepcopy() on elements. copy.copy() works also, but -does the same thing, and does not create a shallow copy, as that -makes no sense in the context of libxml2 trees. This means a -potential incompatibility with ElementTree, but there's more chance -that it works than if copy.copy() isn't supported at all.
  • -
  • Increased compatibility with (c)ElementTree; .parse() on ElementTree is -supported and parsing of gzipped XML files works.
  • -
  • implemented index() on elements, allowing one to find the index of a -SubElement.
  • -
-
-
-

Bugs fixed

-
    -
  • Use xslt-config instead of xml2-config to find out libxml2 -directories to take into account a case where libxslt is installed -in a different directory than libxslt.
  • -
  • Eliminate crash condition in iteration when text nodes are changed.
  • -
  • Passing 'None' to tostring() does not result in a segfault anymore, -but an AssertionError.
  • -
  • Some test fixes for Windows.
  • -
  • Raise XMLSyntaxError and XPathSyntaxError instead of plain python -syntax errors. This should be less confusing.
  • -
  • Fixed error with uncaught exception in Pyrex code.
  • -
  • Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a -segfault.
  • -
  • has_key() works on attrib. 'in' tests also work correctly on attrib.
  • -
  • INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported -libxml2 version, as it should.
  • -
  • Passing a UTF-8 encoded string to the XML() function would fail; -fixed.
  • -
-
-
-
-

0.7 (2005-06-15)

-
-

Features added

-
    -
  • parameters (XPath expressions) can be passed to XSLT using keyword -parameters.
  • -
  • Simple XInclude support. Calling the xinclude() method on a tree -will process any XInclude statements in the document.
  • -
  • XMLSchema support. Use the XMLSchema class or the convenience -xmlschema() method on a tree to do XML Schema (XSD) validation.
  • -
  • Added convenience xslt() method on tree. This is less efficient -than the XSLT object, but makes it easier to write quick code.
  • -
  • Added convenience relaxng() method on tree. This is less efficient -than the RelaxNG object, but makes it easier to write quick code.
  • -
  • Make it possible to use XPathEvaluator with elements as well. The -XPathEvaluator in this case will retain the element so multiple -XPath queries can be made against one element efficiently. This -replaces the second argument to the .evaluate() method that existed -previously.
  • -
  • Allow registerNamespace() to be called on an XPathEvaluator, after -creation, to add additional namespaces. Also allow registerNamespaces(), -which does the same for a namespace dictionary.
  • -
  • Add 'prefix' attribute to element to be able to read prefix information. -This is entirely read-only.
  • -
  • It is possible to supply an extra nsmap keyword parameter to -the Element() and SubElement() constructors, which supplies a -prefix to namespace URI mapping. This will create namespace -prefix declarations on these elements and these prefixes will show up -in XML serialization.
  • -
-
-
-

Bugs fixed

-
    -
  • Killed yet another memory management related bug: trees created -using newDoc would not get a libxml2-level dictionary, which caused -problems when deallocating these documents later if they contained a -node that came from a document with a dictionary.
  • -
  • Moving namespaced elements between documents was problematic as -references to the original document would remain. This has been fixed -by applying xmlReconciliateNs() after each move operation.
  • -
  • Can pass None to 'dump()' without segfaults.
  • -
  • tostring() works properly for non-root elements as well.
  • -
  • Cleaned out the tostring() method so it should handle encoding -correctly.
  • -
  • Cleaned out the ElementTree.write() method so it should handle encoding -correctly. Writing directly to a file should also be faster, as there is no -need to go through a Python string in that case. Made sure the test cases -test both serializing to StringIO as well as serializing to a real file.
  • -
-
-
-
-

0.6 (2005-05-14)

-
-

Features added

-
    -
  • Changed setup.py so that library_dirs is also guessed. This should -help with compilation on the Mac OS X platform, where otherwise the -wrong library (shipping with the OS) could be picked up.
  • -
  • Tweaked setup.py so that it picks up the version from version.txt.
  • -
-
-
-

Bugs fixed

-
    -
  • Do the right thing when handling namespaced attributes.
  • -
  • fix bug where tostring() moved nodes into new documents. tostring() -had very nasty side-effects before this fix, sorry!
  • -
-
-
-
-

0.5.1 (2005-04-09)

-
    -
  • Python 2.2 compatibility fixes.
  • -
  • unicode fixes in Element() and Comment() as well as XML(); unicode -input wasn't properly being UTF-8 encoded.
  • -
-
-
-

0.5 (2005-04-08)

-

Initial public release.

-
-
- - - diff --git a/doc/html/compatibility.html b/doc/html/compatibility.html deleted file mode 100644 index 429b3cdf..00000000 --- a/doc/html/compatibility.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - -ElementTree compatibility of lxml.etree - - - -
-

ElementTree compatibility of lxml.etree

- -

A lot of care has been taken to ensure compatibility between etree and -ElementTree. Nonetheless, some differences and incompatibilities exist:

-
    -
  • Importing etree is obviously different; etree uses a lower-case -package name, while ElementTree uses a combination of upper-case and -lower case in imports:

    -
    # etree
    -from lxml.etree import Element
    -
    -# ElementTree
    -from elementtree.ElementTree import Element
    -
    -# ElementTree in the Python 2.5 standard library
    -from xml.etree.ElementTree import Element
    -
    -

    When switching over code from ElementTree to lxml.etree, and you're using -the package name prefix 'ElementTree', you can do the following:

    -
    # instead of
    -from elementtree import ElementTree
    -# use
    -from lxml import etree as ElementTree
    -
    -
  • -
  • lxml.etree offers a lot more functionality, such as XPath, XSLT, Relax NG, -and XML Schema support, which (c)ElementTree does not offer.

    -
  • -
  • etree has a different idea about Python unicode strings than ElementTree. -In most parts of the API, ElementTree uses plain strings and unicode strings -as what they are. This includes Element.text, Element.tail and many other -places. However, the ElementTree parsers assume by default that any string -(str or unicode) contains ASCII data. They raise an exception if -strings do not match the expected encoding.

    -

    etree has the same idea about plain strings (str) as ElementTree. For -unicode strings, however, etree assumes throughout the API that they are -Python unicode encoded strings rather than byte data. This includes the -parsers. It is therefore perfectly correct to pass XML unicode data into -the etree parsers in form of Python unicode strings. It is an error, on the -other hand, if unicode strings specify an encoding in their XML declaration, -as this conflicts with the characteristic encoding of Python unicode -strings.

    -
  • -
  • ElementTree allows you to place an Element in two different trees at the -same time. Thus, this:

    -
    a = Element('a')
    -b = SubElement(a, 'b')
    -c = Element('c')
    -c.append(b)
    -
    -

    will result in the following tree a:

    -
    <a><b /></a>
    -
    -

    and the following tree c:

    -
    <c><b /></c>
    -
    -

    In lxml, this behavior is different, because lxml is built on top of a tree -that maintains parent relationships for elements (like W3C DOM). This means -an element can only exist in a single tree at the same time. Adding an -element in some tree to another tree will cause this element to be moved.

    -

    So, for tree a we will get:

    -
    <a></a>
    -
    -

    and for tree c we will get:

    -
    <c><b/></c>
    -
    -

    Unfortunately this is a rather fundamental difference in behavior, which is -hard to change. It won't affect some applications, but if you want to port -code you must unfortunately make sure that it doesn't affect yours.

    -
  • -
  • etree allows navigation to the parent of a node by the getparent() -method and to the siblings by calling getnext() and getprevious(). -This is not possible in ElementTree as the underlying tree model does not -have this information.

    -
  • -
  • When trying to set a subelement using __setitem__ that is in fact not an -Element but some other object, etree raises a TypeError, and ElementTree -raises an AssertionError. This also applies to some other places of the -API. In general, etree tries to avoid AssertionErrors in favour of being -more specific about the reason for the exception.

    -
  • -
  • When parsing fails in iterparse(), ElementTree up to version -1.2.x raises a low-level ExpatError instead of a SyntaxError -as the other parsers. Both lxml and ElementTree 1.3 raise a -ParseError for parser errors.

    -
  • -
  • The iterparse() function in lxml is implemented based on the libxml2 -parser and tree generator. This means that modifications of the document -root or the ancestors of the current element during parsing can irritate the -parser and even segfault. While this is not a problem in the Python object -structure used by ElementTree, the C tree underlying lxml suffers from it. -The golden rule for iterparse() on lxml therefore is: do not touch -anything that will have to be touched again by the parser later on. See the -lxml parser documentation on this.

    -
  • -
  • ElementTree ignores comments and processing instructions when parsing XML, -while etree will read them in and treat them as Comment or -ProcessingInstruction elements respectively. This is especially visible -where comments are found inside text content, which is then split by the -Comment element.

    -

    You can disable this behaviour by passing the boolean remove_comments -and/or remove_pis keyword arguments to the parser you use. For -convenience and to support portable code, you can also use the -etree.ETCompatXMLParser instead of the default etree.XMLParser. It -tries to provide a default setup that is as close to the ElementTree parser -as possible.

    -
  • -
  • The TreeBuilder class of lxml.etree uses a different -signature for the start() method. It accepts an additional -argument nsmap to propagate the namespace declarations of an -element in addition to its own namespace. To assure compatibility -with ElementTree (which does not support this argument), lxml checks -if the method accepts 3 arguments before calling it, and otherwise -drops the namespace mapping. This should work with most existing -ElementTree code, although there may still be conflicting cases.

    -
  • -
  • ElementTree 1.2 has a bug when serializing an empty Comment (no text -argument given) to XML, etree serializes this successfully.

    -
  • -
  • ElementTree adds whitespace around comments on serialization, lxml does -not. This means that a comment text "text" that ElementTree serializes as -"<!-- text -->" will become "<!--text-->" in lxml.

    -
  • -
  • When the string '*' is used as tag filter in the Element.getiterator() -method, ElementTree returns all elements in the tree, including comments and -processing instructions. lxml.etree only returns real Elements, i.e. tree -nodes that have a string tag name. Without a filter, both libraries iterate -over all nodes.

    -

    Note that currently only lxml.etree supports passing the Element factory -function as filter to select only Elements. Both libraries support passing -the Comment and ProcessingInstruction factories to select the -respective tree nodes.

    -
  • -
  • ElementTree merges the target of a processing instruction into PI.text, -while lxml.etree puts it into the .target property and leaves it out of -the .text property. The pi.text in ElementTree therefore -correspondents to pi.target + " " + pi.text in lxml.etree.

    -
  • -
  • Because etree is built on top of libxml2, which is namespace prefix aware, -etree preserves namespaces declarations and prefixes while ElementTree tends -to come up with its own prefixes (ns0, ns1, etc). When no namespace prefix -is given, however, etree creates ElementTree style prefixes as well.

    -
  • -
  • etree has a 'prefix' attribute (read-only) on elements giving the Element's -prefix, if this is known, and None otherwise (in case of no namespace at -all, or default namespace).

    -
  • -
  • etree further allows passing an 'nsmap' dictionary to the Element and -SubElement element factories to explicitly map namespace prefixes to -namespace URIs. These will be translated into namespace declarations on -that element. This means that in the probably rare case that you need to -construct an attribute called 'nsmap', you need to be aware that unlike in -ElementTree, you cannot pass it as a keyword argument to the Element and -SubElement factories directly.

    -
  • -
  • ElementTree allows QName objects as attribute values and resolves their -prefix on serialisation (e.g. an attribute value QName("{myns}myname") -becomes "p:myname" if "p" is the namespace prefix of "myns"). lxml.etree -also allows you to set attribute values from QName instances (and also .text -values), but it resolves their prefix immediately and stores the plain text -value. So, if prefixes are modified later on, e.g. by moving a subtree to a -different tree (which reassigns the prefix mappings), the text values will -not be updated and you might end up with an undefined prefix.

    -
  • -
  • etree elements can be copied using copy.deepcopy() and copy.copy(), -just like ElementTree's. However, copy.copy() does not create a -shallow copy where elements are shared between trees, as this makes no sense -in the context of libxml2 trees. Note that lxml can deep-copy trees -considerably faster than ElementTree, so a deep copy might still be fast -enough to replace a shallow copy in your case.

    -
  • -
-
- - - \ No newline at end of file diff --git a/doc/html/credits.html b/doc/html/credits.html deleted file mode 100644 index 4f1bae51..00000000 --- a/doc/html/credits.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - -Credits - - - -
-

Credits

- -
-

Main contributors

-
-
Stefan Behnel
-
main developer and maintainer
-
Martijn Faassen
-
creator of lxml and initial main developer
-
Ian Bicking
-
creator and maintainer of lxml.html
-
Holger Joukl
-
ISO-Schematron support, development on lxml.objectify, bug reports, feedback
-
Simon Sapin
-
external maintenance and development of the cssselect package
-
Marc-Antoine Parent
-
XPath extension function help and patches
-
Olivier Grisel
-
improved (c)ElementTree compatibility patches, -website improvements.
-
Kasimier Buchcik
-
help with specs and libxml2
-
Florian Wagner
-
help with copy.deepcopy support, bug reporting
-
Emil Kroymann
-
help with encoding support, bug reporting
-
Paul Everitt
-
bug reporting, feedback on API design
-
Victor Ng
-
Discussions on memory management strategies, vlibxml2
-
Robert Kern
-
feedback on API design
-
Andreas Pakulat
-
rpath linking support, doc improvements
-
David Sankel
-
building statically on Windows
-
Marcin Kasperski
-
PDF documentation generation
-
Sidnei da Silva
-
official MS Windows builds
-
Pascal Oberndörfer
-
official Mac-OS builds
-
-

... and lots of other people who contributed to lxml by reporting -bugs, discussing its functionality or blaming the docs for the bugs in -their code. Thank you all, user feedback and discussions form a very -important part of an Open Source project!

-
-
-

Special thanks goes to:

-
    -
  • Daniel Veillard and the libxml2 project for a great XML library.
  • -
  • Fredrik Lundh for ElementTree, its API, and the competition through -cElementTree.
  • -
  • Greg Ewing (Pyrex) and Robert Bradshaw et al. (Cython) for the -binding technology.
  • -
  • Jonathan Stoppani for hosting the new mailing list on lxml.de.
  • -
  • the codespeak crew, in particular Philipp von Weitershausen and -Holger Krekel for originally hosting lxml on codespeak.net
  • -
-
-
- - - \ No newline at end of file diff --git a/doc/html/cssselect.html b/doc/html/cssselect.html deleted file mode 100644 index e923d22a..00000000 --- a/doc/html/cssselect.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - -lxml.cssselect - - - -
-

lxml.cssselect

- -

lxml supports a number of interesting languages for tree traversal and element -selection. The most important is obviously XPath, but there is also -ObjectPath in the lxml.objectify module. The newest child of this family -is CSS selection, which is made available in form of the lxml.cssselect -module.

-

Although it started its life in lxml, cssselect is now an independent project. -It translates CSS selectors to XPath 1.0 expressions that can be used with -lxml's XPath engine. lxml.cssselect adds a few convenience shortcuts into -that package.

-

To install cssselect, run

-
-pip install cssselect
-
-

lxml will then import and use it automatically.

- -
-

The CSSSelector class

-

The most important class in the lxml.cssselect module is CSSSelector. It -provides the same interface as the XPath class, but accepts a CSS selector -expression as input:

-
>>> from lxml.cssselect import CSSSelector
->>> sel = CSSSelector('div.content')
->>> sel  #doctest: +ELLIPSIS
-<CSSSelector ... for 'div.content'>
->>> sel.css
-'div.content'
-
-

The selector actually compiles to XPath, and you can see the -expression by inspecting the object:

-
>>> sel.path
-"descendant-or-self::div[@class and contains(concat(' ', normalize-space(@class), ' '), ' content ')]"
-
-

To use the selector, simply call it with a document or element -object:

-
>>> from lxml.etree import fromstring
->>> h = fromstring('''<div id="outer">
-...   <div id="inner" class="content body">
-...       text
-...   </div></div>''')
->>> [e.get('id') for e in sel(h)]
-['inner']
-
-

Using CSSSelector is equivalent to translating with cssselect -and using the XPath class:

-
>>> from cssselect import GenericTranslator
->>> from lxml.etree import XPath
->>> sel = XPath(GenericTranslator().css_to_xpath('div.content'))
-
-

CSSSelector takes a translator parameter to let you choose which -translator to use. It can be 'xml' (the default), 'xhtml', 'html' -or a Translator object.

-
-
-

The cssselect method

-

lxml Element objects have a cssselect convenience method.

-
>>> h.cssselect('div.content') == sel(h)
-True
-
-

Note however that pre-compiling the expression with the CSSSelector or -XPath class can provide a substantial speedup.

-

The method also accepts a translator parameter. On HtmlElement -objects, the default is changed to 'html'.

-
-
-

Supported Selectors

-

Most Level 3 selectors are supported. The details are in the -cssselect documentation.

-
-
-

Namespaces

-

In CSS you can use namespace-prefix|element, similar to -namespace-prefix:element in an XPath expression. In fact, it maps -one-to-one, and the same rules are used to map namespace prefixes to -namespace URIs: the CSSSelector class accepts a dictionary as its -namespaces argument.

-
-
- - - \ No newline at end of file diff --git a/doc/html/element_classes.html b/doc/html/element_classes.html deleted file mode 100644 index 8f2fdbb2..00000000 --- a/doc/html/element_classes.html +++ /dev/null @@ -1,532 +0,0 @@ - - - - - -Using custom Element classes in lxml - - - -
-

Using custom Element classes in lxml

- -

lxml has very sophisticated support for custom Element classes. You -can provide your own classes for Elements and have lxml use them by -default for all elements generated by a specific parser, only for a -specific tag name in a specific namespace or even for an exact element -at a specific position in the tree.

-

Custom Elements must inherit from the lxml.etree.ElementBase class, which -provides the Element interface for subclasses:

-
>>> from lxml import etree
-
->>> class honk(etree.ElementBase):
-...    @property
-...    def honking(self):
-...       return self.get('honking') == 'true'
-
-

This defines a new Element class honk with a property honking.

-

The following document describes how you can make lxml.etree use these -custom Element classes.

- -
-

Background on Element proxies

-

Being based on libxml2, lxml.etree holds the entire XML tree in a C -structure. To communicate with Python code, it creates Python proxy -objects for the XML elements on demand.

-
-proxies.png -
-

The mapping between C elements and Python Element classes is -completely configurable. When you ask lxml.etree for an Element by -using its API, it will instantiate your classes for you. All you have -to do is tell lxml which class to use for which kind of Element. This -is done through a class lookup scheme, as described in the sections -below.

-
-
-

Element initialization

-

There is one thing to know up front. Element classes must not have -an __init___ or __new__ method. There should not be any -internal state either, except for the data stored in the underlying -XML tree. Element instances are created and garbage collected at -need, so there is normally no way to predict when and how often a -proxy is created for them. Even worse, when the __init__ method -is called, the object is not even initialized yet to represent the XML -tag, so there is not much use in providing an __init__ method in -subclasses.

-

Most use cases will not require any class initialisation or proxy -state, so you can content yourself with skipping to the next section -for now. However, if you really need to set up your element class on -instantiation, or need a way to persistently store state in the proxy -instances instead of the XML tree, here is a way to do so.

-

There is one important guarantee regarding Element proxies. Once a -proxy has been instantiated, it will keep alive as long as there is a -Python reference to it, and any access to the XML element in the tree -will return this very instance. Therefore, if you need to store local -state in a custom Element class (which is generally discouraged), you -can do so by keeping the Elements in a tree alive. If the tree -doesn't change, you can simply do this:

-
proxy_cache = list(root.iter())
-
-

or

-
proxy_cache = set(root.iter())
-
-

or use any other suitable container. Note that you have to keep this -cache manually up to date if the tree changes, which can get tricky in -cases.

-

For proxy initialisation, ElementBase classes have an _init() -method that can be overridden, as oppose to the normal __init__() -method. It can be used to modify the XML tree, e.g. to construct -special children or verify and update attributes.

-

The semantics of _init() are as follows:

-
    -
  • It is called once on Element class instantiation time. That is, -when a Python representation of the element is created by lxml. At -that time, the element object is completely initialized to represent -a specific XML element within the tree.
  • -
  • The method has complete access to the XML tree. Modifications can be done -in exactly the same way as anywhere else in the program.
  • -
  • Python representations of elements may be created multiple times during the -lifetime of an XML element in the underlying C tree. The _init() code -provided by subclasses must take special care by itself that multiple -executions either are harmless or that they are prevented by some kind of -flag in the XML tree. The latter can be achieved by modifying an attribute -value or by removing or adding a specific child node and then verifying this -before running through the init process.
  • -
  • Any exceptions raised in _init() will be propagated through the API -call that lead to the creation of the Element. So be careful with the code -you write here as its exceptions may turn up in various unexpected places.
  • -
-
-
-

Setting up a class lookup scheme

-

The first thing to do when deploying custom element classes is to register a -class lookup scheme on a parser. lxml.etree provides quite a number of -different schemes that also support class lookup based on namespaces or -attribute values. Most lookups support fallback chaining, which allows the -next lookup mechanism to take over when the previous one fails to find a -class.

-

For example, setting the honk Element as a default element class -for a parser works as follows:

-
>>> parser_lookup = etree.ElementDefaultClassLookup(element=honk)
->>> parser = etree.XMLParser()
->>> parser.set_element_class_lookup(parser_lookup)
-
-

There is one drawback of the parser based scheme: the Element() factory -does not know about your specialised parser and creates a new document that -deploys the default parser:

-
>>> el = etree.Element("root")
->>> print(isinstance(el, honk))
-False
-
-

You should therefore avoid using this factory function in code that -uses custom classes. The makeelement() method of parsers provides -a simple replacement:

-
>>> el = parser.makeelement("root")
->>> print(isinstance(el, honk))
-True
-
-

If you use a parser at the module level, you can easily redirect a module -level Element() factory to the parser method by adding code like this:

-
>>> module_level_parser = etree.XMLParser()
->>> Element = module_level_parser.makeelement
-
-

While the XML() and HTML() factories also depend on the default -parser, you can pass them a different parser as second argument:

-
>>> element = etree.XML("<test/>")
->>> print(isinstance(element, honk))
-False
-
->>> element = etree.XML("<test/>", parser)
->>> print(isinstance(element, honk))
-True
-
-

Whenever you create a document with a parser, it will inherit the lookup -scheme and all subsequent element instantiations for this document will use -it:

-
>>> element = etree.fromstring("<test/>", parser)
->>> print(isinstance(element, honk))
-True
->>> el = etree.SubElement(element, "subel")
->>> print(isinstance(el, honk))
-True
-
-

For testing code in the Python interpreter and for small projects, you -may also consider setting a lookup scheme on the default parser. To -avoid interfering with other modules, however, it is usually a better -idea to use a dedicated parser for each module (or a parser pool when -using threads) and then register the required lookup scheme only for -this parser.

-
-

Default class lookup

-

This is the most simple lookup mechanism. It always returns the default -element class. Consequently, no further fallbacks are supported, but this -scheme is a nice fallback for other custom lookup mechanisms. Specifically, -it also handles comments and processing instructions, which are easy to -forget about when mapping proxies to classes.

-

Usage:

-
>>> lookup = etree.ElementDefaultClassLookup()
->>> parser = etree.XMLParser()
->>> parser.set_element_class_lookup(lookup)
-
-

Note that the default for new parsers is to use the global fallback, which is -also the default lookup (if not configured otherwise).

-

To change the default element implementation, you can pass your new class to -the constructor. While it accepts classes for element, comment and -pi nodes, most use cases will only override the element class:

-
>>> el = parser.makeelement("myelement")
->>> print(isinstance(el, honk))
-False
-
->>> lookup = etree.ElementDefaultClassLookup(element=honk)
->>> parser.set_element_class_lookup(lookup)
-
->>> el = parser.makeelement("myelement")
->>> print(isinstance(el, honk))
-True
->>> el.honking
-False
->>> el = parser.makeelement("myelement", honking='true')
->>> etree.tostring(el)
-b'<myelement honking="true"/>'
->>> el.honking
-True
-
->>> root = etree.fromstring(
-...     '<root honking="true"><!--comment--></root>', parser)
->>> root.honking
-True
->>> print(root[0].text)
-comment
-
-
-
-

Namespace class lookup

-

This is an advanced lookup mechanism that supports namespace/tag-name specific -element classes. You can select it by calling:

-
>>> lookup = etree.ElementNamespaceClassLookup()
->>> parser = etree.XMLParser()
->>> parser.set_element_class_lookup(lookup)
-
-

See the separate section on implementing namespaces below to learn how to -make use of it.

-

This scheme supports a fallback mechanism that is used in the case where the -namespace is not found or no class was registered for the element name. -Normally, the default class lookup is used here. To change it, pass the -desired fallback lookup scheme to the constructor:

-
>>> fallback = etree.ElementDefaultClassLookup(element=honk)
->>> lookup = etree.ElementNamespaceClassLookup(fallback)
->>> parser.set_element_class_lookup(lookup)
-
->>> root = etree.fromstring(
-...     '<root honking="true"><!--comment--></root>', parser)
->>> root.honking
-True
->>> print(root[0].text)
-comment
-
-
-
-

Attribute based lookup

-

This scheme uses a mapping from attribute values to classes. An attribute -name is set at initialisation time and is then used to find the corresponding -value in a dictionary. It is set up as follows:

-
>>> id_class_mapping = {'1234' : honk} # maps attribute values to classes
-
->>> lookup = etree.AttributeBasedElementClassLookup(
-...                                      'id', id_class_mapping)
->>> parser = etree.XMLParser()
->>> parser.set_element_class_lookup(lookup)
-
-

And here is how to use it:

-
>>> xml = '<a id="123"><b id="1234"/><b id="1234" honking="true"/></a>'
->>> a = etree.fromstring(xml, parser)
-
->>> a.honking       # id does not match !
-Traceback (most recent call last):
-AttributeError: 'lxml.etree._Element' object has no attribute 'honking'
-
->>> a[0].honking
-False
->>> a[1].honking
-True
-
-

This lookup scheme uses its fallback if the attribute is not found or -its value is not in the mapping. Normally, the default class lookup -is used here. If you want to use the namespace lookup, for example, -you can use this code:

-
>>> fallback = etree.ElementNamespaceClassLookup()
->>> lookup = etree.AttributeBasedElementClassLookup(
-...                       'id', id_class_mapping, fallback)
->>> parser = etree.XMLParser()
->>> parser.set_element_class_lookup(lookup)
-
-
-
-

Custom element class lookup

-

This is the most customisable way of finding element classes on a per-element -basis. It allows you to implement a custom lookup scheme in a subclass:

-
>>> class MyLookup(etree.CustomElementClassLookup):
-...     def lookup(self, node_type, document, namespace, name):
-...         if node_type == 'element':
-...             return honk  # be a bit more selective here ...
-...         else:
-...             return None  # pass on to (default) fallback
-
->>> parser = etree.XMLParser()
->>> parser.set_element_class_lookup(MyLookup())
-
->>> root = etree.fromstring(
-...     '<root honking="true"><!--comment--></root>', parser)
->>> root.honking
-True
->>> print(root[0].text)
-comment
-
-

The .lookup() method must return either None (which triggers the -fallback mechanism) or a subclass of lxml.etree.ElementBase. It -can take any decision it wants based on the node type (one of -"element", "comment", "PI", "entity"), the XML document of the -element, or its namespace or tag name.

-
-
-

Tree based element class lookup in Python

-

Taking more elaborate decisions than allowed by the custom scheme is -difficult to achieve in pure Python, as it results in a -chicken-and-egg problem. It would require access to the tree - before -the elements in the tree have been instantiated as Python Element -proxies.

-

Luckily, there is a way to do this. The PythonElementClassLookup -works similar to the custom lookup scheme:

-
>>> class MyLookup(etree.PythonElementClassLookup):
-...     def lookup(self, document, element):
-...         return MyElementClass # defined elsewhere
-
->>> parser = etree.XMLParser()
->>> parser.set_element_class_lookup(MyLookup())
-
-

As before, the first argument to the lookup() method is the opaque -document instance that contains the Element. The second arguments is a -lightweight Element proxy implementation that is only valid during the lookup. -Do not try to keep a reference to it. Once the lookup is finished, the proxy -will become invalid. You will get an AssertionError if you access any of -the properties or methods outside the scope of the lookup call where they were -instantiated.

-

During the lookup, the element object behaves mostly like a normal Element -instance. It provides the properties tag, text, tail etc. and -supports indexing, slicing and the getchildren(), getparent() -etc. methods. It does not support iteration, nor does it support any kind -of modification. All of its properties are read-only and it cannot be removed -or inserted into other trees. You can use it as a starting point to freely -traverse the tree and collect any kind of information that its elements -provide. Once you have taken the decision which class to use for this -element, you can simply return it and have lxml take care of cleaning up the -instantiated proxy classes.

-

Sidenote: this lookup scheme originally lived in a separate module called -lxml.pyclasslookup.

-
-
-
-

Generating XML with custom classes

-

Up to lxml 2.1, you could not instantiate proxy classes yourself. -Only lxml.etree could do that when creating an object representation -of an existing XML element. Since lxml 2.2, however, instantiating -this class will simply create a new Element:

-
>>> el = honk(honking='true')
->>> el.tag
-'honk'
->>> el.honking
-True
-
-

Note, however, that the proxy you create here will be garbage -collected just like any other proxy. You can therefore not count on -lxml.etree using the same class that you instantiated when you access -this Element a second time after letting its reference go. You should -therefore always use a corresponding class lookup scheme that returns -your Element proxy classes for the elements that they create. The -ElementNamespaceClassLookup is generally a good match.

-

You can use custom Element classes to quickly create XML fragments:

-
>>> class hale(etree.ElementBase): pass
->>> class bopp(etree.ElementBase): pass
-
->>> el = hale( "some ", honk(honking = 'true'), bopp, " text" )
-
->>> print(etree.tostring(el, encoding='unicode'))
-<hale>some <honk honking="true"/><bopp/> text</hale>
-
-
-
-

Implementing namespaces

-

lxml allows you to implement namespaces, in a rather literal sense. After -setting up the namespace class lookup mechanism as described above, you can -build a new element namespace (or retrieve an existing one) by calling the -get_namespace(uri) method of the lookup:

-
>>> lookup = etree.ElementNamespaceClassLookup()
->>> parser = etree.XMLParser()
->>> parser.set_element_class_lookup(lookup)
-
->>> namespace = lookup.get_namespace('http://hui.de/honk')
-
-

and then register the new element type with that namespace, say, under the tag -name honk:

-
>>> namespace['honk'] = honk
-
-

If you have many Element classes declared in one module, and they are -all named like the elements they create, you can simply use -namespace.update(globals()) at the end of your module to declare them -automatically. The implementation is smart enough to ignore -everything that is not an Element class.

-

After this, you create and use your XML elements through the normal API of -lxml:

-
>>> xml = '<honk xmlns="http://hui.de/honk" honking="true"/>'
->>> honk_element = etree.XML(xml, parser)
->>> print(honk_element.honking)
-True
-
-

The same works when creating elements by hand:

-
>>> honk_element = parser.makeelement('{http://hui.de/honk}honk',
-...                                   honking='true')
->>> print(honk_element.honking)
-True
-
-

Essentially, what this allows you to do, is to give Elements a custom API -based on their namespace and tag name.

-

A somewhat related topic are extension functions which use a similar -mechanism for registering Python functions for use in XPath and XSLT.

-

In the setup example above, we associated the honk Element class -only with the 'honk' element. If an XML tree contains different -elements in the same namespace, they do not pick up the same -implementation:

-
>>> xml = ('<honk xmlns="http://hui.de/honk" honking="true">'
-...        '<bla/><!--comment-->'
-...        '</honk>')
->>> honk_element = etree.XML(xml, parser)
->>> print(honk_element.honking)
-True
->>> print(honk_element[0].honking)
-Traceback (most recent call last):
-  ...
-AttributeError: 'lxml.etree._Element' object has no attribute 'honking'
->>> print(honk_element[1].text)
-comment
-
-

You can therefore provide one implementation per element name in each -namespace and have lxml select the right one on the fly. If you want one -element implementation per namespace (ignoring the element name) or prefer -having a common class for most elements except a few, you can specify a -default implementation for an entire namespace by registering that class with -the empty element name (None).

-

You may consider following an object oriented approach here. If you build a -class hierarchy of element classes, you can also implement a base class for a -namespace that is used if no specific element class is provided. Again, you -can just pass None as an element name:

-
>>> class HonkNSElement(etree.ElementBase):
-...    def honk(self):
-...       return "HONK"
->>> namespace[None] = HonkNSElement  # default Element for namespace
-
->>> class HonkElement(HonkNSElement):
-...    @property
-...    def honking(self):
-...       return self.get('honking') == 'true'
->>> namespace['honk'] = HonkElement  # Element for specific tag
-
-

Now you can rely on lxml to always return objects of type HonkNSElement or its -subclasses for elements of this namespace:

-
>>> xml = ('<honk xmlns="http://hui.de/honk" honking="true">'
-...        '<bla/><!--comment-->'
-...        '</honk>')
->>> honk_element = etree.fromstring(xml, parser)
-
->>> print(type(honk_element))
-<class 'HonkElement'>
->>> print(type(honk_element[0]))
-<class 'HonkNSElement'>
-
->>> print(honk_element.honking)
-True
->>> print(honk_element.honk())
-HONK
-
->>> print(honk_element[0].honk())
-HONK
->>> print(honk_element[0].honking)
-Traceback (most recent call last):
-...
-AttributeError: 'HonkNSElement' object has no attribute 'honking'
-
->>> print(honk_element[1].text)  # uses fallback for non-elements
-comment
-
-

Since lxml 4.1, the registration is more conveniently done with -class decorators. The namespace registry object is callable with -a name (or None) as argument and can then be used as decorator.

-
>>> honk_elements = lookup.get_namespace('http://hui.de/honk')
-
->>> @honk_elements(None)
-... class HonkNSElement(etree.ElementBase):
-...    def honk(self):
-...       return "HONK"
-
-

If the class has the same name as the tag, you can also leave out the call -and use the blank decorator instead:

-
-
->>> @honk_elements
-... class honkel(HonkNSElement):
-...    @property
-...    def honking(self):
-...       return self.get('honking') == 'true'
-
-
->>> xml = '<honkel xmlns="http://hui.de/honk" honking="true"><bla/><!--comment--></honkel>'
->>> honk_element = etree.fromstring(xml, parser)
-
-
->>> print(type(honk_element))
-<class 'honkel'>
->>> print(type(honk_element[0]))
-<class 'HonkNSElement'>
-
-
-
-
- - - \ No newline at end of file diff --git a/doc/html/elementsoup.html b/doc/html/elementsoup.html deleted file mode 100644 index 113e5b7c..00000000 --- a/doc/html/elementsoup.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - -BeautifulSoup Parser - - - -
-

BeautifulSoup Parser

- -

BeautifulSoup is a Python package for working with real-world and broken HTML, -just like lxml.html. As of version 4.x, it can use -different HTML parsers, -each of which has its advantages and disadvantages (see the link).

-

lxml can make use of BeautifulSoup as a parser backend, just like BeautifulSoup -can employ lxml as a parser. When using BeautifulSoup from lxml, however, the -default is to use Python's integrated HTML parser in the -html.parser module. -In order to make use of the HTML5 parser of -html5lib instead, it is better -to go directly through the html5parser module in -lxml.html.

-

A very nice feature of BeautifulSoup is its excellent support for encoding -detection which can provide better results for real-world HTML pages that -do not (correctly) declare their encoding.

-

lxml interfaces with BeautifulSoup through the lxml.html.soupparser -module. It provides three main functions: fromstring() and parse() -to parse a string or file using BeautifulSoup into an lxml.html -document, and convert_tree() to convert an existing BeautifulSoup -tree into a list of top-level Elements.

- -
-

Parsing with the soupparser

-

The functions fromstring() and parse() behave as known from -lxml. The first returns a root Element, the latter returns an -ElementTree.

-

There is also a legacy module called lxml.html.ElementSoup, which -mimics the interface provided by Fredrik Lundh's ElementSoup -module. Note that the soupparser module was added in lxml 2.0.3. -Previous versions of lxml 2.0.x only have the ElementSoup module.

-

Here is a document full of tag soup, similar to, but not quite like, HTML:

-
>>> tag_soup = '''
-... <meta/><head><title>Hello</head><body onload=crash()>Hi all<p>'''
-
-

All you need to do is pass it to the fromstring() function:

-
>>> from lxml.html.soupparser import fromstring
->>> root = fromstring(tag_soup)
-
-

To see what we have here, you can serialise it:

-
>>> from lxml.etree import tostring
->>> print(tostring(root, pretty_print=True).strip())
-<html>
-  <meta/>
-  <head>
-    <title>Hello</title>
-  </head>
-  <body onload="crash()">Hi all<p/></body>
-</html>
-
-

Not quite what you'd expect from an HTML page, but, well, it was broken -already, right? The parser did its best, and so now it's a tree.

-

To control how Element objects are created during the conversion -of the tree, you can pass a makeelement factory function to -parse() and fromstring(). By default, this is based on the -HTML parser defined in lxml.html.

-

For a quick comparison, libxml2 2.9.1 parses the same tag soup as -follows. The only difference is that libxml2 tries harder to adhere -to the structure of an HTML document and moves misplaced tags where -they (likely) belong. Note, however, that the result can vary between -parser versions.

-
<html>
-  <head>
-    <meta/>
-    <title>Hello</title>
-  </head>
-  <body onload="crash()">Hi all<p/></body>
-</html>
-
-
-
-

Entity handling

-

By default, the BeautifulSoup parser also replaces the entities it -finds by their character equivalent.

-
>>> tag_soup = '<body>&copy;&euro;&#45;&#245;&#445;<p>'
->>> body = fromstring(tag_soup).find('.//body')
->>> body.text
-u'\xa9\u20ac-\xf5\u01bd'
-
-

If you want them back on the way out, you can just serialise with the -default encoding, which is 'US-ASCII'.

-
>>> tostring(body)
-'<body>&#169;&#8364;-&#245;&#445;<p/></body>'
-
->>> tostring(body, method="html")
-'<body>&#169;&#8364;-&#245;&#445;<p></p></body>'
-
-

Any other encoding will output the respective byte sequences.

-
>>> tostring(body, encoding="utf-8")
-'<body>\xc2\xa9\xe2\x82\xac-\xc3\xb5\xc6\xbd<p/></body>'
-
->>> tostring(body, method="html", encoding="utf-8")
-'<body>\xc2\xa9\xe2\x82\xac-\xc3\xb5\xc6\xbd<p></p></body>'
-
->>> tostring(body, encoding='unicode')
-u'<body>\xa9\u20ac-\xf5\u01bd<p/></body>'
-
->>> tostring(body, method="html", encoding='unicode')
-u'<body>\xa9\u20ac-\xf5\u01bd<p></p></body>'
-
-
-
-

Using soupparser as a fallback

-

The downside of using this parser is that it is much slower than -the C implemented HTML parser of libxml2 that lxml uses. So if -performance matters, you might want to consider using soupparser -only as a fallback for certain cases.

-

One common problem of lxml's parser is that it might not get the -encoding right in cases where the document contains a <meta> tag -at the wrong place. In this case, you can exploit the fact that lxml -serialises much faster than most other HTML libraries for Python. -Just serialise the document to unicode and if that gives you an -exception, re-parse it with BeautifulSoup to see if that works -better.

-
>>> tag_soup = '''\
-... <meta http-equiv="Content-Type"
-...       content="text/html;charset=utf-8" />
-... <html>
-...   <head>
-...     <title>Hello W\xc3\xb6rld!</title>
-...   </head>
-...   <body>Hi all</body>
-... </html>'''
-
->>> import lxml.html
->>> import lxml.html.soupparser
-
->>> root = lxml.html.fromstring(tag_soup)
->>> try:
-...     ignore = tostring(root, encoding='unicode')
-... except UnicodeDecodeError:
-...     root = lxml.html.soupparser.fromstring(tag_soup)
-
-
-
-

Using only the encoding detection

-

Even if you prefer lxml's fast HTML parser, you can still benefit -from BeautifulSoup's support for encoding detection in the -UnicodeDammit class. Once it succeeds in decoding the data, -you can simply pass the resulting Unicode string into lxml's parser.

-
>>> try:
-...    from bs4 import UnicodeDammit             # BeautifulSoup 4
-...
-...    def decode_html(html_string):
-...        converted = UnicodeDammit(html_string)
-...        if not converted.unicode_markup:
-...            raise UnicodeDecodeError(
-...                "Failed to detect encoding, tried [%s]",
-...                ', '.join(converted.tried_encodings))
-...        # print converted.original_encoding
-...        return converted.unicode_markup
-...
-... except ImportError:
-...    from BeautifulSoup import UnicodeDammit   # BeautifulSoup 3
-...
-...    def decode_html(html_string):
-...        converted = UnicodeDammit(html_string, isHTML=True)
-...        if not converted.unicode:
-...            raise UnicodeDecodeError(
-...                "Failed to detect encoding, tried [%s]",
-...                ', '.join(converted.triedEncodings))
-...        # print converted.originalEncoding
-...        return converted.unicode
-
->>> root = lxml.html.fromstring(decode_html(tag_soup))
-
-
-
- - - \ No newline at end of file diff --git a/doc/html/extensions.html b/doc/html/extensions.html deleted file mode 100644 index 7d51d0c3..00000000 --- a/doc/html/extensions.html +++ /dev/null @@ -1,537 +0,0 @@ - - - - - -Python extensions for XPath and XSLT - - - -
-

Python extensions for XPath and XSLT

- -

This document describes how to use Python extension functions in XPath -and XSLT like this:

-
<xsl:value-of select="f:myPythonFunction(.//sometag)" />
-
-

and extension elements in XSLT as in the following example:

-
<xsl:template match="*">
-    <my:python-extension>
-        <some-content />
-    </my:python-extension>
-</xsl:template>
-
- -
-

XPath Extension functions

-

Here is how an extension function looks like. As the first argument, -it always receives a context object (see below). The other arguments -are provided by the respective call in the XPath expression, one in -the following examples. Any number of arguments is allowed:

-
>>> def hello(context, a):
-...    return "Hello %s" % a
->>> def ola(context, a):
-...    return "Ola %s" % a
->>> def loadsofargs(context, *args):
-...    return "Got %d arguments." % len(args)
-
-
-

The FunctionNamespace

-

In order to use a function in XPath or XSLT, it needs to have a -(namespaced) name by which it can be called during evaluation. This -is done using the FunctionNamespace class. For simplicity, we choose -the empty namespace (None):

-
>>> from lxml import etree
->>> ns = etree.FunctionNamespace(None)
->>> ns['hello'] = hello
->>> ns['countargs'] = loadsofargs
-
-

This registers the function hello with the name hello in the default -namespace (None), and the function loadsofargs with the name countargs.

-

Since lxml 4.1, it is preferred to use the FunctionNamespace as a decorator. -Either pass an explicit function name (@ns("countargs")), or just use the -bare decorator to register the function under its own name:

-
>>> @ns
-... def hello(context, a):
-...    return "Hello %s" % a
-
-

Now we're going to create a document that we can run XPath expressions -against:

-
>>> root = etree.XML('<a><b>Haegar</b></a>')
->>> doc = etree.ElementTree(root)
-
-

Done. Now we can have XPath expressions call our new function:

-
>>> print(root.xpath("hello('Dr. Falken')"))
-Hello Dr. Falken
->>> print(root.xpath('hello(local-name(*))'))
-Hello b
->>> print(root.xpath('hello(string(b))'))
-Hello Haegar
->>> print(root.xpath('countargs(., b, ./*)'))
-Got 3 arguments.
-
-

Note how we call both a Python function (hello()) and an XPath built-in -function (string()) in exactly the same way. Normally, however, you would -want to separate the two in different namespaces. The FunctionNamespace class -allows you to do this:

-
>>> ns = etree.FunctionNamespace('http://mydomain.org/myfunctions')
->>> ns['hello'] = hello
-
->>> prefixmap = {'f' : 'http://mydomain.org/myfunctions'}
->>> print(root.xpath('f:hello(local-name(*))', namespaces=prefixmap))
-Hello b
-
-
-
-

Global prefix assignment

-

In the last example, you had to specify a prefix for the function namespace. -If you always use the same prefix for a function namespace, you can also -register it with the namespace:

-
>>> ns = etree.FunctionNamespace('http://mydomain.org/myother/functions')
->>> ns.prefix = 'es'
->>> ns['hello'] = ola
-
->>> print(root.xpath('es:hello(local-name(*))'))
-Ola b
-
-

This is a global assignment, so take care not to assign the same prefix to -more than one namespace. The resulting behaviour in that case is completely -undefined. It is always a good idea to consistently use the same meaningful -prefix for each namespace throughout your application.

-

The prefix assignment only works with functions and FunctionNamespace objects, -not with the general Namespace object that registers element classes. The -reasoning is that elements in lxml do not care about prefixes anyway, so it -would rather complicate things than be of any help.

-
-
-

The XPath context

-

Functions get a context object as first parameter. In lxml 1.x, this value -was None, but since lxml 2.0 it provides two properties: eval_context and -context_node. The context node is the Element where the current function -is called:

-
>>> def print_tag(context, nodes):
-...     print("%s: %s" % (context.context_node.tag, [ n.tag for n in nodes ]))
-
->>> ns = etree.FunctionNamespace('http://mydomain.org/printtag')
->>> ns.prefix = "pt"
->>> ns["print_tag"] = print_tag
-
->>> ignore = root.xpath("//*[pt:print_tag(.//*)]")
-a: ['b']
-b: []
-
-

The eval_context is a dictionary that is local to the evaluation. It -allows functions to keep state:

-
>>> def print_context(context):
-...     context.eval_context[context.context_node.tag] = "done"
-...     print(sorted(context.eval_context.items()))
->>> ns["print_context"] = print_context
-
->>> ignore = root.xpath("//*[pt:print_context()]")
-[('a', 'done')]
-[('a', 'done'), ('b', 'done')]
-
-
-
-

Evaluators and XSLT

-

Extension functions work for all ways of evaluating XPath expressions and for -XSL transformations:

-
>>> e = etree.XPathEvaluator(doc)
->>> print(e('es:hello(local-name(/a))'))
-Ola a
-
->>> namespaces = {'f' : 'http://mydomain.org/myfunctions'}
->>> e = etree.XPathEvaluator(doc, namespaces=namespaces)
->>> print(e('f:hello(local-name(/a))'))
-Hello a
-
->>> xslt = etree.XSLT(etree.XML('''
-...   <stylesheet version="1.0"
-...          xmlns="http://www.w3.org/1999/XSL/Transform"
-...          xmlns:es="http://mydomain.org/myother/functions">
-...     <output method="text" encoding="ASCII"/>
-...     <template match="/">
-...       <value-of select="es:hello(string(//b))"/>
-...     </template>
-...   </stylesheet>
-... '''))
->>> print(xslt(doc))
-Ola Haegar
-
-

It is also possible to register namespaces with a single evaluator after its -creation. While the following example involves no functions, the idea should -still be clear:

-
>>> f = StringIO('<a xmlns="http://mydomain.org/myfunctions" />')
->>> ns_doc = etree.parse(f)
->>> e = etree.XPathEvaluator(ns_doc)
->>> e('/a')
-[]
-
-

This returns nothing, as we did not ask for the right namespace. When we -register the namespace with the evaluator, however, we can access it via a -prefix:

-
>>> e.register_namespace('foo', 'http://mydomain.org/myfunctions')
->>> e('/foo:a')[0].tag
-'{http://mydomain.org/myfunctions}a'
-
-

Note that this prefix mapping is only known to this evaluator, as opposed to -the global mapping of the FunctionNamespace objects:

-
>>> e2 = etree.XPathEvaluator(ns_doc)
->>> e2('/foo:a')
-Traceback (most recent call last):
-...
-lxml.etree.XPathEvalError: Undefined namespace prefix
-
-
-
-

Evaluator-local extensions

-

Apart from the global registration of extension functions, there is also a way -of making extensions known to a single Evaluator or XSLT. All evaluators and -the XSLT object accept a keyword argument extensions in their constructor. -The value is a dictionary mapping (namespace, name) tuples to functions:

-
>>> extensions = {('local-ns', 'local-hello') : hello}
->>> namespaces = {'l' : 'local-ns'}
-
->>> e = etree.XPathEvaluator(doc, namespaces=namespaces, extensions=extensions)
->>> print(e('l:local-hello(string(b))'))
-Hello Haegar
-
-

For larger numbers of extension functions, you can define classes or modules -and use the Extension helper:

-
>>> class MyExt:
-...     def function1(self, _, arg):
-...         return '1'+arg
-...     def function2(self, _, arg):
-...         return '2'+arg
-...     def function3(self, _, arg):
-...         return '3'+arg
-
->>> ext_module = MyExt()
->>> functions = ('function1', 'function2')
->>> extensions = etree.Extension( ext_module, functions, ns='local-ns' )
-
->>> e = etree.XPathEvaluator(doc, namespaces=namespaces, extensions=extensions)
->>> print(e('l:function1(string(b))'))
-1Haegar
-
-

The optional second argument to Extension can either be a -sequence of names to select from the module, a dictionary that -explicitly maps function names to their XPath alter-ego or None -(explicitly passed) to take all available functions under their -original name (if their name does not start with '_').

-

The additional ns keyword argument takes a namespace URI or -None (also if left out) for the default namespace. The following -examples will therefore all do the same thing:

-
>>> functions = ('function1', 'function2', 'function3')
->>> extensions = etree.Extension( ext_module, functions )
->>> e = etree.XPathEvaluator(doc, extensions=extensions)
->>> print(e('function1(function2(function3(string(b))))'))
-123Haegar
-
->>> extensions = etree.Extension( ext_module, functions, ns=None )
->>> e = etree.XPathEvaluator(doc, extensions=extensions)
->>> print(e('function1(function2(function3(string(b))))'))
-123Haegar
-
->>> extensions = etree.Extension(ext_module)
->>> e = etree.XPathEvaluator(doc, extensions=extensions)
->>> print(e('function1(function2(function3(string(b))))'))
-123Haegar
-
->>> functions = {
-...     'function1' : 'function1',
-...     'function2' : 'function2',
-...     'function3' : 'function3'
-...     }
->>> extensions = etree.Extension(ext_module, functions)
->>> e = etree.XPathEvaluator(doc, extensions=extensions)
->>> print(e('function1(function2(function3(string(b))))'))
-123Haegar
-
-

For convenience, you can also pass a sequence of extensions:

-
>>> extensions1 = etree.Extension(ext_module)
->>> extensions2 = etree.Extension(ext_module, ns='local-ns')
->>> e = etree.XPathEvaluator(doc, extensions=[extensions1, extensions2],
-...                          namespaces=namespaces)
->>> print(e('function1(l:function2(function3(string(b))))'))
-123Haegar
-
-
-
-

What to return from a function

-

Extension functions can return any data type for which there is an XPath -equivalent (see the documentation on XPath return values). This includes -numbers, boolean values, elements and lists of elements. Note that integers -will also be returned as floats:

-
>>> def returnsFloat(_):
-...    return 1.7
->>> def returnsInteger(_):
-...    return 1
->>> def returnsBool(_):
-...    return True
->>> def returnFirstNode(_, nodes):
-...    return nodes[0]
-
->>> ns = etree.FunctionNamespace(None)
->>> ns['float'] = returnsFloat
->>> ns['int']   = returnsInteger
->>> ns['bool']  = returnsBool
->>> ns['first'] = returnFirstNode
-
->>> e = etree.XPathEvaluator(doc)
->>> e("float()")
-1.7
->>> e("int()")
-1.0
->>> int( e("int()") )
-1
->>> e("bool()")
-True
->>> e("count(first(//b))")
-1.0
-
-

As the last example shows, you can pass the results of functions back into -the XPath expression. Elements and sequences of elements are treated as -XPath node-sets:

-
>>> def returnsNodeSet(_):
-...     results1 = etree.Element('results1')
-...     etree.SubElement(results1, 'result').text = "Alpha"
-...     etree.SubElement(results1, 'result').text = "Beta"
-...
-...     results2 = etree.Element('results2')
-...     etree.SubElement(results2, 'result').text = "Gamma"
-...     etree.SubElement(results2, 'result').text = "Delta"
-...
-...     results3 = etree.SubElement(results2, 'subresult')
-...     return [results1, results2, results3]
-
->>> ns['new-node-set'] = returnsNodeSet
-
->>> e = etree.XPathEvaluator(doc)
-
->>> r = e("new-node-set()/result")
->>> print([ t.text for t in r ])
-['Alpha', 'Beta', 'Gamma', 'Delta']
-
->>> r = e("new-node-set()")
->>> print([ t.tag for t in r ])
-['results1', 'results2', 'subresult']
->>> print([ len(t) for t in r ])
-[2, 3, 0]
->>> r[0][0].text
-'Alpha'
-
->>> etree.tostring(r[0])
-b'<results1><result>Alpha</result><result>Beta</result></results1>'
-
->>> etree.tostring(r[1])
-b'<results2><result>Gamma</result><result>Delta</result><subresult/></results2>'
-
->>> etree.tostring(r[2])
-b'<subresult/>'
-
-

The current implementation deep-copies newly created elements in node-sets. -Only the elements and their children are passed on, no outlying parents or -tail texts will be available in the result. This also means that in the above -example, the subresult elements in results2 and results3 are no longer -identical within the node-set, they belong to independent trees:

-
>>> print("%s - %s" % (r[1][-1].tag, r[2].tag))
-subresult - subresult
->>> print(r[1][-1] == r[2])
-False
->>> print(r[1][-1].getparent().tag)
-results2
->>> print(r[2].getparent())
-None
-
-

This is an implementation detail that you should be aware of, but you should -avoid relying on it in your code. Note that elements taken from the source -document (the most common case) do not suffer from this restriction. They -will always be passed unchanged.

-
-
-
-

XSLT extension elements

-

Just like the XPath extension functions described above, lxml supports -custom extension elements in XSLT. This means, you can write XSLT -code like this:

-
<xsl:template match="*">
-    <my:python-extension>
-        <some-content />
-    </my:python-extension>
-</xsl:template>
-
-

And then you can implement the element in Python like this:

-
>>> class MyExtElement(etree.XSLTExtension):
-...     def execute(self, context, self_node, input_node, output_parent):
-...         print("Hello from XSLT!")
-...         output_parent.text = "I did it!"
-...         # just copy own content input to output
-...         output_parent.extend( list(self_node) )
-
-

The arguments passed to the .execute() method are

-
-
context
-
The opaque evaluation context. You need this when calling back -into the XSLT processor.
-
self_node
-
A read-only Element object that represents the extension element -in the stylesheet.
-
input_node
-
The current context Element in the input document (also read-only).
-
output_parent
-
The current insertion point in the output document. You can -append elements or set the text value (not the tail). Apart from -that, the Element is read-only.
-
-
-

Declaring extension elements

-

In XSLT, extension elements can be used like any other XSLT element, -except that they must be declared as extensions using the standard -XSLT extension-element-prefixes option:

-
>>> xslt_ext_tree = etree.XML('''
-... <xsl:stylesheet version="1.0"
-...     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-...     xmlns:my="testns"
-...     extension-element-prefixes="my">
-...     <xsl:template match="/">
-...         <foo><my:ext><child>XYZ</child></my:ext></foo>
-...     </xsl:template>
-...     <xsl:template match="child">
-...         <CHILD>--xyz--</CHILD>
-...     </xsl:template>
-... </xsl:stylesheet>''')
-
-

To register the extension, add its namespace and name to the extension -mapping of the XSLT object:

-
>>> my_extension = MyExtElement()
->>> extensions = { ('testns', 'ext') : my_extension }
->>> transform = etree.XSLT(xslt_ext_tree, extensions = extensions)
-
-

Note how we pass an instance here, not the class of the extension. -Now we can run the transformation and see how our extension is -called:

-
>>> root = etree.XML('<dummy/>')
->>> result = transform(root)
-Hello from XSLT!
->>> str(result)
-'<?xml version="1.0"?>\n<foo>I did it!<child>XYZ</child></foo>\n'
-
-
-
-

Applying XSL templates

-

XSLT extensions are a very powerful feature that allows you to -interact directly with the XSLT processor. You have full read-only -access to the input document and the stylesheet, and you can even call -back into the XSLT processor to process templates. Here is an example -that passes an Element into the .apply_templates() method of the -XSLTExtension instance:

-
>>> class MyExtElement(etree.XSLTExtension):
-...     def execute(self, context, self_node, input_node, output_parent):
-...         child = self_node[0]
-...         results = self.apply_templates(context, child)
-...         output_parent.append(results[0])
-
->>> my_extension = MyExtElement()
->>> extensions = { ('testns', 'ext') : my_extension }
->>> transform = etree.XSLT(xslt_ext_tree, extensions = extensions)
-
->>> root = etree.XML('<dummy/>')
->>> result = transform(root)
->>> str(result)
-'<?xml version="1.0"?>\n<foo><CHILD>--xyz--</CHILD></foo>\n'
-
-

Here, we applied the templates to a child of the extension element -itself, i.e. to an element inside the stylesheet instead of an element -of the input document.

-

The return value of .apply_templates() is always a list. It may -contain a mix of elements and strings, collected from the XSLT processing -result. If you want to append these values to the output parent, be aware -that you cannot use the .append() method to add strings. In many -cases, you would only be interested in elements anyway, so you can discard -strings (e.g. formatting whitespace) and append the rest.

-

If you want to include string results in the output, you can either build -an appropriate tree yourself and append that, or you can manually add the -string values to the current output tree, e.g. by concatenating them with -the .tail of the last element that was appended.

-

Note that you can also let lxml build the result tree for you by passing -the output_parent into the .apply_templates() method. In this -case, the result will be None and all content found by applying templates -will be appended to the output parent.

-

If you do not care about string results at all, e.g. because you already -know that they will only contain whitespace, you can pass the option -elements_only=True to the .apply_templates() method, or pass -remove_blank_text=True to remove only those strings that consist -entirely of whitespace.

-
-
-

Working with read-only elements

-

There is one important thing to keep in mind: all Elements that the -execute() method gets to deal with are read-only Elements, so you -cannot modify them. They also will not easily work in the API. For -example, you cannot pass them to the tostring() function or wrap -them in an ElementTree.

-

What you can do, however, is to deepcopy them to make them normal -Elements, and then modify them using the normal etree API. So this -will work:

-
>>> from copy import deepcopy
->>> class MyExtElement(etree.XSLTExtension):
-...     def execute(self, context, self_node, input_node, output_parent):
-...         child = deepcopy(self_node[0])
-...         child.text = "NEW TEXT"
-...         output_parent.append(child)
-
->>> my_extension = MyExtElement()
->>> extensions = { ('testns', 'ext') : my_extension }
->>> transform = etree.XSLT(xslt_ext_tree, extensions = extensions)
-
->>> root = etree.XML('<dummy/>')
->>> result = transform(root)
->>> str(result)
-'<?xml version="1.0"?>\n<foo><child>NEW TEXT</child></foo>\n'
-
-
-
-
- - - \ No newline at end of file diff --git a/doc/html/html5parser.html b/doc/html/html5parser.html deleted file mode 100644 index d48c8490..00000000 --- a/doc/html/html5parser.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - -html5lib Parser - - - -
-

html5lib Parser

- -

html5lib is a Python package that implements the HTML5 parsing algorithm -which is heavily influenced by current browsers and based on the WHATWG -HTML5 specification.

-

lxml can benefit from the parsing capabilities of html5lib through -the lxml.html.html5parser module. It provides a similar interface -to the lxml.html module by providing fromstring(), -parse(), document_fromstring(), fragment_fromstring() and -fragments_fromstring() that work like the regular html parsing -functions.

-
-

Differences to regular HTML parsing

-

There are a few differences in the returned tree to the regular HTML -parsing functions from lxml.html. html5lib normalizes some elements -and element structures to a common format. For example even if a tables -does not have a tbody html5lib will inject one automatically:

-
>>> from lxml.html import tostring, html5parser
->>> tostring(html5parser.fromstring("<table><td>foo"))
-'<table><tbody><tr><td>foo</td></tr></tbody></table>'
-
-

Also the parameters the functions accept are different.

-
-
-

Function Reference

-
-
parse(filename_url_or_file):
-
Parses the named file or url, or if the object has a .read() -method, parses from that.
-
document_fromstring(html, guess_charset=True):
-

Parses a document from the given string. This always creates a -correct HTML document, which means the parent node is <html>, -and there is a body and possibly a head.

-

If a bytestring is passed and guess_charset is true the chardet -library (if installed) will guess the charset if ambiguities exist.

-
-
fragment_fromstring(string, create_parent=False, guess_charset=False):
-

Returns an HTML fragment from a string. The fragment must contain -just a single element, unless create_parent is given; -e.g., fragment_fromstring(string, create_parent='div') will -wrap the element in a <div>. If create_parent is true the -default parent tag (div) is used.

-

If a bytestring is passed and guess_charset is true the chardet -library (if installed) will guess the charset if ambiguities exist.

-
-
fragments_fromstring(string, no_leading_text=False, parser=None):
-

Returns a list of the elements found in the fragment. The first item in -the list may be a string. If no_leading_text is true, then it will -be an error if there is leading text, and it will always be a list of -only elements.

-

If a bytestring is passed and guess_charset is true the chardet -library (if installed) will guess the charset if ambiguities exist.

-
-
fromstring(string):
-
Returns document_fromstring or fragment_fromstring, based -on whether the string looks like a full document, or just a -fragment.
-
-

Additionally all parsing functions accept an parser keyword argument -that can be set to a custom parser instance. To create custom parsers -you can subclass the HTMLParser and XHTMLParser from the same -module. Note that these are the parser classes provided by html5lib.

-
-
- - - \ No newline at end of file diff --git a/doc/html/index.html b/doc/html/index.html deleted file mode 100644 index d937912e..00000000 --- a/doc/html/index.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - -lxml - Processing XML and HTML with Python - - - - - -
-

lxml - XML and HTML with Python

- - -

lxml is the most feature-rich -and easy-to-use library -for processing XML and HTML -in the Python language.

-
-

Introduction

-

The lxml XML toolkit is a Pythonic binding for the C libraries -libxml2 and libxslt. It is unique in that it combines the speed and -XML feature completeness of these libraries with the simplicity of a -native Python API, mostly compatible but superior to the well-known -ElementTree API. The latest release works with all CPython versions -from 2.6 to 3.6. See the introduction for more information about -background and goals of the lxml project. Some common questions are -answered in the FAQ.

-
-

Support the project

-

lxml has been downloaded from the Python Package Index -millions of times and is also available directly in many package -distributions, e.g. for Linux or MacOS-X.

-

Most people who use lxml do so because they like using it. -You can show us that you like it by blogging about your experience -with it and linking to the project website.

-

If you are using lxml for your work and feel like giving a bit of -your own benefit back to support the project, consider sending us -money through PayPal that we can use for fixing bugs in the software -and improving its features and documentation. Please read the Legal -Notice below, at the bottom of this page. Thank you for your support.

-

Donate to the lxml project

-

Please contact Stefan Behnel -for other ways to support the lxml project, -as well as commercial consulting, customisations and trainings on lxml and -fast Python XML processing.

-

Travis-CI and AppVeyor -support the lxml project with their build and CI servers. -Jetbrains supports the lxml project by donating free licenses of their -PyCharm IDE.

-
-
-
-

Documentation

-

The complete lxml documentation is available for download as PDF -documentation. The HTML documentation from this web site is part of -the normal source download.

- -

lxml.etree follows the ElementTree API as much as possible, building -it on top of the native libxml2 tree. If you are new to ElementTree, -start with the lxml.etree tutorial for XML processing. See also the -ElementTree compatibility overview and the ElementTree performance -page comparing lxml to the original ElementTree and cElementTree -implementations.

-

Right after the lxml.etree tutorial for XML processing and the -ElementTree documentation, the next place to look is the lxml.etree -specific API documentation. It describes how lxml extends the -ElementTree API to expose libxml2 and libxslt specific XML -functionality, such as XPath, Relax NG, XML Schema, XSLT, and -c14n. Python code can be called from XPath expressions and XSLT -stylesheets through the use of XPath extension functions. lxml -also offers a SAX compliant API, that works with the SAX support in -the standard library.

-

There is a separate module lxml.objectify that implements a data-binding -API on top of lxml.etree. See the objectify and etree FAQ entry for a -comparison.

-

In addition to the ElementTree API, lxml also features a sophisticated -API for custom XML element classes. This is a simple way to write -arbitrary XML driven APIs on top of lxml. lxml.etree also has a -C-level API that can be used to efficiently extend lxml.etree in -external C modules, including fast custom element class support.

-
-
-

Download

-

The best way to download lxml is to visit lxml at the Python Package -Index (PyPI). It has the source -that compiles on various platforms. The source distribution is signed -with this key.

-

The latest version is lxml 4.2.3, released 2018-06-27 -(changes for 4.2.3). Older versions -are listed below.

-

Please take a look at the -installation instructions !

-

This complete web site (including the generated API documentation) is -part of the source distribution, so if you want to download the -documentation for offline use, take the source archive and copy the -doc/html directory out of the source tree, or use the -PDF documentation.

-

The latest installable developer sources -are available from Github. It's also possible to check out -the latest development version of lxml from Github directly, using a command -like this (assuming you use hg and have hg-git installed):

-
-hg clone git+ssh://git@github.com/lxml/lxml.git lxml
-
-

Alternatively, if you use git, this should work as well:

-
-git clone https://github.com/lxml/lxml.git lxml
-
-

You can browse the source repository and its history through -the web. Please read how to build lxml from source -first. The latest CHANGES of the developer version are also -accessible. You can check there if a bug you found has been fixed -or a feature you want has been implemented in the latest trunk version.

-
-
-

Mailing list

-

Questions? Suggestions? Code to contribute? We have a mailing list.

-

You can search the archive with Gmane or Google.

-
-
-

Bug tracker

-

lxml uses the launchpad bug tracker. If you are sure you found a -bug in lxml, please file a bug report there. If you are not sure -whether some unexpected behaviour of lxml is a bug or not, please -check the documentation and ask on the mailing list first. Do not -forget to search the archive (e.g. with Gmane)!

-
-
-

License

-

The lxml library is shipped under a BSD license. libxml2 and libxslt2 -itself are shipped under the MIT license. There should therefore be no -obstacle to using lxml in your codebase.

-
-
-

Old Versions

-

See the websites of lxml -1.3, -2.0, -2.1, -2.2, -2.3, -3.0, -3.1, -3.2, -3.3, -3.4, -3.5, -3.6, -3.7, -3.8, -4.0 -4.1

- -
-
-

Docutils System Messages

-
-

System Message: ERROR/3 (./doc/main.txt, line 259); backlink

-Unknown target name: "changes for 4.2.1".
- -
-
- - - \ No newline at end of file diff --git a/doc/html/installation.html b/doc/html/installation.html deleted file mode 100644 index 19aa2c4e..00000000 --- a/doc/html/installation.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - -Installing lxml - - - -
-

Installing lxml

- - -
-

Where to get it

-

lxml is generally distributed through PyPI.

-

Most Linux platforms come with some version of lxml readily -packaged, usually named python-lxml for the Python 2.x version -and python3-lxml for Python 3.x. If you can use that version, -the quickest way to install lxml is to use the system package -manager, e.g. apt-get on Debian/Ubuntu:

-
-sudo apt-get install python3-lxml
-
-

For MacOS-X, a macport of lxml is available. -Try something like

-
-sudo port install py27-lxml
-
-

To install a newer version or to install lxml on other systems, -see below.

-
-
-

Requirements

-

You need Python 2.6 or later.

-

Unless you are using a static binary distribution (e.g. from a -Windows binary installer), lxml requires libxml2 and libxslt to -be installed, in particular:

-
    -
  • libxml2 version 2.7.0 or later.
      -
    • We recommend libxml2 2.9.2 or a later version.
    • -
    • If you want to use the feed parser interface, especially when -parsing from unicode strings, do not use libxml2 2.7.4 through -2.7.6.
    • -
    -
  • -
  • libxslt version 1.1.23 or later.
      -
    • We recommend libxslt 1.1.28 or later. Version 1.1.25 will not -work due to a missing library symbol.
    • -
    -
  • -
-

Newer versions generally contain fewer bugs and are therefore -recommended. XML Schema support is also still worked on in libxml2, -so newer versions will give you better compliance with the W3C spec.

-

To install the required development packages of these dependencies -on Linux systems, use your distribution specific installation tool, -e.g. apt-get on Debian/Ubuntu:

-
-sudo apt-get install libxml2-dev libxslt-dev python-dev
-
-

For Debian based systems, it should be enough to install the known -build dependencies of the provided lxml package, e.g.

-
-sudo apt-get build-dep python3-lxml
-
-
-
-

Installation

-

If your system does not provide binary packages or you want to install -a newer version, the best way is to get the pip package management tool -(or use a virtualenv) and -run the following:

-
-pip install lxml
-
-

If you are not using pip in a virtualenv and want to install lxml globally -instead, you have to run the above command as admin, e.g. on Linux:

-
-sudo pip install lxml
-
-

To install a specific version, either download the distribution -manually and let pip install that, or pass the desired version -to pip:

-
-pip install lxml==3.4.2
-
-

To speed up the build in test environments, e.g. on a continuous -integration server, disable the C compiler optimisations by setting -the CFLAGS environment variable:

-
-CFLAGS="-O0"  pip install lxml
-
-

(The option reads "minus Oh Zero", i.e. zero optimisations.)

-
-

MS Windows

-

For MS Windows, recent lxml releases feature community donated -binary distributions, although you might still want to take a look -at the related FAQ entry. -If you fail to build lxml on your MS Windows system from the signed -and tested sources that we release, consider using the binary builds -from PyPI or the unofficial Windows binaries -that Christoph Gohlke generously provides.

-
-
-

Linux

-

On Linux (and most other well-behaved operating systems), pip will -manage to build the source distribution as long as libxml2 and libxslt -are properly installed, including development packages, i.e. header files, -etc. See the requirements section above and use your system package -management tool to look for packages like libxml2-dev or -libxslt-devel. If the build fails, make sure they are installed.

-

Alternatively, setting STATIC_DEPS=true will download and build -both libraries automatically in their latest version, e.g. -STATIC_DEPS=true pip install lxml.

-
-
-

MacOS-X

-

On MacOS-X, use the following to build the source distribution, -and make sure you have a working Internet connection, as this will -download libxml2 and libxslt in order to build them:

-
-STATIC_DEPS=true sudo pip install lxml
-
-
-
-
-

Building lxml from dev sources

-

If you want to build lxml from the GitHub repository, you should read -how to build lxml from source (or the file doc/build.txt in the -source tree). Building from developer sources or from modified -distribution sources requires Cython to translate the lxml sources -into C code. The source distribution ships with pre-generated C -source files, so you do not need Cython installed to build from -release sources.

-

If you have read these instructions and still cannot manage to install lxml, -you can check the archives of the mailing list to see if your problem is -known or otherwise send a mail to the list.

-
-
-

Using lxml with python-libxml2

-

If you want to use lxml together with the official libxml2 Python -bindings (maybe because one of your dependencies uses it), you must -build lxml statically. Otherwise, the two packages will interfere in -places where the libxml2 library requires global configuration, which -can have any kind of effect from disappearing functionality to crashes -in either of the two.

-

To get a static build, either pass the --static-deps option to the -setup.py script, or run pip with the STATIC_DEPS or -STATICBUILD environment variable set to true, i.e.

-
-STATIC_DEPS=true pip install lxml
-
-

The STATICBUILD environment variable is handled equivalently to -the STATIC_DEPS variable, but is used by some other extension -packages, too.

-
-
-

Source builds on MS Windows

-

Most MS Windows systems lack the necessarily tools to build software, -starting with a C compiler already. Microsoft leaves it to users to -install and configure them, which is usually not trivial and means -that distributors cannot rely on these dependencies being available -on a given system. In a way, you get what you've paid for and make -others pay for it.

-

Due to the additional lack of package management of this platform, -it is best to link the library dependencies statically if you decide -to build from sources, rather than using a binary installer. For -that, lxml can use the binary distribution of libxml2 and libxslt, which it downloads -automatically during the static build. It needs both libxml2 and -libxslt, as well as iconv and zlib, which are available from the -same download site. Further build instructions are in the -source build documentation.

-
-
-

Source builds on MacOS-X

-

If you are not using macports or want to use a more recent lxml -release, you have to build it yourself. While the pre-installed system -libraries of libxml2 and libxslt are less outdated in recent MacOS-X -versions than they used to be, so lxml should work with them out of the -box, it is still recommended to use a static build with the most recent -library versions.

-

Luckily, lxml's setup.py script has built-in support for building -and integrating these libraries statically during the build. Please -read the -MacOS-X build instructions.

-
-
- - - \ No newline at end of file diff --git a/doc/html/intro.html b/doc/html/intro.html deleted file mode 100644 index 1790c13d..00000000 --- a/doc/html/intro.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - -Why lxml? - - - -
-

Why lxml?

- -
-

Contents

- -
-
-

Motto

-

"the thrills without the strangeness"

-

To explain the motto:

-

"Programming with libxml2 is like the thrilling embrace of an exotic stranger. -It seems to have the potential to fulfill your wildest dreams, but there's a -nagging voice somewhere in your head warning you that you're about to get -screwed in the worst way." (a quote by Mark Pilgrim)

-

Mark Pilgrim was describing in particular the experience a Python programmer -has when dealing with libxml2. The default Python bindings of libxml2 are -fast, thrilling, powerful, and your code might fail in some horrible way that -you really shouldn't have to worry about when writing Python code. lxml -combines the power of libxml2 with the ease of use of Python.

-
-
-

Aims

-

The C libraries libxml2 and libxslt have huge benefits:

-
    -
  • Standards-compliant XML support.
  • -
  • Support for (broken) HTML.
  • -
  • Full-featured.
  • -
  • Actively maintained by XML experts.
  • -
  • fast. fast! FAST!
  • -
-

These libraries already ship with Python bindings, but these Python bindings -mimic the C-level interface. This yields a number of problems:

-
    -
  • very low level and C-ish (not Pythonic).
  • -
  • underdocumented and huge, you get lost in them.
  • -
  • UTF-8 in API, instead of Python unicode strings.
  • -
  • Can easily cause segfaults from Python.
  • -
  • Require manual memory management!
  • -
-

lxml is a new Python binding for libxml2 and libxslt, completely independent -from these existing Python bindings. Its aims:

-
    -
  • Pythonic API.
  • -
  • Documented.
  • -
  • Use Python unicode strings in API.
  • -
  • Safe (no segfaults).
  • -
  • No manual memory management!
  • -
-

lxml aims to provide a Pythonic API by following as much as possible the -ElementTree API. We're trying to avoid inventing too many new APIs, or you -having to learn new things -- XML is complicated enough.

-
-
- - - \ No newline at end of file diff --git a/doc/html/lxml-source-howto.html b/doc/html/lxml-source-howto.html deleted file mode 100644 index 87de28b5..00000000 --- a/doc/html/lxml-source-howto.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - - -How to read the source of lxml - - - - - - -
-

How to read the source of lxml

- --- - - - -
Author:Stefan Behnel
-

This document describes how to read the source code of lxml and how -to start working on it. You might also be interested in the companion -document that describes how to build lxml from sources.

- -
-

What is Cython?

-

Cython is the language that lxml is written in. It is a very -Python-like language that was specifically designed for writing Python -extension modules.

-

The reason why Cython (or actually its predecessor Pyrex at the time) -was chosen as an implementation language for lxml, is that it makes it -very easy to interface with both the Python world and external C code. -Cython generates all the necessary glue code for the Python API, -including Python types, calling conventions and reference counting. -On the other side of the table, calling into C code is not more than -declaring the signature of the function and maybe some variables as -being C types, pointers or structs, and then calling it. The rest of -the code is just plain Python code.

-

The Cython language is so close to Python that the Cython compiler can -actually compile many, many Python programs to C without major -modifications. But the real speed gains of a C compilation come from -type annotations that were added to the language and that allow Cython -to generate very efficient C code.

-

Even if you are not familiar with Cython, you should keep in mind that -a slow implementation of a feature is better than none. So, if you -want to contribute and have an idea what code you want to write, feel -free to start with a pure Python implementation. Chances are, if you -get the change officially accepted and integrated, others will take -the time to optimise it so that it runs fast in Cython.

-
-
-

Where to start?

-

First of all, read how to build lxml from sources to learn how to -retrieve the source code from the GitHub repository and how to -build it. The source code lives in the subdirectory src of the -checkout.

-

The main extension modules in lxml are lxml.etree and -lxml.objectify. All main modules have the file extension -.pyx, which shows the descendence from Pyrex. As usual in Python, -the main files start with a short description and a couple of imports. -Cython distinguishes between the run-time import statement (as -known from Python) and the compile-time cimport statement, which -imports C declarations, either from external libraries or from other -Cython modules.

-
-

Concepts

-

lxml's tree API is based on proxy objects. That means, every Element -object (or rather _Element object) is a proxy for a libxml2 node -structure. The class declaration is (mainly):

-
-cdef class _Element:
-    cdef _Document _doc
-    cdef xmlNode* _c_node
-
-

It is a naming convention that C variables and C level class members -that are passed into libxml2 start with a prefixed c_ (commonly -libxml2 struct pointers), and that C level class members are prefixed -with an underscore. So you will often see names like c_doc for an -xmlDoc* variable (or c_node for an xmlNode*), or the above -_c_node for a class member that points to an xmlNode struct -(or _c_doc for an xmlDoc*).

-

It is important to know that every proxy in lxml has a factory -function that properly sets up C level members. Proxy objects must -never be instantiated outside of that factory. For example, to -instantiate an _Element object or its subclasses, you must always call -its factory function:

-
-cdef xmlNode* c_node
-cdef _Document doc
-cdef _Element element
-...
-element = _elementFactory(doc, c_node)
-
-

A good place to see how this factory is used are the Element methods -getparent(), getnext() and getprevious().

-
-
-

The documentation

-

An important part of lxml is the documentation that lives in the -doc directory. It describes a large part of the API and comprises -a lot of example code in the form of doctests.

-

The documentation is written in the ReStructured Text format, a -very powerful text markup language that looks almost like plain text. -It is part of the docutils package.

-

The project web site of lxml is completely generated from these text -documents. Even the side menu is just collected from the table of -contents that the ReST processor writes into each HTML page. -Obviously, we use lxml for this.

-

The easiest way to generate the HTML pages is by calling:

-
-make html
-
-

This will call the script doc/mkhtml.py to run the ReST processor -on the files. After generating an HTML page the script parses it back -in to build the side menu, and injects the complete menu into each -page at the very end.

-

Running the make command will also generate the API documentation -if you have epydoc installed. The epydoc package will import and -introspect the extension modules and also introspect and parse the -Python modules of lxml. The aggregated information will then be -written out into an HTML documentation site.

-
-
-
-

lxml.etree

-

The main module, lxml.etree, is in the file lxml.etree.pyx. It -implements the main functions and types of the ElementTree API, as -well as all the factory functions for proxies. It is the best place -to start if you want to find out how a specific feature is -implemented.

-

At the very end of the file, it contains a series of include -statements that merge the rest of the implementation into the -generated C code. Yes, you read right: no importing, no source file -namespacing, just plain good old include and a huge C code result of -more than 100,000 lines that we throw right into the C compiler.

-

The main include files are:

-
-
apihelpers.pxi
-
Private C helper functions. Except for the factory functions, -most of the little functions that are used all over the place are -defined here. This includes things like reading out the text -content of a libxml2 tree node, checking input from the API level, -creating a new Element node or handling attribute values. If you -want to work on the lxml code, you should keep these functions in -the back of your head, as they will definitely make your life -easier.
-
classlookup.pxi
-
Element class lookup mechanisms. The main API and engines for -those who want to define custom Element classes and inject them -into lxml.
-
docloader.pxi
-
Support for custom document loaders. Base class and registry for -custom document resolvers.
-
extensions.pxi
-
Infrastructure for extension functions in XPath/XSLT, including -XPath value conversion and function registration.
-
iterparse.pxi
-
Incremental XML parsing. An iterator class that builds iterparse -events while parsing.
-
nsclasses.pxi
-
Namespace implementation and registry. The registry and engine -for Element classes that use the ElementNamespaceClassLookup -scheme.
-
parser.pxi
-
Parsers for XML and HTML. This is the main parser engine. It's -the reason why you can parse a document from various sources in -two lines of Python code. It's definitely not the right place to -start reading lxml's source code.
-
parsertarget.pxi
-
An ElementTree compatible parser target implementation based on -the SAX2 interface of libxml2.
-
proxy.pxi
-
Very low-level functions for memory allocation/deallocation -and Element proxy handling. Ignoring this for the beginning -will safe your head from exploding.
-
public-api.pxi
-
The set of C functions that are exported to other extension -modules at the C level. For example, lxml.objectify makes use -of these. See the C-level API documentation.
-
readonlytree.pxi
-
A separate read-only implementation of the Element API. This is -used in places where non-intrusive access to a tree is required, -such as the PythonElementClassLookup or XSLT extension -elements.
-
saxparser.pxi
-
SAX-like parser interfaces as known from ElementTree's TreeBuilder.
-
serializer.pxi
-
XML output functions. Basically everything that creates byte -sequences from XML trees.
-
xinclude.pxi
-
XInclude support.
-
xmlerror.pxi
-

Error log handling. All error messages that libxml2 generates -internally walk through the code in this file to end up in lxml's -Python level error logs.

-

At the end of the file, you will find a long list of named error -codes. It is generated from the libxml2 HTML documentation (using -lxml, of course). See the script update-error-constants.py -for this.

-
-
xmlid.pxi
-
XMLID and IDDict, a dictionary-like way to find Elements by their -XML-ID attribute.
-
xpath.pxi
-
XPath evaluators.
-
xslt.pxi
-
XSL transformations, including the XSLT class, document lookup -handling and access control.
-
-

The different schema languages (DTD, RelaxNG, XML Schema and -Schematron) are implemented in the following include files:

-
    -
  • dtd.pxi
  • -
  • relaxng.pxi
  • -
  • schematron.pxi
  • -
  • xmlschema.pxi
  • -
-
-
-

Python modules

-

The lxml package also contains a number of pure Python modules:

-
-
builder.py
-
The E-factory and the ElementBuilder class. These provide a -simple interface to XML tree generation.
-
cssselect.py
-
A CSS selector implementation based on XPath. The main class is -called CSSSelector.
-
doctestcompare.py
-
A relaxed comparison scheme for XML/HTML markup in doctest.
-
ElementInclude.py
-
XInclude-like document inclusion, compatible with ElementTree.
-
_elementpath.py
-
XPath-like path language, compatible with ElementTree.
-
sax.py
-
SAX2 compatible interfaces to copy lxml trees from/to SAX compatible -tools.
-
usedoctest.py
-
Wrapper module for doctestcompare.py that simplifies its usage -from inside a doctest.
-
-
-
-

lxml.objectify

-

A Cython implemented extension module that uses the public C-API of -lxml.etree. It provides a Python object-like interface to XML trees. -The implementation resides in the file lxml.objectify.pyx.

-
-
-

lxml.html

-

A specialised toolkit for HTML handling, based on lxml.etree. This is -implemented in pure Python.

-
-
- - - \ No newline at end of file diff --git a/doc/html/lxmlhtml.html b/doc/html/lxmlhtml.html deleted file mode 100644 index c7eff9d7..00000000 --- a/doc/html/lxmlhtml.html +++ /dev/null @@ -1,703 +0,0 @@ - - - - - -lxml.html - - - - -
-

lxml.html

- --- - - - -
Author:Ian Bicking
-

Since version 2.0, lxml comes with a dedicated Python package for -dealing with HTML: lxml.html. It is based on lxml's HTML parser, -but provides a special Element API for HTML elements, as well as a -number of utilities for common HTML processing tasks.

- -

The main API is based on the lxml.etree API, and thus, on the ElementTree -API.

-
-

Parsing HTML

-
-

Parsing HTML fragments

-

There are several functions available to parse HTML:

-
-
parse(filename_url_or_file):
-

Parses the named file or url, or if the object has a .read() -method, parses from that.

-

If you give a URL, or if the object has a .geturl() method (as -file-like objects from urllib.urlopen() have), then that URL -is used as the base URL. You can also provide an explicit -base_url keyword argument.

-
-
document_fromstring(string):
-
Parses a document from the given string. This always creates a -correct HTML document, which means the parent node is <html>, -and there is a body and possibly a head.
-
fragment_fromstring(string, create_parent=False):
-
Returns an HTML fragment from a string. The fragment must contain -just a single element, unless create_parent is given; -e.g., fragment_fromstring(string, create_parent='div') will -wrap the element in a <div>.
-
fragments_fromstring(string):
-
Returns a list of the elements found in the fragment.
-
fromstring(string):
-
Returns document_fromstring or fragment_fromstring, based -on whether the string looks like a full document, or just a -fragment.
-
-
-
-

Really broken pages

-

The normal HTML parser is capable of handling broken HTML, but for -pages that are far enough from HTML to call them 'tag soup', it may -still fail to parse the page in a useful way. A way to deal with this -is ElementSoup, which deploys the well-known BeautifulSoup parser to -build an lxml HTML tree.

-

However, note that the most common problem with web pages is the lack -of (or the existence of incorrect) encoding declarations. It is -therefore often sufficient to only use the encoding detection of -BeautifulSoup, called UnicodeDammit, and to leave the rest to lxml's -own HTML parser, which is several times faster.

-
-
-
-

HTML Element Methods

-

HTML elements have all the methods that come with ElementTree, but -also include some extra methods:

-
-
.drop_tree():
-
Drops the element and all its children. Unlike -el.getparent().remove(el) this does not remove the tail -text; with drop_tree the tail text is merged with the previous -element.
-
.drop_tag():
-
Drops the tag, but keeps its children and text.
-
.find_class(class_name):
-
Returns a list of all the elements with the given CSS class name. -Note that class names are space separated in HTML, so -doc.find_class_name('highlight') will find an element like -<div class="sidebar highlight">. Class names are case -sensitive.
-
.find_rel_links(rel):
-
Returns a list of all the <a rel="{rel}"> elements. E.g., -doc.find_rel_links('tag') returns all the links marked as -tags.
-
.get_element_by_id(id, default=None):
-
Return the element with the given id, or the default if -none is found. If there are multiple elements with the same id -(which there shouldn't be, but there often is), this returns only -the first.
-
.text_content():
-
Returns the text content of the element, including the text -content of its children, with no markup.
-
.cssselect(expr):
-
Select elements from this element and its children, using a CSS -selector expression. (Note that .xpath(expr) is also -available as on all lxml elements.)
-
.label:
-
Returns the corresponding <label> element for this element, if -any exists (None if there is none). Label elements have a -label.for_element attribute that points back to the element.
-
.base_url:
-
The base URL for this element, if one was saved from the parsing. -This attribute is not settable. Is None when no base URL was -saved.
-
.classes:
-
Returns a set-like object that allows accessing and modifying the -names in the 'class' attribute of the element. (New in lxml 3.5).
-
.set(key, value=None):
-
Sets an HTML attribute. If no value is given, or if the value is -None, it creates a boolean attribute like <form novalidate></form> -or <div custom-attribute></div>. In XML, attributes must -have at least the empty string as their value like <form -novalidate=""></form>, but HTML boolean attributes can also be -just present or absent from an element without having a value.
-
-
-
-

Running HTML doctests

-

One of the interesting modules in the lxml.html package deals with -doctests. It can be hard to compare two HTML pages for equality, as -whitespace differences aren't meaningful and the structural formatting -can differ. This is even more a problem in doctests, where output is -tested for equality and small differences in whitespace or the order -of attributes can let a test fail. And given the verbosity of -tag-based languages, it may take more than a quick look to find the -actual differences in the doctest output.

-

Luckily, lxml provides the lxml.doctestcompare module that -supports relaxed comparison of XML and HTML pages and provides a -readable diff in the output when a test fails. The HTML comparison is -most easily used by importing the usedoctest module in a doctest:

-
>>> import lxml.html.usedoctest
-
-

Now, if you have an HTML document and want to compare it to an expected result -document in a doctest, you can do the following:

-
>>> import lxml.html
->>> html = lxml.html.fromstring('''\
-...    <html><body onload="" color="white">
-...      <p>Hi  !</p>
-...    </body></html>
-... ''')
-
->>> print lxml.html.tostring(html)
-<html><body onload="" color="white"><p>Hi !</p></body></html>
-
->>> print lxml.html.tostring(html)
-<html> <body color="white" onload=""> <p>Hi    !</p> </body> </html>
-
->>> print lxml.html.tostring(html)
-<html>
-  <body color="white" onload="">
-    <p>Hi !</p>
-  </body>
-</html>
-
-

In documentation, you would likely prefer the pretty printed HTML output, as -it is the most readable. However, the three documents are equivalent from the -point of view of an HTML tool, so the doctest will silently accept any of the -above. This allows you to concentrate on readability in your doctests, even -if the real output is a straight ugly HTML one-liner.

-

Note that there is also an lxml.usedoctest module which you can -import for XML comparisons. The HTML parser notably ignores -namespaces and some other XMLisms.

-
-
-

Creating HTML with the E-factory

-

lxml.html comes with a predefined HTML vocabulary for the E-factory, -originally written by Fredrik Lundh. This allows you to quickly generate HTML -pages and fragments:

-
>>> from lxml.html import builder as E
->>> from lxml.html import usedoctest
->>> html = E.HTML(
-...   E.HEAD(
-...     E.LINK(rel="stylesheet", href="great.css", type="text/css"),
-...     E.TITLE("Best Page Ever")
-...   ),
-...   E.BODY(
-...     E.H1(E.CLASS("heading"), "Top News"),
-...     E.P("World News only on this page", style="font-size: 200%"),
-...     "Ah, and here's some more text, by the way.",
-...     lxml.html.fromstring("<p>... and this is a parsed fragment ...</p>")
-...   )
-... )
-
->>> print lxml.html.tostring(html)
-<html>
-  <head>
-    <link href="great.css" rel="stylesheet" type="text/css">
-    <title>Best Page Ever</title>
-  </head>
-  <body>
-    <h1 class="heading">Top News</h1>
-    <p style="font-size: 200%">World News only on this page</p>
-    Ah, and here's some more text, by the way.
-    <p>... and this is a parsed fragment ...</p>
-  </body>
-</html>
-
-

Note that you should use lxml.html.tostring and not -lxml.tostring. lxml.tostring(doc) will return the XML -representation of the document, which is not valid HTML. In -particular, things like <script src="..."></script> will be -serialized as <script src="..." />, which completely confuses -browsers.

-
-

Viewing your HTML

-

A handy method for viewing your HTML: -lxml.html.open_in_browser(lxml_doc) will write the document to -disk and open it in a browser (with the webbrowser module).

-
-
- -
-

Forms

-

Any <form> elements in a document are available through -the list doc.forms (e.g., doc.forms[0]). Form, input, select, -and textarea elements each have special methods.

-

Input elements (including <select> and <textarea>) have these -attributes:

-
-
.name:
-
The name of the element.
-
.value:
-

The value of an input, the content of a textarea, the selected -option(s) of a select. This attribute can be set.

-

In the case of a select that takes multiple options (<select -multiple>) this will be a set of the selected options; you can -add or remove items to select and unselect the options.

-
-
-

Select attributes:

-
-
.value_options:
-
For select elements, this is all the possible values (the values -of all the options).
-
.multiple:
-
For select elements, true if this is a <select multiple> -element.
-
-

Input attributes:

-
-
.type:
-
The type attribute in <input> elements.
-
.checkable:
-
True if this can be checked (i.e., true for type=radio and -type=checkbox).
-
.checked:
-
If this element is checkable, the checked state. Raises -AttributeError on non-checkable inputs.
-
-

The form itself has these attributes:

-
-
.inputs:
-
A dictionary-like object that can be used to access input elements -by name. When there are multiple input elements with the same -name, this returns list-like structures that can also be used to -access the options and their values as a group.
-
.fields:
-

A dictionary-like object used to access values by their name. -form.inputs returns elements, this only returns values. -Setting values in this dictionary will effect the form inputs. -Basically form.fields[x] is equivalent to -form.inputs[x].value and form.fields[x] = y is equivalent -to form.inputs[x].value = y. (Note that sometimes -form.inputs[x] returns a compound object, but these objects -also have .value attributes.)

-

If you set this attribute, it is equivalent to -form.fields.clear(); form.fields.update(new_value)

-
-
.form_values():
-
Returns a list of [(name, value), ...], suitable to be passed -to urllib.urlencode() for form submission.
-
.action:
-
The action attribute. This is resolved to an absolute URL if -possible.
-
.method:
-
The method attribute, which defaults to GET.
-
-
-

Form Filling Example

-

Note that you can change any of these attributes (values, method, -action, etc) and then serialize the form to see the updated values. -You can, for instance, do:

-
>>> from lxml.html import fromstring, tostring
->>> form_page = fromstring('''<html><body><form>
-...   Your name: <input type="text" name="name"> <br>
-...   Your phone: <input type="text" name="phone"> <br>
-...   Your favorite pets: <br>
-...   Dogs: <input type="checkbox" name="interest" value="dogs"> <br>
-...   Cats: <input type="checkbox" name="interest" value="cats"> <br>
-...   Llamas: <input type="checkbox" name="interest" value="llamas"> <br>
-...   <input type="submit"></form></body></html>''')
->>> form = form_page.forms[0]
->>> form.fields = dict(
-...     name='John Smith',
-...     phone='555-555-3949',
-...     interest=set(['cats', 'llamas']))
->>> print tostring(form)
-<html>
-  <body>
-    <form>
-    Your name:
-      <input name="name" type="text" value="John Smith">
-      <br>Your phone:
-      <input name="phone" type="text" value="555-555-3949">
-      <br>Your favorite pets:
-      <br>Dogs:
-      <input name="interest" type="checkbox" value="dogs">
-      <br>Cats:
-      <input checked name="interest" type="checkbox" value="cats">
-      <br>Llamas:
-      <input checked name="interest" type="checkbox" value="llamas">
-      <br>
-      <input type="submit">
-    </form>
-  </body>
-</html>
-
-
-
-

Form Submission

-

You can submit a form with lxml.html.submit_form(form_element). -This will return a file-like object (the result of -urllib.urlopen()).

-

If you have extra input values you want to pass you can use the -keyword argument extra_values, like extra_values={'submit': -'Yes!'}. This is the only way to get submit values into the form, -as there is no state of "submitted" for these elements.

-

You can pass in an alternate opener with the open_http keyword -argument, which is a function with the signature open_http(method, -url, values).

-

Example:

-
>>> from lxml.html import parse, submit_form
->>> page = parse('http://tinyurl.com').getroot()
->>> page.forms[0].fields['url'] = 'http://lxml.de/'
->>> result = parse(submit_form(page.forms[0])).getroot()
->>> [a.attrib['href'] for a in result.xpath("//a[@target='_blank']")]
-['http://tinyurl.com/2xae8s', 'http://preview.tinyurl.com/2xae8s']
-
-
-
-
-

Cleaning up HTML

-

The module lxml.html.clean provides a Cleaner class for cleaning up -HTML pages. It supports removing embedded or script content, special tags, -CSS style annotations and much more.

-

Say, you have an evil web page from an untrusted source that contains lots of -content that upsets browsers and tries to run evil code on the client side:

-
>>> html = '''\
-... <html>
-...  <head>
-...    <script type="text/javascript" src="evil-site"></script>
-...    <link rel="alternate" type="text/rss" src="evil-rss">
-...    <style>
-...      body {background-image: url(javascript:do_evil)};
-...      div {color: expression(evil)};
-...    </style>
-...  </head>
-...  <body onload="evil_function()">
-...    <!-- I am interpreted for EVIL! -->
-...    <a href="javascript:evil_function()">a link</a>
-...    <a href="#" onclick="evil_function()">another link</a>
-...    <p onclick="evil_function()">a paragraph</p>
-...    <div style="display: none">secret EVIL!</div>
-...    <object> of EVIL! </object>
-...    <iframe src="evil-site"></iframe>
-...    <form action="evil-site">
-...      Password: <input type="password" name="password">
-...    </form>
-...    <blink>annoying EVIL!</blink>
-...    <a href="evil-site">spam spam SPAM!</a>
-...    <image src="evil!">
-...  </body>
-... </html>'''
-
-

To remove the all suspicious content from this unparsed document, use the -clean_html function:

-
>>> from lxml.html.clean import clean_html
->>> print clean_html(html)
-<div><style>/* deleted */</style><body>
-
-   <a href="">a link</a>
-   <a href="#">another link</a>
-   <p>a paragraph</p>
-   <div>secret EVIL!</div>
-    of EVIL!
-
-
-     Password:
-   annoying EVIL!<a href="evil-site">spam spam SPAM!</a>
-   <img src="evil!"></body></div>
-
-

The Cleaner class supports several keyword arguments to control exactly -which content is removed:

-
>>> from lxml.html.clean import Cleaner
-
->>> cleaner = Cleaner(page_structure=False, links=False)
->>> print cleaner.clean_html(html)
-<html>
-  <head>
-    <link rel="alternate" src="evil-rss" type="text/rss">
-    <style>/* deleted */</style>
-  </head>
-  <body>
-    <a href="">a link</a>
-    <a href="#">another link</a>
-    <p>a paragraph</p>
-    <div>secret EVIL!</div>
-    of EVIL!
-    Password:
-    annoying EVIL!
-    <a href="evil-site">spam spam SPAM!</a>
-    <img src="evil!">
-  </body>
-</html>
-
->>> cleaner = Cleaner(style=True, links=True, add_nofollow=True,
-...                   page_structure=False, safe_attrs_only=False)
-
->>> print cleaner.clean_html(html)
-<html>
-  <head>
-  </head>
-  <body>
-    <a href="">a link</a>
-    <a href="#">another link</a>
-    <p>a paragraph</p>
-    <div>secret EVIL!</div>
-    of EVIL!
-    Password:
-    annoying EVIL!
-    <a href="evil-site" rel="nofollow">spam spam SPAM!</a>
-    <img src="evil!">
-  </body>
-</html>
-
-

You can also whitelist some otherwise dangerous content with -Cleaner(host_whitelist=['www.youtube.com']), which would allow -embedded media from YouTube, while still filtering out embedded media -from other sites.

-

See the docstring of Cleaner for the details of what can be -cleaned.

- -
-

wordwrap

-

You can also wrap long words in your html:

-
-word_break(doc, max_width=40, ...)
-
-word_break_html(html, ...)
-
-

This finds any long words in the text of the document and inserts -&#8203; in the document (which is the Unicode zero-width space).

-

This avoids the elements <pre>, <textarea>, and <code>. -You can control this with avoid_elements=['textarea', ...].

-

It also avoids elements with the CSS class nobreak. You can -control this with avoid_classes=['code', ...].

-

Lastly you can control the character that is inserted with -break_character=u'\u200b'. However, you cannot insert markup, -only text.

-

word_break_html(html) parses the HTML document and returns a -string.

-
-
-
-

HTML Diff

-

The module lxml.html.diff offers some ways to visualize -differences in HTML documents. These differences are content -oriented. That is, changes in markup are largely ignored; only -changes in the content itself are highlighted.

-

There are two ways to view differences: htmldiff and -html_annotate. One shows differences with <ins> and -<del>, while the other annotates a set of changes similar to svn -blame. Both these functions operate on text, and work best with -content fragments (only what goes in <body>), not complete -documents.

-

Example of htmldiff:

-
>>> from lxml.html.diff import htmldiff, html_annotate
->>> doc1 = '''<p>Here is some text.</p>'''
->>> doc2 = '''<p>Here is <b>a lot</b> of <i>text</i>.</p>'''
->>> doc3 = '''<p>Here is <b>a little</b> <i>text</i>.</p>'''
->>> print htmldiff(doc1, doc2)
-<p>Here is <ins><b>a lot</b> of <i>text</i>.</ins> <del>some text.</del> </p>
->>> print html_annotate([(doc1, 'author1'), (doc2, 'author2'),
-...                      (doc3, 'author3')])
-<p><span title="author1">Here is</span>
-   <b><span title="author2">a</span>
-   <span title="author3">little</span></b>
-   <i><span title="author2">text</span></i>
-   <span title="author2">.</span></p>
-
-

As you can see, it is imperfect as such things tend to be. On larger -tracts of text with larger edits it will generally do better.

-

The html_annotate function can also take an optional second -argument, markup. This is a function like markup(text, -version) that returns the given text marked up with the given -version. The default version, the output of which you see in the -example, looks like:

-
def default_markup(text, version):
-    return '<span title="%s">%s</span>' % (
-        cgi.escape(unicode(version), 1), text)
-
-
-
-

Examples

-
-

Microformat Example

-

This example parses the hCard -microformat.

-

First we get the page:

-
>>> import urllib
->>> from lxml.html import fromstring
->>> url = 'http://microformats.org/'
->>> content = urllib.urlopen(url).read()
->>> doc = fromstring(content)
->>> doc.make_links_absolute(url)
-
-

Then we create some objects to put the information in:

-
>>> class Card(object):
-...     def __init__(self, **kw):
-...         for name, value in kw:
-...             setattr(self, name, value)
->>> class Phone(object):
-...     def __init__(self, phone, types=()):
-...         self.phone, self.types = phone, types
-
-

And some generally handy functions for microformats:

-
>>> def get_text(el, class_name):
-...     els = el.find_class(class_name)
-...     if els:
-...         return els[0].text_content()
-...     else:
-...         return ''
->>> def get_value(el):
-...     return get_text(el, 'value') or el.text_content()
->>> def get_all_texts(el, class_name):
-...     return [e.text_content() for e in els.find_class(class_name)]
->>> def parse_addresses(el):
-...     # Ideally this would parse street, etc.
-...     return el.find_class('adr')
-
-

Then the parsing:

-
>>> for el in doc.find_class('hcard'):
-...     card = Card()
-...     card.el = el
-...     card.fn = get_text(el, 'fn')
-...     card.tels = []
-...     for tel_el in card.find_class('tel'):
-...         card.tels.append(Phone(get_value(tel_el),
-...                                get_all_texts(tel_el, 'type')))
-...     card.addresses = parse_addresses(el)
-
-
-
-
- - - \ No newline at end of file diff --git a/doc/html/objectify.html b/doc/html/objectify.html deleted file mode 100644 index ac62ea0c..00000000 --- a/doc/html/objectify.html +++ /dev/null @@ -1,1172 +0,0 @@ - - - - - -lxml.objectify - - - - -
-

lxml.objectify

- --- - - - -
Authors:Stefan Behnel -
Holger Joukl
-

lxml supports an alternative API similar to the Amara bindery or -gnosis.xml.objectify through a custom Element implementation. The main idea -is to hide the usage of XML behind normal Python objects, sometimes referred -to as data-binding. It allows you to use XML as if you were dealing with a -normal Python object hierarchy.

-

Accessing the children of an XML element deploys object attribute access. If -there are multiple children with the same name, slicing and indexing can be -used. Python data types are extracted from XML content automatically and made -available to the normal Python operators.

- -

To set up and use objectify, you need both the lxml.etree -module and lxml.objectify:

-
>>> from lxml import etree
->>> from lxml import objectify
-
-

The objectify API is very different from the ElementTree API. If it -is used, it should not be mixed with other element implementations -(such as trees parsed with lxml.etree), to avoid non-obvious -behaviour.

-

The benchmark page has some hints on performance optimisation of -code using lxml.objectify.

-

To make the doctests in this document look a little nicer, we also use -this:

-
>>> import lxml.usedoctest
-
-

Imported from within a doctest, this relieves us from caring about the exact -formatting of XML output.

-
-

The lxml.objectify API

-

In lxml.objectify, element trees provide an API that models the behaviour -of normal Python object trees as closely as possible.

-
-

Element access through object attributes

-

The main idea behind the objectify API is to hide XML element access -behind the usual object attribute access pattern. Asking an element for an -attribute will return the sequence of children with corresponding tag names:

-
>>> root = objectify.Element("root")
->>> b = objectify.SubElement(root, "b")
->>> print(root.b[0].tag)
-b
->>> root.index(root.b[0])
-0
->>> b = objectify.SubElement(root, "b")
->>> print(root.b[0].tag)
-b
->>> print(root.b[1].tag)
-b
->>> root.index(root.b[1])
-1
-
-

For convenience, you can omit the index '0' to access the first child:

-
>>> print(root.b.tag)
-b
->>> root.index(root.b)
-0
->>> del root.b
-
-

Iteration and slicing also obey the requested tag:

-
>>> x1 = objectify.SubElement(root, "x")
->>> x2 = objectify.SubElement(root, "x")
->>> x3 = objectify.SubElement(root, "x")
-
->>> [ el.tag for el in root.x ]
-['x', 'x', 'x']
-
->>> [ el.tag for el in root.x[1:3] ]
-['x', 'x']
-
->>> [ el.tag for el in root.x[-1:] ]
-['x']
-
->>> del root.x[1:2]
->>> [ el.tag for el in root.x ]
-['x', 'x']
-
-

If you want to iterate over all children or need to provide a specific -namespace for the tag, use the iterchildren() method. Like the other -methods for iteration, it supports an optional tag keyword argument:

-
>>> [ el.tag for el in root.iterchildren() ]
-['b', 'x', 'x']
-
->>> [ el.tag for el in root.iterchildren(tag='b') ]
-['b']
-
->>> [ el.tag for el in root.b ]
-['b']
-
-

XML attributes are accessed as in the normal ElementTree API:

-
>>> c = objectify.SubElement(root, "c", myattr="someval")
->>> print(root.c.get("myattr"))
-someval
-
->>> root.c.set("c", "oh-oh")
->>> print(root.c.get("c"))
-oh-oh
-
-

In addition to the normal ElementTree API for appending elements to trees, -subtrees can also be added by assigning them to object attributes. In this -case, the subtree is automatically deep copied and the tag name of its root is -updated to match the attribute name:

-
>>> el = objectify.Element("yet_another_child")
->>> root.new_child = el
->>> print(root.new_child.tag)
-new_child
->>> print(el.tag)
-yet_another_child
-
->>> root.y = [ objectify.Element("y"), objectify.Element("y") ]
->>> [ el.tag for el in root.y ]
-['y', 'y']
-
-

The latter is a short form for operations on the full slice:

-
>>> root.y[:] = [ objectify.Element("y") ]
->>> [ el.tag for el in root.y ]
-['y']
-
-

You can also replace children that way:

-
>>> child1 = objectify.SubElement(root, "child")
->>> child2 = objectify.SubElement(root, "child")
->>> child3 = objectify.SubElement(root, "child")
-
->>> el = objectify.Element("new_child")
->>> subel = objectify.SubElement(el, "sub")
-
->>> root.child = el
->>> print(root.child.sub.tag)
-sub
-
->>> root.child[2] = el
->>> print(root.child[2].sub.tag)
-sub
-
-

Note that special care must be taken when changing the tag name of an element:

-
>>> print(root.b.tag)
-b
->>> root.b.tag = "notB"
->>> root.b
-Traceback (most recent call last):
-  ...
-AttributeError: no such child: b
->>> print(root.notB.tag)
-notB
-
-
-
-

Creating objectify trees

-

As with lxml.etree, you can either create an objectify tree by -parsing an XML document or by building one from scratch. To parse a -document, just use the parse() or fromstring() functions of -the module:

-
>>> fileobject = StringIO('<test/>')
-
->>> tree = objectify.parse(fileobject)
->>> print(isinstance(tree.getroot(), objectify.ObjectifiedElement))
-True
-
->>> root = objectify.fromstring('<test/>')
->>> print(isinstance(root, objectify.ObjectifiedElement))
-True
-
-

To build a new tree in memory, objectify replicates the standard -factory function Element() from lxml.etree:

-
>>> obj_el = objectify.Element("new")
->>> print(isinstance(obj_el, objectify.ObjectifiedElement))
-True
-
-

After creating such an Element, you can use the usual API of -lxml.etree to add SubElements to the tree:

-
>>> child = objectify.SubElement(obj_el, "newchild", attr="value")
-
-

New subelements will automatically inherit the objectify behaviour -from their tree. However, all independent elements that you create -through the Element() factory of lxml.etree (instead of objectify) -will not support the objectify API by themselves:

-
>>> subel = objectify.SubElement(obj_el, "sub")
->>> print(isinstance(subel, objectify.ObjectifiedElement))
-True
-
->>> independent_el = etree.Element("new")
->>> print(isinstance(independent_el, objectify.ObjectifiedElement))
-False
-
-
-
-

Tree generation with the E-factory

-

To simplify the generation of trees even further, you can use the E-factory:

-
>>> E = objectify.E
->>> root = E.root(
-...   E.a(5),
-...   E.b(6.21),
-...   E.c(True),
-...   E.d("how", tell="me")
-... )
-
->>> print(etree.tostring(root, pretty_print=True))
-<root xmlns:py="http://codespeak.net/lxml/objectify/pytype">
-  <a py:pytype="int">5</a>
-  <b py:pytype="float">6.21</b>
-  <c py:pytype="bool">true</c>
-  <d py:pytype="str" tell="me">how</d>
-</root>
-
-

This allows you to write up a specific language in tags:

-
>>> ROOT = objectify.E.root
->>> TITLE = objectify.E.title
->>> HOWMANY = getattr(objectify.E, "how-many")
-
->>> root = ROOT(
-...   TITLE("The title"),
-...   HOWMANY(5)
-... )
-
->>> print(etree.tostring(root, pretty_print=True))
-<root xmlns:py="http://codespeak.net/lxml/objectify/pytype">
-  <title py:pytype="str">The title</title>
-  <how-many py:pytype="int">5</how-many>
-</root>
-
-

objectify.E is an instance of objectify.ElementMaker. By default, it -creates pytype annotated Elements without a namespace. You can switch off the -pytype annotation by passing False to the annotate keyword argument of the -constructor. You can also pass a default namespace and an nsmap:

-
>>> myE = objectify.ElementMaker(annotate=False,
-...           namespace="http://my/ns", nsmap={None : "http://my/ns"})
-
->>> root = myE.root( myE.someint(2) )
-
->>> print(etree.tostring(root, pretty_print=True))
-<root xmlns="http://my/ns">
-  <someint>2</someint>
-</root>
-
-
-
-

Namespace handling

-

During tag lookups, namespaces are handled mostly behind the scenes. -If you access a child of an Element without specifying a namespace, -the lookup will use the namespace of the parent:

-
>>> root = objectify.Element("{http://ns/}root")
->>> b = objectify.SubElement(root, "{http://ns/}b")
->>> c = objectify.SubElement(root, "{http://other/}c")
-
->>> print(root.b.tag)
-{http://ns/}b
-
-

Note that the SubElement() factory of lxml.etree does not -inherit any namespaces when creating a new subelement. Element -creation must be explicit about the namespace, and is simplified -through the E-factory as described above.

-

Lookups, however, inherit namespaces implicitly:

-
>>> print(root.b.tag)
-{http://ns/}b
-
->>> print(root.c)
-Traceback (most recent call last):
-    ...
-AttributeError: no such child: {http://ns/}c
-
-

To access an element in a different namespace than its parent, you can -use getattr():

-
>>> c = getattr(root, "{http://other/}c")
->>> print(c.tag)
-{http://other/}c
-
-

For convenience, there is also a quick way through item access:

-
>>> c = root["{http://other/}c"]
->>> print(c.tag)
-{http://other/}c
-
-

The same approach must be used to access children with tag names that are not -valid Python identifiers:

-
>>> el = objectify.SubElement(root, "{http://ns/}tag-name")
->>> print(root["tag-name"].tag)
-{http://ns/}tag-name
-
->>> new_el = objectify.Element("{http://ns/}new-element")
->>> el = objectify.SubElement(new_el, "{http://ns/}child")
->>> el = objectify.SubElement(new_el, "{http://ns/}child")
->>> el = objectify.SubElement(new_el, "{http://ns/}child")
-
->>> root["tag-name"] = [ new_el, new_el ]
->>> print(len(root["tag-name"]))
-2
->>> print(root["tag-name"].tag)
-{http://ns/}tag-name
-
->>> print(len(root["tag-name"].child))
-3
->>> print(root["tag-name"].child.tag)
-{http://ns/}child
->>> print(root["tag-name"][1].child.tag)
-{http://ns/}child
-
-

or for names that have a special meaning in lxml.objectify:

-
>>> root = objectify.XML("<root><text>TEXT</text></root>")
-
->>> print(root.text.text)
-Traceback (most recent call last):
-  ...
-AttributeError: 'NoneType' object has no attribute 'text'
-
->>> print(root["text"].text)
-TEXT
-
-
-
-
-

Asserting a Schema

-

When dealing with XML documents from different sources, you will often -require them to follow a common schema. In lxml.objectify, this -directly translates to enforcing a specific object tree, i.e. expected -object attributes are ensured to be there and to have the expected -type. This can easily be achieved through XML Schema validation at -parse time. Also see the documentation on validation on this -topic.

-

First of all, we need a parser that knows our schema, so let's say we -parse the schema from a file-like object (or file or filename):

-
>>> f = StringIO('''\
-...   <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-...     <xsd:element name="a" type="AType"/>
-...     <xsd:complexType name="AType">
-...       <xsd:sequence>
-...         <xsd:element name="b" type="xsd:string" />
-...       </xsd:sequence>
-...     </xsd:complexType>
-...   </xsd:schema>
-... ''')
->>> schema = etree.XMLSchema(file=f)
-
-

When creating the validating parser, we must make sure it returns -objectify trees. This is best done with the makeparser() -function:

-
>>> parser = objectify.makeparser(schema = schema)
-
-

Now we can use it to parse a valid document:

-
>>> xml = "<a><b>test</b></a>"
->>> a = objectify.fromstring(xml, parser)
-
->>> print(a.b)
-test
-
-

Or an invalid document:

-
>>> xml = b"<a><b>test</b><c/></a>"
->>> a = objectify.fromstring(xml, parser)  # doctest: +ELLIPSIS
-Traceback (most recent call last):
-lxml.etree.XMLSyntaxError: Element 'c': This element is not expected...
-
-

Note that the same works for parse-time DTD validation, except that -DTDs do not support any data types by design.

-
-
-

ObjectPath

-

For both convenience and speed, objectify supports its own path language, -represented by the ObjectPath class:

-
>>> root = objectify.Element("{http://ns/}root")
->>> b1 = objectify.SubElement(root, "{http://ns/}b")
->>> c  = objectify.SubElement(b1,   "{http://ns/}c")
->>> b2 = objectify.SubElement(root, "{http://ns/}b")
->>> d  = objectify.SubElement(root, "{http://other/}d")
-
->>> path = objectify.ObjectPath("root.b.c")
->>> print(path)
-root.b.c
->>> path.hasattr(root)
-True
->>> print(path.find(root).tag)
-{http://ns/}c
-
->>> find = objectify.ObjectPath("root.b.c")
->>> print(find(root).tag)
-{http://ns/}c
-
->>> find = objectify.ObjectPath("root.{http://other/}d")
->>> print(find(root).tag)
-{http://other/}d
-
->>> find = objectify.ObjectPath("root.{not}there")
->>> print(find(root).tag)
-Traceback (most recent call last):
-  ...
-AttributeError: no such child: {not}there
-
->>> find = objectify.ObjectPath("{not}there")
->>> print(find(root).tag)
-Traceback (most recent call last):
-  ...
-ValueError: root element does not match: need {not}there, got {http://ns/}root
-
->>> find = objectify.ObjectPath("root.b[1]")
->>> print(find(root).tag)
-{http://ns/}b
-
->>> find = objectify.ObjectPath("root.{http://ns/}b[1]")
->>> print(find(root).tag)
-{http://ns/}b
-
-

Apart from strings, ObjectPath also accepts lists of path segments:

-
>>> find = objectify.ObjectPath(['root', 'b', 'c'])
->>> print(find(root).tag)
-{http://ns/}c
-
->>> find = objectify.ObjectPath(['root', '{http://ns/}b[1]'])
->>> print(find(root).tag)
-{http://ns/}b
-
-

You can also use relative paths starting with a '.' to ignore the actual root -element and only inherit its namespace:

-
>>> find = objectify.ObjectPath(".b[1]")
->>> print(find(root).tag)
-{http://ns/}b
-
->>> find = objectify.ObjectPath(['', 'b[1]'])
->>> print(find(root).tag)
-{http://ns/}b
-
->>> find = objectify.ObjectPath(".unknown[1]")
->>> print(find(root).tag)
-Traceback (most recent call last):
-  ...
-AttributeError: no such child: {http://ns/}unknown
-
->>> find = objectify.ObjectPath(".{http://other/}unknown[1]")
->>> print(find(root).tag)
-Traceback (most recent call last):
-  ...
-AttributeError: no such child: {http://other/}unknown
-
-

For convenience, a single dot represents the empty ObjectPath (identity):

-
>>> find = objectify.ObjectPath(".")
->>> print(find(root).tag)
-{http://ns/}root
-
-

ObjectPath objects can be used to manipulate trees:

-
>>> root = objectify.Element("{http://ns/}root")
-
->>> path = objectify.ObjectPath(".some.child.{http://other/}unknown")
->>> path.hasattr(root)
-False
->>> path.find(root)
-Traceback (most recent call last):
-  ...
-AttributeError: no such child: {http://ns/}some
-
->>> path.setattr(root, "my value") # creates children as necessary
->>> path.hasattr(root)
-True
->>> print(path.find(root).text)
-my value
->>> print(root.some.child["{http://other/}unknown"].text)
-my value
-
->>> print(len( path.find(root) ))
-1
->>> path.addattr(root, "my new value")
->>> print(len( path.find(root) ))
-2
->>> [ el.text for el in path.find(root) ]
-['my value', 'my new value']
-
-

As with attribute assignment, setattr() accepts lists:

-
>>> path.setattr(root, ["v1", "v2", "v3"])
->>> [ el.text for el in path.find(root) ]
-['v1', 'v2', 'v3']
-
-

Note, however, that indexing is only supported in this context if the children -exist. Indexing of non existing children will not extend or create a list of -such children but raise an exception:

-
>>> path = objectify.ObjectPath(".{non}existing[1]")
->>> path.setattr(root, "my value")
-Traceback (most recent call last):
-  ...
-TypeError: creating indexed path attributes is not supported
-
-

It is worth noting that ObjectPath does not depend on the objectify module -or the ObjectifiedElement implementation. It can also be used in combination -with Elements from the normal lxml.etree API.

-
-
-

Python data types

-

The objectify module knows about Python data types and tries its best to let -element content behave like them. For example, they support the normal math -operators:

-
>>> root = objectify.fromstring(
-...             "<root><a>5</a><b>11</b><c>true</c><d>hoi</d></root>")
->>> root.a + root.b
-16
->>> root.a += root.b
->>> print(root.a)
-16
-
->>> root.a = 2
->>> print(root.a + 2)
-4
->>> print(1 + root.a)
-3
-
->>> print(root.c)
-True
->>> root.c = False
->>> if not root.c:
-...     print("false!")
-false!
-
->>> print(root.d + " test !")
-hoi test !
->>> root.d = "%s - %s"
->>> print(root.d % (1234, 12345))
-1234 - 12345
-
-

However, data elements continue to provide the objectify API. This means that -sequence operations such as len(), slicing and indexing (e.g. of strings) -cannot behave as the Python types. Like all other tree elements, they show -the normal slicing behaviour of objectify elements:

-
>>> root = objectify.fromstring("<root><a>test</a><b>toast</b></root>")
->>> print(root.a + ' me') # behaves like a string, right?
-test me
->>> len(root.a) # but there's only one 'a' element!
-1
->>> [ a.tag for a in root.a ]
-['a']
->>> print(root.a[0].tag)
-a
-
->>> print(root.a)
-test
->>> [ str(a) for a in root.a[:1] ]
-['test']
-
-

If you need to run sequence operations on data types, you must ask the API for -the real Python value. The string value is always available through the -normal ElementTree .text attribute. Additionally, all data classes -provide a .pyval attribute that returns the value as plain Python type:

-
>>> root = objectify.fromstring("<root><a>test</a><b>5</b></root>")
->>> root.a.text
-'test'
->>> root.a.pyval
-'test'
-
->>> root.b.text
-'5'
->>> root.b.pyval
-5
-
-

Note, however, that both attributes are read-only in objectify. If you want -to change values, just assign them directly to the attribute:

-
>>> root.a.text  = "25"
-Traceback (most recent call last):
-  ...
-TypeError: attribute 'text' of 'StringElement' objects is not writable
-
->>> root.a.pyval = 25
-Traceback (most recent call last):
-  ...
-TypeError: attribute 'pyval' of 'StringElement' objects is not writable
-
->>> root.a = 25
->>> print(root.a)
-25
->>> print(root.a.pyval)
-25
-
-

In other words, objectify data elements behave like immutable Python -types. You can replace them, but not modify them.

-
-

Recursive tree dump

-

To see the data types that are currently used, you can call the module level -dump() function that returns a recursive string representation for -elements:

-
>>> root = objectify.fromstring("""
-... <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-...   <a attr1="foo" attr2="bar">1</a>
-...   <a>1.2</a>
-...   <b>1</b>
-...   <b>true</b>
-...   <c>what?</c>
-...   <d xsi:nil="true"/>
-... </root>
-... """)
-
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = 1 [IntElement]
-      * attr1 = 'foo'
-      * attr2 = 'bar'
-    a = 1.2 [FloatElement]
-    b = 1 [IntElement]
-    b = True [BoolElement]
-    c = 'what?' [StringElement]
-    d = None [NoneElement]
-      * xsi:nil = 'true'
-
-

You can freely switch between different types for the same child:

-
>>> root = objectify.fromstring("<root><a>5</a></root>")
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = 5 [IntElement]
-
->>> root.a = 'nice string!'
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = 'nice string!' [StringElement]
-      * py:pytype = 'str'
-
->>> root.a = True
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = True [BoolElement]
-      * py:pytype = 'bool'
-
->>> root.a = [1, 2, 3]
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = 1 [IntElement]
-      * py:pytype = 'int'
-    a = 2 [IntElement]
-      * py:pytype = 'int'
-    a = 3 [IntElement]
-      * py:pytype = 'int'
-
->>> root.a = (1, 2, 3)
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = 1 [IntElement]
-      * py:pytype = 'int'
-    a = 2 [IntElement]
-      * py:pytype = 'int'
-    a = 3 [IntElement]
-      * py:pytype = 'int'
-
-
-
-

Recursive string representation of elements

-

Normally, elements use the standard string representation for str() that is -provided by lxml.etree. You can enable a pretty-print representation for -objectify elements like this:

-
>>> objectify.enable_recursive_str()
-
->>> root = objectify.fromstring("""
-... <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-...   <a attr1="foo" attr2="bar">1</a>
-...   <a>1.2</a>
-...   <b>1</b>
-...   <b>true</b>
-...   <c>what?</c>
-...   <d xsi:nil="true"/>
-... </root>
-... """)
-
->>> print(str(root))
-root = None [ObjectifiedElement]
-    a = 1 [IntElement]
-      * attr1 = 'foo'
-      * attr2 = 'bar'
-    a = 1.2 [FloatElement]
-    b = 1 [IntElement]
-    b = True [BoolElement]
-    c = 'what?' [StringElement]
-    d = None [NoneElement]
-      * xsi:nil = 'true'
-
-

This behaviour can be switched off in the same way:

-
>>> objectify.enable_recursive_str(False)
-
-
-
-
-

How data types are matched

-

Objectify uses two different types of Elements. Structural Elements (or tree -Elements) represent the object tree structure. Data Elements represent the -data containers at the leafs. You can explicitly create tree Elements with -the objectify.Element() factory and data Elements with the -objectify.DataElement() factory.

-

When Element objects are created, lxml.objectify must determine which -implementation class to use for them. This is relatively easy for tree -Elements and less so for data Elements. The algorithm is as follows:

-
    -
  1. If an element has children, use the default tree class.
  2. -
  3. If an element is defined as xsi:nil, use the NoneElement class.
  4. -
  5. If a "Python type hint" attribute is given, use this to determine the element -class, see below.
  6. -
  7. If an XML Schema xsi:type hint is given, use this to determine the element -class, see below.
  8. -
  9. Try to determine the element class from the text content type by trial and -error.
  10. -
  11. If the element is a root node then use the default tree class.
  12. -
  13. Otherwise, use the default class for empty data classes.
  14. -
-

You can change the default classes for tree Elements and empty data Elements -at setup time. The ObjectifyElementClassLookup() call accepts two keyword -arguments, tree_class and empty_data_class, that determine the Element -classes used in these cases. By default, tree_class is a class called -ObjectifiedElement and empty_data_class is a StringElement.

-
-

Type annotations

-

The "type hint" mechanism deploys an XML attribute defined as -lxml.objectify.PYTYPE_ATTRIBUTE. It may contain any of the following -string values: int, long, float, str, unicode, NoneType:

-
>>> print(objectify.PYTYPE_ATTRIBUTE)
-{http://codespeak.net/lxml/objectify/pytype}pytype
->>> ns, name = objectify.PYTYPE_ATTRIBUTE[1:].split('}')
-
->>> root = objectify.fromstring("""\
-... <root xmlns:py='%s'>
-...   <a py:pytype='str'>5</a>
-...   <b py:pytype='int'>5</b>
-...   <c py:pytype='NoneType' />
-... </root>
-... """ % ns)
-
->>> print(root.a + 10)
-510
->>> print(root.b + 10)
-15
->>> print(root.c)
-None
-
-

Note that you can change the name and namespace used for this -attribute through the set_pytype_attribute_tag(tag) module -function, in case your application ever needs to. There is also a -utility function annotate() that recursively generates this -attribute for the elements of a tree:

-
>>> root = objectify.fromstring("<root><a>test</a><b>5</b></root>")
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = 'test' [StringElement]
-    b = 5 [IntElement]
-
->>> objectify.annotate(root)
-
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = 'test' [StringElement]
-      * py:pytype = 'str'
-    b = 5 [IntElement]
-      * py:pytype = 'int'
-
-
-
-

XML Schema datatype annotation

-

A second way of specifying data type information uses XML Schema types as -element annotations. Objectify knows those that can be mapped to normal -Python types:

-
>>> root = objectify.fromstring('''\
-...    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-...          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-...      <d xsi:type="xsd:double">5</d>
-...      <i xsi:type="xsd:int"   >5</i>
-...      <s xsi:type="xsd:string">5</s>
-...    </root>
-...    ''')
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    d = 5.0 [FloatElement]
-      * xsi:type = 'xsd:double'
-    i = 5 [IntElement]
-      * xsi:type = 'xsd:int'
-    s = '5' [StringElement]
-      * xsi:type = 'xsd:string'
-
-

Again, there is a utility function xsiannotate() that recursively -generates the "xsi:type" attribute for the elements of a tree:

-
>>> root = objectify.fromstring('''\
-...    <root><a>test</a><b>5</b><c>true</c></root>
-...    ''')
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = 'test' [StringElement]
-    b = 5 [IntElement]
-    c = True [BoolElement]
-
->>> objectify.xsiannotate(root)
-
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    a = 'test' [StringElement]
-      * xsi:type = 'xsd:string'
-    b = 5 [IntElement]
-      * xsi:type = 'xsd:integer'
-    c = True [BoolElement]
-      * xsi:type = 'xsd:boolean'
-
-

Note, however, that xsiannotate() will always use the first XML Schema -datatype that is defined for any given Python type, see also -Defining additional data classes.

-

The utility function deannotate() can be used to get rid of 'py:pytype' -and/or 'xsi:type' information:

-
>>> root = objectify.fromstring('''\
-... <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-...       xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-...   <d xsi:type="xsd:double">5</d>
-...   <i xsi:type="xsd:int"   >5</i>
-...   <s xsi:type="xsd:string">5</s>
-... </root>''')
->>> objectify.annotate(root)
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    d = 5.0 [FloatElement]
-      * xsi:type = 'xsd:double'
-      * py:pytype = 'float'
-    i = 5 [IntElement]
-      * xsi:type = 'xsd:int'
-      * py:pytype = 'int'
-    s = '5' [StringElement]
-      * xsi:type = 'xsd:string'
-      * py:pytype = 'str'
->>> objectify.deannotate(root)
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    d = 5 [IntElement]
-    i = 5 [IntElement]
-    s = 5 [IntElement]
-
-

You can control which type attributes should be de-annotated with the keyword -arguments 'pytype' (default: True) and 'xsi' (default: True). -deannotate() can also remove 'xsi:nil' attributes by setting 'xsi_nil=True' -(default: False):

-
>>> root = objectify.fromstring('''\
-... <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-...       xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-...   <d xsi:type="xsd:double">5</d>
-...   <i xsi:type="xsd:int"   >5</i>
-...   <s xsi:type="xsd:string">5</s>
-...   <n xsi:nil="true"/>
-... </root>''')
->>> objectify.annotate(root)
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    d = 5.0 [FloatElement]
-      * xsi:type = 'xsd:double'
-      * py:pytype = 'float'
-    i = 5 [IntElement]
-      * xsi:type = 'xsd:int'
-      * py:pytype = 'int'
-    s = '5' [StringElement]
-      * xsi:type = 'xsd:string'
-      * py:pytype = 'str'
-    n = None [NoneElement]
-      * xsi:nil = 'true'
-      * py:pytype = 'NoneType'
->>> objectify.deannotate(root, xsi_nil=True)
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    d = 5 [IntElement]
-    i = 5 [IntElement]
-    s = 5 [IntElement]
-    n = u'' [StringElement]
-
-

Note that deannotate() does not remove the namespace declarations -of the pytype namespace by default. To remove them as well, and -to generally clean up the namespace declarations in the document -(usually when done with the whole processing), pass the option -cleanup_namespaces=True. This option is new in lxml 2.3.2. In -older versions, use the function lxml.etree.cleanup_namespaces() -instead.

-
-
-

The DataElement factory

-

For convenience, the DataElement() factory creates an Element with a -Python value in one step. You can pass the required Python type name or the -XSI type name:

-
>>> root = objectify.Element("root")
->>> root.x = objectify.DataElement(5, _pytype="int")
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    x = 5 [IntElement]
-      * py:pytype = 'int'
-
->>> root.x = objectify.DataElement(5, _pytype="str", myattr="someval")
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    x = '5' [StringElement]
-      * myattr = 'someval'
-      * py:pytype = 'str'
-
->>> root.x = objectify.DataElement(5, _xsi="integer")
->>> print(objectify.dump(root))
-root = None [ObjectifiedElement]
-    x = 5 [IntElement]
-      * py:pytype = 'int'
-      * xsi:type = 'xsd:integer'
-
-

XML Schema types reside in the XML schema namespace thus DataElement() -tries to correctly prefix the xsi:type attribute value for you:

-
>>> root = objectify.Element("root")
->>> root.s = objectify.DataElement(5, _xsi="string")
-
->>> objectify.deannotate(root, xsi=False)
->>> print(etree.tostring(root, pretty_print=True))
-<root xmlns:py="http://codespeak.net/lxml/objectify/pytype" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <s xsi:type="xsd:string">5</s>
-</root>
-
-

DataElement() uses a default nsmap to set these prefixes:

-
>>> el = objectify.DataElement('5', _xsi='string')
->>> namespaces = list(el.nsmap.items())
->>> namespaces.sort()
->>> for prefix, namespace in namespaces:
-...     print("%s - %s" % (prefix, namespace))
-py - http://codespeak.net/lxml/objectify/pytype
-xsd - http://www.w3.org/2001/XMLSchema
-xsi - http://www.w3.org/2001/XMLSchema-instance
-
->>> print(el.get("{http://www.w3.org/2001/XMLSchema-instance}type"))
-xsd:string
-
-

While you can set custom namespace prefixes, it is necessary to provide valid -namespace information if you choose to do so:

-
>>> el = objectify.DataElement('5', _xsi='foo:string',
-...          nsmap={'foo': 'http://www.w3.org/2001/XMLSchema'})
->>> namespaces = list(el.nsmap.items())
->>> namespaces.sort()
->>> for prefix, namespace in namespaces:
-...     print("%s - %s" % (prefix, namespace))
-foo - http://www.w3.org/2001/XMLSchema
-py - http://codespeak.net/lxml/objectify/pytype
-xsi - http://www.w3.org/2001/XMLSchema-instance
-
->>> print(el.get("{http://www.w3.org/2001/XMLSchema-instance}type"))
-foo:string
-
-

Note how lxml chose a default prefix for the XML Schema Instance -namespace. We can override it as in the following example:

-
>>> el = objectify.DataElement('5', _xsi='foo:string',
-...          nsmap={'foo': 'http://www.w3.org/2001/XMLSchema',
-...                 'myxsi': 'http://www.w3.org/2001/XMLSchema-instance'})
->>> namespaces = list(el.nsmap.items())
->>> namespaces.sort()
->>> for prefix, namespace in namespaces:
-...     print("%s - %s" % (prefix, namespace))
-foo - http://www.w3.org/2001/XMLSchema
-myxsi - http://www.w3.org/2001/XMLSchema-instance
-py - http://codespeak.net/lxml/objectify/pytype
-
->>> print(el.get("{http://www.w3.org/2001/XMLSchema-instance}type"))
-foo:string
-
-

Care must be taken if different namespace prefixes have been used for the same -namespace. Namespace information gets merged to avoid duplicate definitions -when adding a new sub-element to a tree, but this mechanism does not adapt the -prefixes of attribute values:

-
>>> root = objectify.fromstring("""<root xmlns:schema="http://www.w3.org/2001/XMLSchema"/>""")
->>> print(etree.tostring(root, pretty_print=True))
-<root xmlns:schema="http://www.w3.org/2001/XMLSchema"/>
-
->>> s = objectify.DataElement("17", _xsi="string")
->>> print(etree.tostring(s, pretty_print=True))
-<value xmlns:py="http://codespeak.net/lxml/objectify/pytype" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" py:pytype="str" xsi:type="xsd:string">17</value>
-
->>> root.s = s
->>> print(etree.tostring(root, pretty_print=True))
-<root xmlns:schema="http://www.w3.org/2001/XMLSchema">
-  <s xmlns:py="http://codespeak.net/lxml/objectify/pytype" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" py:pytype="str" xsi:type="xsd:string">17</s>
-</root>
-
-

It is your responsibility to fix the prefixes of attribute values if you -choose to deviate from the standard prefixes. A convenient way to do this for -xsi:type attributes is to use the xsiannotate() utility:

-
>>> objectify.xsiannotate(root)
->>> print(etree.tostring(root, pretty_print=True))
-<root xmlns:schema="http://www.w3.org/2001/XMLSchema">
-  <s xmlns:py="http://codespeak.net/lxml/objectify/pytype" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" py:pytype="str" xsi:type="schema:string">17</s>
-</root>
-
-

Of course, it is discouraged to use different prefixes for one and the same -namespace when building up an objectify tree.

-
-
-

Defining additional data classes

-

You can plug additional data classes into objectify that will be used in -exactly the same way as the predefined types. Data classes can either inherit -from ObjectifiedDataElement directly or from one of the specialised -classes like NumberElement or BoolElement. The numeric types require -an initial call to the NumberElement method self._setValueParser(function) -to set their type conversion function (string -> numeric Python type). This -call should be placed into the element _init() method.

-

The registration of data classes uses the PyType class:

-
>>> class ChristmasDate(objectify.ObjectifiedDataElement):
-...     def call_santa(self):
-...         print("Ho ho ho!")
-
->>> def checkChristmasDate(date_string):
-...     if not date_string.startswith('24.12.'):
-...         raise ValueError # or TypeError
-
->>> xmas_type = objectify.PyType('date', checkChristmasDate, ChristmasDate)
-
-

The PyType constructor takes a string type name, an (optional) callable type -check and the custom data class. If a type check is provided it must accept a -string as argument and raise ValueError or TypeError if it cannot handle the -string value.

-

PyTypes are used if an element carries a py:pytype attribute denoting its -data type or, in absence of such an attribute, if the given type check callable -does not raise a ValueError/TypeError exception when applied to the element -text.

-

If you want, you can also register this type under an XML Schema type name:

-
>>> xmas_type.xmlSchemaTypes = ("date",)
-
-

XML Schema types will be considered if the element has an xsi:type -attribute that specifies its data type. The line above binds the XSD type -date to the newly defined Python type. Note that this must be done before -the next step, which is to register the type. Then you can use it:

-
>>> xmas_type.register()
-
->>> root = objectify.fromstring(
-...             "<root><a>24.12.2000</a><b>12.24.2000</b></root>")
->>> root.a.call_santa()
-Ho ho ho!
->>> root.b.call_santa()
-Traceback (most recent call last):
-  ...
-AttributeError: no such child: call_santa
-
-

If you need to specify dependencies between the type check functions, you can -pass a sequence of type names through the before and after keyword -arguments of the register() method. The PyType will then try to register -itself before or after the respective types, as long as they are currently -registered. Note that this only impacts the currently registered types at the -time of registration. Types that are registered later on will not care about -the dependencies of already registered types.

-

If you provide XML Schema type information, this will override the type check -function defined above:

-
>>> root = objectify.fromstring('''\
-...    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-...      <a xsi:type="date">12.24.2000</a>
-...    </root>
-...    ''')
->>> print(root.a)
-12.24.2000
->>> root.a.call_santa()
-Ho ho ho!
-
-

To unregister a type, call its unregister() method:

-
>>> root.a.call_santa()
-Ho ho ho!
->>> xmas_type.unregister()
->>> root.a.call_santa()
-Traceback (most recent call last):
-  ...
-AttributeError: no such child: call_santa
-
-

Be aware, though, that this does not immediately apply to elements to which -there already is a Python reference. Their Python class will only be changed -after all references are gone and the Python object is garbage collected.

-
-
-

Advanced element class lookup

-

In some cases, the normal data class setup is not enough. Being based -on lxml.etree, however, lxml.objectify supports very -fine-grained control over the Element classes used in a tree. All you -have to do is configure a different class lookup mechanism (or -write one yourself).

-

The first step for the setup is to create a new parser that builds -objectify documents. The objectify API is meant for data-centric XML -(as opposed to document XML with mixed content). Therefore, we -configure the parser to let it remove whitespace-only text from the -parsed document if it is not enclosed by an XML element. Note that -this alters the document infoset, so if you consider the removed -spaces as data in your specific use case, you should go with a normal -parser and just set the element class lookup. Most applications, -however, will work fine with the following setup:

-
>>> parser = objectify.makeparser(remove_blank_text=True)
-
-

What this does internally, is:

-
>>> parser = etree.XMLParser(remove_blank_text=True)
-
->>> lookup = objectify.ObjectifyElementClassLookup()
->>> parser.set_element_class_lookup(lookup)
-
-

If you want to change the lookup scheme, say, to get additional -support for namespace specific classes, you can register the -objectify lookup as a fallback of the namespace lookup. In this case, -however, you have to take care that the namespace classes inherit from -objectify.ObjectifiedElement, not only from the normal -lxml.etree.ElementBase, so that they support the objectify -API. The above setup code then becomes:

-
>>> lookup = etree.ElementNamespaceClassLookup(
-...                   objectify.ObjectifyElementClassLookup() )
->>> parser.set_element_class_lookup(lookup)
-
-

See the documentation on class lookup schemes for more information.

-
-
-
-

What is different from lxml.etree?

-

Such a different Element API obviously implies some side effects to the normal -behaviour of the rest of the API.

-
    -
  • len(<element>) returns the sibling count, not the number of children of -<element>. You can retrieve the number of children with the -countchildren() method.
  • -
  • Iteration over elements does not yield the children, but the siblings. You -can access all children with the iterchildren() method on elements or -retrieve a list by calling the getchildren() method.
  • -
  • The find, findall and findtext methods require a different implementation -based on ETXPath. In lxml.etree, they use a Python implementation based -on the original iteration scheme. This has the disadvantage that they may -not be 100% backwards compatible, and the additional advantage that they now -support any XPath expression.
  • -
-
-
- - - \ No newline at end of file diff --git a/doc/html/parsing.html b/doc/html/parsing.html deleted file mode 100644 index 2b585daf..00000000 --- a/doc/html/parsing.html +++ /dev/null @@ -1,900 +0,0 @@ - - - - - -Parsing XML and HTML with lxml - - - -
-

Parsing XML and HTML with lxml

- -

lxml provides a very simple and powerful API for parsing XML and HTML. It -supports one-step parsing as well as step-by-step parsing using an -event-driven API (currently only for XML).

- -

The usual setup procedure:

-
>>> from lxml import etree
-
-

The following examples also use StringIO or BytesIO to show how to parse -from files and file-like objects. Both are available in the io module:

-
from io import StringIO, BytesIO
-
-
-

Parsers

-

Parsers are represented by parser objects. There is support for parsing both -XML and (broken) HTML. Note that XHTML is best parsed as XML, parsing it with -the HTML parser can lead to unexpected results. Here is a simple example for -parsing XML from an in-memory string:

-
>>> xml = '<a xmlns="test"><b xmlns="test"/></a>'
-
->>> root = etree.fromstring(xml)
->>> etree.tostring(root)
-b'<a xmlns="test"><b xmlns="test"/></a>'
-
-

To read from a file or file-like object, you can use the parse() function, -which returns an ElementTree object:

-
>>> tree = etree.parse(StringIO(xml))
->>> etree.tostring(tree.getroot())
-b'<a xmlns="test"><b xmlns="test"/></a>'
-
-

Note how the parse() function reads from a file-like object here. If -parsing is done from a real file, it is more common (and also somewhat more -efficient) to pass a filename:

-
>>> tree = etree.parse("doc/test.xml")
-
-

lxml can parse from a local file, an HTTP URL or an FTP URL. It also -auto-detects and reads gzip-compressed XML files (.gz).

-

If you want to parse from memory and still provide a base URL for the document -(e.g. to support relative paths in an XInclude), you can pass the base_url -keyword argument:

-
>>> root = etree.fromstring(xml, base_url="http://where.it/is/from.xml")
-
-
-

Parser options

-

The parsers accept a number of setup options as keyword arguments. The above -example is easily extended to clean up namespaces during parsing:

-
>>> parser = etree.XMLParser(ns_clean=True)
->>> tree   = etree.parse(StringIO(xml), parser)
->>> etree.tostring(tree.getroot())
-b'<a xmlns="test"><b/></a>'
-
-

The keyword arguments in the constructor are mainly based on the libxml2 -parser configuration. A DTD will also be loaded if validation or attribute -default values are requested.

-

Available boolean keyword arguments:

-
    -
  • attribute_defaults - read the DTD (if referenced by the document) and add -the default attributes from it
  • -
  • dtd_validation - validate while parsing (if a DTD was referenced)
  • -
  • load_dtd - load and parse the DTD while parsing (no validation is performed)
  • -
  • no_network - prevent network access when looking up external -documents (on by default)
  • -
  • ns_clean - try to clean up redundant namespace declarations
  • -
  • recover - try hard to parse through broken XML
  • -
  • remove_blank_text - discard blank text nodes between tags, also known as -ignorable whitespace. This is best used together with a DTD or schema -(which tells data and noise apart), otherwise a heuristic will be applied.
  • -
  • remove_comments - discard comments
  • -
  • remove_pis - discard processing instructions
  • -
  • strip_cdata - replace CDATA sections by normal text content (on by -default)
  • -
  • resolve_entities - replace entities by their text value (on by -default)
  • -
  • huge_tree - disable security restrictions and support very deep trees -and very long text content (only affects libxml2 2.7+)
  • -
  • compact - use compact storage for short text content (on by default)
  • -
  • collect_ids - collect XML IDs in a hash table while parsing (on by default). -Disabling this can substantially speed up parsing of documents with many -different IDs if the hash lookup is not used afterwards.
  • -
-

Other keyword arguments:

-
    -
  • encoding - override the document encoding
  • -
  • target - a parser target object that will receive the parse events -(see The target parser interface)
  • -
  • schema - an XMLSchema to validate against (see validation)
  • -
-
-
-

Error log

-

Parsers have an error_log property that lists the errors and -warnings of the last parser run:

-
>>> parser = etree.XMLParser()
->>> print(len(parser.error_log))
-0
-
->>> tree = etree.XML("<root>\n</b>", parser)  # doctest: +ELLIPSIS
-Traceback (most recent call last):
-  ...
-lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: root line 1 and b, line 2, column 5...
-
->>> print(len(parser.error_log))
-1
-
->>> error = parser.error_log[0]
->>> print(error.message)
-Opening and ending tag mismatch: root line 1 and b
->>> print(error.line)
-2
->>> print(error.column)
-5
-
-

Each entry in the log has the following properties:

-
    -
  • message: the message text
  • -
  • domain: the domain ID (see the lxml.etree.ErrorDomains class)
  • -
  • type: the message type ID (see the lxml.etree.ErrorTypes class)
  • -
  • level: the log level ID (see the lxml.etree.ErrorLevels class)
  • -
  • line: the line at which the message originated (if applicable)
  • -
  • column: the character column at which the message originated (if applicable)
  • -
  • filename: the name of the file in which the message originated (if applicable)
  • -
-

For convenience, there are also three properties that provide readable -names for the ID values:

-
    -
  • domain_name
  • -
  • type_name
  • -
  • level_name
  • -
-

To filter for a specific kind of message, use the different -filter_*() methods on the error log (see the -lxml.etree._ListErrorLog class).

-
-
-

Parsing HTML

-

HTML parsing is similarly simple. The parsers have a recover -keyword argument that the HTMLParser sets by default. It lets libxml2 -try its best to return a valid HTML tree with all content it can -manage to parse. It will not raise an exception on parser errors. -You should use libxml2 version 2.6.21 or newer to take advantage of -this feature.

-
>>> broken_html = "<html><head><title>test<body><h1>page title</h3>"
-
->>> parser = etree.HTMLParser()
->>> tree   = etree.parse(StringIO(broken_html), parser)
-
->>> result = etree.tostring(tree.getroot(),
-...                         pretty_print=True, method="html")
->>> print(result)
-<html>
-  <head>
-    <title>test</title>
-  </head>
-  <body>
-    <h1>page title</h1>
-  </body>
-</html>
-
-

Lxml has an HTML function, similar to the XML shortcut known from -ElementTree:

-
>>> html = etree.HTML(broken_html)
->>> result = etree.tostring(html, pretty_print=True, method="html")
->>> print(result)
-<html>
-  <head>
-    <title>test</title>
-  </head>
-  <body>
-    <h1>page title</h1>
-  </body>
-</html>
-
-

The support for parsing broken HTML depends entirely on libxml2's recovery -algorithm. It is not the fault of lxml if you find documents that are so -heavily broken that the parser cannot handle them. There is also no guarantee -that the resulting tree will contain all data from the original document. The -parser may have to drop seriously broken parts when struggling to keep -parsing. Especially misplaced meta tags can suffer from this, which may lead -to encoding problems.

-

Note that the result is a valid HTML tree, but it may not be a -well-formed XML tree. For example, XML forbids double hyphens in -comments, which the HTML parser will happily accept in recovery mode. -Therefore, if your goal is to serialise an HTML document as an -XML/XHTML document after parsing, you may have to apply some manual -preprocessing first.

-

Also note that the HTML parser is meant to parse HTML documents. For -XHTML documents, use the XML parser, which is namespace aware.

-
-
-

Doctype information

-

The use of the libxml2 parsers makes some additional information available at -the API level. Currently, ElementTree objects can access the DOCTYPE -information provided by a parsed document, as well as the XML version and the -original encoding. Since lxml 3.5, the doctype references are mutable.

-
>>> pub_id  = "-//W3C//DTD XHTML 1.0 Transitional//EN"
->>> sys_url = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
->>> doctype_string = '<!DOCTYPE html PUBLIC "%s" "%s">' % (pub_id, sys_url)
->>> xml_header = '<?xml version="1.0" encoding="ascii"?>'
->>> xhtml = xml_header + doctype_string + '<html><body></body></html>'
-
->>> tree = etree.parse(StringIO(xhtml))
->>> docinfo = tree.docinfo
->>> print(docinfo.public_id)
--//W3C//DTD XHTML 1.0 Transitional//EN
->>> print(docinfo.system_url)
-http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
->>> docinfo.doctype == doctype_string
-True
-
->>> print(docinfo.xml_version)
-1.0
->>> print(docinfo.encoding)
-ascii
-
->>> docinfo.system_url = None
->>> docinfo.public_id = None
->>> print(etree.tostring(tree))
-<!DOCTYPE html>
-<html><body/></html>
-
-
-
-
-

The target parser interface

-

As in ElementTree, and similar to a SAX event handler, you can pass -a target object to the parser:

-
>>> class EchoTarget(object):
-...     def start(self, tag, attrib):
-...         print("start %s %r" % (tag, dict(attrib)))
-...     def end(self, tag):
-...         print("end %s" % tag)
-...     def data(self, data):
-...         print("data %r" % data)
-...     def comment(self, text):
-...         print("comment %s" % text)
-...     def close(self):
-...         print("close")
-...         return "closed!"
-
->>> parser = etree.XMLParser(target = EchoTarget())
-
->>> result = etree.XML("<element>some<!--comment-->text</element>",
-...                    parser)
-start element {}
-data u'some'
-comment comment
-data u'text'
-end element
-close
-
->>> print(result)
-closed!
-
-

It is important for the .close() method to reset the parser target -to a usable state, so that you can reuse the parser as often as you -like:

-
>>> result = etree.XML("<element>some<!--comment-->text</element>",
-...                    parser)
-start element {}
-data u'some'
-comment comment
-data u'text'
-end element
-close
-
->>> print(result)
-closed!
-
-

Starting with lxml 2.3, the .close() method will also be called in -the error case. This diverges from the behaviour of ElementTree, but -allows target objects to clean up their state in all situations, so -that the parser can reuse them afterwards.

-
>>> class CollectorTarget(object):
-...     def __init__(self):
-...         self.events = []
-...     def start(self, tag, attrib):
-...         self.events.append("start %s %r" % (tag, dict(attrib)))
-...     def end(self, tag):
-...         self.events.append("end %s" % tag)
-...     def data(self, data):
-...         self.events.append("data %r" % data)
-...     def comment(self, text):
-...         self.events.append("comment %s" % text)
-...     def close(self):
-...         self.events.append("close")
-...         return "closed!"
-
->>> parser = etree.XMLParser(target = CollectorTarget())
-
->>> result = etree.XML("<element>some</error>",
-...                    parser)        # doctest: +ELLIPSIS
-Traceback (most recent call last):
-  ...
-lxml.etree.XMLSyntaxError: Opening and ending tag mismatch...
-
->>> for event in parser.target.events:
-...     print(event)
-start element {}
-data u'some'
-close
-
-

Note that the parser does not build a tree when using a parser -target. The result of the parser run is whatever the target object -returns from its .close() method. If you want to return an XML -tree here, you have to create it programmatically in the target -object. An example for a parser target that builds a tree is the -TreeBuilder:

-
>>> parser = etree.XMLParser(target = etree.TreeBuilder())
-
->>> result = etree.XML("<element>some<!--comment-->text</element>",
-...                    parser)
-
->>> print(result.tag)
-element
->>> print(result[0].text)
-comment
-
-
-
-

The feed parser interface

-

Since lxml 2.0, the parsers have a feed parser interface that is -compatible to the ElementTree parsers. You can use it to feed data -into the parser in a controlled step-by-step way.

-

In lxml.etree, you can use both interfaces to a parser at the same -time: the parse() or XML() functions, and the feed parser -interface. Both are independent and will not conflict (except if used -in conjunction with a parser target object as described above).

-

To start parsing with a feed parser, just call its feed() method -to feed it some data.

-
>>> parser = etree.XMLParser()
-
->>> for data in ('<?xml versio', 'n="1.0"?', '><roo', 't><a', '/></root>'):
-...     parser.feed(data)
-
-

When you are done parsing, you must call the close() method to -retrieve the root Element of the parse result document, and to unlock the -parser:

-
>>> root = parser.close()
-
->>> print(root.tag)
-root
->>> print(root[0].tag)
-a
-
-

If you do not call close(), the parser will stay locked and -subsequent feeds will keep appending data, usually resulting in a non -well-formed document and an unexpected parser error. So make sure you -always close the parser after use, also in the exception case.

-

Another way of achieving the same step-by-step parsing is by writing your own -file-like object that returns a chunk of data on each read() call. Where -the feed parser interface allows you to actively pass data chunks into the -parser, a file-like object passively responds to read() requests of the -parser itself. Depending on the data source, either way may be more natural.

-

Note that the feed parser has its own error log called -feed_error_log. Errors in the feed parser do not show up in the -normal error_log and vice versa.

-

You can also combine the feed parser interface with the target parser:

-
>>> parser = etree.XMLParser(target = EchoTarget())
-
->>> parser.feed("<eleme")
->>> parser.feed("nt>some text</elem")
-start element {}
-data u'some text'
->>> parser.feed("ent>")
-end element
-
->>> result = parser.close()
-close
->>> print(result)
-closed!
-
-

Again, this prevents the automatic creation of an XML tree and leaves -all the event handling to the target object. The close() method -of the parser forwards the return value of the target's close() -method.

-
-
-

Incremental event parsing

-

In Python 3.4, the xml.etree.ElementTree package gained an extension -to the feed parser interface that is implemented by the XMLPullParser -class. It additionally allows processing parse events after each -incremental parsing step, by calling the .read_events() method and -iterating over the result. This is most useful for non-blocking execution -environments where data chunks arrive one after the other and should be -processed as far as possible in each step.

-

The same feature is available in lxml 3.3. The basic usage is as follows:

-
>>> parser = etree.XMLPullParser(events=('start', 'end'))
-
->>> def print_events(parser):
-...     for action, element in parser.read_events():
-...         print('%s: %s' % (action, element.tag))
-
->>> parser.feed('<root>some text')
->>> print_events(parser)
-start: root
->>> print_events(parser)    # well, no more events, as before ...
-
->>> parser.feed('<child><a />')
->>> print_events(parser)
-start: child
-start: a
-end: a
-
->>> parser.feed('</child></roo')
->>> print_events(parser)
-end: child
->>> parser.feed('t>')
->>> print_events(parser)
-end: root
-
-

Just like the normal feed parser, the XMLPullParser builds a tree in -memory (and you should always call the .close() method when done with -parsing):

-
>>> root = parser.close()
->>> etree.tostring(root)
-b'<root>some text<child><a/></child></root>'
-
-

However, since the parser provides incremental access to that tree, -you can explicitly delete content that you no longer need once you -have processed it. Read the section on Modifying the tree below -to see what you can do here and what kind of modifications you should -avoid.

-

In lxml, it is enough to call the .read_events() method once as -the iterator it returns can be reused when new events are available.

-

Also, as known from other iterators in lxml, you can pass a tag -argument that selects which parse events are returned by the -.read_events() iterator.

-
-

Event types

-

The parse events are tuples (event-type, object). The event types -supported by ElementTree and lxml.etree are the strings 'start', 'end', -'start-ns' and 'end-ns'. The 'start' and 'end' events represent opening -and closing elements. They are accompanied by the respective Element -instance. By default, only 'end' events are generated, whereas the -example above requested the generation of both 'start' and 'end' events.

-

The 'start-ns' and 'end-ns' events notify about namespace declarations. -They do not come with Elements. Instead, the value of the 'start-ns' -event is a tuple (prefix, namespaceURI) that designates the beginning -of a prefix-namespace mapping. The corresponding end-ns event does -not have a value (None). It is common practice to use a list as namespace -stack and pop the last entry on the 'end-ns' event.

-
>>> def print_events(events):
-...     for action, obj in events:
-...         if action in ('start', 'end'):
-...             print("%s: %s" % (action, obj.tag))
-...         elif action == 'start-ns':
-...             print("%s: %s" % (action, obj))
-...         else:
-...             print(action)
-
->>> event_types = ("start", "end", "start-ns", "end-ns")
->>> parser = etree.XMLPullParser(event_types)
->>> events = parser.read_events()
-
->>> parser.feed('<root><element>')
->>> print_events(events)
-start: root
-start: element
->>> parser.feed('text</element><element>text</element>')
->>> print_events(events)
-end: element
-start: element
-end: element
->>> parser.feed('<empty-element xmlns="http://testns/" />')
->>> print_events(events)
-start-ns: ('', 'http://testns/')
-start: {http://testns/}empty-element
-end: {http://testns/}empty-element
-end-ns
->>> parser.feed('</root>')
->>> print_events(events)
-end: root
-
-
-
-

Modifying the tree

-

You can modify the element and its descendants when handling the -'end' event. To save memory, for example, you can remove subtrees -that are no longer needed:

-
>>> parser = etree.XMLPullParser()
->>> events = parser.read_events()
-
->>> parser.feed('<root><element key="value">text</element>')
->>> parser.feed('<element><child /></element>')
->>> for action, elem in events:
-...     print('%s: %d' % (elem.tag, len(elem)))  # processing
-...     elem.clear()                             # delete children
-element: 0
-child: 0
-element: 1
->>> parser.feed('<empty-element xmlns="http://testns/" /></root>')
->>> for action, elem in events:
-...     print('%s: %d' % (elem.tag, len(elem)))  # processing
-...     elem.clear()                             # delete children
-{http://testns/}empty-element: 0
-root: 3
-
->>> root = parser.close()
->>> etree.tostring(root)
-b'<root/>'
-
-

WARNING: During the 'start' event, any content of the element, -such as the descendants, following siblings or text, is not yet -available and should not be accessed. Only attributes are guaranteed -to be set. During the 'end' event, the element and its descendants -can be freely modified, but its following siblings should not be -accessed. During either of the two events, you must not modify or -move the ancestors (parents) of the current element. You should also -avoid moving or discarding the element itself. The golden rule is: do -not touch anything that will have to be touched again by the parser -later on.

-

If you have elements with a long list of children in your XML file and want -to save more memory during parsing, you can clean up the preceding siblings -of the current element:

-
>>> for event, element in parser.read_events():
-...     # ... do something with the element
-...     element.clear()                 # clean up children
-...     while element.getprevious() is not None:
-...         del element.getparent()[0]  # clean up preceding siblings
-
-

The while loop deletes multiple siblings in a row. This is only necessary -if you skipped over some of them using the tag keyword argument. -Otherwise, a simple if should do. The more selective your tag is, -however, the more thought you will have to put into finding the right way to -clean up the elements that were skipped. Therefore, it is sometimes easier to -traverse all elements and do the tag selection by hand in the event handler -code.

-
-
-

Selective tag events

-

As an extension over ElementTree, lxml.etree accepts a tag keyword -argument just like element.iter(tag). This restricts events to a -specific tag or namespace:

-
>>> parser = etree.XMLPullParser(tag="element")
-
->>> parser.feed('<root><element key="value">text</element>')
->>> parser.feed('<element><child /></element>')
->>> parser.feed('<empty-element xmlns="http://testns/" /></root>')
-
->>> for action, elem in parser.read_events():
-...     print("%s: %s" % (action, elem.tag))
-end: element
-end: element
-
->>> event_types = ("start", "end")
->>> parser = etree.XMLPullParser(event_types, tag="{http://testns/}*")
-
->>> parser.feed('<root><element key="value">text</element>')
->>> parser.feed('<element><child /></element>')
->>> parser.feed('<empty-element xmlns="http://testns/" /></root>')
-
->>> for action, elem in parser.read_events():
-...     print("%s: %s" % (action, elem.tag))
-start: {http://testns/}empty-element
-end: {http://testns/}empty-element
-
-
-
-

Comments and PIs

-

As an extension over ElementTree, the XMLPullParser in lxml.etree -also supports the event types 'comment' and 'pi' for the respective -XML structures.

-
>>> event_types = ("start", "end", "comment", "pi")
->>> parser = etree.XMLPullParser(event_types)
-
->>> parser.feed('<?some pi ?><!-- a comment --><root>')
->>> parser.feed('<element key="value">text</element>')
->>> parser.feed('<!-- another comment -->')
->>> parser.feed('<element>text</element>tail')
->>> parser.feed('<empty-element xmlns="http://testns/" />')
->>> parser.feed('</root>')
-
->>> for action, elem in parser.read_events():
-...     if action in ('start', 'end'):
-...         print("%s: %s" % (action, elem.tag))
-...     elif action == 'pi':
-...         print("%s: -%s=%s-" % (action, elem.target, elem.text))
-...     else: # 'comment'
-...         print("%s: -%s-" % (action, elem.text))
-pi: -some=pi -
-comment: - a comment -
-start: root
-start: element
-end: element
-comment: - another comment -
-start: element
-end: element
-start: {http://testns/}empty-element
-end: {http://testns/}empty-element
-end: root
-
->>> root = parser.close()
->>> print(root.tag)
-root
-
-
-
-

Events with custom targets

-

You can combine the pull parser with a parser target. In that case, -it is the target's responsibility to generate event values. Whatever -it returns from its .start() and .end() methods will be returned -by the pull parser as the second item of the parse events tuple.

-
>>> class Target(object):
-...     def start(self, tag, attrib):
-...         print('-> start(%s)' % tag)
-...         return '>>START: %s<<' % tag
-...     def end(self, tag):
-...         print('-> end(%s)' % tag)
-...         return '>>END: %s<<' % tag
-...     def close(self):
-...         print('-> close()')
-...         return "CLOSED!"
-
->>> event_types = ('start', 'end')
->>> parser = etree.XMLPullParser(event_types, target=Target())
-
->>> parser.feed('<root><child1 /><child2 /></root>')
--> start(root)
--> start(child1)
--> end(child1)
--> start(child2)
--> end(child2)
--> end(root)
-
->>> for action, value in parser.read_events():
-...     print('%s: %s' % (action, value))
-start: >>START: root<<
-start: >>START: child1<<
-end: >>END: child1<<
-start: >>START: child2<<
-end: >>END: child2<<
-end: >>END: root<<
-
->>> print(parser.close())
--> close()
-CLOSED!
-
-

As you can see, the event values do not even have to be Element objects. -The target is generally free to decide how it wants to create an XML tree -or whatever else it wants to make of the parser callbacks. In many cases, -however, you will want to make your custom target inherit from the -TreeBuilder class in order to have it build a tree that you can process -normally. The start() and .end() methods of TreeBuilder return -the Element object that was created, so you can override them and modify -the input or output according to your needs. Here is an example that -filters attributes before they are being added to the tree:

-
>>> class AttributeFilter(etree.TreeBuilder):
-...     def start(self, tag, attrib):
-...         attrib = dict(attrib)
-...         if 'evil' in attrib:
-...             del attrib['evil']
-...         return super(AttributeFilter, self).start(tag, attrib)
-
->>> parser = etree.XMLPullParser(target=AttributeFilter())
->>> parser.feed('<root><child1 test="123" /><child2 evil="YES" /></root>')
-
->>> for action, element in parser.read_events():
-...     print('%s: %s(%r)' % (action, element.tag, element.attrib))
-end: child1({'test': '123'})
-end: child2({})
-end: root({})
-
->>> root = parser.close()
-
-
-
-
-

iterparse and iterwalk

-

As known from ElementTree, the iterparse() utility function -returns an iterator that generates parser events for an XML file (or -file-like object), while building the tree. You can think of it as -a blocking wrapper around the XMLPullParser that automatically and -incrementally reads data from the input file for you and provides a -single iterator for them:

-
>>> xml = '''
-... <root>
-...   <element key='value'>text</element>
-...   <element>text</element>tail
-...   <empty-element xmlns="http://testns/" />
-... </root>
-... '''
-
->>> context = etree.iterparse(StringIO(xml))
->>> for action, elem in context:
-...     print("%s: %s" % (action, elem.tag))
-end: element
-end: element
-end: {http://testns/}empty-element
-end: root
-
-

After parsing, the resulting tree is available through the root property -of the iterator:

-
>>> context.root.tag
-'root'
-
-

The other event types can be activated with the events keyword argument:

-
>>> events = ("start", "end")
->>> context = etree.iterparse(StringIO(xml), events=events)
->>> for action, elem in context:
-...     print("%s: %s" % (action, elem.tag))
-start: root
-start: element
-end: element
-start: element
-end: element
-start: {http://testns/}empty-element
-end: {http://testns/}empty-element
-end: root
-
-

iterparse() also supports the tag argument for selective event -iteration and several other parameters that control the parser setup. -The tag argument can be a single tag or a sequence of tags. -You can also use it to parse HTML input by passing html=True.

-
-

iterwalk

-

For convenience, lxml also provides an iterwalk() function. -It behaves exactly like iterparse(), but works on Elements and -ElementTrees. Here is an example for a tree parsed by iterparse():

-
>>> f = StringIO(xml)
->>> context = etree.iterparse(
-...             f, events=("start", "end"), tag="element")
-
->>> for action, elem in context:
-...     print("%s: %s" % (action, elem.tag))
-start: element
-end: element
-start: element
-end: element
-
->>> root = context.root
-
-

And now we can take the resulting in-memory tree and iterate over it -using iterwalk() to get the exact same events without parsing the -input again:

-
>>> context = etree.iterwalk(
-...             root, events=("start", "end"), tag="element")
-
->>> for action, elem in context:
-...     print("%s: %s" % (action, elem.tag))
-start: element
-end: element
-start: element
-end: element
-
-

In order to avoid wasting time on uninteresting parts of the tree, the iterwalk -iterator can be instructed to skip over an entire subtree with its -.skip_subtree() method.

-
>>> root = etree.XML('''
-... <root>
-...   <a> <b /> </a>
-...   <c />
-... </root>
-... ''')
-
->>> context = etree.iterwalk(root, events=("start", "end"))
-
->>> for action, elem in context:
-...     print("%s: %s" % (action, elem.tag))
-...     if action == 'start' and elem.tag == 'a':
-...         context.skip_subtree()  # ignore <b>
-start: root
-start: a
-end: a
-start: c
-end: c
-end: root
-
-

Note that .skip_subtree() only has an effect when handling start or -start-ns events.

-
-
-
-

Python unicode strings

-

lxml.etree has broader support for Python unicode strings than the ElementTree -library. First of all, where ElementTree would raise an exception, the -parsers in lxml.etree can handle unicode strings straight away. This is most -helpful for XML snippets embedded in source code using the XML() -function:

-
>>> root = etree.XML( u'<test> \uf8d1 + \uf8d2 </test>' )
-
-

This requires, however, that unicode strings do not specify a conflicting -encoding themselves and thus lie about their real encoding:

-
>>> etree.XML( u'<?xml version="1.0" encoding="ASCII"?>\n' +
-...            u'<test> \uf8d1 + \uf8d2 </test>' )
-Traceback (most recent call last):
-  ...
-ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
-
-

Similarly, you will get errors when you try the same with HTML data in a -unicode string that specifies a charset in a meta tag of the header. You -should generally avoid converting XML/HTML data to unicode before passing it -into the parsers. It is both slower and error prone.

-
-

Serialising to Unicode strings

-

To serialize the result, you would normally use the tostring() -module function, which serializes to plain ASCII by default or a -number of other byte encodings if asked for:

-
>>> etree.tostring(root)
-b'<test> &#63697; + &#63698; </test>'
-
->>> etree.tostring(root, encoding='UTF-8', xml_declaration=False)
-b'<test> \xef\xa3\x91 + \xef\xa3\x92 </test>'
-
-

As an extension, lxml.etree recognises the name 'unicode' as an argument -to the encoding parameter to build a Python unicode representation of a tree:

-
>>> etree.tostring(root, encoding='unicode')
-u'<test> \uf8d1 + \uf8d2 </test>'
-
->>> el = etree.Element("test")
->>> etree.tostring(el, encoding='unicode')
-u'<test/>'
-
->>> subel = etree.SubElement(el, "subtest")
->>> etree.tostring(el, encoding='unicode')
-u'<test><subtest/></test>'
-
->>> tree = etree.ElementTree(el)
->>> etree.tostring(tree, encoding='unicode')
-u'<test><subtest/></test>'
-
-

The result of tostring(encoding='unicode') can be treated like any -other Python unicode string and then passed back into the parsers. -However, if you want to save the result to a file or pass it over the -network, you should use write() or tostring() with a byte -encoding (typically UTF-8) to serialize the XML. The main reason is -that unicode strings returned by tostring(encoding='unicode') are -not byte streams and they never have an XML declaration to specify -their encoding. These strings are most likely not parsable by other -XML libraries.

-

For normal byte encodings, the tostring() function automatically -adds a declaration as needed that reflects the encoding of the -returned string. This makes it possible for other parsers to -correctly parse the XML byte stream. Note that using tostring() -with UTF-8 is also considerably faster in most cases.

-
-
-
- - - \ No newline at end of file diff --git a/doc/html/performance.html b/doc/html/performance.html deleted file mode 100644 index 9457d41f..00000000 --- a/doc/html/performance.html +++ /dev/null @@ -1,805 +0,0 @@ - - - - - -Benchmarks and Speed - - - - - - -
-

Benchmarks and Speed

- --- - - - -
Author:Stefan Behnel
-

lxml.etree is a very fast XML library. Most of this is due to the -speed of libxml2, e.g. the parser and serialiser, or the XPath engine. -Other areas of lxml were specifically written for high performance in -high-level operations, such as the tree iterators.

-

On the other hand, the simplicity of lxml sometimes hides internal -operations that are more costly than the API suggests. If you are not -aware of these cases, lxml may not always perform as you expect. A -common example in the Python world is the Python list type. New users -often expect it to be a linked list, while it actually is implemented -as an array, which results in a completely different complexity for -common operations.

-

Similarly, the tree model of libxml2 is more complex than what lxml's -ElementTree API projects into Python space, so some operations may -show unexpected performance. Rest assured that most lxml users will -not notice this in real life, as lxml is very fast in absolute -numbers. It is definitely fast enough for most applications, so lxml -is probably somewhere between 'fast enough' and 'the best choice' for -yours. Read some messages from happy users to see what we mean.

-

This text describes where lxml.etree (abbreviated to 'lxe') excels, gives -hints on some performance traps and compares the overall performance to the -original ElementTree (ET) and cElementTree (cET) libraries by Fredrik Lundh. -The cElementTree library is a fast C-implementation of the original -ElementTree.

- -
-

General notes

-

First thing to say: there is an overhead involved in having a DOM-like C -library mimic the ElementTree API. As opposed to ElementTree, lxml has to -generate Python representations of tree nodes on the fly when asked for them, -and the internal tree structure of libxml2 results in a higher maintenance -overhead than the simpler top-down structure of ElementTree. What this means -is: the more of your code runs in Python, the less you can benefit from the -speed of lxml and libxml2. Note, however, that this is true for most -performance critical Python applications. No one would implement Fourier -transformations in pure Python when you can use NumPy.

-

The up side then is that lxml provides powerful tools like tree iterators, -XPath and XSLT, that can handle complex operations at the speed of C. Their -pythonic API in lxml makes them so flexible that most applications can easily -benefit from them.

-
-
-

How to read the timings

-

The statements made here are backed by the (micro-)benchmark scripts -bench_etree.py, bench_xpath.py and bench_objectify.py that come with -the lxml source distribution. They are distributed under the same BSD license -as lxml itself, and the lxml project would like to promote them as a general -benchmarking suite for all ElementTree implementations. New benchmarks are -very easy to add as tiny test methods, so if you write a performance test for -a specific part of the API yourself, please consider sending it to the lxml -mailing list.

-

The timings presented below compare lxml 3.1.1 (with libxml2 2.9.0) to the -latest released versions of ElementTree (with cElementTree as accelerator -module) in the standard library of CPython 3.3.0. They were run -single-threaded on a 2.9GHz 64bit double core Intel i7 machine under -Ubuntu Linux 12.10 (Quantal). The C libraries were compiled with the -same platform specific optimisation flags. The Python interpreter was -also manually compiled for the platform. Note that many of the following -ElementTree timings are therefore better than what a normal Python -installation with the standard library (c)ElementTree modules would yield. -Note also that CPython 2.7 and 3.2+ come with a newer ElementTree version, -so older Python installations will not perform as good for (c)ElementTree, -and sometimes substantially worse.

-

The scripts run a number of simple tests on the different libraries, using -different XML tree configurations: different tree sizes (T1-4), with or -without attributes (-/A), with or without ASCII string or unicode text -(-/S/U), and either against a tree or its serialised XML form (T/X). In the -result extracts cited below, T1 refers to a 3-level tree with many children at -the third level, T2 is swapped around to have many children below the root -element, T3 is a deep tree with few children at each level and T4 is a small -tree, slightly broader than deep. If repetition is involved, this usually -means running the benchmark in a loop over all children of the tree root, -otherwise, the operation is run on the root node (C/R).

-

As an example, the character code (SATR T1) states that the benchmark was -running for tree T1, with plain string text (S) and attributes (A). It was -run against the root element (R) in the tree structure of the data (T).

-

Note that very small operations are repeated in integer loops to make them -measurable. It is therefore not always possible to compare the absolute -timings of, say, a single access benchmark (which usually loops) and a 'get -all in one step' benchmark, which already takes enough time to be measurable -and is therefore measured as is. An example is the index access to a single -child, which cannot be compared to the timings for getchildren(). Take a -look at the concrete benchmarks in the scripts to understand how the numbers -compare.

-
-
-

Parsing and Serialising

-

Serialisation is an area where lxml excels. The reason is that it -executes entirely at the C level, without any interaction with Python -code. The results are rather impressive, especially for UTF-8, which -is native to libxml2. While 20 to 40 times faster than (c)ElementTree -1.2 (which was part of the standard library before Python 2.7/3.2), -lxml is still more than 10 times as fast as the much improved -ElementTree 1.3 in recent Python versions:

-
-lxe: tostring_utf16  (S-TR T1)    7.9958 msec/pass
-cET: tostring_utf16  (S-TR T1)   83.1358 msec/pass
-
-lxe: tostring_utf16  (UATR T1)    8.3222 msec/pass
-cET: tostring_utf16  (UATR T1)   84.4688 msec/pass
-
-lxe: tostring_utf16  (S-TR T2)    8.2297 msec/pass
-cET: tostring_utf16  (S-TR T2)   87.3415 msec/pass
-
-lxe: tostring_utf8   (S-TR T2)    6.5677 msec/pass
-cET: tostring_utf8   (S-TR T2)   76.2064 msec/pass
-
-lxe: tostring_utf8   (U-TR T3)    1.1952 msec/pass
-cET: tostring_utf8   (U-TR T3)   22.0058 msec/pass
-
-

The difference is somewhat smaller for plain text serialisation:

-
-lxe: tostring_text_ascii     (S-TR T1)    2.7738 msec/pass
-cET: tostring_text_ascii     (S-TR T1)    4.7629 msec/pass
-
-lxe: tostring_text_ascii     (S-TR T3)    0.8273 msec/pass
-cET: tostring_text_ascii     (S-TR T3)    1.5273 msec/pass
-
-lxe: tostring_text_utf16     (S-TR T1)    2.7659 msec/pass
-cET: tostring_text_utf16     (S-TR T1)   10.5038 msec/pass
-
-lxe: tostring_text_utf16     (U-TR T1)    2.8017 msec/pass
-cET: tostring_text_utf16     (U-TR T1)   10.5207 msec/pass
-
-

The tostring() function also supports serialisation to a Python -unicode string object, which is currently faster in ElementTree -under CPython 3.3:

-
-lxe: tostring_text_unicode   (S-TR T1)    2.6896 msec/pass
-cET: tostring_text_unicode   (S-TR T1)    1.0056 msec/pass
-
-lxe: tostring_text_unicode   (U-TR T1)    2.7366 msec/pass
-cET: tostring_text_unicode   (U-TR T1)    1.0154 msec/pass
-
-lxe: tostring_text_unicode   (S-TR T3)    0.7997 msec/pass
-cET: tostring_text_unicode   (S-TR T3)    0.3154 msec/pass
-
-lxe: tostring_text_unicode   (U-TR T4)    0.0048 msec/pass
-cET: tostring_text_unicode   (U-TR T4)    0.0160 msec/pass
-
-

For parsing, lxml.etree and cElementTree compete for the medal. -Depending on the input, either of the two can be faster. The (c)ET -libraries use a very thin layer on top of the expat parser, which is -known to be very fast. Here are some timings from the benchmarking -suite:

-
-lxe: parse_bytesIO   (SAXR T1)   13.0246 msec/pass
-cET: parse_bytesIO   (SAXR T1)    8.2929 msec/pass
-
-lxe: parse_bytesIO   (S-XR T3)    1.3542 msec/pass
-cET: parse_bytesIO   (S-XR T3)    2.4023 msec/pass
-
-lxe: parse_bytesIO   (UAXR T3)    7.5610 msec/pass
-cET: parse_bytesIO   (UAXR T3)   11.2455 msec/pass
-
-

And another couple of timings from a benchmark that Fredrik Lundh -used to promote cElementTree, comparing a number of different -parsers. First, parsing a 274KB XML file containing Shakespeare's -Hamlet:

-
-xml.etree.ElementTree.parse done in 0.017 seconds
-xml.etree.cElementTree.parse done in 0.007 seconds
-xml.etree.cElementTree.XMLParser.feed(): 6636 nodes read in 0.007 seconds
-lxml.etree.parse done in 0.003 seconds
-drop_whitespace.parse done in 0.003 seconds
-lxml.etree.XMLParser.feed(): 6636 nodes read in 0.004 seconds
-minidom tree read in 0.080 seconds
-
-

And a 3.4MB XML file containing the Old Testament:

-
-xml.etree.ElementTree.parse done in 0.038 seconds
-xml.etree.cElementTree.parse done in 0.030 seconds
-xml.etree.cElementTree.XMLParser.feed(): 25317 nodes read in 0.030 seconds
-lxml.etree.parse done in 0.016 seconds
-drop_whitespace.parse done in 0.015 seconds
-lxml.etree.XMLParser.feed(): 25317 nodes read in 0.022 seconds
-minidom tree read in 0.288 seconds
-
-

Here are the same benchmarks again, but including the memory usage -of the process in KB before and after parsing (using os.fork() to -make sure we start from a clean state each time). For the 274KB -hamlet.xml file:

-
-Memory usage: 7284
-xml.etree.ElementTree.parse done in 0.017 seconds
-Memory usage: 9432 (+2148)
-xml.etree.cElementTree.parse done in 0.007 seconds
-Memory usage: 9432 (+2152)
-xml.etree.cElementTree.XMLParser.feed(): 6636 nodes read in 0.007 seconds
-Memory usage: 9448 (+2164)
-lxml.etree.parse done in 0.003 seconds
-Memory usage: 11032 (+3748)
-drop_whitespace.parse done in 0.003 seconds
-Memory usage: 10224 (+2940)
-lxml.etree.XMLParser.feed(): 6636 nodes read in 0.004 seconds
-Memory usage: 11804 (+4520)
-minidom tree read in 0.080 seconds
-Memory usage: 12324 (+5040)
-
-

And for the 3.4MB Old Testament XML file:

-
-Memory usage: 10420
-xml.etree.ElementTree.parse done in 0.038 seconds
-Memory usage: 20660 (+10240)
-xml.etree.cElementTree.parse done in 0.030 seconds
-Memory usage: 20660 (+10240)
-xml.etree.cElementTree.XMLParser.feed(): 25317 nodes read in 0.030 seconds
-Memory usage: 20844 (+10424)
-lxml.etree.parse done in 0.016 seconds
-Memory usage: 27624 (+17204)
-drop_whitespace.parse done in 0.015 seconds
-Memory usage: 24468 (+14052)
-lxml.etree.XMLParser.feed(): 25317 nodes read in 0.022 seconds
-Memory usage: 29844 (+19424)
-minidom tree read in 0.288 seconds
-Memory usage: 28788 (+18368)
-
-

As can be seen from the sizes, both lxml.etree and cElementTree are -rather memory friendly compared to the pure Python libraries -ElementTree and (especially) minidom. Comparing to older CPython -versions, the memory footprint of the minidom library was considerably -reduced in CPython 3.3, by about a factor of 4 in this case.

-

For plain parser performance, lxml.etree and cElementTree tend to stay -rather close to each other, usually within a factor of two, with -winners well distributed over both sides. Similar timings can be -observed for the iterparse() function:

-
-lxe: iterparse_bytesIO   (SAXR T1)   17.9198 msec/pass
-cET: iterparse_bytesIO   (SAXR T1)   14.4982 msec/pass
-
-lxe: iterparse_bytesIO   (UAXR T3)    8.8522 msec/pass
-cET: iterparse_bytesIO   (UAXR T3)   12.9857 msec/pass
-
-

However, if you benchmark the complete round-trip of a serialise-parse -cycle, the numbers will look similar to these:

-
-lxe: write_utf8_parse_bytesIO   (S-TR T1)   19.8867 msec/pass
-cET: write_utf8_parse_bytesIO   (S-TR T1)   80.7259 msec/pass
-
-lxe: write_utf8_parse_bytesIO   (UATR T2)   23.7896 msec/pass
-cET: write_utf8_parse_bytesIO   (UATR T2)   98.0766 msec/pass
-
-lxe: write_utf8_parse_bytesIO   (S-TR T3)    3.0684 msec/pass
-cET: write_utf8_parse_bytesIO   (S-TR T3)   24.6122 msec/pass
-
-lxe: write_utf8_parse_bytesIO   (SATR T4)    0.3495 msec/pass
-cET: write_utf8_parse_bytesIO   (SATR T4)    1.9610 msec/pass
-
-

For applications that require a high parser throughput of large files, -and that do little to no serialization, both cET and lxml.etree are a -good choice. The cET library is particularly fast for iterparse -applications that extract small amounts of data or aggregate -information from large XML data sets that do not fit into memory. If -it comes to round-trip performance, however, lxml is multiple times -faster in total. So, whenever the input documents are not -considerably larger than the output, lxml is the clear winner.

-

Regarding HTML parsing, Ian Bicking has done some benchmarking on -lxml's HTML parser, comparing it to a number of other famous HTML -parser tools for Python. lxml wins this contest by quite a length. -To give an idea, the numbers suggest that lxml.html can run a couple -of parse-serialise cycles in the time that other tools need for -parsing alone. The comparison even shows some very favourable results -regarding memory consumption.

-

Liza Daly has written an article that presents a couple of tweaks to -get the most out of lxml's parser for very large XML documents. She -quite favourably positions lxml.etree as a tool for -high-performance XML parsing.

-

Finally, xml.com has a couple of publications about XML parser -performance. Farwick and Hafner have written two interesting articles -that compare the parser of libxml2 to some major Java based XML -parsers. One deals with event-driven parser performance, the other -one presents benchmark results comparing DOM parsers. Both -comparisons suggest that libxml2's parser performance is largely -superior to all commonly used Java parsers in almost all cases. Note -that the C parser benchmark results are based on xmlbench, which uses -a simpler setup for libxml2 than lxml does.

-
-
-

The ElementTree API

-

Since all three libraries implement the same API, their performance is -easy to compare in this area. A major disadvantage for lxml's -performance is the different tree model that underlies libxml2. It -allows lxml to provide parent pointers for elements and full XPath -support, but also increases the overhead of tree building and -restructuring. This can be seen from the tree setup times of the -benchmark (given in seconds):

-
-lxe:       --     S-     U-     -A     SA     UA
-     T1: 0.0299 0.0343 0.0344 0.0293 0.0345 0.0342
-     T2: 0.0368 0.0423 0.0418 0.0427 0.0474 0.0459
-     T3: 0.0088 0.0084 0.0086 0.0251 0.0258 0.0261
-     T4: 0.0002 0.0002 0.0002 0.0005 0.0006 0.0006
-cET:       --     S-     U-     -A     SA     UA
-     T1: 0.0050 0.0045 0.0093 0.0044 0.0043 0.0043
-     T2: 0.0073 0.0075 0.0074 0.0201 0.0075 0.0074
-     T3: 0.0033 0.0213 0.0032 0.0034 0.0033 0.0035
-     T4: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
-
-

The timings are somewhat close to each other, although cET can be -several times faster than lxml for larger trees. One of the -reasons is that lxml must encode incoming string data and tag names -into UTF-8, and additionally discard the created Python elements -after their use, when they are no longer referenced. ElementTree -represents the tree itself through these objects, which reduces -the overhead in creating them.

-
-

Child access

-

The same tree overhead makes operations like collecting children as in -list(element) more costly in lxml. Where cET can quickly create -a shallow copy of their list of children, lxml has to create a Python -object for each child and collect them in a list:

-
-lxe: root_list_children        (--TR T1)    0.0038 msec/pass
-cET: root_list_children        (--TR T1)    0.0010 msec/pass
-
-lxe: root_list_children        (--TR T2)    0.0455 msec/pass
-cET: root_list_children        (--TR T2)    0.0050 msec/pass
-
-

This handicap is also visible when accessing single children:

-
-lxe: first_child               (--TR T2)    0.0424 msec/pass
-cET: first_child               (--TR T2)    0.0384 msec/pass
-
-lxe: last_child                (--TR T1)    0.0477 msec/pass
-cET: last_child                (--TR T1)    0.0467 msec/pass
-
-

... unless you also add the time to find a child index in a bigger -list. ET and cET use Python lists here, which are based on arrays. -The data structure used by libxml2 is a linked tree, and thus, a -linked list of children:

-
-lxe: middle_child              (--TR T1)    0.0710 msec/pass
-cET: middle_child              (--TR T1)    0.0420 msec/pass
-
-lxe: middle_child              (--TR T2)    1.7393 msec/pass
-cET: middle_child              (--TR T2)    0.0396 msec/pass
-
-
-
-

Element creation

-

As opposed to ET, libxml2 has a notion of documents that each element must be -in. This results in a major performance difference for creating independent -Elements that end up in independently created documents:

-
-lxe: create_elements           (--TC T2)    1.0045 msec/pass
-cET: create_elements           (--TC T2)    0.0753 msec/pass
-
-

Therefore, it is always preferable to create Elements for the document they -are supposed to end up in, either as SubElements of an Element or using the -explicit Element.makeelement() call:

-
-lxe: makeelement               (--TC T2)    1.0586 msec/pass
-cET: makeelement               (--TC T2)    0.1483 msec/pass
-
-lxe: create_subelements        (--TC T2)    0.8826 msec/pass
-cET: create_subelements        (--TC T2)    0.0827 msec/pass
-
-

So, if the main performance bottleneck of an application is creating large XML -trees in memory through calls to Element and SubElement, cET is the best -choice. Note, however, that the serialisation performance may even out this -advantage, especially for smaller trees and trees with many attributes.

-
-
-

Merging different sources

-

A critical action for lxml is moving elements between document contexts. It -requires lxml to do recursive adaptations throughout the moved tree structure.

-

The following benchmark appends all root children of the second tree to the -root of the first tree:

-
-lxe: append_from_document      (--TR T1,T2)    1.0812 msec/pass
-cET: append_from_document      (--TR T1,T2)    0.1104 msec/pass
-
-lxe: append_from_document      (--TR T3,T4)    0.0155 msec/pass
-cET: append_from_document      (--TR T3,T4)    0.0060 msec/pass
-
-

Although these are fairly small numbers compared to parsing, this easily shows -the different performance classes for lxml and (c)ET. Where the latter do not -have to care about parent pointers and tree structures, lxml has to deep -traverse the appended tree. The performance difference therefore increases -with the size of the tree that is moved.

-

This difference is not always as visible, but applies to most parts of the -API, like inserting newly created elements:

-
-lxe: insert_from_document         (--TR T1,T2)    3.9763 msec/pass
-cET: insert_from_document         (--TR T1,T2)    0.1459 msec/pass
-
-

or replacing the child slice by a newly created element:

-
-lxe: replace_children_element   (--TC T1)    0.0749 msec/pass
-cET: replace_children_element   (--TC T1)    0.0081 msec/pass
-
-

as opposed to replacing the slice with an existing element from the -same document:

-
-lxe: replace_children           (--TC T1)    0.0052 msec/pass
-cET: replace_children           (--TC T1)    0.0036 msec/pass
-
-

While these numbers are too small to provide a major performance -impact in practice, you should keep this difference in mind when you -merge very large trees. Note that Elements have a makeelement() -method that allows to create an Element within the same document, -thus avoiding the merge overhead when inserting it into that tree.

-
-
-

deepcopy

-

Deep copying a tree is fast in lxml:

-
-lxe: deepcopy_all              (--TR T1)    3.1650 msec/pass
-cET: deepcopy_all              (--TR T1)   53.9973 msec/pass
-
-lxe: deepcopy_all              (-ATR T2)    3.7365 msec/pass
-cET: deepcopy_all              (-ATR T2)   61.6267 msec/pass
-
-lxe: deepcopy_all              (S-TR T3)    0.7913 msec/pass
-cET: deepcopy_all              (S-TR T3)   13.6220 msec/pass
-
-

So, for example, if you have a database-like scenario where you parse in a -large tree and then search and copy independent subtrees from it for further -processing, lxml is by far the best choice here.

-
-
-

Tree traversal

-

Another important area in XML processing is iteration for tree -traversal. If your algorithms can benefit from step-by-step -traversal of the XML tree and especially if few elements are of -interest or the target element tag name is known, the .iter() -method is a good choice:

-
-lxe: iter_all             (--TR T1)    1.0529 msec/pass
-cET: iter_all             (--TR T1)    0.2635 msec/pass
-
-lxe: iter_islice          (--TR T2)    0.0110 msec/pass
-cET: iter_islice          (--TR T2)    0.0050 msec/pass
-
-lxe: iter_tag             (--TR T2)    0.0079 msec/pass
-cET: iter_tag             (--TR T2)    0.0112 msec/pass
-
-lxe: iter_tag_all         (--TR T2)    0.1822 msec/pass
-cET: iter_tag_all         (--TR T2)    0.5343 msec/pass
-
-

This translates directly into similar timings for Element.findall():

-
-lxe: findall              (--TR T2)    1.7176 msec/pass
-cET: findall              (--TR T2)    0.9973 msec/pass
-
-lxe: findall              (--TR T3)    0.3967 msec/pass
-cET: findall              (--TR T3)    0.2525 msec/pass
-
-lxe: findall_tag          (--TR T2)    0.2258 msec/pass
-cET: findall_tag          (--TR T2)    0.5770 msec/pass
-
-lxe: findall_tag          (--TR T3)    0.1085 msec/pass
-cET: findall_tag          (--TR T3)    0.1919 msec/pass
-
-

Note that all three libraries currently use the same Python -implementation for .findall(), except for their native tree -iterator (element.iter()). In general, lxml is very fast -for iteration, but loses ground against cET when many Elements -are found and need to be instantiated. So, the more selective -your search is, the faster lxml will run.

-
-
-
-

XPath

-

The following timings are based on the benchmark script bench_xpath.py.

-

This part of lxml does not have an equivalent in ElementTree. However, lxml -provides more than one way of accessing it and you should take care which part -of the lxml API you use. The most straight forward way is to call the -xpath() method on an Element or ElementTree:

-
-lxe: xpath_method         (--TC T1)    0.3982 msec/pass
-lxe: xpath_method         (--TC T2)    7.8895 msec/pass
-lxe: xpath_method         (--TC T3)    0.0477 msec/pass
-lxe: xpath_method         (--TC T4)    0.3982 msec/pass
-
-

This is well suited for testing and when the XPath expressions are as diverse -as the trees they are called on. However, if you have a single XPath -expression that you want to apply to a larger number of different elements, -the XPath class is the most efficient way to do it:

-
-lxe: xpath_class          (--TC T1)    0.0713 msec/pass
-lxe: xpath_class          (--TC T2)    1.1325 msec/pass
-lxe: xpath_class          (--TC T3)    0.0215 msec/pass
-lxe: xpath_class          (--TC T4)    0.0722 msec/pass
-
-

Note that this still allows you to use variables in the expression, so you can -parse it once and then adapt it through variables at call time. In other -cases, where you have a fixed Element or ElementTree and want to run different -expressions on it, you should consider the XPathEvaluator:

-
-lxe: xpath_element        (--TR T1)    0.1101 msec/pass
-lxe: xpath_element        (--TR T2)    2.0473 msec/pass
-lxe: xpath_element        (--TR T3)    0.0267 msec/pass
-lxe: xpath_element        (--TR T4)    0.1087 msec/pass
-
-

While it looks slightly slower, creating an XPath object for each of the -expressions generates a much higher overhead here:

-
-lxe: xpath_class_repeat           (--TC T1   )    0.3884 msec/pass
-lxe: xpath_class_repeat           (--TC T2   )    7.6182 msec/pass
-lxe: xpath_class_repeat           (--TC T3   )    0.0465 msec/pass
-lxe: xpath_class_repeat           (--TC T4   )    0.3877 msec/pass
-
-

Note that tree iteration can be substantially faster than XPath if -your code short-circuits after the first couple of elements were -found. The XPath engine will always return the complete result set, -regardless of how much of it will actually be used.

-

Here is an example where only the first matching element is being -searched, a case for which XPath has syntax support as well:

-
-lxe: find_single                (--TR T2)    0.0184 msec/pass
-cET: find_single                (--TR T2)    0.0052 msec/pass
-
-lxe: iter_single                (--TR T2)    0.0024 msec/pass
-cET: iter_single                (--TR T2)    0.0007 msec/pass
-
-lxe: xpath_single               (--TR T2)    0.0033 msec/pass
-
-

When looking for the first two elements out of many, the numbers -explode for XPath, as restricting the result subset requires a -more complex expression:

-
-lxe: iterfind_two               (--TR T2)    0.0184 msec/pass
-cET: iterfind_two               (--TR T2)    0.0062 msec/pass
-
-lxe: iter_two                   (--TR T2)    0.0029 msec/pass
-cET: iter_two                   (--TR T2)    0.0017 msec/pass
-
-lxe: xpath_two                  (--TR T2)    0.2768 msec/pass
-
-
-
-

A longer example

-

... based on lxml 1.3.

-

A while ago, Uche Ogbuji posted a benchmark proposal that would -read in a 3MB XML version of the Old Testament of the Bible and -look for the word begat in all verses. Apparently, it is contained -in 120 out of almost 24000 verses. This is easy to implement in -ElementTree using findall(). However, the fastest and most memory -friendly way to do this is obviously iterparse(), as most of the -data is not of any interest.

-

Now, Uche's original proposal was more or less the following:

-
def bench_ET():
-    tree = ElementTree.parse("ot.xml")
-    result = []
-    for v in tree.findall("//v"):
-        text = v.text
-        if 'begat' in text:
-            result.append(text)
-    return len(result)
-
-

which takes about one second on my machine today. The faster iterparse() -variant looks like this:

-
def bench_ET_iterparse():
-    result = []
-    for event, v in ElementTree.iterparse("ot.xml"):
-        if v.tag == 'v':
-            text = v.text
-            if 'begat' in text:
-                result.append(text)
-        v.clear()
-    return len(result)
-
-

The improvement is about 10%. At the time I first tried (early 2006), lxml -didn't have iterparse() support, but the findall() variant was already -faster than ElementTree. This changes immediately when you switch to -cElementTree. The latter only needs 0.17 seconds to do the trick today and -only some impressive 0.10 seconds when running the iterparse version. And -even back then, it was quite a bit faster than what lxml could achieve.

-

Since then, lxml has matured a lot and has gotten much faster. The iterparse -variant now runs in 0.14 seconds, and if you remove the v.clear(), it is -even a little faster (which isn't the case for cElementTree).

-

One of the many great tools in lxml is XPath, a Swiss army knife for finding -things in XML documents. It is possible to move the whole thing to a pure -XPath implementation, which looks like this:

-
def bench_lxml_xpath_all():
-    tree = etree.parse("ot.xml")
-    result = tree.xpath("//v[contains(., 'begat')]/text()")
-    return len(result)
-
-

This runs in about 0.13 seconds and is about the shortest possible -implementation (in lines of Python code) that I could come up with. Now, this -is already a rather complex XPath expression compared to the simple "//v" -ElementPath expression we started with. Since this is also valid XPath, let's -try this instead:

-
def bench_lxml_xpath():
-    tree = etree.parse("ot.xml")
-    result = []
-    for v in tree.xpath("//v"):
-        text = v.text
-        if 'begat' in text:
-            result.append(text)
-    return len(result)
-
-

This gets us down to 0.12 seconds, thus showing that a generic XPath -evaluation engine cannot always compete with a simpler, tailored solution. -However, since this is not much different from the original findall variant, -we can remove the complexity of the XPath call completely and just go with -what we had in the beginning. Under lxml, this runs in the same 0.12 seconds.

-

But there is one thing left to try. We can replace the simple ElementPath -expression with a native tree iterator:

-
def bench_lxml_getiterator():
-    tree = etree.parse("ot.xml")
-    result = []
-    for v in tree.getiterator("v"):
-        text = v.text
-        if 'begat' in text:
-            result.append(text)
-    return len(result)
-
-

This implements the same thing, just without the overhead of parsing and -evaluating a path expression. And this makes it another bit faster, down to -0.11 seconds. For comparison, cElementTree runs this version in 0.17 seconds.

-

So, what have we learned?

-
    -
  • Python code is not slow. The pure XPath solution was not even as fast as -the first shot Python implementation. In general, a few more lines in -Python make things more readable, which is much more important than the last -5% of performance.
  • -
  • It's important to know the available options - and it's worth starting with -the most simple one. In this case, a programmer would then probably have -started with getiterator("v") or iterparse(). Either of them would -already have been the most efficient, depending on which library is used.
  • -
  • It's important to know your tool. lxml and cElementTree are both very fast -libraries, but they do not have the same performance characteristics. The -fastest solution in one library can be comparatively slow in the other. If -you optimise, optimise for the specific target platform.
  • -
  • It's not always worth optimising. After all that hassle we got from 0.12 -seconds for the initial implementation to 0.11 seconds. Switching over to -cElementTree and writing an iterparse() based version would have given -us 0.10 seconds - not a big difference for 3MB of XML.
  • -
  • Take care what operation is really dominating in your use case. If we split -up the operations, we can see that lxml is slightly slower than cElementTree -on parse() (both about 0.06 seconds), but more visibly slower on -iterparse(): 0.07 versus 0.10 seconds. However, tree iteration in lxml -is incredibly fast, so it can be better to parse the whole tree and then -iterate over it rather than using iterparse() to do both in one step. -Or, you can just wait for the lxml developers to optimise iterparse in one -of the next releases...
  • -
-
-
-

lxml.objectify

-

The following timings are based on the benchmark script bench_objectify.py.

-

Objectify is a data-binding API for XML based on lxml.etree, that was added in -version 1.1. It uses standard Python attribute access to traverse the XML -tree. It also features ObjectPath, a fast path language based on the same -meme.

-

Just like lxml.etree, lxml.objectify creates Python representations of -elements on the fly. To save memory, the normal Python garbage collection -mechanisms will discard them when their last reference is gone. In cases -where deeply nested elements are frequently accessed through the objectify -API, the create-discard cycles can become a bottleneck, as elements have to be -instantiated over and over again.

-
-

ObjectPath

-

ObjectPath can be used to speed up the access to elements that are deep in the -tree. It avoids step-by-step Python element instantiations along the path, -which can substantially improve the access time:

-
-lxe: attribute                  (--TR T1)    4.1828 msec/pass
-lxe: attribute                  (--TR T2)   17.3802 msec/pass
-lxe: attribute                  (--TR T4)    3.8657 msec/pass
-
-lxe: objectpath                 (--TR T1)    0.9289 msec/pass
-lxe: objectpath                 (--TR T2)   13.3109 msec/pass
-lxe: objectpath                 (--TR T4)    0.9289 msec/pass
-
-lxe: attributes_deep            (--TR T1)    6.2900 msec/pass
-lxe: attributes_deep            (--TR T2)   20.4713 msec/pass
-lxe: attributes_deep            (--TR T4)    6.1679 msec/pass
-
-lxe: objectpath_deep            (--TR T1)    1.3049 msec/pass
-lxe: objectpath_deep            (--TR T2)   14.0815 msec/pass
-lxe: objectpath_deep            (--TR T4)    1.3051 msec/pass
-
-

Note, however, that parsing ObjectPath expressions is not for free either, so -this is most effective for frequently accessing the same element.

-
-
-

Caching Elements

-

A way to improve the normal attribute access time is static instantiation of -the Python objects, thus trading memory for speed. Just create a cache -dictionary and run:

-
cache[root] = list(root.iter())
-
-

after parsing and:

-
del cache[root]
-
-

when you are done with the tree. This will keep the Python element -representations of all elements alive and thus avoid the overhead of repeated -Python object creation. You can also consider using filters or generator -expressions to be more selective. By choosing the right trees (or even -subtrees and elements) to cache, you can trade memory usage against access -speed:

-
-lxe: attribute_cached           (--TR T1)    3.1357 msec/pass
-lxe: attribute_cached           (--TR T2)   15.8911 msec/pass
-lxe: attribute_cached           (--TR T4)    2.9194 msec/pass
-
-lxe: attributes_deep_cached     (--TR T1)    3.8984 msec/pass
-lxe: attributes_deep_cached     (--TR T2)   16.8300 msec/pass
-lxe: attributes_deep_cached     (--TR T4)    3.6936 msec/pass
-
-lxe: objectpath_deep_cached     (--TR T1)    0.7496 msec/pass
-lxe: objectpath_deep_cached     (--TR T2)   12.3763 msec/pass
-lxe: objectpath_deep_cached     (--TR T4)    0.7427 msec/pass
-
-

Things to note: you cannot currently use weakref.WeakKeyDictionary objects -for this as lxml's element objects do not support weak references (which are -costly in terms of memory). Also note that new element objects that you add -to these trees will not turn up in the cache automatically and will therefore -still be garbage collected when all their Python references are gone, so this -is most effective for largely immutable trees. You should consider using a -set instead of a list in this case and add new elements by hand.

-
-
-

Further optimisations

-

Here are some more things to try if optimisation is required:

-
    -
  • A lot of time is usually spent in tree traversal to find the addressed -elements in the tree. If you often work in subtrees, do what you would also -do with deep Python objects: assign the parent of the subtree to a variable -or pass it into functions instead of starting at the root. This allows -accessing its descendants more directly.
  • -
  • Try assigning data values directly to attributes instead of passing them -through DataElement.
  • -
  • If you use custom data types that are costly to parse, try running -objectify.annotate() over read-only trees to speed up the attribute type -inference on read access.
  • -
-

Note that none of these measures is guaranteed to speed up your application. -As usual, you should prefer readable code over premature optimisations and -profile your expected use cases before bothering to apply optimisations at -random.

-
-
-
- - - \ No newline at end of file diff --git a/doc/html/resolvers.html b/doc/html/resolvers.html deleted file mode 100644 index 345915e8..00000000 --- a/doc/html/resolvers.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - - -Document loading and URL resolving - - - -
-

Document loading and URL resolving

- - -

The normal way to load external entities (such as DTDs) is by using -XML catalogs. Lxml also has support for user provided document -loaders in both the parsers and XSL transformations. These so-called -resolvers are subclasses of the etree.Resolver class.

-
-

XML Catalogs

-

When loading an external entity for a document, e.g. a DTD, the parser -is normally configured to prevent network access (see the -no_network parser option). Instead, it will try to load the -entity from their local file system path or, in the most common case -that the entity uses a network URL as reference, from a local XML -catalog.

-

XML catalogs are the preferred and agreed-on mechanism to load -external entities from XML processors. Most tools will use them, so -it is worth configuring them properly on a system. Many Linux -installations use them by default, but on other systems they may need -to get enabled manually. The libxml2 site has some documentation -on how to set up XML catalogs

-
-
-

URI Resolvers

-

Here is an example of a custom resolver:

-
>>> from lxml import etree
-
->>> class DTDResolver(etree.Resolver):
-...     def resolve(self, url, id, context):
-...         print("Resolving URL '%s'" % url)
-...         return self.resolve_string(
-...             '<!ENTITY myentity "[resolved text: %s]">' % url, context)
-
-

This defines a resolver that always returns a dynamically generated DTD -fragment defining an entity. The url argument passes the system URL of -the requested document, the id argument is the public ID. Note that any -of these may be None. The context object is not normally used by client code.

-

Resolving is based on the methods of the Resolver object that build -internal representations of the result document. The following -methods exist:

-
    -
  • resolve_string takes a parsable string as result document
  • -
  • resolve_filename takes a filename
  • -
  • resolve_file takes an open file-like object that has at least a read() method
  • -
  • resolve_empty resolves into an empty document
  • -
-

The resolve() method may choose to return None, in which case the next -registered resolver (or the default resolver) is consulted. Resolving always -terminates if resolve() returns the result of any of the above -resolve_*() methods.

-

Resolvers are registered local to a parser:

-
>>> parser = etree.XMLParser(load_dtd=True)
->>> parser.resolvers.add( DTDResolver() )
-
-

Note that we instantiate a parser that loads the DTD. This is not done by the -default parser, which does no validation. When we use this parser to parse a -document that requires resolving a URL, it will call our custom resolver:

-
>>> xml = '<!DOCTYPE doc SYSTEM "MissingDTD.dtd"><doc>&myentity;</doc>'
->>> tree = etree.parse(StringIO(xml), parser)
-Resolving URL 'MissingDTD.dtd'
->>> root = tree.getroot()
->>> print(root.text)
-[resolved text: MissingDTD.dtd]
-
-

The entity in the document was correctly resolved by the generated DTD -fragment.

-
-
-

Document loading in context

-

XML documents memorise their initial parser (and its resolvers) during their -life-time. This means that a lookup process related to a document will use -the resolvers of the document's parser. We can demonstrate this with a -resolver that only responds to a specific prefix:

-
>>> class PrefixResolver(etree.Resolver):
-...     def __init__(self, prefix):
-...         self.prefix = prefix
-...         self.result_xml = '''\
-...              <xsl:stylesheet
-...                     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-...                <test xmlns="testNS">%s-TEST</test>
-...              </xsl:stylesheet>
-...              ''' % prefix
-...     def resolve(self, url, pubid, context):
-...         if url.startswith(self.prefix):
-...             print("Resolved url %s as prefix %s" % (url, self.prefix))
-...             return self.resolve_string(self.result_xml, context)
-
-

We demonstrate this in XSLT and use the following stylesheet as an example:

-
>>> xml_text = """\
-... <xsl:stylesheet version="1.0"
-...    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-...   <xsl:include href="honk:test"/>
-...   <xsl:template match="/">
-...     <test>
-...       <xsl:value-of select="document('hoi:test')/*/*/text()"/>
-...     </test>
-...   </xsl:template>
-... </xsl:stylesheet>
-... """
-
-

Note that it needs to resolve two URIs: honk:test when compiling the XSLT -document (i.e. when resolving xsl:import and xsl:include elements) and -hoi:test at transformation time, when calls to the document function -are resolved. If we now register different resolvers with two different -parsers, we can parse our document twice in different resolver contexts:

-
>>> hoi_parser = etree.XMLParser()
->>> normal_doc = etree.parse(StringIO(xml_text), hoi_parser)
-
->>> hoi_parser.resolvers.add( PrefixResolver("hoi") )
->>> hoi_doc = etree.parse(StringIO(xml_text), hoi_parser)
-
->>> honk_parser = etree.XMLParser()
->>> honk_parser.resolvers.add( PrefixResolver("honk") )
->>> honk_doc = etree.parse(StringIO(xml_text), honk_parser)
-
-

These contexts are important for the further behaviour of the documents. They -memorise their original parser so that the correct set of resolvers is used in -subsequent lookups. To compile the stylesheet, XSLT must resolve the -honk:test URI in the xsl:include element. The hoi resolver cannot -do that:

-
>>> transform = etree.XSLT(normal_doc)
-Traceback (most recent call last):
-  ...
-lxml.etree.XSLTParseError: Cannot resolve URI honk:test
-
->>> transform = etree.XSLT(hoi_doc)
-Traceback (most recent call last):
-  ...
-lxml.etree.XSLTParseError: Cannot resolve URI honk:test
-
-

However, if we use the honk resolver associated with the respective -document, everything works fine:

-
>>> transform = etree.XSLT(honk_doc)
-Resolved url honk:test as prefix honk
-
-

Running the transform accesses the same parser context again, but since it now -needs to resolve the hoi URI in the call to the document function, its -honk resolver will fail to do so:

-
>>> result = transform(normal_doc)
-Traceback (most recent call last):
-  ...
-lxml.etree.XSLTApplyError: Cannot resolve URI hoi:test
-
->>> result = transform(hoi_doc)
-Traceback (most recent call last):
-  ...
-lxml.etree.XSLTApplyError: Cannot resolve URI hoi:test
-
->>> result = transform(honk_doc)
-Traceback (most recent call last):
-  ...
-lxml.etree.XSLTApplyError: Cannot resolve URI hoi:test
-
-

This can only be solved by adding a hoi resolver to the original parser:

-
>>> honk_parser.resolvers.add( PrefixResolver("hoi") )
->>> result = transform(honk_doc)
-Resolved url hoi:test as prefix hoi
->>> print(str(result)[:-1])
-<?xml version="1.0"?>
-<test>hoi-TEST</test>
-
-

We can see that the hoi resolver was called to generate a document that -was then inserted into the result document by the XSLT transformation. Note -that this is completely independent of the XML file you transform, as the URI -is resolved from within the stylesheet context:

-
>>> result = transform(normal_doc)
-Resolved url hoi:test as prefix hoi
->>> print(str(result)[:-1])
-<?xml version="1.0"?>
-<test>hoi-TEST</test>
-
-

It may be seen as a matter of taste what resolvers the generated document -inherits. For XSLT, the output document inherits the resolvers of the input -document and not those of the stylesheet. Therefore, the last result does not -inherit any resolvers at all.

-
-
-

I/O access control in XSLT

-

By default, XSLT supports all extension functions from libxslt and libexslt as -well as Python regular expressions through EXSLT. Some extensions enable -style sheets to read and write files on the local file system.

-

XSLT has a mechanism to control the access to certain I/O operations during -the transformation process. This is most interesting where XSL scripts come -from potentially insecure sources and must be prevented from modifying the -local file system. Note, however, that there is no way to keep them from -eating up your precious CPU time, so this should not stop you from thinking -about what XSLT you execute.

-

Access control is configured using the XSLTAccessControl class. It can be -called with a number of keyword arguments that allow or deny specific -operations:

-
>>> transform = etree.XSLT(honk_doc)
-Resolved url honk:test as prefix honk
->>> result = transform(normal_doc)
-Resolved url hoi:test as prefix hoi
-
->>> ac = etree.XSLTAccessControl(read_network=False)
->>> transform = etree.XSLT(honk_doc, access_control=ac)
-Resolved url honk:test as prefix honk
->>> result = transform(normal_doc)
-Traceback (most recent call last):
-  ...
-lxml.etree.XSLTApplyError: xsltLoadDocument: read rights for hoi:test denied
-
-

There are a few things to keep in mind:

-
    -
  • XSL parsing (xsl:import, etc.) is not affected by this mechanism
  • -
  • read_file=False does not imply write_file=False, all controls are -independent.
  • -
  • read_file only applies to files in the file system. Any other scheme -for URLs is controlled by the *_network keywords.
  • -
  • If you need more fine-grained control than switching access on and off, you -should consider writing a custom document loader that returns empty -documents or raises exceptions if access is denied.
  • -
-
-
- - - \ No newline at end of file diff --git a/doc/html/sax.html b/doc/html/sax.html deleted file mode 100644 index 03d255aa..00000000 --- a/doc/html/sax.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - -Sax support - - - -
-

Sax support

- -

In this document we'll describe lxml's SAX support. lxml has support for -producing SAX events for an ElementTree or Element. lxml can also turn SAX -events into an ElementTree. The SAX API used by lxml is compatible with that -in the Python core (xml.sax), so is useful for interfacing lxml with code that -uses the Python core SAX facilities.

- -
-

Building a tree from SAX events

-

First of all, lxml has support for building a new tree given SAX events. To -do this, we use the special SAX content handler defined by lxml named -lxml.sax.ElementTreeContentHandler:

-
>>> import lxml.sax
->>> handler = lxml.sax.ElementTreeContentHandler()
-
-

Now let's fire some SAX events at it:

-
>>> handler.startElementNS((None, 'a'), 'a', {})
->>> handler.startElementNS((None, 'b'), 'b', {(None, 'foo'): 'bar'})
->>> handler.characters('Hello world')
->>> handler.endElementNS((None, 'b'), 'b')
->>> handler.endElementNS((None, 'a'), 'a')
-
-

This constructs an equivalent tree. You can access it through the etree -property of the handler:

-
>>> tree = handler.etree
->>> lxml.etree.tostring(tree.getroot())
-b'<a><b foo="bar">Hello world</b></a>'
-
-

By passing a makeelement function the constructor of -ElementTreeContentHandler, e.g. the one of a parser you configured, you -can determine which element class lookup scheme should be used.

-
-
-

Producing SAX events from an ElementTree or Element

-

Let's make a tree we can generate SAX events for:

-
>>> f = StringIO('<a><b>Text</b></a>')
->>> tree = lxml.etree.parse(f)
-
-

To see whether the correct SAX events are produced, we'll write a custom -content handler.:

-
>>> from xml.sax.handler import ContentHandler
->>> class MyContentHandler(ContentHandler):
-...     def __init__(self):
-...         self.a_amount = 0
-...         self.b_amount = 0
-...         self.text = None
-...
-...     def startElementNS(self, name, qname, attributes):
-...         uri, localname = name
-...         if localname == 'a':
-...             self.a_amount += 1
-...         if localname == 'b':
-...             self.b_amount += 1
-...
-...     def characters(self, data):
-...         self.text = data
-
-

Note that it only defines the startElementNS() method and not startElement(). -The SAX event generator in lxml.sax currently only supports namespace-aware -processing.

-

To test the content handler, we can produce SAX events from the tree:

-
>>> handler = MyContentHandler()
->>> lxml.sax.saxify(tree, handler)
-
-

This is what we expect:

-
>>> handler.a_amount
-1
->>> handler.b_amount
-1
->>> handler.text
-'Text'
-
-
-
-

Interfacing with pulldom/minidom

-

lxml.sax is a simple way to interface with the standard XML support in the -Python library. Note, however, that this is a one-way solution, as Python's -DOM implementation cannot generate SAX events from a DOM tree.

-

You can use xml.dom.pulldom to build a minidom from lxml:

-
>>> from xml.dom.pulldom import SAX2DOM
->>> handler = SAX2DOM()
->>> lxml.sax.saxify(tree, handler)
-
-

PullDOM makes the result available through the document attribute:

-
>>> dom = handler.document
->>> print(dom.firstChild.localName)
-a
-
-
-
- - - \ No newline at end of file diff --git a/doc/html/sitemap.html b/doc/html/sitemap.html deleted file mode 100644 index a3cdfdca..00000000 --- a/doc/html/sitemap.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Sitemap of lxml.de - Processing XML and HTML with Python - - - - -

Sitemap of lxml.de - Processing XML and HTML with Python

-
- \ No newline at end of file diff --git a/doc/html/tutorial.html b/doc/html/tutorial.html deleted file mode 100644 index 125f43a0..00000000 --- a/doc/html/tutorial.html +++ /dev/null @@ -1,1191 +0,0 @@ - - - - - -The lxml.etree Tutorial - - - - - - -
-

The lxml.etree Tutorial

- --- - - - -
Author:Stefan Behnel
-

This is a tutorial on XML processing with lxml.etree. It briefly -overviews the main concepts of the ElementTree API, and some simple -enhancements that make your life as a programmer easier.

-

For a complete reference of the API, see the generated API -documentation.

- -

A common way to import lxml.etree is as follows:

-
>>> from lxml import etree
-
-

If your code only uses the ElementTree API and does not rely on any -functionality that is specific to lxml.etree, you can also use (any part -of) the following import chain as a fall-back to the original ElementTree:

-
try:
-  from lxml import etree
-  print("running with lxml.etree")
-except ImportError:
-  try:
-    # Python 2.5
-    import xml.etree.cElementTree as etree
-    print("running with cElementTree on Python 2.5+")
-  except ImportError:
-    try:
-      # Python 2.5
-      import xml.etree.ElementTree as etree
-      print("running with ElementTree on Python 2.5+")
-    except ImportError:
-      try:
-        # normal cElementTree install
-        import cElementTree as etree
-        print("running with cElementTree")
-      except ImportError:
-        try:
-          # normal ElementTree install
-          import elementtree.ElementTree as etree
-          print("running with ElementTree")
-        except ImportError:
-          print("Failed to import ElementTree from any known place")
-
-

To aid in writing portable code, this tutorial makes it clear in the examples -which part of the presented API is an extension of lxml.etree over the -original ElementTree API, as defined by Fredrik Lundh's ElementTree -library.

-
-

The Element class

-

An Element is the main container object for the ElementTree API. Most of -the XML tree functionality is accessed through this class. Elements are -easily created through the Element factory:

-
>>> root = etree.Element("root")
-
-

The XML tag name of elements is accessed through the tag property:

-
>>> print(root.tag)
-root
-
-

Elements are organised in an XML tree structure. To create child elements and -add them to a parent element, you can use the append() method:

-
>>> root.append( etree.Element("child1") )
-
-

However, this is so common that there is a shorter and much more efficient way -to do this: the SubElement factory. It accepts the same arguments as the -Element factory, but additionally requires the parent as first argument:

-
>>> child2 = etree.SubElement(root, "child2")
->>> child3 = etree.SubElement(root, "child3")
-
-

To see that this is really XML, you can serialise the tree you have created:

-
>>> print(etree.tostring(root, pretty_print=True))
-<root>
-  <child1/>
-  <child2/>
-  <child3/>
-</root>
-
-
-

Elements are lists

-

To make the access to these subelements easy and straight forward, -elements mimic the behaviour of normal Python lists as closely as -possible:

-
>>> child = root[0]
->>> print(child.tag)
-child1
-
->>> print(len(root))
-3
-
->>> root.index(root[1]) # lxml.etree only!
-1
-
->>> children = list(root)
-
->>> for child in root:
-...     print(child.tag)
-child1
-child2
-child3
-
->>> root.insert(0, etree.Element("child0"))
->>> start = root[:1]
->>> end   = root[-1:]
-
->>> print(start[0].tag)
-child0
->>> print(end[0].tag)
-child3
-
-

Prior to ElementTree 1.3 and lxml 2.0, you could also check the truth value of -an Element to see if it has children, i.e. if the list of children is empty:

-
if root:   # this no longer works!
-    print("The root element has children")
-
-

This is no longer supported as people tend to expect that a "something" -evaluates to True and expect Elements to be "something", may they have -children or not. So, many users find it surprising that any Element -would evaluate to False in an if-statement like the above. Instead, -use len(element), which is both more explicit and less error prone.

-
>>> print(etree.iselement(root))  # test if it's some kind of Element
-True
->>> if len(root):                 # test if it has children
-...     print("The root element has children")
-The root element has children
-
-

There is another important case where the behaviour of Elements in lxml -(in 2.0 and later) deviates from that of lists and from that of the -original ElementTree (prior to version 1.3 or Python 2.7/3.2):

-
>>> for child in root:
-...     print(child.tag)
-child0
-child1
-child2
-child3
->>> root[0] = root[-1]  # this moves the element in lxml.etree!
->>> for child in root:
-...     print(child.tag)
-child3
-child1
-child2
-
-

In this example, the last element is moved to a different position, -instead of being copied, i.e. it is automatically removed from its -previous position when it is put in a different place. In lists, -objects can appear in multiple positions at the same time, and the -above assignment would just copy the item reference into the first -position, so that both contain the exact same item:

-
>>> l = [0, 1, 2, 3]
->>> l[0] = l[-1]
->>> l
-[3, 1, 2, 3]
-
-

Note that in the original ElementTree, a single Element object can sit -in any number of places in any number of trees, which allows for the same -copy operation as with lists. The obvious drawback is that modifications -to such an Element will apply to all places where it appears in a tree, -which may or may not be intended.

-

The upside of this difference is that an Element in lxml.etree always -has exactly one parent, which can be queried through the getparent() -method. This is not supported in the original ElementTree.

-
>>> root is root[0].getparent()  # lxml.etree only!
-True
-
-

If you want to copy an element to a different position in lxml.etree, -consider creating an independent deep copy using the copy module -from Python's standard library:

-
>>> from copy import deepcopy
-
->>> element = etree.Element("neu")
->>> element.append( deepcopy(root[1]) )
-
->>> print(element[0].tag)
-child1
->>> print([ c.tag for c in root ])
-['child3', 'child1', 'child2']
-
-

The siblings (or neighbours) of an element are accessed as next and previous -elements:

-
>>> root[0] is root[1].getprevious() # lxml.etree only!
-True
->>> root[1] is root[0].getnext() # lxml.etree only!
-True
-
-
-
-

Elements carry attributes as a dict

-

XML elements support attributes. You can create them directly in the Element -factory:

-
>>> root = etree.Element("root", interesting="totally")
->>> etree.tostring(root)
-b'<root interesting="totally"/>'
-
-

Attributes are just unordered name-value pairs, so a very convenient way -of dealing with them is through the dictionary-like interface of Elements:

-
>>> print(root.get("interesting"))
-totally
-
->>> print(root.get("hello"))
-None
->>> root.set("hello", "Huhu")
->>> print(root.get("hello"))
-Huhu
-
->>> etree.tostring(root)
-b'<root interesting="totally" hello="Huhu"/>'
-
->>> sorted(root.keys())
-['hello', 'interesting']
-
->>> for name, value in sorted(root.items()):
-...     print('%s = %r' % (name, value))
-hello = 'Huhu'
-interesting = 'totally'
-
-

For the cases where you want to do item lookup or have other reasons for -getting a 'real' dictionary-like object, e.g. for passing it around, -you can use the attrib property:

-
>>> attributes = root.attrib
-
->>> print(attributes["interesting"])
-totally
->>> print(attributes.get("no-such-attribute"))
-None
-
->>> attributes["hello"] = "Guten Tag"
->>> print(attributes["hello"])
-Guten Tag
->>> print(root.get("hello"))
-Guten Tag
-
-

Note that attrib is a dict-like object backed by the Element itself. -This means that any changes to the Element are reflected in attrib -and vice versa. It also means that the XML tree stays alive in memory -as long as the attrib of one of its Elements is in use. To get an -independent snapshot of the attributes that does not depend on the XML -tree, copy it into a dict:

-
>>> d = dict(root.attrib)
->>> sorted(d.items())
-[('hello', 'Guten Tag'), ('interesting', 'totally')]
-
-
-
-

Elements contain text

-

Elements can contain text:

-
>>> root = etree.Element("root")
->>> root.text = "TEXT"
-
->>> print(root.text)
-TEXT
-
->>> etree.tostring(root)
-b'<root>TEXT</root>'
-
-

In many XML documents (data-centric documents), this is the only place where -text can be found. It is encapsulated by a leaf tag at the very bottom of the -tree hierarchy.

-

However, if XML is used for tagged text documents such as (X)HTML, text can -also appear between different elements, right in the middle of the tree:

-
<html><body>Hello<br/>World</body></html>
-
-

Here, the <br/> tag is surrounded by text. This is often referred to as -document-style or mixed-content XML. Elements support this through their -tail property. It contains the text that directly follows the element, up -to the next element in the XML tree:

-
>>> html = etree.Element("html")
->>> body = etree.SubElement(html, "body")
->>> body.text = "TEXT"
-
->>> etree.tostring(html)
-b'<html><body>TEXT</body></html>'
-
->>> br = etree.SubElement(body, "br")
->>> etree.tostring(html)
-b'<html><body>TEXT<br/></body></html>'
-
->>> br.tail = "TAIL"
->>> etree.tostring(html)
-b'<html><body>TEXT<br/>TAIL</body></html>'
-
-

The two properties .text and .tail are enough to represent any -text content in an XML document. This way, the ElementTree API does -not require any special text nodes in addition to the Element -class, that tend to get in the way fairly often (as you might know -from classic DOM APIs).

-

However, there are cases where the tail text also gets in the way. -For example, when you serialise an Element from within the tree, you -do not always want its tail text in the result (although you would -still want the tail text of its children). For this purpose, the -tostring() function accepts the keyword argument with_tail:

-
>>> etree.tostring(br)
-b'<br/>TAIL'
->>> etree.tostring(br, with_tail=False) # lxml.etree only!
-b'<br/>'
-
-

If you want to read only the text, i.e. without any intermediate -tags, you have to recursively concatenate all text and tail -attributes in the correct order. Again, the tostring() function -comes to the rescue, this time using the method keyword:

-
>>> etree.tostring(html, method="text")
-b'TEXTTAIL'
-
-
-
-

Using XPath to find text

-

Another way to extract the text content of a tree is XPath, which -also allows you to extract the separate text chunks into a list:

-
>>> print(html.xpath("string()")) # lxml.etree only!
-TEXTTAIL
->>> print(html.xpath("//text()")) # lxml.etree only!
-['TEXT', 'TAIL']
-
-

If you want to use this more often, you can wrap it in a function:

-
>>> build_text_list = etree.XPath("//text()") # lxml.etree only!
->>> print(build_text_list(html))
-['TEXT', 'TAIL']
-
-

Note that a string result returned by XPath is a special 'smart' -object that knows about its origins. You can ask it where it came -from through its getparent() method, just as you would with -Elements:

-
>>> texts = build_text_list(html)
->>> print(texts[0])
-TEXT
->>> parent = texts[0].getparent()
->>> print(parent.tag)
-body
-
->>> print(texts[1])
-TAIL
->>> print(texts[1].getparent().tag)
-br
-
-

You can also find out if it's normal text content or tail text:

-
>>> print(texts[0].is_text)
-True
->>> print(texts[1].is_text)
-False
->>> print(texts[1].is_tail)
-True
-
-

While this works for the results of the text() function, lxml will -not tell you the origin of a string value that was constructed by the -XPath functions string() or concat():

-
>>> stringify = etree.XPath("string()")
->>> print(stringify(html))
-TEXTTAIL
->>> print(stringify(html).getparent())
-None
-
-
-
-

Tree iteration

-

For problems like the above, where you want to recursively traverse the tree -and do something with its elements, tree iteration is a very convenient -solution. Elements provide a tree iterator for this purpose. It yields -elements in document order, i.e. in the order their tags would appear if you -serialised the tree to XML:

-
>>> root = etree.Element("root")
->>> etree.SubElement(root, "child").text = "Child 1"
->>> etree.SubElement(root, "child").text = "Child 2"
->>> etree.SubElement(root, "another").text = "Child 3"
-
->>> print(etree.tostring(root, pretty_print=True))
-<root>
-  <child>Child 1</child>
-  <child>Child 2</child>
-  <another>Child 3</another>
-</root>
-
->>> for element in root.iter():
-...     print("%s - %s" % (element.tag, element.text))
-root - None
-child - Child 1
-child - Child 2
-another - Child 3
-
-

If you know you are only interested in a single tag, you can pass its name to -iter() to have it filter for you. Starting with lxml 3.0, you can also -pass more than one tag to intercept on multiple tags during iteration.

-
>>> for element in root.iter("child"):
-...     print("%s - %s" % (element.tag, element.text))
-child - Child 1
-child - Child 2
-
->>> for element in root.iter("another", "child"):
-...     print("%s - %s" % (element.tag, element.text))
-child - Child 1
-child - Child 2
-another - Child 3
-
-

By default, iteration yields all nodes in the tree, including -ProcessingInstructions, Comments and Entity instances. If you want to -make sure only Element objects are returned, you can pass the -Element factory as tag parameter:

-
>>> root.append(etree.Entity("#234"))
->>> root.append(etree.Comment("some comment"))
-
->>> for element in root.iter():
-...     if isinstance(element.tag, basestring):  # or 'str' in Python 3
-...         print("%s - %s" % (element.tag, element.text))
-...     else:
-...         print("SPECIAL: %s - %s" % (element, element.text))
-root - None
-child - Child 1
-child - Child 2
-another - Child 3
-SPECIAL: &#234; - &#234;
-SPECIAL: <!--some comment--> - some comment
-
->>> for element in root.iter(tag=etree.Element):
-...     print("%s - %s" % (element.tag, element.text))
-root - None
-child - Child 1
-child - Child 2
-another - Child 3
-
->>> for element in root.iter(tag=etree.Entity):
-...     print(element.text)
-&#234;
-
-

Note that passing a wildcard "*" tag name will also yield all -Element nodes (and only elements).

-

In lxml.etree, elements provide further iterators for all directions in the -tree: children, parents (or rather ancestors) and siblings.

-
-
-

Serialisation

-

Serialisation commonly uses the tostring() function that returns a -string, or the ElementTree.write() method that writes to a file, a -file-like object, or a URL (via FTP PUT or HTTP POST). Both calls accept -the same keyword arguments like pretty_print for formatted output -or encoding to select a specific output encoding other than plain -ASCII:

-
>>> root = etree.XML('<root><a><b/></a></root>')
-
->>> etree.tostring(root)
-b'<root><a><b/></a></root>'
-
->>> print(etree.tostring(root, xml_declaration=True))
-<?xml version='1.0' encoding='ASCII'?>
-<root><a><b/></a></root>
-
->>> print(etree.tostring(root, encoding='iso-8859-1'))
-<?xml version='1.0' encoding='iso-8859-1'?>
-<root><a><b/></a></root>
-
->>> print(etree.tostring(root, pretty_print=True))
-<root>
-  <a>
-    <b/>
-  </a>
-</root>
-
-

Note that pretty printing appends a newline at the end.

-

In lxml 2.0 and later (as well as ElementTree 1.3), the serialisation -functions can do more than XML serialisation. You can serialise to -HTML or extract the text content by passing the method keyword:

-
>>> root = etree.XML(
-...    '<html><head/><body><p>Hello<br/>World</p></body></html>')
-
->>> etree.tostring(root) # default: method = 'xml'
-b'<html><head/><body><p>Hello<br/>World</p></body></html>'
-
->>> etree.tostring(root, method='xml') # same as above
-b'<html><head/><body><p>Hello<br/>World</p></body></html>'
-
->>> etree.tostring(root, method='html')
-b'<html><head></head><body><p>Hello<br>World</p></body></html>'
-
->>> print(etree.tostring(root, method='html', pretty_print=True))
-<html>
-<head></head>
-<body><p>Hello<br>World</p></body>
-</html>
-
->>> etree.tostring(root, method='text')
-b'HelloWorld'
-
-

As for XML serialisation, the default encoding for plain text -serialisation is ASCII:

-
>>> br = next(root.iter('br'))  # get first result of iteration
->>> br.tail = u'W\xf6rld'
-
->>> etree.tostring(root, method='text')  # doctest: +ELLIPSIS
-Traceback (most recent call last):
-  ...
-UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' ...
-
->>> etree.tostring(root, method='text', encoding="UTF-8")
-b'HelloW\xc3\xb6rld'
-
-

Here, serialising to a Python unicode string instead of a byte string -might become handy. Just pass the name 'unicode' as encoding:

-
>>> etree.tostring(root, encoding='unicode', method='text')
-u'HelloW\xf6rld'
-
-

The W3C has a good article about the Unicode character set and -character encodings.

-
-
-
-

The ElementTree class

-

An ElementTree is mainly a document wrapper around a tree with a -root node. It provides a couple of methods for serialisation and -general document handling.

-
>>> root = etree.XML('''\
-... <?xml version="1.0"?>
-... <!DOCTYPE root SYSTEM "test" [ <!ENTITY tasty "parsnips"> ]>
-... <root>
-...   <a>&tasty;</a>
-... </root>
-... ''')
-
->>> tree = etree.ElementTree(root)
->>> print(tree.docinfo.xml_version)
-1.0
->>> print(tree.docinfo.doctype)
-<!DOCTYPE root SYSTEM "test">
-
->>> tree.docinfo.public_id = '-//W3C//DTD XHTML 1.0 Transitional//EN'
->>> tree.docinfo.system_url = 'file://local.dtd'
->>> print(tree.docinfo.doctype)
-<!DOCTYPE root PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "file://local.dtd">
-
-

An ElementTree is also what you get back when you call the -parse() function to parse files or file-like objects (see the -parsing section below).

-

One of the important differences is that the ElementTree class -serialises as a complete document, as opposed to a single Element. -This includes top-level processing instructions and comments, as well -as a DOCTYPE and other DTD content in the document:

-
>>> print(etree.tostring(tree))  # lxml 1.3.4 and later
-<!DOCTYPE root PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "file://local.dtd" [
-<!ENTITY tasty "parsnips">
-]>
-<root>
-  <a>parsnips</a>
-</root>
-
-

In the original xml.etree.ElementTree implementation and in lxml -up to 1.3.3, the output looks the same as when serialising only -the root Element:

-
>>> print(etree.tostring(tree.getroot()))
-<root>
-  <a>parsnips</a>
-</root>
-
-

This serialisation behaviour has changed in lxml 1.3.4. Before, -the tree was serialised without DTD content, which made lxml -lose DTD information in an input-output cycle.

-
-
-

Parsing from strings and files

-

lxml.etree supports parsing XML in a number of ways and from all -important sources, namely strings, files, URLs (http/ftp) and -file-like objects. The main parse functions are fromstring() and -parse(), both called with the source as first argument. By -default, they use the standard parser, but you can always pass a -different parser as second argument.

-
-

The fromstring() function

-

The fromstring() function is the easiest way to parse a string:

-
>>> some_xml_data = "<root>data</root>"
-
->>> root = etree.fromstring(some_xml_data)
->>> print(root.tag)
-root
->>> etree.tostring(root)
-b'<root>data</root>'
-
-
-
-

The XML() function

-

The XML() function behaves like the fromstring() function, but is -commonly used to write XML literals right into the source:

-
>>> root = etree.XML("<root>data</root>")
->>> print(root.tag)
-root
->>> etree.tostring(root)
-b'<root>data</root>'
-
-

There is also a corresponding function HTML() for HTML literals.

-
>>> root = etree.HTML("<p>data</p>")
->>> etree.tostring(root)
-b'<html><body><p>data</p></body></html>'
-
-
-
-

The parse() function

-

The parse() function is used to parse from files and file-like objects.

-

As an example of such a file-like object, the following code uses the -BytesIO class for reading from a string instead of an external file. -That class comes from the io module in Python 2.6 and later. In older -Python versions, you will have to use the StringIO class from the -StringIO module. However, in real life, you would obviously avoid -doing this all together and use the string parsing functions above.

-
>>> from io import BytesIO
->>> some_file_or_file_like_object = BytesIO(b"<root>data</root>")
-
->>> tree = etree.parse(some_file_or_file_like_object)
-
->>> etree.tostring(tree)
-b'<root>data</root>'
-
-

Note that parse() returns an ElementTree object, not an Element object as -the string parser functions:

-
>>> root = tree.getroot()
->>> print(root.tag)
-root
->>> etree.tostring(root)
-b'<root>data</root>'
-
-

The reasoning behind this difference is that parse() returns a -complete document from a file, while the string parsing functions are -commonly used to parse XML fragments.

-

The parse() function supports any of the following sources:

-
    -
  • an open file object (make sure to open it in binary mode)
  • -
  • a file-like object that has a .read(byte_count) method returning -a byte string on each call
  • -
  • a filename string
  • -
  • an HTTP or FTP URL string
  • -
-

Note that passing a filename or URL is usually faster than passing an -open file or file-like object. However, the HTTP/FTP client in libxml2 -is rather simple, so things like HTTP authentication require a dedicated -URL request library, e.g. urllib2 or requests. These libraries -usually provide a file-like object for the result that you can parse -from while the response is streaming in.

-
-
-

Parser objects

-

By default, lxml.etree uses a standard parser with a default setup. If -you want to configure the parser, you can create a new instance:

-
>>> parser = etree.XMLParser(remove_blank_text=True) # lxml.etree only!
-
-

This creates a parser that removes empty text between tags while parsing, -which can reduce the size of the tree and avoid dangling tail text if you know -that whitespace-only content is not meaningful for your data. An example:

-
>>> root = etree.XML("<root>  <a/>   <b>  </b>     </root>", parser)
-
->>> etree.tostring(root)
-b'<root><a/><b>  </b></root>'
-
-

Note that the whitespace content inside the <b> tag was not removed, as -content at leaf elements tends to be data content (even if blank). You can -easily remove it in an additional step by traversing the tree:

-
>>> for element in root.iter("*"):
-...     if element.text is not None and not element.text.strip():
-...         element.text = None
-
->>> etree.tostring(root)
-b'<root><a/><b/></root>'
-
-

See help(etree.XMLParser) to find out about the available parser options.

-
-
-

Incremental parsing

-

lxml.etree provides two ways for incremental step-by-step parsing. One is -through file-like objects, where it calls the read() method repeatedly. -This is best used where the data arrives from a source like urllib or any -other file-like object that can provide data on request. Note that the parser -will block and wait until data becomes available in this case:

-
>>> class DataSource:
-...     data = [ b"<roo", b"t><", b"a/", b"><", b"/root>" ]
-...     def read(self, requested_size):
-...         try:
-...             return self.data.pop(0)
-...         except IndexError:
-...             return b''
-
->>> tree = etree.parse(DataSource())
-
->>> etree.tostring(tree)
-b'<root><a/></root>'
-
-

The second way is through a feed parser interface, given by the feed(data) -and close() methods:

-
>>> parser = etree.XMLParser()
-
->>> parser.feed("<roo")
->>> parser.feed("t><")
->>> parser.feed("a/")
->>> parser.feed("><")
->>> parser.feed("/root>")
-
->>> root = parser.close()
-
->>> etree.tostring(root)
-b'<root><a/></root>'
-
-

Here, you can interrupt the parsing process at any time and continue it later -on with another call to the feed() method. This comes in handy if you -want to avoid blocking calls to the parser, e.g. in frameworks like Twisted, -or whenever data comes in slowly or in chunks and you want to do other things -while waiting for the next chunk.

-

After calling the close() method (or when an exception was raised -by the parser), you can reuse the parser by calling its feed() -method again:

-
>>> parser.feed("<root/>")
->>> root = parser.close()
->>> etree.tostring(root)
-b'<root/>'
-
-
-
-

Event-driven parsing

-

Sometimes, all you need from a document is a small fraction somewhere deep -inside the tree, so parsing the whole tree into memory, traversing it and -dropping it can be too much overhead. lxml.etree supports this use case -with two event-driven parser interfaces, one that generates parser events -while building the tree (iterparse), and one that does not build the tree -at all, and instead calls feedback methods on a target object in a SAX-like -fashion.

-

Here is a simple iterparse() example:

-
>>> some_file_like = BytesIO(b"<root><a>data</a></root>")
-
->>> for event, element in etree.iterparse(some_file_like):
-...     print("%s, %4s, %s" % (event, element.tag, element.text))
-end,    a, data
-end, root, None
-
-

By default, iterparse() only generates events when it is done parsing an -element, but you can control this through the events keyword argument:

-
>>> some_file_like = BytesIO(b"<root><a>data</a></root>")
-
->>> for event, element in etree.iterparse(some_file_like,
-...                                       events=("start", "end")):
-...     print("%5s, %4s, %s" % (event, element.tag, element.text))
-start, root, None
-start,    a, data
-  end,    a, data
-  end, root, None
-
-

Note that the text, tail, and children of an Element are not necessarily present -yet when receiving the start event. Only the end event guarantees -that the Element has been parsed completely.

-

It also allows you to .clear() or modify the content of an Element to -save memory. So if you parse a large tree and you want to keep memory -usage small, you should clean up parts of the tree that you no longer -need:

-
>>> some_file_like = BytesIO(
-...     b"<root><a><b>data</b></a><a><b/></a></root>")
-
->>> for event, element in etree.iterparse(some_file_like):
-...     if element.tag == 'b':
-...         print(element.text)
-...     elif element.tag == 'a':
-...         print("** cleaning up the subtree")
-...         element.clear()
-data
-** cleaning up the subtree
-None
-** cleaning up the subtree
-
-

A very important use case for iterparse() is parsing large -generated XML files, e.g. database dumps. Most often, these XML -formats only have one main data item element that hangs directly below -the root node and that is repeated thousands of times. In this case, -it is best practice to let lxml.etree do the tree building and only to -intercept on exactly this one Element, using the normal tree API -for data extraction.

-
>>> xml_file = BytesIO(b'''\
-... <root>
-...   <a><b>ABC</b><c>abc</c></a>
-...   <a><b>MORE DATA</b><c>more data</c></a>
-...   <a><b>XYZ</b><c>xyz</c></a>
-... </root>''')
-
->>> for _, element in etree.iterparse(xml_file, tag='a'):
-...     print('%s -- %s' % (element.findtext('b'), element[1].text))
-...     element.clear()
-ABC -- abc
-MORE DATA -- more data
-XYZ -- xyz
-
-

If, for some reason, building the tree is not desired at all, the -target parser interface of lxml.etree can be used. It creates -SAX-like events by calling the methods of a target object. By -implementing some or all of these methods, you can control which -events are generated:

-
>>> class ParserTarget:
-...     events = []
-...     close_count = 0
-...     def start(self, tag, attrib):
-...         self.events.append(("start", tag, attrib))
-...     def close(self):
-...         events, self.events = self.events, []
-...         self.close_count += 1
-...         return events
-
->>> parser_target = ParserTarget()
-
->>> parser = etree.XMLParser(target=parser_target)
->>> events = etree.fromstring('<root test="true"/>', parser)
-
->>> print(parser_target.close_count)
-1
-
->>> for event in events:
-...     print('event: %s - tag: %s' % (event[0], event[1]))
-...     for attr, value in event[2].items():
-...         print(' * %s = %s' % (attr, value))
-event: start - tag: root
- * test = true
-
-

You can reuse the parser and its target as often as you like, so you -should take care that the .close() method really resets the -target to a usable state (also in the case of an error!).

-
>>> events = etree.fromstring('<root test="true"/>', parser)
->>> print(parser_target.close_count)
-2
->>> events = etree.fromstring('<root test="true"/>', parser)
->>> print(parser_target.close_count)
-3
->>> events = etree.fromstring('<root test="true"/>', parser)
->>> print(parser_target.close_count)
-4
-
->>> for event in events:
-...     print('event: %s - tag: %s' % (event[0], event[1]))
-...     for attr, value in event[2].items():
-...         print(' * %s = %s' % (attr, value))
-event: start - tag: root
- * test = true
-
-
-
-
-

Namespaces

-

The ElementTree API avoids -namespace prefixes -wherever possible and deploys the real namespace (the URI) instead:

-
>>> xhtml = etree.Element("{http://www.w3.org/1999/xhtml}html")
->>> body = etree.SubElement(xhtml, "{http://www.w3.org/1999/xhtml}body")
->>> body.text = "Hello World"
-
->>> print(etree.tostring(xhtml, pretty_print=True))
-<html:html xmlns:html="http://www.w3.org/1999/xhtml">
-  <html:body>Hello World</html:body>
-</html:html>
-
-

The notation that ElementTree uses was originally brought up by -James Clark. It has the major -advantage of providing a universally qualified name for a tag, regardless -of any prefixes that may or may not have been used or defined in a document. -By moving the indirection of prefixes out of the way, it makes namespace -aware code much clearer and easier to get right.

-

As you can see from the example, prefixes only become important when -you serialise the result. However, the above code looks somewhat -verbose due to the lengthy namespace names. And retyping or copying a -string over and over again is error prone. It is therefore common -practice to store a namespace URI in a global variable. To adapt the -namespace prefixes for serialisation, you can also pass a mapping to -the Element factory function, e.g. to define the default namespace:

-
>>> XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"
->>> XHTML = "{%s}" % XHTML_NAMESPACE
-
->>> NSMAP = {None : XHTML_NAMESPACE} # the default namespace (no prefix)
-
->>> xhtml = etree.Element(XHTML + "html", nsmap=NSMAP) # lxml only!
->>> body = etree.SubElement(xhtml, XHTML + "body")
->>> body.text = "Hello World"
-
->>> print(etree.tostring(xhtml, pretty_print=True))
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <body>Hello World</body>
-</html>
-
-

You can also use the QName helper class to build or split qualified -tag names:

-
>>> tag = etree.QName('http://www.w3.org/1999/xhtml', 'html')
->>> print(tag.localname)
-html
->>> print(tag.namespace)
-http://www.w3.org/1999/xhtml
->>> print(tag.text)
-{http://www.w3.org/1999/xhtml}html
-
->>> tag = etree.QName('{http://www.w3.org/1999/xhtml}html')
->>> print(tag.localname)
-html
->>> print(tag.namespace)
-http://www.w3.org/1999/xhtml
-
->>> root = etree.Element('{http://www.w3.org/1999/xhtml}html')
->>> tag = etree.QName(root)
->>> print(tag.localname)
-html
-
->>> tag = etree.QName(root, 'script')
->>> print(tag.text)
-{http://www.w3.org/1999/xhtml}script
->>> tag = etree.QName('{http://www.w3.org/1999/xhtml}html', 'script')
->>> print(tag.text)
-{http://www.w3.org/1999/xhtml}script
-
-

lxml.etree allows you to look up the current namespaces defined for a -node through the .nsmap property:

-
>>> xhtml.nsmap
-{None: 'http://www.w3.org/1999/xhtml'}
-
-

Note, however, that this includes all prefixes known in the context of -an Element, not only those that it defines itself.

-
>>> root = etree.Element('root', nsmap={'a': 'http://a.b/c'})
->>> child = etree.SubElement(root, 'child',
-...                          nsmap={'b': 'http://b.c/d'})
->>> len(root.nsmap)
-1
->>> len(child.nsmap)
-2
->>> child.nsmap['a']
-'http://a.b/c'
->>> child.nsmap['b']
-'http://b.c/d'
-
-

Therefore, modifying the returned dict cannot have any meaningful -impact on the Element. Any changes to it are ignored.

-

Namespaces on attributes work alike, but as of version 2.3, lxml.etree -will ensure that the attribute uses a prefixed namespace -declaration. This is because unprefixed attribute names are not -considered being in a namespace by the XML namespace specification -(section 6.2), so they may end up losing their namespace on a -serialise-parse roundtrip, even if they appear in a namespaced -element.

-
>>> body.set(XHTML + "bgcolor", "#CCFFAA")
-
->>> print(etree.tostring(xhtml, pretty_print=True))
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <body xmlns:html="http://www.w3.org/1999/xhtml" html:bgcolor="#CCFFAA">Hello World</body>
-</html>
-
->>> print(body.get("bgcolor"))
-None
->>> body.get(XHTML + "bgcolor")
-'#CCFFAA'
-
-

You can also use XPath with fully qualified names:

-
>>> find_xhtml_body = etree.ETXPath(      # lxml only !
-...     "//{%s}body" % XHTML_NAMESPACE)
->>> results = find_xhtml_body(xhtml)
-
->>> print(results[0].tag)
-{http://www.w3.org/1999/xhtml}body
-
-

For convenience, you can use "*" wildcards in all iterators of lxml.etree, -both for tag names and namespaces:

-
>>> for el in xhtml.iter('*'): print(el.tag)   # any element
-{http://www.w3.org/1999/xhtml}html
-{http://www.w3.org/1999/xhtml}body
->>> for el in xhtml.iter('{http://www.w3.org/1999/xhtml}*'): print(el.tag)
-{http://www.w3.org/1999/xhtml}html
-{http://www.w3.org/1999/xhtml}body
->>> for el in xhtml.iter('{*}body'): print(el.tag)
-{http://www.w3.org/1999/xhtml}body
-
-

To look for elements that do not have a namespace, either use the -plain tag name or provide the empty namespace explicitly:

-
>>> [ el.tag for el in xhtml.iter('{http://www.w3.org/1999/xhtml}body') ]
-['{http://www.w3.org/1999/xhtml}body']
->>> [ el.tag for el in xhtml.iter('body') ]
-[]
->>> [ el.tag for el in xhtml.iter('{}body') ]
-[]
->>> [ el.tag for el in xhtml.iter('{}*') ]
-[]
-
-
-
-

The E-factory

-

The E-factory provides a simple and compact syntax for generating XML and -HTML:

-
>>> from lxml.builder import E
-
->>> def CLASS(*args): # class is a reserved word in Python
-...     return {"class":' '.join(args)}
-
->>> html = page = (
-...   E.html(       # create an Element called "html"
-...     E.head(
-...       E.title("This is a sample document")
-...     ),
-...     E.body(
-...       E.h1("Hello!", CLASS("title")),
-...       E.p("This is a paragraph with ", E.b("bold"), " text in it!"),
-...       E.p("This is another paragraph, with a", "\n      ",
-...         E.a("link", href="http://www.python.org"), "."),
-...       E.p("Here are some reserved characters: <spam&egg>."),
-...       etree.XML("<p>And finally an embedded XHTML fragment.</p>"),
-...     )
-...   )
-... )
-
->>> print(etree.tostring(page, pretty_print=True))
-<html>
-  <head>
-    <title>This is a sample document</title>
-  </head>
-  <body>
-    <h1 class="title">Hello!</h1>
-    <p>This is a paragraph with <b>bold</b> text in it!</p>
-    <p>This is another paragraph, with a
-      <a href="http://www.python.org">link</a>.</p>
-    <p>Here are some reserved characters: &lt;spam&amp;egg&gt;.</p>
-    <p>And finally an embedded XHTML fragment.</p>
-  </body>
-</html>
-
-

Element creation based on attribute access makes it easy to build up a -simple vocabulary for an XML language:

-
>>> from lxml.builder import ElementMaker # lxml only !
-
->>> E = ElementMaker(namespace="http://my.de/fault/namespace",
-...                  nsmap={'p' : "http://my.de/fault/namespace"})
-
->>> DOC = E.doc
->>> TITLE = E.title
->>> SECTION = E.section
->>> PAR = E.par
-
->>> my_doc = DOC(
-...   TITLE("The dog and the hog"),
-...   SECTION(
-...     TITLE("The dog"),
-...     PAR("Once upon a time, ..."),
-...     PAR("And then ...")
-...   ),
-...   SECTION(
-...     TITLE("The hog"),
-...     PAR("Sooner or later ...")
-...   )
-... )
-
->>> print(etree.tostring(my_doc, pretty_print=True))
-<p:doc xmlns:p="http://my.de/fault/namespace">
-  <p:title>The dog and the hog</p:title>
-  <p:section>
-    <p:title>The dog</p:title>
-    <p:par>Once upon a time, ...</p:par>
-    <p:par>And then ...</p:par>
-  </p:section>
-  <p:section>
-    <p:title>The hog</p:title>
-    <p:par>Sooner or later ...</p:par>
-  </p:section>
-</p:doc>
-
-

One such example is the module lxml.html.builder, which provides a -vocabulary for HTML.

-

When dealing with multiple namespaces, it is good practice to define -one ElementMaker for each namespace URI. Again, note how the above -example predefines the tag builders in named constants. That makes it -easy to put all tag declarations of a namespace into one Python module -and to import/use the tag name constants from there. This avoids -pitfalls like typos or accidentally missing namespaces.

-
-
-

ElementPath

-

The ElementTree library comes with a simple XPath-like path language -called ElementPath. The main difference is that you can use the -{namespace}tag notation in ElementPath expressions. However, -advanced features like value comparison and functions are not -available.

-

In addition to a full XPath implementation, lxml.etree supports the -ElementPath language in the same way ElementTree does, even using -(almost) the same implementation. The API provides four methods here -that you can find on Elements and ElementTrees:

-
    -
  • iterfind() iterates over all Elements that match the path -expression
  • -
  • findall() returns a list of matching Elements
  • -
  • find() efficiently returns only the first match
  • -
  • findtext() returns the .text content of the first match
  • -
-

Here are some examples:

-
>>> root = etree.XML("<root><a x='123'>aText<b/><c/><b/></a></root>")
-
-

Find a child of an Element:

-
>>> print(root.find("b"))
-None
->>> print(root.find("a").tag)
-a
-
-

Find an Element anywhere in the tree:

-
>>> print(root.find(".//b").tag)
-b
->>> [ b.tag for b in root.iterfind(".//b") ]
-['b', 'b']
-
-

Find Elements with a certain attribute:

-
>>> print(root.findall(".//a[@x]")[0].tag)
-a
->>> print(root.findall(".//a[@y]"))
-[]
-
-

In lxml 3.4, there is a new helper to generate a structural ElementPath -expression for an Element:

-
>>> tree = etree.ElementTree(root)
->>> a = root[0]
->>> print(tree.getelementpath(a[0]))
-a/b[1]
->>> print(tree.getelementpath(a[1]))
-a/c
->>> print(tree.getelementpath(a[2]))
-a/b[2]
->>> tree.find(tree.getelementpath(a[2])) == a[2]
-True
-
-

As long as the tree is not modified, this path expression represents an -identifier for a given element that can be used to find() it in the same -tree later. Compared to XPath, ElementPath expressions have the advantage -of being self-contained even for documents that use namespaces.

-

The .iter() method is a special case that only finds specific tags -in the tree by their name, not based on a path. That means that the -following commands are equivalent in the success case:

-
>>> print(root.find(".//b").tag)
-b
->>> print(next(root.iterfind(".//b")).tag)
-b
->>> print(next(root.iter("b")).tag)
-b
-
-

Note that the .find() method simply returns None if no match is found, -whereas the other two examples would raise a StopIteration exception.

-
-
- - - \ No newline at end of file diff --git a/doc/html/validation.html b/doc/html/validation.html deleted file mode 100644 index 0411f684..00000000 --- a/doc/html/validation.html +++ /dev/null @@ -1,563 +0,0 @@ - - - - - -Validation with lxml - - - -
-

Validation with lxml

- -

Apart from the built-in DTD support in parsers, lxml currently supports three -schema languages: DTD, Relax NG and XML Schema. All three provide -identical APIs in lxml, represented by validator classes with the obvious -names.

-

lxml also provides support for ISO-Schematron, based on the pure-XSLT -skeleton implementation of Schematron:

-

There is also basic support for pre-ISO-Schematron through the libxml2 -Schematron features. However, this does not currently support error reporting -in the validation phase due to insufficiencies in the implementation as of -libxml2 2.6.30.

- -

The usual setup procedure:

-
>>> from lxml import etree
-
-
-

Validation at parse time

-

The parser in lxml can do on-the-fly validation of a document against -a DTD or an XML schema. The DTD is retrieved automatically based on -the DOCTYPE of the parsed document. All you have to do is use a -parser that has DTD validation enabled:

-
>>> parser = etree.XMLParser(dtd_validation=True)
-
-

Obviously, a request for validation enables the DTD loading feature. -There are two other options that enable loading the DTD, but that do -not perform any validation. The first is the load_dtd keyword -option, which simply loads the DTD into the parser and makes it -available to the document as external subset. You can retrieve the -DTD from the parsed document using the docinfo property of the -result ElementTree object. The internal subset is available as -internalDTD, the external subset is provided as externalDTD.

-

The third way to activate DTD loading is with the -attribute_defaults option, which loads the DTD and weaves -attribute default values into the document. Again, no validation is -performed unless explicitly requested.

-

XML schema is supported in a similar way, but requires an explicit -schema to be provided:

-
>>> schema_root = etree.XML('''\
-...   <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-...     <xsd:element name="a" type="xsd:integer"/>
-...   </xsd:schema>
-... ''')
->>> schema = etree.XMLSchema(schema_root)
-
->>> parser = etree.XMLParser(schema = schema)
->>> root = etree.fromstring("<a>5</a>", parser)
-
-

If the validation fails (be it for a DTD or an XML schema), the parser -will raise an exception:

-
>>> root = etree.fromstring("<a>no int</a>", parser)  # doctest: +ELLIPSIS
-Traceback (most recent call last):
-lxml.etree.XMLSyntaxError: Element 'a': 'no int' is not a valid value of the atomic type 'xs:integer'...
-
-

If you want the parser to succeed regardless of the outcome of the -validation, you should use a non validating parser and run the -validation separately after parsing the document.

-
-
-

DTD

-

As described above, the parser support for DTDs depends on internal or -external subsets of the XML file. This means that the XML file itself -must either contain a DTD or must reference a DTD to make this work. -If you want to validate an XML document against a DTD that is not -referenced by the document itself, you can use the DTD class.

-

To use the DTD class, you must first pass a filename or file-like object -into the constructor to parse a DTD:

-
>>> f = StringIO("<!ELEMENT b EMPTY>")
->>> dtd = etree.DTD(f)
-
-

Now you can use it to validate documents:

-
>>> root = etree.XML("<b/>")
->>> print(dtd.validate(root))
-True
-
->>> root = etree.XML("<b><a/></b>")
->>> print(dtd.validate(root))
-False
-
-

The reason for the validation failure can be found in the error log:

-
>>> print(dtd.error_log.filter_from_errors()[0])
-<string>:1:0:ERROR:VALID:DTD_NOT_EMPTY: Element b was declared EMPTY this one has content
-
-

As an alternative to parsing from a file, you can use the -external_id keyword argument to parse from a catalog. The -following example reads the DocBook DTD in version 4.2, if available -in the system catalog:

-
dtd = etree.DTD(external_id = "-//OASIS//DTD DocBook XML V4.2//EN")
-
-

The DTD information is available as attributes on the DTD object. The method -iterelements provides an iterator over the element declarations:

-
>>> dtd = etree.DTD(StringIO('<!ELEMENT a EMPTY><!ELEMENT b EMPTY>'))
->>> for el in dtd.iterelements():
-...     print(el.name)
-a
-b
-
-

The method elements returns the element declarations as a list:

-
>>> dtd = etree.DTD(StringIO('<!ELEMENT a EMPTY><!ELEMENT b EMPTY>'))
->>> len(dtd.elements())
-2
-
-

An element declaration object provides the following attributes/methods:

-
-
    -
  • name: The name of the element;
  • -
  • type: The element type, one of "undefined", "empty", "any", "mixed", or "element";
  • -
  • content: Element content declaration (see below);
  • -
  • iterattributes(): Return an iterator over attribute declarations (see below);
  • -
  • attributes(): Return a list of attribute declarations.
  • -
-
-

The content attribute contains information about the content model of the element. -These element content declaration objects form a binary tree (via the left and right -attributes), that makes it possible to reconstruct the content model expression. Here's a -list of all attributes:

-
-
    -
  • name: If this object represents an element in the content model expression, -name is the name of the element, otherwise it is None;
  • -
  • type: The type of the node: one of "pcdata", "element", "seq", or "or";
  • -
  • occur: How often this element (or this combination of elements) may occur: -one of "once", "opt", "mult", or "plus"
  • -
  • left: The left hand subexpression
  • -
  • right: The right hand subexpression
  • -
-
-

For example, the element declaration <!ELEMENT a (a|b)+> results -in the following element content declaration objects:

-
>>> dtd = etree.DTD(StringIO('<!ELEMENT a (a|b)+>'))
->>> content = dtd.elements()[0].content
->>> content.type, content.occur, content.name
-('or', 'plus', None)
-
->>> left, right = content.left, content.right
->>> left.type, left.occur, left.name
-('element', 'once', 'a')
->>> right.type, right.occur, right.name
-('element', 'once', 'b')
-
-

Attributes declarations have the following attributes/methods:

-
-
    -
  • name: The name of the attribute;
  • -
  • elemname: The name of the element the attribute belongs to;
  • -
  • type: The attribute type, one of "cdata", "id", "idref", "idrefs", "entity", -"entities", "nmtoken", "nmtokens", "enumeration", or "notation";
  • -
  • default: The type of the default value, one of "none", "required", "implied", -or "fixed";
  • -
  • defaultValue: The default value;
  • -
  • itervalues(): Return an iterator over the allowed attribute values (if the attribute -is of type "enumeration");
  • -
  • values(): Return a list of allowed attribute values.
  • -
-
-

Entity declarations are available via the iterentities and entities methods:

-
-
->>> dtd = etree.DTD(StringIO('<!ENTITY hurz "&#x40;">'))
->>> entity = dtd.entities()[0]
->>> entity.name, entity.orig, entity.content
-('hurz', '&#x40;', '@')
-
-
-
-
-

RelaxNG

-

The RelaxNG class takes an ElementTree object to construct a Relax NG -validator:

-
>>> f = StringIO('''\
-... <element name="a" xmlns="http://relaxng.org/ns/structure/1.0">
-...  <zeroOrMore>
-...     <element name="b">
-...       <text />
-...     </element>
-...  </zeroOrMore>
-... </element>
-... ''')
->>> relaxng_doc = etree.parse(f)
->>> relaxng = etree.RelaxNG(relaxng_doc)
-
-

Alternatively, pass a filename to the file keyword argument to parse from -a file. This also enables correct handling of include files from within the -RelaxNG parser.

-

You can then validate some ElementTree document against the schema. You'll get -back True if the document is valid against the Relax NG schema, and False if -not:

-
>>> valid = StringIO('<a><b></b></a>')
->>> doc = etree.parse(valid)
->>> relaxng.validate(doc)
-True
-
->>> invalid = StringIO('<a><c></c></a>')
->>> doc2 = etree.parse(invalid)
->>> relaxng.validate(doc2)
-False
-
-

Calling the schema object has the same effect as calling its validate -method. This is sometimes used in conditional statements:

-
>>> invalid = StringIO('<a><c></c></a>')
->>> doc2 = etree.parse(invalid)
->>> if not relaxng(doc2):
-...     print("invalid!")
-invalid!
-
-

If you prefer getting an exception when validating, you can use the -assert_ or assertValid methods:

-
>>> relaxng.assertValid(doc2)
-Traceback (most recent call last):
-  ...
-lxml.etree.DocumentInvalid: Did not expect element c there, line 1
-
->>> relaxng.assert_(doc2)
-Traceback (most recent call last):
-  ...
-AssertionError: Did not expect element c there, line 1
-
-

If you want to find out why the validation failed in the second case, you can -look up the error log of the validation process and check it for relevant -messages:

-
>>> log = relaxng.error_log
->>> print(log.last_error)
-<string>:1:0:ERROR:RELAXNGV:RELAXNG_ERR_ELEMWRONG: Did not expect element c there
-
-

You can see that the error (ERROR) happened during RelaxNG validation -(RELAXNGV). The message then tells you what went wrong. You can also -look at the error domain and its type directly:

-
>>> error = log.last_error
->>> print(error.domain_name)
-RELAXNGV
->>> print(error.type_name)
-RELAXNG_ERR_ELEMWRONG
-
-

Note that this error log is local to the RelaxNG object. It will only -contain log entries that appeared during the validation.

-

Similar to XSLT, there's also a less efficient but easier shortcut method to -do one-shot RelaxNG validation:

-
>>> doc.relaxng(relaxng_doc)
-True
->>> doc2.relaxng(relaxng_doc)
-False
-
-

libxml2 does not currently support the RelaxNG Compact Syntax. -However, if rnc2rng is installed, lxml 3.6 and later can use it -internally to parse the input schema. It recognises the .rnc file -extension and also allows parsing an RNC schema from a string using -RelaxNG.from_rnc_string().

-

Alternatively, the trang translator can convert the compact syntax -to the XML syntax, which can then be used with lxml.

-
-
-

XMLSchema

-

lxml.etree also has XML Schema (XSD) support, using the class -lxml.etree.XMLSchema. The API is very similar to the Relax NG and DTD -classes. Pass an ElementTree object to construct a XMLSchema validator:

-
>>> f = StringIO('''\
-... <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-... <xsd:element name="a" type="AType"/>
-... <xsd:complexType name="AType">
-...   <xsd:sequence>
-...     <xsd:element name="b" type="xsd:string" />
-...   </xsd:sequence>
-... </xsd:complexType>
-... </xsd:schema>
-... ''')
->>> xmlschema_doc = etree.parse(f)
->>> xmlschema = etree.XMLSchema(xmlschema_doc)
-
-

You can then validate some ElementTree document with this. Like with RelaxNG, -you'll get back true if the document is valid against the XML schema, and -false if not:

-
>>> valid = StringIO('<a><b></b></a>')
->>> doc = etree.parse(valid)
->>> xmlschema.validate(doc)
-True
-
->>> invalid = StringIO('<a><c></c></a>')
->>> doc2 = etree.parse(invalid)
->>> xmlschema.validate(doc2)
-False
-
-

Calling the schema object has the same effect as calling its validate method. -This is sometimes used in conditional statements:

-
>>> invalid = StringIO('<a><c></c></a>')
->>> doc2 = etree.parse(invalid)
->>> if not xmlschema(doc2):
-...     print("invalid!")
-invalid!
-
-

If you prefer getting an exception when validating, you can use the -assert_ or assertValid methods:

-
>>> xmlschema.assertValid(doc2)
-Traceback (most recent call last):
-  ...
-lxml.etree.DocumentInvalid: Element 'c': This element is not expected. Expected is ( b )., line 1
-
->>> xmlschema.assert_(doc2)
-Traceback (most recent call last):
-  ...
-AssertionError: Element 'c': This element is not expected. Expected is ( b )., line 1
-
-

Error reporting works as for the RelaxNG class:

-
>>> log = xmlschema.error_log
->>> error = log.last_error
->>> print(error.domain_name)
-SCHEMASV
->>> print(error.type_name)
-SCHEMAV_ELEMENT_CONTENT
-
-

If you were to print this log entry, you would get something like the -following. Note that the error message depends on the libxml2 version in -use:

-
-<string>:1:ERROR::SCHEMAV_ELEMENT_CONTENT: Element 'c': This element is not expected. Expected is ( b ).
-
-

Similar to XSLT and RelaxNG, there's also a less efficient but easier shortcut -method to do XML Schema validation:

-
>>> doc.xmlschema(xmlschema_doc)
-True
->>> doc2.xmlschema(xmlschema_doc)
-False
-
-
-
-

Schematron

-

From version 2.3 on lxml features ISO-Schematron support built on the -de-facto reference implementation of Schematron, the pure-XSLT-1.0 -skeleton implementation. This is provided by the lxml.isoschematron package -that implements the Schematron class, with an API compatible to the other -validators'. Pass an Element or ElementTree object to construct a Schematron -validator:

-
>>> from lxml import isoschematron
->>> f = StringIO('''\
-... <schema xmlns="http://purl.oclc.org/dsdl/schematron" >
-...   <pattern id="sum_equals_100_percent">
-...     <title>Sum equals 100%.</title>
-...     <rule context="Total">
-...       <assert test="sum(//Percent)=100">Sum is not 100%.</assert>
-...     </rule>
-...   </pattern>
-... </schema>
-... ''')
-
->>> sct_doc = etree.parse(f)
->>> schematron = isoschematron.Schematron(sct_doc)
-
-

You can then validate some ElementTree document with this. Just like with -XMLSchema or RelaxNG, you'll get back true if the document is valid against the -schema, and false if not:

-
>>> valid = StringIO('''\
-... <Total>
-...   <Percent>20</Percent>
-...   <Percent>30</Percent>
-...   <Percent>50</Percent>
-... </Total>
-... ''')
-
->>> doc = etree.parse(valid)
->>> schematron.validate(doc)
-True
-
->>> etree.SubElement(doc.getroot(), "Percent").text = "10"
-
->>> schematron.validate(doc)
-False
-
-

Calling the schema object has the same effect as calling its validate method. -This can be useful for conditional statements:

-
>>> is_valid = isoschematron.Schematron(sct_doc)
-
->>> if not is_valid(doc):
-...     print("invalid!")
-invalid!
-
-

Built on a pure-xslt implementation, the actual validator is created as an -XSLT 1.0 stylesheet using these steps:

-
    -
  1. (Extract embedded Schematron from XML Schema or RelaxNG schema)
  2. -
  3. Process inclusions
  4. -
  5. Process abstract patterns
  6. -
  7. Compile the schematron schema to XSLT
  8. -
-

To allow more control over the individual steps, isoschematron.Schematron -supports an extended API:

-

The include and expand keyword arguments can be used to switch off -steps 1) and 2).

-

To set parameters for steps 1), 2) and 3) dictionaries containing parameters -for XSLT can be provided using the keyword arguments include_params, -expand_params or compile_params. Schematron automatically converts these -parameters to stylesheet parameters so you need not worry to set string -parameters using quotes or to use XSLT.strparam(). If you ever need to pass an -XPath as argument to the XSLT stylesheet you can pass in an etree.XPath object -(see XPath and XSLT with lxml: Stylesheet-parameters for background on this).

-

The phase parameter of the compile step is additionally exposed as a keyword -argument. If set, it overrides occurrence in compile_params. Note that -isoschematron.Schematron might expose more common parameters as additional keyword -args in the future.

-

By setting store_schematron to True, the (included-and-expanded) schematron -document tree is stored and made available through the schematron property.

-

Similarly, setting store_xslt to True will result in the validation XSLT -document tree being kept; it can be retrieved through the validator_xslt -property.

-

Finally, with store_report set to True (default: False), the resulting -validation report document gets stored and can be accessed as the -validation_report property.

-

Using the phase parameter of isoschematron.Schematron allows for selective -validation of predefined pattern groups:

-
>>> f = StringIO('''\
-... <schema xmlns="http://purl.oclc.org/dsdl/schematron" >
-...   <phase id="phase.sum_check">
-...     <active pattern="sum_equals_100_percent"/>
-...   </phase>
-...   <phase id="phase.entries_check">
-...     <active pattern="all_positive"/>
-...   </phase>
-...   <pattern id="sum_equals_100_percent">
-...     <title>Sum equals 100%.</title>
-...     <rule context="Total">
-...       <assert test="sum(//Percent)=100">Sum is not 100%.</assert>
-...     </rule>
-...   </pattern>
-...   <pattern id="all_positive">
-...     <title>All entries must be positive.</title>
-...     <rule context="Percent">
-...       <assert test="number(.)>0">Number (<value-of select="."/>) not positive</assert>
-...     </rule>
-...   </pattern>
-... </schema>
-... ''')
-
->>> sct_doc = etree.parse(f)
->>> schematron = isoschematron.Schematron(sct_doc)
-
->>> valid = StringIO('''\
-... <Total>
-...   <Percent>20</Percent>
-...   <Percent>30</Percent>
-...   <Percent>50</Percent>
-... </Total>
-... ''')
-
->>> doc = etree.parse(valid)
->>> schematron.validate(doc)
-True
-
->>> invalid_positive = StringIO('''\
-... <Total>
-...   <Percent>0</Percent>
-...   <Percent>50</Percent>
-...   <Percent>50</Percent>
-... </Total>
-... ''')
-
->>> doc = etree.parse(invalid_positive)
-
->>> schematron.validate(doc)
-False
-
-

If the constraint of Percent entries being positive is not of interest in a -certain validation scenario, it can now be disabled:

-
>>> selective = isoschematron.Schematron(sct_doc, phase="phase.sum_check")
->>> selective.validate(doc)
-True
-
-

The usage of validation phases is a unique feature of ISO-Schematron and can be -a very powerful tool e.g. for establishing validation stages or to provide -different validators for different "validation audiences".

-
-
-

(Pre-ISO-Schematron)

-

Since version 2.0, lxml.etree features pre-ISO-Schematron support, using the -class lxml.etree.Schematron. It requires at least libxml2 2.6.21 to -work. The API is the same as for the other validators. Pass an -ElementTree object to construct a Schematron validator:

-
>>> f = StringIO('''\
-... <schema xmlns="http://www.ascc.net/xml/schematron" >
-...   <pattern name="Sum equals 100%.">
-...     <rule context="Total">
-...       <assert test="sum(//Percent)=100">Sum is not 100%.</assert>
-...     </rule>
-...   </pattern>
-... </schema>
-... ''')
-
->>> sct_doc = etree.parse(f)
->>> schematron = etree.Schematron(sct_doc)
-
-

You can then validate some ElementTree document with this. Like with RelaxNG, -you'll get back true if the document is valid against the schema, and false if -not:

-
>>> valid = StringIO('''\
-... <Total>
-...   <Percent>20</Percent>
-...   <Percent>30</Percent>
-...   <Percent>50</Percent>
-... </Total>
-... ''')
-
->>> doc = etree.parse(valid)
->>> schematron.validate(doc)
-True
-
->>> etree.SubElement(doc.getroot(), "Percent").text = "10"
-
->>> schematron.validate(doc)
-False
-
-

Calling the schema object has the same effect as calling its validate method. -This is sometimes used in conditional statements:

-
>>> is_valid = etree.Schematron(sct_doc)
-
->>> if not is_valid(doc):
-...     print("invalid!")
-invalid!
-
-

Note that libxml2 restricts error reporting to the parsing step (when creating -the Schematron instance). There is not currently any support for error -reporting during validation.

-
-
- - - \ No newline at end of file diff --git a/doc/html/xpathxslt.html b/doc/html/xpathxslt.html deleted file mode 100644 index a8c3d8b2..00000000 --- a/doc/html/xpathxslt.html +++ /dev/null @@ -1,639 +0,0 @@ - - - - - -XPath and XSLT with lxml - - - -
-

XPath and XSLT with lxml

- -

lxml supports XPath 1.0, XSLT 1.0 and the EXSLT extensions through -libxml2 and libxslt in a standards compliant way.

- -

The usual setup procedure:

-
>>> from lxml import etree
-
-
-

XPath

-

lxml.etree supports the simple path syntax of the find, findall and -findtext methods on ElementTree and Element, as known from the original -ElementTree library (ElementPath). As an lxml specific extension, these -classes also provide an xpath() method that supports expressions in the -complete XPath syntax, as well as custom extension functions.

-

There are also specialized XPath evaluator classes that are more efficient for -frequent evaluation: XPath and XPathEvaluator. See the performance -comparison to learn when to use which. Their semantics when used on -Elements and ElementTrees are the same as for the xpath() method described -here.

-
-

The xpath() method

-

For ElementTree, the xpath method performs a global XPath query against the -document (if absolute) or against the root node (if relative):

-
>>> f = StringIO('<foo><bar></bar></foo>')
->>> tree = etree.parse(f)
-
->>> r = tree.xpath('/foo/bar')
->>> len(r)
-1
->>> r[0].tag
-'bar'
-
->>> r = tree.xpath('bar')
->>> r[0].tag
-'bar'
-
-

When xpath() is used on an Element, the XPath expression is evaluated -against the element (if relative) or against the root tree (if absolute):

-
>>> root = tree.getroot()
->>> r = root.xpath('bar')
->>> r[0].tag
-'bar'
-
->>> bar = root[0]
->>> r = bar.xpath('/foo/bar')
->>> r[0].tag
-'bar'
-
->>> tree = bar.getroottree()
->>> r = tree.xpath('/foo/bar')
->>> r[0].tag
-'bar'
-
-

The xpath() method has support for XPath variables:

-
>>> expr = "//*[local-name() = $name]"
-
->>> print(root.xpath(expr, name = "foo")[0].tag)
-foo
-
->>> print(root.xpath(expr, name = "bar")[0].tag)
-bar
-
->>> print(root.xpath("$text", text = "Hello World!"))
-Hello World!
-
-
-
-

Namespaces and prefixes

-

If your XPath expression uses namespace prefixes, you must define them -in a prefix mapping. To this end, pass a dictionary to the -namespaces keyword argument that maps the namespace prefixes used -in the XPath expression to namespace URIs:

-
>>> f = StringIO('''\
-... <a:foo xmlns:a="http://codespeak.net/ns/test1"
-...        xmlns:b="http://codespeak.net/ns/test2">
-...    <b:bar>Text</b:bar>
-... </a:foo>
-... ''')
->>> doc = etree.parse(f)
-
->>> r = doc.xpath('/x:foo/b:bar',
-...               namespaces={'x': 'http://codespeak.net/ns/test1',
-...                           'b': 'http://codespeak.net/ns/test2'})
->>> len(r)
-1
->>> r[0].tag
-'{http://codespeak.net/ns/test2}bar'
->>> r[0].text
-'Text'
-
-

The prefixes you choose here are not linked to the prefixes used -inside the XML document. The document may define whatever prefixes it -likes, including the empty prefix, without breaking the above code.

-

Note that XPath does not have a notion of a default namespace. The -empty prefix is therefore undefined for XPath and cannot be used in -namespace prefix mappings.

-

There is also an optional extensions argument which is used to -define custom extension functions in Python that are local to this -evaluation. The namespace prefixes that they use in the XPath -expression must also be defined in the namespace prefix mapping.

-
-
-

XPath return values

-

The return value types of XPath evaluations vary, depending on the -XPath expression used:

-
    -
  • True or False, when the XPath expression has a boolean result
  • -
  • a float, when the XPath expression has a numeric result (integer or float)
  • -
  • a 'smart' string (as described below), when the XPath expression has -a string result.
  • -
  • a list of items, when the XPath expression has a list as result. -The items may include Elements (also comments and processing -instructions), strings and tuples. Text nodes and attributes in the -result are returned as 'smart' string values. Namespace -declarations are returned as tuples of strings: (prefix, URI).
  • -
-

XPath string results are 'smart' in that they provide a -getparent() method that knows their origin:

-
    -
  • for attribute values, result.getparent() returns the Element -that carries them. An example is //foo/@attribute, where the -parent would be a foo Element.
  • -
  • for the text() function (as in //text()), it returns the -Element that contains the text or tail that was returned.
  • -
-

You can distinguish between different text origins with the boolean -properties is_text, is_tail and is_attribute.

-

Note that getparent() may not always return an Element. For -example, the XPath functions string() and concat() will -construct strings that do not have an origin. For them, -getparent() will return None.

-

There are certain cases where the smart string behaviour is -undesirable. For example, it means that the tree will be kept alive -by the string, which may have a considerable memory impact in the case -that the string value is the only thing in the tree that is actually -of interest. For these cases, you can deactivate the parental -relationship using the keyword argument smart_strings.

-
>>> root = etree.XML("<root><a>TEXT</a></root>")
-
->>> find_text = etree.XPath("//text()")
->>> text = find_text(root)[0]
->>> print(text)
-TEXT
->>> print(text.getparent().text)
-TEXT
-
->>> find_text = etree.XPath("//text()", smart_strings=False)
->>> text = find_text(root)[0]
->>> print(text)
-TEXT
->>> hasattr(text, 'getparent')
-False
-
-
-
-

Generating XPath expressions

-

ElementTree objects have a method getpath(element), which returns a -structural, absolute XPath expression to find that element:

-
>>> a  = etree.Element("a")
->>> b  = etree.SubElement(a, "b")
->>> c  = etree.SubElement(a, "c")
->>> d1 = etree.SubElement(c, "d")
->>> d2 = etree.SubElement(c, "d")
-
->>> tree = etree.ElementTree(c)
->>> print(tree.getpath(d2))
-/c/d[2]
->>> tree.xpath(tree.getpath(d2)) == [d2]
-True
-
-
-
-

The XPath class

-

The XPath class compiles an XPath expression into a callable function:

-
>>> root = etree.XML("<root><a><b/></a><b/></root>")
-
->>> find = etree.XPath("//b")
->>> print(find(root)[0].tag)
-b
-
-

The compilation takes as much time as in the xpath() method, but it is -done only once per class instantiation. This makes it especially efficient -for repeated evaluation of the same XPath expression.

-

Just like the xpath() method, the XPath class supports XPath -variables:

-
>>> count_elements = etree.XPath("count(//*[local-name() = $name])")
-
->>> print(count_elements(root, name = "a"))
-1.0
->>> print(count_elements(root, name = "b"))
-2.0
-
-

This supports very efficient evaluation of modified versions of an XPath -expression, as compilation is still only required once.

-

Prefix-to-namespace mappings can be passed as second parameter:

-
>>> root = etree.XML("<root xmlns='NS'><a><b/></a><b/></root>")
-
->>> find = etree.XPath("//n:b", namespaces={'n':'NS'})
->>> print(find(root)[0].tag)
-{NS}b
-
-
-
-

Regular expressions in XPath

-

By default, XPath supports regular expressions in the EXSLT namespace:

-
>>> regexpNS = "http://exslt.org/regular-expressions"
->>> find = etree.XPath("//*[re:test(., '^abc$', 'i')]",
-...                    namespaces={'re':regexpNS})
-
->>> root = etree.XML("<root><a>aB</a><b>aBc</b></root>")
->>> print(find(root)[0].text)
-aBc
-
-

You can disable this with the boolean keyword argument regexp which -defaults to True.

-
-
-

The XPathEvaluator classes

-

lxml.etree provides two other efficient XPath evaluators that work on -ElementTrees or Elements respectively: XPathDocumentEvaluator and -XPathElementEvaluator. They are automatically selected if you use the -XPathEvaluator helper for instantiation:

-
>>> root = etree.XML("<root><a><b/></a><b/></root>")
->>> xpatheval = etree.XPathEvaluator(root)
-
->>> print(isinstance(xpatheval, etree.XPathElementEvaluator))
-True
-
->>> print(xpatheval("//b")[0].tag)
-b
-
-

This class provides efficient support for evaluating different XPath -expressions on the same Element or ElementTree.

-
-
-

ETXPath

-

ElementTree supports a language named ElementPath in its find*() methods. -One of the main differences between XPath and ElementPath is that the XPath -language requires an indirection through prefixes for namespace support, -whereas ElementTree uses the Clark notation ({ns}name) to avoid prefixes -completely. The other major difference regards the capabilities of both path -languages. Where XPath supports various sophisticated ways of restricting the -result set through functions and boolean expressions, ElementPath only -supports pure path traversal without nesting or further conditions. So, while -the ElementPath syntax is self-contained and therefore easier to write and -handle, XPath is much more powerful and expressive.

-

lxml.etree bridges this gap through the class ETXPath, which accepts XPath -expressions with namespaces in Clark notation. It is identical to the -XPath class, except for the namespace notation. Normally, you would -write:

-
>>> root = etree.XML("<root xmlns='ns'><a><b/></a><b/></root>")
-
->>> find = etree.XPath("//p:b", namespaces={'p' : 'ns'})
->>> print(find(root)[0].tag)
-{ns}b
-
-

ETXPath allows you to change this to:

-
>>> find = etree.ETXPath("//{ns}b")
->>> print(find(root)[0].tag)
-{ns}b
-
-
-
-

Error handling

-

lxml.etree raises exceptions when errors occur while parsing or evaluating an -XPath expression:

-
>>> find = etree.XPath("\\")
-Traceback (most recent call last):
-  ...
-lxml.etree.XPathSyntaxError: Invalid expression
-
-

lxml will also try to give you a hint what went wrong, so if you pass a more -complex expression, you may get a somewhat more specific error:

-
>>> find = etree.XPath("//*[1.1.1]")
-Traceback (most recent call last):
-  ...
-lxml.etree.XPathSyntaxError: Invalid predicate
-
-

During evaluation, lxml will emit an XPathEvalError on errors:

-
>>> find = etree.XPath("//ns:a")
->>> find(root)
-Traceback (most recent call last):
-  ...
-lxml.etree.XPathEvalError: Undefined namespace prefix
-
-

This works for the XPath class, however, the other evaluators (including -the xpath() method) are one-shot operations that do parsing and evaluation -in one step. They therefore raise evaluation exceptions in all cases:

-
>>> root = etree.Element("test")
->>> find = root.xpath("//*[1.1.1]")
-Traceback (most recent call last):
-  ...
-lxml.etree.XPathEvalError: Invalid predicate
-
->>> find = root.xpath("//ns:a")
-Traceback (most recent call last):
-  ...
-lxml.etree.XPathEvalError: Undefined namespace prefix
-
->>> find = root.xpath("\\")
-Traceback (most recent call last):
-  ...
-lxml.etree.XPathEvalError: Invalid expression
-
-

Note that lxml versions before 1.3 always raised an XPathSyntaxError for -all errors, including evaluation errors. The best way to support older -versions is to except on the superclass XPathError.

-
-
-
-

XSLT

-

lxml.etree introduces a new class, lxml.etree.XSLT. The class can be -given an ElementTree or Element object to construct an XSLT -transformer:

-
>>> xslt_root = etree.XML('''\
-... <xsl:stylesheet version="1.0"
-...     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-...     <xsl:template match="/">
-...         <foo><xsl:value-of select="/a/b/text()" /></foo>
-...     </xsl:template>
-... </xsl:stylesheet>''')
->>> transform = etree.XSLT(xslt_root)
-
-

You can then run the transformation on an ElementTree document by simply -calling it, and this results in another ElementTree object:

-
>>> f = StringIO('<a><b>Text</b></a>')
->>> doc = etree.parse(f)
->>> result_tree = transform(doc)
-
-

By default, XSLT supports all extension functions from libxslt and -libexslt as well as Python regular expressions through the EXSLT -regexp functions. Also see the documentation on custom extension -functions, XSLT extension elements and document resolvers. -There is a separate section on controlling access to external -documents and resources.

-
-

XSLT result objects

-

The result of an XSL transformation can be accessed like a normal ElementTree -document:

-
>>> root = etree.XML('<a><b>Text</b></a>')
->>> result = transform(root)
-
->>> result.getroot().text
-'Text'
-
-

but, as opposed to normal ElementTree objects, can also be turned into an (XML -or text) string by applying the str() function:

-
>>> str(result)
-'<?xml version="1.0"?>\n<foo>Text</foo>\n'
-
-

The result is always a plain string, encoded as requested by the -xsl:output element in the stylesheet. If you want a Python unicode string -instead, you should set this encoding to UTF-8 (unless the ASCII default -is sufficient). This allows you to call the builtin unicode() function on -the result:

-
>>> unicode(result)
-u'<?xml version="1.0"?>\n<foo>Text</foo>\n'
-
-

You can use other encodings at the cost of multiple recoding. Encodings that -are not supported by Python will result in an error:

-
>>> xslt_tree = etree.XML('''\
-... <xsl:stylesheet version="1.0"
-...     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-...     <xsl:output encoding="UCS4"/>
-...     <xsl:template match="/">
-...         <foo><xsl:value-of select="/a/b/text()" /></foo>
-...     </xsl:template>
-... </xsl:stylesheet>''')
->>> transform = etree.XSLT(xslt_tree)
-
->>> result = transform(doc)
->>> unicode(result)
-Traceback (most recent call last):
-  ...
-LookupError: unknown encoding: UCS4
-
-

While it is possible to use the .write() method (known from ElementTree -objects) to serialise the XSLT result into a file, it is better to use the -.write_output() method. The latter knows about the <xsl:output> tag -and writes the expected data into the output file.

-
>>> xslt_root = etree.XML('''\
-... <xsl:stylesheet version="1.0"
-...     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-...     <xsl:output method="text" encoding="utf8" />
-...     <xsl:template match="/">
-...         <foo><xsl:value-of select="/a/b/text()" /></foo>
-...     </xsl:template>
-... </xsl:stylesheet>''')
->>> transform = etree.XSLT(xslt_root)
-
->>> result = transform(doc)
->>> result.write_output("output.txt.gz", compression=9)    # doctest: +SKIP
-
-
-
->>> from io import BytesIO
->>> out = BytesIO()
->>> result.write_output(out)
->>> data = out.getvalue()
->>> b'Text' in data
-True
-
-
-
-
-

Stylesheet parameters

-

It is possible to pass parameters, in the form of XPath expressions, to the -XSLT template:

-
>>> xslt_tree = etree.XML('''\
-... <xsl:stylesheet version="1.0"
-...     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-...     <xsl:param name="a" />
-...     <xsl:template match="/">
-...         <foo><xsl:value-of select="$a" /></foo>
-...     </xsl:template>
-... </xsl:stylesheet>''')
->>> transform = etree.XSLT(xslt_tree)
->>> doc_root = etree.XML('<a><b>Text</b></a>')
-
-

The parameters are passed as keyword parameters to the transform call. -First, let's try passing in a simple integer expression:

-
>>> result = transform(doc_root, a="5")
->>> str(result)
-'<?xml version="1.0"?>\n<foo>5</foo>\n'
-
-

You can use any valid XPath expression as parameter value:

-
>>> result = transform(doc_root, a="/a/b/text()")
->>> str(result)
-'<?xml version="1.0"?>\n<foo>Text</foo>\n'
-
-

It's also possible to pass an XPath object as a parameter:

-
>>> result = transform(doc_root, a=etree.XPath("/a/b/text()"))
->>> str(result)
-'<?xml version="1.0"?>\n<foo>Text</foo>\n'
-
-

Passing a string expression looks like this:

-
>>> result = transform(doc_root, a="'A'")
->>> str(result)
-'<?xml version="1.0"?>\n<foo>A</foo>\n'
-
-

To pass a string that (potentially) contains quotes, you can use the -.strparam() class method. Note that it does not escape the -string. Instead, it returns an opaque object that keeps the string -value.

-
>>> plain_string_value = etree.XSLT.strparam(
-...                          """ It's "Monty Python" """)
->>> result = transform(doc_root, a=plain_string_value)
->>> str(result)
-'<?xml version="1.0"?>\n<foo> It\'s "Monty Python" </foo>\n'
-
-

If you need to pass parameters that are not legal Python identifiers, -pass them inside of a dictionary:

-
>>> transform = etree.XSLT(etree.XML('''\
-... <xsl:stylesheet version="1.0"
-...     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-...     <xsl:param name="non-python-identifier" />
-...     <xsl:template match="/">
-...         <foo><xsl:value-of select="$non-python-identifier" /></foo>
-...     </xsl:template>
-... </xsl:stylesheet>'''))
-
->>> result = transform(doc_root, **{'non-python-identifier': '5'})
->>> str(result)
-'<?xml version="1.0"?>\n<foo>5</foo>\n'
-
-
-
-

Errors and messages

-

Like most of the processing oriented objects in lxml.etree, XSLT -provides an error log that lists messages and error output from the -last run. See the parser documentation for a description of the -error log.

-
>>> xslt_root = etree.XML('''\
-... <xsl:stylesheet version="1.0"
-...     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-...     <xsl:template match="/">
-...         <xsl:message terminate="no">STARTING</xsl:message>
-...         <foo><xsl:value-of select="/a/b/text()" /></foo>
-...         <xsl:message terminate="no">DONE</xsl:message>
-...     </xsl:template>
-... </xsl:stylesheet>''')
->>> transform = etree.XSLT(xslt_root)
-
->>> doc_root = etree.XML('<a><b>Text</b></a>')
->>> result = transform(doc_root)
->>> str(result)
-'<?xml version="1.0"?>\n<foo>Text</foo>\n'
-
->>> print(transform.error_log)
-<string>:0:0:ERROR:XSLT:ERR_OK: STARTING
-<string>:0:0:ERROR:XSLT:ERR_OK: DONE
-
->>> for entry in transform.error_log:
-...     print('message from line %s, col %s: %s' % (
-...                entry.line, entry.column, entry.message))
-...     print('domain: %s (%d)' % (entry.domain_name, entry.domain))
-...     print('type: %s (%d)' % (entry.type_name, entry.type))
-...     print('level: %s (%d)' % (entry.level_name, entry.level))
-...     print('filename: %s' % entry.filename)
-message from line 0, col 0: STARTING
-domain: XSLT (22)
-type: ERR_OK (0)
-level: ERROR (2)
-filename: <string>
-message from line 0, col 0: DONE
-domain: XSLT (22)
-type: ERR_OK (0)
-level: ERROR (2)
-filename: <string>
-
-

Note that there is no way in XSLT to distinguish between user -messages, warnings and error messages that occurred during the -run. libxslt simply does not provide this information. You can -partly work around this limitation by making your own messages -uniquely identifiable, e.g. with a common text prefix.

-
-
-

The xslt() tree method

-

There's also a convenience method on ElementTree objects for doing XSL -transformations. This is less efficient if you want to apply the same XSL -transformation to multiple documents, but is shorter to write for one-shot -operations, as you do not have to instantiate a stylesheet yourself:

-
>>> result = doc.xslt(xslt_tree, a="'A'")
->>> str(result)
-'<?xml version="1.0"?>\n<foo>A</foo>\n'
-
-

This is a shortcut for the following code:

-
>>> transform = etree.XSLT(xslt_tree)
->>> result = transform(doc, a="'A'")
->>> str(result)
-'<?xml version="1.0"?>\n<foo>A</foo>\n'
-
-
-
-

Dealing with stylesheet complexity

-

Some applications require a larger set of rather diverse stylesheets. -lxml.etree allows you to deal with this in a number of ways. Here are -some ideas to try.

-

The most simple way to reduce the diversity is by using XSLT -parameters that you pass at call time to configure the stylesheets. -The partial() function in the functools module of Python 2.5 -may come in handy here. It allows you to bind a set of keyword -arguments (i.e. stylesheet parameters) to a reference of a callable -stylesheet. The same works for instances of the XPath() -evaluator, obviously.

-

You may also consider creating stylesheets programmatically. Just -create an XSL tree, e.g. from a parsed template, and then add or -replace parts as you see fit. Passing an XSL tree into the XSLT() -constructor multiple times will create independent stylesheets, so -later modifications of the tree will not be reflected in the already -created stylesheets. This makes stylesheet generation very straight -forward.

-

A third thing to remember is the support for custom extension -functions and XSLT extension elements. Some things are much -easier to express in XSLT than in Python, while for others it is the -complete opposite. Finding the right mixture of Python code and XSL -code can help a great deal in keeping applications well designed and -maintainable.

-
-
-

Profiling

-

If you want to know how your stylesheet performed, pass the profile_run -keyword to the transform:

-
>>> result = transform(doc, a="/a/b/text()", profile_run=True)
->>> profile = result.xslt_profile
-
-

The value of the xslt_profile property is an ElementTree with profiling -data about each template, similar to the following:

-
<profile>
-  <template rank="1" match="/" name="" mode="" calls="1" time="1" average="1"/>
-</profile>
-
-

Note that this is a read-only document. You must not move any of its elements -to other documents. Please deep-copy the document if you need to modify it. -If you want to free it from memory, just do:

-
>>> del result.xslt_profile
-
-
-
-
- - - \ No newline at end of file diff --git a/doc/main.txt b/doc/main.txt index d538b74a..40c199bf 100644 --- a/doc/main.txt +++ b/doc/main.txt @@ -157,8 +157,8 @@ Index `_ (PyPI). It has the source that compiles on various platforms. The source distribution is signed with `this key `_. -The latest version is `lxml 4.2.3`_, released 2018-06-27 -(`changes for 4.2.3`_). `Older versions <#old-versions>`_ +The latest version is `lxml 4.2.4`_, released 2018-08-03 +(`changes for 4.2.4`_). `Older versions <#old-versions>`_ are listed below. Please take a look at the @@ -250,7 +250,9 @@ See the websites of lxml .. and the `latest in-development version `_. -.. _`PDF documentation`: lxmldoc-4.2.3.pdf +.. _`PDF documentation`: lxmldoc-4.2.4.pdf + +* `lxml 4.2.4`_, released 2018-08-03 (`changes for 4.2.4`_) * `lxml 4.2.3`_, released 2018-06-27 (`changes for 4.2.3`_) @@ -270,6 +272,7 @@ See the websites of lxml * `older releases `_ +.. _`lxml 4.2.4`: /files/lxml-4.2.4.tgz .. _`lxml 4.2.3`: /files/lxml-4.2.3.tgz .. _`lxml 4.2.2`: /files/lxml-4.2.2.tgz .. _`lxml 4.2.1`: /files/lxml-4.2.1.tgz @@ -279,6 +282,7 @@ See the websites of lxml .. _`lxml 4.0.0`: /files/lxml-4.0.0.tgz .. _`lxml 3.8.0`: /files/lxml-3.8.0.tgz +.. _`changes for 4.2.4`: /changes-4.2.4.html .. _`changes for 4.2.3`: /changes-4.2.3.html .. _`changes for 4.2.2`: /changes-4.2.2.html .. _`changes for 4.2.0`: /changes-4.2.0.html diff --git a/doc/pdf/pubkey.asc b/doc/pdf/pubkey.asc deleted file mode 100644 index f72804c9..00000000 --- a/doc/pdf/pubkey.asc +++ /dev/null @@ -1,36 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.2 (GNU/Linux) - -mQGiBEQf3JQRBACciSqxoX0q3VurkRENVVtG/pVqtFh/d2CohbVJlLCrO4s7nnPj -CTfZFt6tmykZjsLJl24XpEJt0O/C0jLcaBqvXVgVvRXHz4DjEYYuQF4LPthhI4MA -4T7ExptX4lU5g3BVJ46vPU8uRBbbxarBRas9rYewgnrYKWpZZCa7yMq+9wCgnyyR -Si4E3viLwi77jda135nA6vcD/iqu8zIl9/dFuUcOvxJrhrm+UdY72puZ1TVczSAH -GOqMjrKkfyHlaJh/ZzWENpTZIfOdVhy7Chvva18vH4Wz7jKj5UeIpRrBvjAD28r3 -Y3W5bfsnpPkvDOyU1vqBsw4q+/250GXEX0JqV2Rbf5yLVgEZPdGrswO460dr4UVS -8RS0BACYTmyrz57AugHc5tRkqNw6o7ux2deOT0c3AbUcOWtOocGumCsUf+M1nOrc -VWkeBWTv4HIIiecWYY/KwIemTthQGjxywaZDxOlBT0BOL/+vfYTq/plZULXr+g90 -rSe82+kLl9N5onkBDJKeDIcJDzRoxIRPV1i0Om/5JBI4jmUnv7QnU3RlZmFuIEJl -aG5lbCA8c2NvZGVyQHVzZXJzLmJlcmxpb3MuZGU+iF8EExECACAFAkQiqKYCGwMG -CwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRANPVNpCNOgHi+2AJ0a0JH8iP3RqrOL -JefvHz1dSl3MxACYo7Ma6CeIgsGnyaSSdNOmNVXn+IhGBBARAgAGBQJEIqk0AAoJ -ELO5mMzzmgZbmCcAoKZ2En1IlsxBpaPPxgWYrUOWfc6hAKCBWODMMOYptCBkSrjg -m3gsrjHgYbQsU3RlZmFuIEJlaG5lbCA8c2NvZGVyQHVzZXJzLnNvdXJjZWZvcmdl -Lm5ldD6IYAQTEQIAIAUCRB/clAIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJ -EA09U2kI06Aen2YAn0hvuDs+Gslq9vPRFFbsFNJI40PmAJ0chjiiEy0xV5C+n6YX -XFuldRDILYhGBBARAgAGBQJEIp4AAAoJELO5mMzzmgZbgKQAn3pWrmFdj8YaEyuR -tEjKVZJDQ6ZVAJ0Y1igwADT40BPra+G/xiLa3YbCrrkCDQREH9ynEAgAiR4/0r0d -doViNECfSLClllu5K0Bo1SEiMtvVNC3sJYgVzBddD8Xn8UAdjyAgmaL5FC2FsNQu -RxxKkNlHNYCq8ZSWtZaL2MQ+SyMUyHv6VXVCGuSW0COpzbx58u+SZpjyESJ1kaZc -73SaIw6kv/dVQHjurwmlo1lg3dLZ3PG08WGCYUMqkkv2K+J7+puzE2Cjo31gTq4s -LYDCV26wjVQ6BqT2EcHQhVEjh0xq5ugc908cr/2FQAKkTifEbF+OVBGWiFMGgri+ -6+G54/BV/RakpvNCFYBiZHn/M9mQaWt7XoTmnEQ1ldq5KNlRhkqnQRF/NK5VpGcQ -29As28aqpZTECwADBgf/WlRvBRI1Q1eIv2falEv7C6sOxqc3kr5z1uUBTRG5v9t6 -ff9k/J4oC6cnQx00GK3ZR8ija6bl8zwu+0m0M3rW49Krb1rsiT7r4ahOZ7p9RRro -oG3NbUJYgMG10D1nxpaioYqa/m+PpILJM0wfYZZEuX0xkZcOB24yb+J7EIcGR09T -mMd5sXtdTU+w/p7Xi2cP61uQ8qixyHBH8E06qgW2JtVFV9rGn7CNUOvkNaUBRnY5 -QxhdkvKJRx7voOLYWZFUBIWgto+6vmTgKmc2Ho6qddzME9UgwUNcknRgm0cf6Cxr -6zPtxZl8a6KemjQcK7kARSmMNCDkqp/Pohe519A5vYhJBBgRAgAJBQJEH9ynAhsM -AAoJEA09U2kI06Aesv4AnjiVQVLzqnNS/64vvMMP1UARY3HtAJ90YxNGhRNIhWYL -UU16oJlGD/9M1Q== -=gWy2 ------END PGP PUBLIC KEY BLOCK----- diff --git a/doc/s5/lxml-ep2008.html b/doc/s5/lxml-ep2008.html deleted file mode 100644 index 58276a59..00000000 --- a/doc/s5/lxml-ep2008.html +++ /dev/null @@ -1,1335 +0,0 @@ - - - - - - - -Implementing XML languages with lxml - - - - - - - - - - - - -
-
-
- - -
-
-
-

Implementing XML languages with lxml

-

Dr. Stefan Behnel

- -

http://codespeak.net/lxml/

-

lxml-dev@codespeak.net

-tagpython.png - - - - - - - - - - -
-
-

What is an »XML language«?

-
    -
  • a language in XML notation
  • -
  • aka »XML dialect«
      -
    • except that it's not a dialect
    • -
    -
  • -
  • Examples:
      -
    • XML Schema
    • -
    • Atom/RSS
    • -
    • (X)HTML
    • -
    • Open Document Format
    • -
    • SOAP
    • -
    • ... add your own one here
    • -
    -
  • -
-
- - -
-

Popular mistakes to avoid (2)

-

"This is tree data, I'll take the DOM!"

-
    -
  • DOM is ubiquitous, but it's as complicated as Java
  • -
  • uglify your application with tons of DOM code to
      -
    • walk over non-element nodes to find the data you need
    • -
    • convert text content to other data types
    • -
    • modify the XML tree in memory
    • -
    -
  • -
-

=> write verbose, redundant, hard-to-maintain code

-
- -
-

Popular mistakes to avoid (3)

-

"SAX is so fast and consumes no memory!"

-
    -
  • but writing SAX code is not fast!
  • -
  • write error-prone, state-keeping SAX code to
      -
    • figure out where you are
    • -
    • find the sections you need
    • -
    • convert text content to other data types
    • -
    • copy the XML data into custom data classes
    • -
    • ... and don't forget the way back into XML!
    • -
    -
  • -
-

=> write confusing state-machine code

-

=> debugging into existence

-
-
-

Working with XML

-
-

Getting XML work done

-

(instead of getting time wasted)

-
-
-
-

How can you work with XML?

-
    -
  • Preparation:
      -
    • Implement usable data classes as an abstraction layer
    • -
    • Implement a mapping from XML to the data classes
    • -
    • Implement a mapping from the data classes to XML
    • -
    -
  • -
  • Workflow:
      -
    • parse XML data
    • -
    • map XML data to data classes
    • -
    • work with data classes
    • -
    • map data classes to XML
    • -
    • serialise XML
    • -
    -
  • -
-
    -
  • Approach:
      -
    • get rid of XML and do everything in your own code
    • -
    -
  • -
-
-
-

What if you could simplify this?

-
    -
  • Preparation:
      -
    • Extend usable XML API classes into an abstraction layer
    • -
    -
  • -
  • Workflow:
      -
    • parse XML data into XML API classes
    • -
    • work with XML API classes
    • -
    • serialise XML
    • -
    -
  • -
-
    -
  • Approach:
      -
    • cover only the quirks of XML and make it work for you
    • -
    -
  • -
-
-
-

What if you could simplify this ...

-
    -
  • ... without sacrificing usability or flexibility?
  • -
  • ... using a high-speed, full-featured, pythonic XML toolkit?
  • -
  • ... with the power of XPath, XSLT and XML validation?
  • -
-

... then »lxml« is your friend!

-
-
-

Overview

-
    -
  • What is lxml?
      -
    • what & who
    • -
    -
  • -
  • How do you use it?
      -
    • Lesson 0: quick API overview
        -
      • ElementTree concepts and lxml features
      • -
      -
    • -
    • Lesson 1: parse XML
        -
      • how to get XML data into memory
      • -
      -
    • -
    • Lesson 2: generate XML
        -
      • how to write an XML generator for a language
      • -
      -
    • -
    • Lesson 3: working with XML trees made easy
        -
      • how to write an XML API for a language
      • -
      -
    • -
    -
  • -
-
-
-

What is lxml?

-
    -
  • a fast, full-featured toolkit for XML and HTML handling -
  • -
  • based on and inspired by
      -
    • the C libraries libxml2 and libxslt (by Daniel Veillard)
    • -
    • the ElementTree API (by Fredrik Lundh)
    • -
    • the Cython compiler (by Robert Bradshaw, Greg Ewing & me)
    • -
    • the Python language (by Guido & [paste Misc/ACKS here])
    • -
    • user feedback, ideas and patches (by you!)
        -
      • keep doing that, we love you all!
      • -
      -
    • -
    -
  • -
  • maintained (and major parts) written by myself
      -
    • initial design and implementation by Martijn Faassen
    • -
    • extensive HTML API and tools by Ian Bicking
    • -
    -
  • -
-
-
-

What do you get for your money?

-
    -
  • many tools in one:
      -
    • Generic, ElementTree compatible XML API: lxml.etree
        -
      • but faster for many tasks and much more feature-rich
      • -
      -
    • -
    • Special tool set for HTML handling: lxml.html
    • -
    • Special API for pythonic data binding: lxml.objectify
    • -
    • General purpose path languages: XPath and CSS selectors
    • -
    • Validation: DTD, XML Schema, RelaxNG, Schematron
    • -
    • XSLT, XInclude, C14N, ...
    • -
    • Fast tree iteration, event-driven parsing, ...
    • -
    -
  • -
  • it's free, but it's worth every €-Cent!
      -
    • what users say:
        -
      • »no qualification, I would recommend lxml for just about any -HTML task«
      • -
      • »THE tool [...] for newbies and experienced developers«
      • -
      • »you can do pretty much anything with an intuitive API«
      • -
      • »lxml takes all the pain out of XML«
      • -
      -
    • -
    -
  • -
-
-
-

Lesson 0: a quick overview

-
-

why »lxml takes all the pain out of XML«

-

(a quick overview of lxml features and ElementTree concepts)

-
- -
-
-

Namespaces in ElementTree

-
    -
  • uses Clark notation:

    -
      -
    • wrap namespace URI in {...}
    • -
    • append the tag name
    • -
    -
    >>> tag = "{http://www.w3.org/the/namespace}tagname"
    ->>> element = etree.Element(tag)
    -
    -
  • -
  • no prefixes!

    -
  • -
  • a single, self-containing tag identifier

    -
  • -
-
-
-

Text content in ElementTree

-
    -
  • uses .text and .tail attributes:

    -
    >>> div = html.fragment_fromstring(
    -...     "<div><p>a paragraph<br>split in two</p> parts</div>")
    ->>> p = div[0]
    ->>> br = p[0]
    -
    ->>> p.text
    -'a paragraph'
    ->>> br.text
    ->>> br.tail
    -'split in two'
    ->>> p.tail
    -' parts'
    -
    -
  • -
  • no text nodes!

    -
      -
    • simplifies tree traversal a lot
    • -
    • simplifies many XML algorithms
    • -
    -
  • -
-
-
-

Attributes in ElementTree

-
    -
  • uses .get() and .set() methods:

    -
    >>> root = etree.fromstring(
    -...     '<root a="the value" b="of an" c="attribute"/>')
    -
    ->>> root.get('a')
    -'the value'
    -
    ->>> root.set('a', "THE value")
    ->>> root.get('a')
    -'THE value'
    -
    -
  • -
  • or the .attrib dictionary property:

    -
    >>> d = root.attrib
    -
    ->>> list(sorted(d.keys()))
    -['a', 'b', 'c']
    ->>> list(sorted(d.values()))
    -['THE value', 'attribute', 'of an']
    -
    -
  • -
-
-
-

Tree iteration in lxml.etree (1)

- -
>>> root = etree.fromstring(
-...   "<root> <a><b/><b/></a> <c><d/><e><f/></e><g/></c> </root>")
-
->>> print([child.tag for child in root])   # children
-['a', 'c']
-
->>> print([el.tag for el in root.iter()])  # self and descendants
-['root', 'a', 'b', 'b', 'c', 'd', 'e', 'f', 'g']
-
->>> print([el.tag for el in root.iterdescendants()])
-['a', 'b', 'b', 'c', 'd', 'e', 'f', 'g']
-
-
->>> def iter_breadth_first(root):
-...     bfs_queue = collections.deque([root])
-...     while bfs_queue:
-...         el = bfs_queue.popleft()  # pop next element
-...         bfs_queue.extend(el)      # append its children
-...         yield el
-
->>> print([el.tag for el in iter_breadth_first(root)])
-['root', 'a', 'c', 'b', 'b', 'd', 'e', 'g', 'f']
-
-
-
-

Tree iteration in lxml.etree (2)

-
>>> root = etree.fromstring(
-...   "<root> <a><b/><b/></a> <c><d/><e><f/></e><g/></c> </root>")
-
->>> tree_walker = etree.iterwalk(root, events=('start', 'end'))
-
->>> for (event, element) in tree_walker:
-...     print("%s (%s)" % (element.tag, event))
-root (start)
-a (start)
-b (start)
-b (end)
-b (start)
-b (end)
-a (end)
-c (start)
-d (start)
-d (end)
-e (start)
-f (start)
-f (end)
-e (end)
-g (start)
-g (end)
-c (end)
-root (end)
-
-
-
-

Path languages in lxml

-
<root>
-  <speech class='dialog'><p>So be it!</p></speech>
-  <p>stuff</p>
-</root>
-
-
    -
  • search it with XPath

    -
    >>> find_paragraphs = etree.XPath("//p")
    ->>> paragraphs = find_paragraphs(xml_tree)
    -
    ->>> print([ p.text for p in paragraphs ])
    -['So be it!', 'stuff']
    -
    -
  • -
  • search it with CSS selectors

    -
    >>> find_dialogs = cssselect.CSSSelector("speech.dialog p")
    ->>> paragraphs = find_dialogs(xml_tree)
    -
    ->>> print([ p.text for p in paragraphs ])
    -['So be it!']
    -
    -
  • -
-
-
-

Summary of lesson 0

-
    -
  • lxml comes with various tools
      -
    • that aim to hide the quirks of XML
    • -
    • that simplify finding and handling data
    • -
    • that make XML a pythonic tool by itself
    • -
    -
  • -
-
-
-

Lesson 1: parsing XML/HTML

-
-

The input side

-

(a quick overview)

-
-
-
-

Parsing XML and HTML from ...

-
    -
  • strings: fromstring(xml_data)
      -
    • byte strings, but also unicode strings
    • -
    -
  • -
  • filenames: parse(filename)
  • -
  • HTTP/FTP URLs: parse(url)
  • -
  • file objects: parse(f)
      -
    • f = open(filename, 'rb') !
    • -
    -
  • -
  • file-like objects: parse(f)
      -
    • only need a f.read(size) method
    • -
    -
  • -
  • data chunks: parser.feed(xml_chunk)
      -
    • result = parser.close()
    • -
    -
  • -
-

(parsing from strings and filenames/URLs frees the GIL)

-
-
-

Example: parsing from a string

-
    -
  • using the fromstring() function:

    -
    >>> root_element = etree.fromstring(some_xml_data)
    -
    -
  • -
  • using the fromstring() function with a specific parser:

    -
    >>> parser = etree.HTMLParser(remove_comments=True)
    ->>> root_element = etree.fromstring(some_html_data, parser)
    -
    -
  • -
  • or the XML() and HTML() aliases for literals in code:

    -
    >>> root_element = etree.XML("<root><child/></root>")
    ->>> root_element = etree.HTML("<p>some<br>paragraph</p>")
    -
    -
  • -
-
-
-

Parsing XML into ...

-
    -
  • a tree in memory
      -
    • parse() and fromstring() functions
    • -
    -
  • -
  • a tree in memory, but step-by-step with a generator
      -
    • iterparse() generates (start/end, element) events
    • -
    • tree can be cleaned up to save space
    • -
    -
  • -
  • SAX-like callbacks without building a tree
      -
    • parse() and fromstring() functions
    • -
    • pass a target object into the parser
    • -
    -
  • -
-
-
-

Summary of lesson 1

-
    -
  • parsing XML/HTML in lxml is mostly straight forward
      -
    • simple functions that do the job
    • -
    -
  • -
  • advanced use cases are pretty simple
      -
    • event-driven parsing using iterparse()
    • -
    • special parser configuration with keyword arguments
        -
      • configuration is generally local to a parser
      • -
      -
    • -
    -
  • -
  • BTW: parsing is very fast, as is serialising
      -
    • don't hesitate to do parse-serialise-parse cycles
    • -
    -
  • -
-
-
-

Lesson 2: generating XML

-
-

The output side

-

(and how to make it safe and simple)

-
-
-
-

The example language: Atom

-

The Atom XML format

-
    -
  • Namespace: http://www.w3.org/2005/Atom
  • -
  • W3C recommendation derived from RSS and friends
  • -
  • Atom feeds describe news entries and annotated links
      -
    • a feed contains one or more entry elements
    • -
    • an entry contains author, link, summary and/or content
    • -
    -
  • -
-
-
-

Example: generate XML (1)

-

The ElementMaker (or E-factory)

-
>>> from lxml.builder import ElementMaker
->>> A = ElementMaker(namespace="http://www.w3.org/2005/Atom",
-...                  nsmap={None : "http://www.w3.org/2005/Atom"})
-
-
>>> atom = A.feed(
-...   A.author( A.name("Stefan Behnel") ),
-...   A.entry(
-...     A.title("News from lxml"),
-...     A.link(href="http://codespeak.net/lxml/"),
-...     A.summary("See what's <b>fun</b> about lxml...",
-...               type="html"),
-...   )
-... )
-
-
>>> from lxml.etree import tostring
->>> print( tostring(atom, pretty_print=True) )
-
-
-
-

Example: generate XML (2)

-
>>> atom = A.feed(
-...   A.author( A.name("Stefan Behnel") ),
-...   A.entry(
-...     A.title("News from lxml"),
-...     A.link(href="http://codespeak.net/lxml/"),
-...     A.summary("See what's <b>fun</b> about lxml...",
-...               type="html"),
-...   )
-... )
-
-
<feed xmlns="http://www.w3.org/2005/Atom">
-  <author>
-    <name>Stefan Behnel</name>
-  </author>
-  <entry>
-    <title>News from lxml</title>
-    <link href="http://codespeak.net/lxml/"/>
-    <summary type="html">See what's &lt;b&gt;fun&lt;/b&gt;
-                         about lxml...</summary>
-  </entry>
-</feed>
-
-
-
-

Be careful what you type!

-
>>> atom = A.feed(
-...   A.author( A.name("Stefan Behnel") ),
-...   A.entry(
-...     A.titel("News from lxml"),
-...     A.link(href="http://codespeak.net/lxml/"),
-...     A.summary("See what's <b>fun</b> about lxml...",
-...               type="html"),
-...   )
-... )
-
-
<feed xmlns="http://www.w3.org/2005/Atom">
-  <author>
-    <name>Stefan Behnel</name>
-  </author>
-  <entry>
-    <titel>News from lxml</titel>
-    <link href="http://codespeak.net/lxml/"/>
-    <summary type="html">See what's &lt;b&gt;fun&lt;/b&gt;
-                         about lxml...</summary>
-  </entry>
-</feed>
-
-
-
-

Want more 'type safety'?

-

Write an XML generator module instead:

-
# atomgen.py
-
-from lxml import etree
-from lxml.builder import ElementMaker
-
-ATOM_NAMESPACE = "http://www.w3.org/2005/Atom"
-
-A = ElementMaker(namespace=ATOM_NAMESPACE,
-                 nsmap={None : ATOM_NAMESPACE})
-
-feed = A.feed
-entry = A.entry
-title = A.title
-# ... and so on and so forth ...
-
-
-# plus a little validation function: isvalid()
-isvalid = etree.RelaxNG(file="atom.rng")
-
-
-
-

The Atom generator module

- -
>>> import atomgen as A
-
->>> atom = A.feed(
-...   A.author( A.name("Stefan Behnel") ),
-...   A.entry(
-...     A.link(href="http://codespeak.net/lxml/"),
-...     A.title("News from lxml"),
-...     A.summary("See what's <b>fun</b> about lxml...",
-...               type="html"),
-...   )
-... )
-
->>> A.isvalid(atom) # ok, forgot the ID's => invalid XML ...
-False
-
->>> title = A.titel("News from lxml")
-Traceback (most recent call last):
-  ...
-AttributeError: 'module' object has no attribute 'titel'
-
-
-
-

Mixing languages (1)

-

Atom can embed serialised HTML

-
>>> import lxml.html.builder as h
-
->>> html_fragment = h.DIV(
-...   "this is some\n",
-...   h.A("HTML", href="http://w3.org/MarkUp/"),
-...   "\ncontent")
-
-
>>> serialised_html = etree.tostring(html_fragment, method="html")
-
->>> summary = A.summary(serialised_html, type="html")
-
-
>>> print(etree.tostring(summary))
-<summary xmlns="http://www.w3.org/2005/Atom" type="html">
-   &lt;div&gt;this is some
-   &lt;a href="http://w3.org/MarkUp/"&gt;HTML&lt;/a&gt;
-   content&lt;/div&gt;
-</summary>
-
-
-
-

Mixing languages (2)

-

Atom can also embed non-escaped XHTML

-
>>> from copy import deepcopy
->>> xhtml_fragment = deepcopy(html_fragment)
-
->>> from lxml.html import html_to_xhtml
->>> html_to_xhtml(xhtml_fragment)
-
->>> summary = A.summary(xhtml_fragment, type="xhtml")
-
-
>>> print(etree.tostring(summary, pretty_print=True))
-<summary xmlns="http://www.w3.org/2005/Atom" type="xhtml">
-  <html:div xmlns:html="http://www.w3.org/1999/xhtml">this is some
-  <html:a href="http://w3.org/MarkUp/">HTML</html:a>
-  content</html:div>
-</summary>
-
-
-
-

Summary of lesson 2

-
    -
  • generating XML is easy
      -
    • use the ElementMaker
    • -
    -
  • -
  • wrap it in a module that provides
      -
    • the target namespace
    • -
    • an ElementMaker name for each language element
    • -
    • a validator
    • -
    • maybe additional helper functions
    • -
    -
  • -
  • mixing languages is easy
      -
    • define a generator module for each
    • -
    -
  • -
-

... this is all you need for the output side of XML languages

-
-
-

Lesson 3: Designing XML APIs

-
-

The Element API

-

(and how to make it the way you want)

-
-
-
-

Trees in C and in Python

-
    -
  • Trees have two representations:
      -
    • a plain, complete, low-level C tree provided by libxml2
    • -
    • a set of Python Element proxies, each representing one element
    • -
    -
  • -
  • Proxies are created on-the-fly:
      -
    • lxml creates an Element object for a C node on request
    • -
    • proxies are garbage collected when going out of scope
    • -
    • XML trees are garbage collected when deleting the last proxy
    • -
    -
  • -
-ep2008/proxies.png -
-
-

Mapping Python classes to nodes

-
    -
  • Proxies can be assigned to XML nodes by user code
      -
    • lxml tells you about a node, you return a class
    • -
    -
  • -
-
-
-

Example: a simple Element class (1)

-
    -
  • define a subclass of ElementBase

    -
    >>> class HonkElement(etree.ElementBase):
    -...    @property
    -...    def honking(self):
    -...       return self.get('honking') == 'true'
    -
    -
  • -
  • let it replace the default Element class

    -
    >>> lookup = etree.ElementDefaultClassLookup(
    -...                             element=HonkElement)
    -
    ->>> parser = etree.XMLParser()
    ->>> parser.set_element_class_lookup(lookup)
    -
    -
  • -
-
-
-

Example: a simple Element class (2)

-
    -
  • use the new Element class

    -
    >>> root = etree.XML('<root><honk honking="true"/></root>',
    -...                  parser)
    -
    ->>> root.honking
    -False
    ->>> root[0].honking
    -True
    -
    -
  • -
-
-
-

Mapping Python classes to nodes

-
    -
  • The Element class lookup
      -
    • lxml tells you about a node, you return a class
    • -
    • no restrictions on lookup algorithm
    • -
    • each parser can use a different class lookup scheme
    • -
    • lookup schemes can be chained through fallbacks
    • -
    -
  • -
  • Classes can be selected based on
      -
    • the node type (element, comment or processing instruction)
        -
      • ElementDefaultClassLookup()
      • -
      -
    • -
    • the namespaced node name
        -
      • CustomElementClassLookup() + a fallback
      • -
      • ElementNamespaceClassLookup() + a fallback
      • -
      -
    • -
    • the value of an attribute (e.g. id or class)
        -
      • AttributeBasedElementClassLookup() + a fallback
      • -
      -
    • -
    • read-only inspection of the tree
        -
      • PythonElementClassLookup() + a fallback
      • -
      -
    • -
    -
  • -
-
-
-

Designing an Atom API

-
    -
  • a feed is a container for entries

    -
    # atom.py
    -
    -ATOM_NAMESPACE = "http://www.w3.org/2005/Atom"
    -_ATOM_NS = "{%s}" % ATOM_NAMESPACE
    -
    -class FeedElement(etree.ElementBase):
    -    @property
    -    def entries(self):
    -       return self.findall(_ATOM_NS + "entry")
    -
    -
  • -
  • it also has a couple of meta-data children, e.g. title

    -
    class FeedElement(etree.ElementBase):
    -    # ...
    -    @property
    -    def title(self):
    -        "return the title or None"
    -        return self.find("title")
    -
    -
  • -
-
-
-

Consider lxml.objectify

-
    -
  • ready-to-use, generic Python object API for XML
  • -
-
>>> from lxml import objectify
-
->>> feed = objectify.parse("atom-example.xml")
->>> print(feed.title)
-Example Feed
-
->>> print([entry.title for entry in feed.entry])
-['Atom-Powered Robots Run Amok']
-
->>> print(feed.entry[0].title)
-Atom-Powered Robots Run Amok
-
-
-
-

Still room for more convenience

-
from itertools import chain
-
-class FeedElement(objectify.ObjectifiedElement):
-
-    def addIDs(self):
-        "initialise the IDs of feed and entries"
-
-        for element in chain([self], self.entry):
-            if element.find(_ATOM_NS + "id") is None:
-                id = etree.SubElement(self, _ATOM_NS + "id")
-                id.text = make_guid()
-
-
-
-

Incremental API design

-
    -
  • choose an XML API to start with
      -
    • lxml.etree is general purpose
    • -
    • lxml.objectify is nice for document-style XML
    • -
    -
  • -
  • fix Elements that really need some API sugar
      -
    • dict-mappings to children with specific content/attributes
    • -
    • properties for specially typed attributes or child values
    • -
    • simplified access to varying content types of an element
    • -
    • shortcuts for unnecessarily deep subtrees
    • -
    -
  • -
  • ignore what works well enough with the Element API
      -
    • lists of homogeneous children -> Element iteration
    • -
    • string attributes -> .get()/.set()
    • -
    -
  • -
  • let the API grow at your fingertips
      -
    • play with it and test use cases
    • -
    • avoid "I want because I can" feature explosion!
    • -
    -
  • -
-
-
-

Setting up the Element mapping

-

Atom has a namespace => leave the mapping to lxml

-
# ...
-_atom_lookup = etree.ElementNamespaceClassLookup(
-                  objectify.ObjectifyElementClassLookup())
-
-# map the classes to tag names
-ns = _atom_lookup.get_namespace(ATOM_NAMESPACE)
-ns["feed"]  = FeedElement
-ns["entry"] = EntryElement
-# ... and so on
-# or use ns.update(vars()) with appropriate class names
-
-# create a parser that does some whitespace cleanup
-atom_parser = etree.XMLParser(remove_blank_text=True)
-
-# make it use our Atom classes
-atom_parser.set_element_class_lookup(_atom_lookup)
-
-# and help users in using our parser setup
-def parse(input):
-    return etree.parse(input, atom_parser)
-
-
-
-

Using your new Atom API

-
>>> import atom
->>> feed = atom.parse("ep2008/atom-example.xml").getroot()
-
->>> print(len(feed.entry))
-1
->>> print([entry.title for entry in feed.entry])
-['Atom-Powered Robots Run Amok']
-
->>> link_tag = "{%s}link" % atom.ATOM_NAMESPACE
->>> print([link.get("href") for link in feed.iter(link_tag)])
-['http://example.org/', 'http://example.org/2003/12/13/atom03']
-
-
-
-

Summary of lesson 3

-

To implement an XML API ...

-
    -
  1. start off with lxml's Element API
      -
    • or take a look at the object API of lxml.objectify
    • -
    -
  2. -
  3. specialise it into a set of custom Element classes
  4. -
  5. map them to XML tags using one of the lookup schemes
  6. -
  7. improve the API incrementally while using it
      -
    • discover inconveniences and beautify them
    • -
    • avoid putting work into things that work
    • -
    -
  8. -
-
-
-

Conclusion

-

lxml ...

-
    -
  • provides a convenient set of tools for XML and HTML
      -
    • parsing
    • -
    • generating
    • -
    • working with in-memory trees
    • -
    -
  • -
  • follows Python idioms wherever possible
      -
    • highly extensible through wrapping and subclassing
    • -
    • callable objects for XPath, CSS selectors, XSLT, schemas
    • -
    • iteration for tree traversal (even while parsing)
    • -
    • list-/dict-like APIs, properties, keyword arguments, ...
    • -
    -
  • -
  • makes extension and specialisation easy
      -
    • write a special XML generator module in trivial code
    • -
    • write your own XML API incrementally on-the-fly
    • -
    -
  • -
-
-
- - diff --git a/setup.cfg b/setup.cfg index a669c45c..861a9f55 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [egg_info] -tag_svn_revision = 0 tag_build = tag_date = 0 +tag_svn_revision = 0 diff --git a/setupinfo.py b/setupinfo.py index 2d3b2002..bdac1d09 100644 --- a/setupinfo.py +++ b/setupinfo.py @@ -155,21 +155,22 @@ def ext_modules(static_include_dirs, static_library_dirs, result = [] for module, src_file in zip(modules, module_files): + is_py = module in COMPILED_MODULES main_module_source = src_file + ( - '.c' if not use_cython else '.py' if module in COMPILED_MODULES else '.pyx') + '.c' if not use_cython else '.py' if is_py else '.pyx') result.append( Extension( module, sources = [main_module_source], depends = find_dependencies(module), extra_compile_args = _cflags, - extra_link_args = _ldflags, - extra_objects = static_binaries, + extra_link_args = None if is_py else _ldflags, + extra_objects = None if is_py else static_binaries, define_macros = _define_macros, include_dirs = _include_dirs, - library_dirs = _library_dirs, - runtime_library_dirs = runtime_library_dirs, - libraries = _libraries, + library_dirs = None if is_py else _library_dirs, + runtime_library_dirs = None if is_py else runtime_library_dirs, + libraries = None if is_py else _libraries, )) if CYTHON_INSTALLED and OPTION_WITH_CYTHON_GDB: for ext in result: @@ -385,9 +386,15 @@ def check_min_version(version, min_version, error_name): return True +def get_library_version(config_tool): + is_pkgconfig = "pkg-config" in config_tool + return run_command(config_tool, + "--modversion" if is_pkgconfig else "--version") + + def get_library_versions(): - xml2_version = run_command(find_xml2_config(), "--version") - xslt_version = run_command(find_xslt_config(), "--version") + xml2_version = get_library_version(find_xml2_config()) + xslt_version = get_library_version(find_xslt_config()) return xml2_version, xslt_version diff --git a/src/lxml.egg-info/PKG-INFO b/src/lxml.egg-info/PKG-INFO index 04f5f69e..9f89cb73 100644 --- a/src/lxml.egg-info/PKG-INFO +++ b/src/lxml.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: lxml -Version: 4.2.3 +Version: 4.2.4 Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API. Home-page: http://lxml.de/ Author: lxml dev team @@ -36,13 +36,21 @@ Description: lxml is a Pythonic, mature binding for the libxml2 and libxslt libr as soon as a maintenance branch has been established. Note that this requires Cython to be installed at an appropriate version for the build. - 4.2.3 (2018-06-27) + 4.2.4 (2018-08-03) ================== + Features added + -------------- + + * GH#259: Allow using ``pkg-config`` for build configuration. + Patch by Patrick Griffis. + Bugs fixed ---------- - * Reverted GH#265: lxml links against zlib as a shared library again. + * LP#1773749, GH#268: Crash when moving an element to another document with + ``Element.insert()``. + Patch by Alexander Weggerle. diff --git a/src/lxml.egg-info/SOURCES.txt b/src/lxml.egg-info/SOURCES.txt index 02040d07..420bd260 100644 --- a/src/lxml.egg-info/SOURCES.txt +++ b/src/lxml.egg-info/SOURCES.txt @@ -52,505 +52,14 @@ doc/tutorial.txt doc/valgrind.txt doc/validation.txt doc/xpathxslt.txt -doc/html/FAQ.html -doc/html/api.html -doc/html/build.html -doc/html/capi.html -doc/html/changes-4.2.3.html -doc/html/compatibility.html -doc/html/credits.html -doc/html/cssselect.html -doc/html/element_classes.html -doc/html/elementsoup.html -doc/html/extensions.html -doc/html/html5parser.html -doc/html/index.html -doc/html/installation.html -doc/html/intro.html -doc/html/lxml-source-howto.html -doc/html/lxmlhtml.html -doc/html/objectify.html -doc/html/parsing.html -doc/html/performance.html doc/html/pubkey.asc -doc/html/resolvers.html -doc/html/sax.html -doc/html/sitemap.html doc/html/style.css doc/html/tagpython-big.png -doc/html/tutorial.html -doc/html/validation.html -doc/html/xpathxslt.html -doc/html/api/abc.ABCMeta-class.html -doc/html/api/api-objects.txt -doc/html/api/class-tree.html -doc/html/api/cssselect.parser.SelectorError-class.html -doc/html/api/cssselect.parser.SelectorSyntaxError-class.html -doc/html/api/cssselect.xpath.ExpressionError-class.html -doc/html/api/cssselect.xpath.XPathExpr-class.html -doc/html/api/deprecated-index.html -doc/html/api/epydoc.css -doc/html/api/exceptions.AssertionError-class.html -doc/html/api/frames.html -doc/html/api/help.html -doc/html/api/identifier-index-A.html -doc/html/api/identifier-index-B.html -doc/html/api/identifier-index-C.html -doc/html/api/identifier-index-D.html -doc/html/api/identifier-index-E.html -doc/html/api/identifier-index-F.html -doc/html/api/identifier-index-G.html -doc/html/api/identifier-index-H.html -doc/html/api/identifier-index-I.html -doc/html/api/identifier-index-J.html -doc/html/api/identifier-index-K.html -doc/html/api/identifier-index-L.html -doc/html/api/identifier-index-M.html -doc/html/api/identifier-index-N.html -doc/html/api/identifier-index-O.html -doc/html/api/identifier-index-P.html -doc/html/api/identifier-index-Q.html -doc/html/api/identifier-index-R.html -doc/html/api/identifier-index-S.html -doc/html/api/identifier-index-T.html -doc/html/api/identifier-index-U.html -doc/html/api/identifier-index-V.html -doc/html/api/identifier-index-W.html -doc/html/api/identifier-index-X.html -doc/html/api/identifier-index-Y.html -doc/html/api/identifier-index-Z.html -doc/html/api/identifier-index-_.html -doc/html/api/identifier-index.html -doc/html/api/index.html -doc/html/api/lxml-module.html -doc/html/api/lxml-pysrc.html -doc/html/api/lxml.ElementInclude-module.html -doc/html/api/lxml.ElementInclude-pysrc.html -doc/html/api/lxml.ElementInclude.FatalIncludeError-class.html -doc/html/api/lxml.builder-module.html -doc/html/api/lxml.builder-pysrc.html -doc/html/api/lxml.builder.ElementMaker-class.html -doc/html/api/lxml.cssselect-module.html -doc/html/api/lxml.cssselect-pysrc.html -doc/html/api/lxml.cssselect.CSSSelector-class.html -doc/html/api/lxml.cssselect.LxmlHTMLTranslator-class.html -doc/html/api/lxml.cssselect.LxmlTranslator-class.html -doc/html/api/lxml.doctestcompare-module.html -doc/html/api/lxml.doctestcompare-pysrc.html -doc/html/api/lxml.doctestcompare.LHTMLOutputChecker-class.html -doc/html/api/lxml.doctestcompare.LXMLOutputChecker-class.html -doc/html/api/lxml.doctestcompare._RestoreChecker-class.html -doc/html/api/lxml.etree-module.html -doc/html/api/lxml.etree.AncestorsIterator-class.html -doc/html/api/lxml.etree.AttributeBasedElementClassLookup-class.html -doc/html/api/lxml.etree.C14NError-class.html -doc/html/api/lxml.etree.CDATA-class.html -doc/html/api/lxml.etree.CommentBase-class.html -doc/html/api/lxml.etree.CustomElementClassLookup-class.html -doc/html/api/lxml.etree.DTD-class.html -doc/html/api/lxml.etree.DTDError-class.html -doc/html/api/lxml.etree.DTDParseError-class.html -doc/html/api/lxml.etree.DTDValidateError-class.html -doc/html/api/lxml.etree.DocInfo-class.html -doc/html/api/lxml.etree.DocumentInvalid-class.html -doc/html/api/lxml.etree.ETCompatXMLParser-class.html -doc/html/api/lxml.etree.ETXPath-class.html -doc/html/api/lxml.etree.ElementBase-class.html -doc/html/api/lxml.etree.ElementChildIterator-class.html -doc/html/api/lxml.etree.ElementClassLookup-class.html -doc/html/api/lxml.etree.ElementDefaultClassLookup-class.html -doc/html/api/lxml.etree.ElementDepthFirstIterator-class.html -doc/html/api/lxml.etree.ElementNamespaceClassLookup-class.html -doc/html/api/lxml.etree.ElementTextIterator-class.html -doc/html/api/lxml.etree.EntityBase-class.html -doc/html/api/lxml.etree.Error-class.html -doc/html/api/lxml.etree.ErrorDomains-class.html -doc/html/api/lxml.etree.ErrorLevels-class.html -doc/html/api/lxml.etree.ErrorTypes-class.html -doc/html/api/lxml.etree.FallbackElementClassLookup-class.html -doc/html/api/lxml.etree.HTMLParser-class.html -doc/html/api/lxml.etree.HTMLPullParser-class.html -doc/html/api/lxml.etree.LxmlError-class.html -doc/html/api/lxml.etree.LxmlRegistryError-class.html -doc/html/api/lxml.etree.LxmlSyntaxError-class.html -doc/html/api/lxml.etree.NamespaceRegistryError-class.html -doc/html/api/lxml.etree.PIBase-class.html -doc/html/api/lxml.etree.ParseError-class.html -doc/html/api/lxml.etree.ParserBasedElementClassLookup-class.html -doc/html/api/lxml.etree.ParserError-class.html -doc/html/api/lxml.etree.PyErrorLog-class.html -doc/html/api/lxml.etree.PythonElementClassLookup-class.html -doc/html/api/lxml.etree.QName-class.html -doc/html/api/lxml.etree.RelaxNG-class.html -doc/html/api/lxml.etree.RelaxNGError-class.html -doc/html/api/lxml.etree.RelaxNGErrorTypes-class.html -doc/html/api/lxml.etree.RelaxNGParseError-class.html -doc/html/api/lxml.etree.RelaxNGValidateError-class.html -doc/html/api/lxml.etree.Resolver-class.html -doc/html/api/lxml.etree.Schematron-class.html -doc/html/api/lxml.etree.SchematronError-class.html -doc/html/api/lxml.etree.SchematronParseError-class.html -doc/html/api/lxml.etree.SchematronValidateError-class.html -doc/html/api/lxml.etree.SerialisationError-class.html -doc/html/api/lxml.etree.SiblingsIterator-class.html -doc/html/api/lxml.etree.TreeBuilder-class.html -doc/html/api/lxml.etree.XInclude-class.html -doc/html/api/lxml.etree.XIncludeError-class.html -doc/html/api/lxml.etree.XMLParser-class.html -doc/html/api/lxml.etree.XMLPullParser-class.html -doc/html/api/lxml.etree.XMLSchema-class.html -doc/html/api/lxml.etree.XMLSchemaError-class.html -doc/html/api/lxml.etree.XMLSchemaParseError-class.html -doc/html/api/lxml.etree.XMLSchemaValidateError-class.html -doc/html/api/lxml.etree.XMLSyntaxError-class.html -doc/html/api/lxml.etree.XPath-class.html -doc/html/api/lxml.etree.XPathDocumentEvaluator-class.html -doc/html/api/lxml.etree.XPathElementEvaluator-class.html -doc/html/api/lxml.etree.XPathError-class.html -doc/html/api/lxml.etree.XPathEvalError-class.html -doc/html/api/lxml.etree.XPathFunctionError-class.html -doc/html/api/lxml.etree.XPathResultError-class.html -doc/html/api/lxml.etree.XPathSyntaxError-class.html -doc/html/api/lxml.etree.XSLT-class.html -doc/html/api/lxml.etree.XSLTAccessControl-class.html -doc/html/api/lxml.etree.XSLTApplyError-class.html -doc/html/api/lxml.etree.XSLTError-class.html -doc/html/api/lxml.etree.XSLTExtension-class.html -doc/html/api/lxml.etree.XSLTExtensionError-class.html -doc/html/api/lxml.etree.XSLTParseError-class.html -doc/html/api/lxml.etree.XSLTSaveError-class.html -doc/html/api/lxml.etree._Attrib-class.html -doc/html/api/lxml.etree._BaseErrorLog-class.html -doc/html/api/lxml.etree._Comment-class.html -doc/html/api/lxml.etree._Document-class.html -doc/html/api/lxml.etree._DomainErrorLog-class.html -doc/html/api/lxml.etree._Element-class.html -doc/html/api/lxml.etree._ElementIterator-class.html -doc/html/api/lxml.etree._ElementMatchIterator-class.html -doc/html/api/lxml.etree._ElementStringResult-class.html -doc/html/api/lxml.etree._ElementTagMatcher-class.html -doc/html/api/lxml.etree._ElementTree-class.html -doc/html/api/lxml.etree._ElementUnicodeResult-class.html -doc/html/api/lxml.etree._Entity-class.html -doc/html/api/lxml.etree._ErrorLog-class.html -doc/html/api/lxml.etree._FeedParser-class.html -doc/html/api/lxml.etree._IDDict-class.html -doc/html/api/lxml.etree._ListErrorLog-class.html -doc/html/api/lxml.etree._LogEntry-class.html -doc/html/api/lxml.etree._ProcessingInstruction-class.html -doc/html/api/lxml.etree._RotatingErrorLog-class.html -doc/html/api/lxml.etree._SaxParserTarget-class.html -doc/html/api/lxml.etree._TargetParserResult-class.html -doc/html/api/lxml.etree._Validator-class.html -doc/html/api/lxml.etree._XPathEvaluatorBase-class.html -doc/html/api/lxml.etree._XSLTProcessingInstruction-class.html -doc/html/api/lxml.etree._XSLTResultTree-class.html -doc/html/api/lxml.etree.htmlfile-class.html -doc/html/api/lxml.etree.iterparse-class.html -doc/html/api/lxml.etree.iterwalk-class.html -doc/html/api/lxml.etree.xmlfile-class.html -doc/html/api/lxml.html-module.html -doc/html/api/lxml.html-pysrc.html -doc/html/api/lxml.html.CheckboxGroup-class.html -doc/html/api/lxml.html.CheckboxValues-class.html -doc/html/api/lxml.html.Classes-class.html -doc/html/api/lxml.html.ElementSoup-module.html -doc/html/api/lxml.html.ElementSoup-pysrc.html -doc/html/api/lxml.html.FieldsDict-class.html -doc/html/api/lxml.html.FormElement-class.html -doc/html/api/lxml.html.HTMLParser-class.html -doc/html/api/lxml.html.HtmlComment-class.html -doc/html/api/lxml.html.HtmlElement-class.html -doc/html/api/lxml.html.HtmlElementClassLookup-class.html -doc/html/api/lxml.html.HtmlEntity-class.html -doc/html/api/lxml.html.HtmlMixin-class.html -doc/html/api/lxml.html.HtmlProcessingInstruction-class.html -doc/html/api/lxml.html.InputElement-class.html -doc/html/api/lxml.html.InputGetter-class.html -doc/html/api/lxml.html.InputMixin-class.html -doc/html/api/lxml.html.LabelElement-class.html -doc/html/api/lxml.html.MultipleSelectOptions-class.html -doc/html/api/lxml.html.RadioGroup-class.html -doc/html/api/lxml.html.SelectElement-class.html -doc/html/api/lxml.html.TextareaElement-class.html -doc/html/api/lxml.html.XHTMLParser-class.html -doc/html/api/lxml.html._MethodFunc-class.html -doc/html/api/lxml.html.builder-module.html -doc/html/api/lxml.html.builder-pysrc.html -doc/html/api/lxml.html.clean-module.html -doc/html/api/lxml.html.clean-pysrc.html -doc/html/api/lxml.html.clean.Cleaner-class.html -doc/html/api/lxml.html.defs-module.html -doc/html/api/lxml.html.defs-pysrc.html -doc/html/api/lxml.html.diff-module.html -doc/html/api/lxml.html.diff-pysrc.html -doc/html/api/lxml.html.diff.DEL_END-class.html -doc/html/api/lxml.html.diff.DEL_START-class.html -doc/html/api/lxml.html.diff.InsensitiveSequenceMatcher-class.html -doc/html/api/lxml.html.diff.NoDeletes-class.html -doc/html/api/lxml.html.diff.href_token-class.html -doc/html/api/lxml.html.diff.tag_token-class.html -doc/html/api/lxml.html.diff.token-class.html -doc/html/api/lxml.html.formfill-module.html -doc/html/api/lxml.html.formfill-pysrc.html -doc/html/api/lxml.html.formfill.DefaultErrorCreator-class.html -doc/html/api/lxml.html.formfill.FormNotFound-class.html -doc/html/api/lxml.html.html5parser-module.html -doc/html/api/lxml.html.html5parser-pysrc.html -doc/html/api/lxml.html.html5parser.HTMLParser-class.html -doc/html/api/lxml.html.html5parser.XHTMLParser-class.html -doc/html/api/lxml.html.soupparser-module.html -doc/html/api/lxml.html.soupparser-pysrc.html -doc/html/api/lxml.html.soupparser._PseudoTag-class.html -doc/html/api/lxml.html.usedoctest-module.html -doc/html/api/lxml.html.usedoctest-pysrc.html -doc/html/api/lxml.includes-module.html -doc/html/api/lxml.includes-pysrc.html -doc/html/api/lxml.isoschematron-module.html -doc/html/api/lxml.isoschematron-pysrc.html -doc/html/api/lxml.isoschematron.Schematron-class.html -doc/html/api/lxml.objectify-module.html -doc/html/api/lxml.objectify.BoolElement-class.html -doc/html/api/lxml.objectify.ElementMaker-class.html -doc/html/api/lxml.objectify.FloatElement-class.html -doc/html/api/lxml.objectify.IntElement-class.html -doc/html/api/lxml.objectify.LongElement-class.html -doc/html/api/lxml.objectify.NoneElement-class.html -doc/html/api/lxml.objectify.NumberElement-class.html -doc/html/api/lxml.objectify.ObjectPath-class.html -doc/html/api/lxml.objectify.ObjectifiedDataElement-class.html -doc/html/api/lxml.objectify.ObjectifiedElement-class.html -doc/html/api/lxml.objectify.ObjectifyElementClassLookup-class.html -doc/html/api/lxml.objectify.PyType-class.html -doc/html/api/lxml.objectify.StringElement-class.html -doc/html/api/lxml.pyclasslookup-module.html -doc/html/api/lxml.pyclasslookup-pysrc.html -doc/html/api/lxml.sax-module.html -doc/html/api/lxml.sax-pysrc.html -doc/html/api/lxml.sax.ElementTreeContentHandler-class.html -doc/html/api/lxml.sax.ElementTreeProducer-class.html -doc/html/api/lxml.sax.SaxError-class.html -doc/html/api/lxml.tests-module.html -doc/html/api/lxml.tests-pysrc.html -doc/html/api/lxml.tests.common_imports-module.html -doc/html/api/lxml.tests.common_imports-pysrc.html -doc/html/api/lxml.tests.common_imports.HelperTestCase-class.html -doc/html/api/lxml.tests.common_imports.LargeFileLike-class.html -doc/html/api/lxml.tests.common_imports.LargeFileLikeUnicode-class.html -doc/html/api/lxml.tests.common_imports.SillyFileLike-class.html -doc/html/api/lxml.tests.common_imports.skipif-class.html -doc/html/api/lxml.tests.dummy_http_server-module.html -doc/html/api/lxml.tests.dummy_http_server-pysrc.html -doc/html/api/lxml.tests.dummy_http_server.HTTPRequestCollector-class.html -doc/html/api/lxml.tests.dummy_http_server.WebServer-class.html -doc/html/api/lxml.tests.dummy_http_server._RequestHandler-class.html -doc/html/api/lxml.tests.selftest-module.html -doc/html/api/lxml.tests.selftest-pysrc.html -doc/html/api/lxml.tests.selftest2-module.html -doc/html/api/lxml.tests.selftest2-pysrc.html -doc/html/api/lxml.tests.test_builder-module.html -doc/html/api/lxml.tests.test_builder-pysrc.html -doc/html/api/lxml.tests.test_builder.BuilderTestCase-class.html -doc/html/api/lxml.tests.test_classlookup-module.html -doc/html/api/lxml.tests.test_classlookup-pysrc.html -doc/html/api/lxml.tests.test_classlookup.ClassLookupTestCase-class.html -doc/html/api/lxml.tests.test_classlookup.ProxyTestCase-class.html -doc/html/api/lxml.tests.test_css-module.html -doc/html/api/lxml.tests.test_css-pysrc.html -doc/html/api/lxml.tests.test_css.CSSTestCase-class.html -doc/html/api/lxml.tests.test_doctestcompare-module.html -doc/html/api/lxml.tests.test_doctestcompare-pysrc.html -doc/html/api/lxml.tests.test_doctestcompare.DoctestCompareTest-class.html -doc/html/api/lxml.tests.test_doctestcompare.DummyInput-class.html -doc/html/api/lxml.tests.test_dtd-module.html -doc/html/api/lxml.tests.test_dtd-pysrc.html -doc/html/api/lxml.tests.test_dtd.ETreeDtdTestCase-class.html -doc/html/api/lxml.tests.test_elementpath-module.html -doc/html/api/lxml.tests.test_elementpath-pysrc.html -doc/html/api/lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html -doc/html/api/lxml.tests.test_elementtree-module.html -doc/html/api/lxml.tests.test_elementtree-pysrc.html -doc/html/api/lxml.tests.test_elementtree.CElementTreeTestCase-class.html -doc/html/api/lxml.tests.test_elementtree.ETreePullTestCase-class.html -doc/html/api/lxml.tests.test_elementtree.ETreeTestCase-class.html -doc/html/api/lxml.tests.test_elementtree.ElementTreeTestCase-class.html -doc/html/api/lxml.tests.test_elementtree._ETreeTestCaseBase-class.html -doc/html/api/lxml.tests.test_elementtree._XMLPullParserTest-class.html -doc/html/api/lxml.tests.test_errors-module.html -doc/html/api/lxml.tests.test_errors-pysrc.html -doc/html/api/lxml.tests.test_errors.ErrorTestCase-class.html -doc/html/api/lxml.tests.test_etree-module.html -doc/html/api/lxml.tests.test_etree-pysrc.html -doc/html/api/lxml.tests.test_etree.ETreeC14NTestCase-class.html -doc/html/api/lxml.tests.test_etree.ETreeErrorLogTest-class.html -doc/html/api/lxml.tests.test_etree.ETreeOnlyTestCase-class.html -doc/html/api/lxml.tests.test_etree.ETreeWriteTestCase-class.html -doc/html/api/lxml.tests.test_etree.ETreeXIncludeTestCase-class.html -doc/html/api/lxml.tests.test_etree.ElementIncludeTestCase-class.html -doc/html/api/lxml.tests.test_etree.XMLPullParserTest-class.html -doc/html/api/lxml.tests.test_etree._XIncludeTestCase-class.html -doc/html/api/lxml.tests.test_external_document-module.html -doc/html/api/lxml.tests.test_external_document-pysrc.html -doc/html/api/lxml.tests.test_external_document.ExternalDocumentTestCase-class.html -doc/html/api/lxml.tests.test_htmlparser-module.html -doc/html/api/lxml.tests.test_htmlparser-pysrc.html -doc/html/api/lxml.tests.test_htmlparser.HtmlParserTestCase-class.html -doc/html/api/lxml.tests.test_http_io-module.html -doc/html/api/lxml.tests.test_http_io-pysrc.html -doc/html/api/lxml.tests.test_http_io.HttpIOTestCase-class.html -doc/html/api/lxml.tests.test_incremental_xmlfile-module.html -doc/html/api/lxml.tests.test_incremental_xmlfile-pysrc.html -doc/html/api/lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html -doc/html/api/lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html -doc/html/api/lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html -doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html -doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html -doc/html/api/lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html -doc/html/api/lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html -doc/html/api/lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html -doc/html/api/lxml.tests.test_io-module.html -doc/html/api/lxml.tests.test_io-pysrc.html -doc/html/api/lxml.tests.test_io.ETreeIOTestCase-class.html -doc/html/api/lxml.tests.test_io.ElementTreeIOTestCase-class.html -doc/html/api/lxml.tests.test_io._IOTestCaseBase-class.html -doc/html/api/lxml.tests.test_isoschematron-module.html -doc/html/api/lxml.tests.test_isoschematron-pysrc.html -doc/html/api/lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html -doc/html/api/lxml.tests.test_nsclasses-module.html -doc/html/api/lxml.tests.test_nsclasses-pysrc.html -doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html -doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class-class.html -doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class-class.html -doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class-class.html -doc/html/api/lxml.tests.test_objectify-module.html -doc/html/api/lxml.tests.test_objectify-pysrc.html -doc/html/api/lxml.tests.test_objectify.ObjectifyTestCase-class.html -doc/html/api/lxml.tests.test_pyclasslookup-module.html -doc/html/api/lxml.tests.test_pyclasslookup-pysrc.html -doc/html/api/lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html -doc/html/api/lxml.tests.test_relaxng-module.html -doc/html/api/lxml.tests.test_relaxng-pysrc.html -doc/html/api/lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html -doc/html/api/lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html -doc/html/api/lxml.tests.test_sax-module.html -doc/html/api/lxml.tests.test_sax-pysrc.html -doc/html/api/lxml.tests.test_sax.ETreeSaxTestCase-class.html -doc/html/api/lxml.tests.test_schematron-module.html -doc/html/api/lxml.tests.test_schematron-pysrc.html -doc/html/api/lxml.tests.test_schematron.ETreeSchematronTestCase-class.html -doc/html/api/lxml.tests.test_threading-module.html -doc/html/api/lxml.tests.test_threading-pysrc.html -doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase-class.html -doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker-class.html -doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker-class.html -doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker-class.html -doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker-class.html -doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker-class.html -doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker-class.html -doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Validate-class.html -doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html -doc/html/api/lxml.tests.test_threading.ThreadingTestCase-class.html -doc/html/api/lxml.tests.test_unicode-module.html -doc/html/api/lxml.tests.test_unicode-pysrc.html -doc/html/api/lxml.tests.test_unicode.EncodingsTestCase-class.html -doc/html/api/lxml.tests.test_unicode.UnicodeTestCase-class.html -doc/html/api/lxml.tests.test_xmlschema-module.html -doc/html/api/lxml.tests.test_xmlschema-pysrc.html -doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html -doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html -doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html -doc/html/api/lxml.tests.test_xpathevaluator-module.html -doc/html/api/lxml.tests.test_xpathevaluator-pysrc.html -doc/html/api/lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html -doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html -doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html -doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html -doc/html/api/lxml.tests.test_xslt-module.html -doc/html/api/lxml.tests.test_xslt-pysrc.html -doc/html/api/lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html -doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html -doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html -doc/html/api/lxml.tests.test_xslt.ETreeXSLTTestCase-class.html -doc/html/api/lxml.tests.test_xslt.Py3XSLTTestCase-class.html -doc/html/api/lxml.usedoctest-module.html -doc/html/api/lxml.usedoctest-pysrc.html -doc/html/api/mimetools.Message-class.html -doc/html/api/module-tree.html -doc/html/api/redirect.html -doc/html/api/str-class.html -doc/html/api/toc-everything.html -doc/html/api/toc-lxml-module.html -doc/html/api/toc-lxml.ElementInclude-module.html -doc/html/api/toc-lxml.builder-module.html -doc/html/api/toc-lxml.cssselect-module.html -doc/html/api/toc-lxml.doctestcompare-module.html -doc/html/api/toc-lxml.etree-module.html -doc/html/api/toc-lxml.html-module.html -doc/html/api/toc-lxml.html.ElementSoup-module.html -doc/html/api/toc-lxml.html.builder-module.html -doc/html/api/toc-lxml.html.clean-module.html -doc/html/api/toc-lxml.html.defs-module.html -doc/html/api/toc-lxml.html.diff-module.html -doc/html/api/toc-lxml.html.formfill-module.html -doc/html/api/toc-lxml.html.html5parser-module.html -doc/html/api/toc-lxml.html.soupparser-module.html -doc/html/api/toc-lxml.html.usedoctest-module.html -doc/html/api/toc-lxml.includes-module.html -doc/html/api/toc-lxml.isoschematron-module.html -doc/html/api/toc-lxml.objectify-module.html -doc/html/api/toc-lxml.pyclasslookup-module.html -doc/html/api/toc-lxml.sax-module.html -doc/html/api/toc-lxml.tests-module.html -doc/html/api/toc-lxml.tests.common_imports-module.html -doc/html/api/toc-lxml.tests.dummy_http_server-module.html -doc/html/api/toc-lxml.tests.selftest-module.html -doc/html/api/toc-lxml.tests.selftest2-module.html -doc/html/api/toc-lxml.tests.test_builder-module.html -doc/html/api/toc-lxml.tests.test_classlookup-module.html -doc/html/api/toc-lxml.tests.test_css-module.html -doc/html/api/toc-lxml.tests.test_doctestcompare-module.html -doc/html/api/toc-lxml.tests.test_dtd-module.html -doc/html/api/toc-lxml.tests.test_elementpath-module.html -doc/html/api/toc-lxml.tests.test_elementtree-module.html -doc/html/api/toc-lxml.tests.test_errors-module.html -doc/html/api/toc-lxml.tests.test_etree-module.html -doc/html/api/toc-lxml.tests.test_external_document-module.html -doc/html/api/toc-lxml.tests.test_htmlparser-module.html -doc/html/api/toc-lxml.tests.test_http_io-module.html -doc/html/api/toc-lxml.tests.test_incremental_xmlfile-module.html -doc/html/api/toc-lxml.tests.test_io-module.html -doc/html/api/toc-lxml.tests.test_isoschematron-module.html -doc/html/api/toc-lxml.tests.test_nsclasses-module.html -doc/html/api/toc-lxml.tests.test_objectify-module.html -doc/html/api/toc-lxml.tests.test_pyclasslookup-module.html -doc/html/api/toc-lxml.tests.test_relaxng-module.html -doc/html/api/toc-lxml.tests.test_sax-module.html -doc/html/api/toc-lxml.tests.test_schematron-module.html -doc/html/api/toc-lxml.tests.test_threading-module.html -doc/html/api/toc-lxml.tests.test_unicode-module.html -doc/html/api/toc-lxml.tests.test_xmlschema-module.html -doc/html/api/toc-lxml.tests.test_xpathevaluator-module.html -doc/html/api/toc-lxml.tests.test_xslt-module.html -doc/html/api/toc-lxml.usedoctest-module.html -doc/html/api/toc-xml.etree.ElementTree-module.html -doc/html/api/toc.html -doc/html/api/xml.etree.ElementTree-module.html -doc/html/api/xml.etree.ElementTree-pysrc.html -doc/html/api/xml.etree.ElementTree.Element-class.html -doc/html/api/xml.etree.ElementTree.ElementTree-class.html -doc/html/api/xml.etree.ElementTree.ParseError-class.html -doc/html/api/xml.etree.ElementTree.QName-class.html -doc/html/api/xml.etree.ElementTree.TreeBuilder-class.html -doc/html/api/xml.etree.ElementTree.XMLParser-class.html -doc/html/api/xml.etree.ElementTree._IterParseIterator-class.html -doc/html/api/xml.etree.ElementTree._SimpleElementPath-class.html doc/licenses/BSD.txt doc/licenses/GPL.txt doc/licenses/ZopePublicLicense.txt doc/licenses/elementtree.txt -doc/pdf/pubkey.asc doc/s5/Makefile -doc/s5/lxml-ep2008.html doc/s5/lxml-ep2008.txt doc/s5/tagpython.png doc/s5/ep2008/atom-example.xml diff --git a/src/lxml/_elementpath.c b/src/lxml/_elementpath.c index bfd8059c..378b8d2f 100644 --- a/src/lxml/_elementpath.c +++ b/src/lxml/_elementpath.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.28.3 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { @@ -18,13 +18,6 @@ "src", "src/lxml/includes" ], - "libraries": [ - "xslt", - "exslt", - "xml2", - "rt", - "m" - ], "name": "lxml._elementpath", "sources": [ "src/lxml/_elementpath.py" @@ -41,7 +34,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_3" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -13372,7 +13365,7 @@ static int __Pyx_modinit_function_import_code(void) { #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -14793,6 +14786,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -15063,7 +15059,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -15078,7 +15074,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -15162,7 +15158,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -17107,14 +17103,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; diff --git a/src/lxml/builder.c b/src/lxml/builder.c index f7ea8487..586c97aa 100644 --- a/src/lxml/builder.c +++ b/src/lxml/builder.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.28.3 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { @@ -18,13 +18,6 @@ "src", "src/lxml/includes" ], - "libraries": [ - "xslt", - "exslt", - "xml2", - "rt", - "m" - ], "name": "lxml.builder", "sources": [ "src/lxml/builder.py" @@ -41,7 +34,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_3" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -5666,7 +5659,7 @@ static int __Pyx_modinit_function_import_code(void) { #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -6616,7 +6609,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -6631,7 +6624,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -6715,7 +6708,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -8031,6 +8024,9 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -9319,14 +9315,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i #ifndef offsetof @@ -57714,7 +57715,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__ * if c_node is NULL: * _appendChild(self, element) # <<<<<<<<<<<<<< * return - * c_source_doc = c_node.doc + * c_source_doc = element._c_node.doc */ __Pyx_TraceLine(918,0,__PYX_ERR(0, 918, __pyx_L1_error)) __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 918, __pyx_L1_error) @@ -57723,7 +57724,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__ * if c_node is NULL: * _appendChild(self, element) * return # <<<<<<<<<<<<<< - * c_source_doc = c_node.doc + * c_source_doc = element._c_node.doc * c_next = element._c_node.next */ __Pyx_TraceLine(919,0,__PYX_ERR(0, 919, __pyx_L1_error)) @@ -57743,17 +57744,17 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__ /* "lxml/etree.pyx":920 * _appendChild(self, element) * return - * c_source_doc = c_node.doc # <<<<<<<<<<<<<< + * c_source_doc = element._c_node.doc # <<<<<<<<<<<<<< * c_next = element._c_node.next * tree.xmlAddPrevSibling(c_node, element._c_node) */ __Pyx_TraceLine(920,0,__PYX_ERR(0, 920, __pyx_L1_error)) - __pyx_t_4 = __pyx_v_c_node->doc; + __pyx_t_4 = __pyx_v_element->_c_node->doc; __pyx_v_c_source_doc = __pyx_t_4; /* "lxml/etree.pyx":921 * return - * c_source_doc = c_node.doc + * c_source_doc = element._c_node.doc * c_next = element._c_node.next # <<<<<<<<<<<<<< * tree.xmlAddPrevSibling(c_node, element._c_node) * _moveTail(c_next, element._c_node) @@ -57763,7 +57764,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__ __pyx_v_c_next = __pyx_t_5; /* "lxml/etree.pyx":922 - * c_source_doc = c_node.doc + * c_source_doc = element._c_node.doc * c_next = element._c_node.next * tree.xmlAddPrevSibling(c_node, element._c_node) # <<<<<<<<<<<<<< * _moveTail(c_next, element._c_node) @@ -249742,7 +249743,7 @@ static int __Pyx_modinit_function_import_code(void) { #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -258678,7 +258679,7 @@ bad: /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -258693,7 +258694,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -258777,7 +258778,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -258966,7 +258967,7 @@ bad: #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -260206,6 +260207,9 @@ bad: } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -260398,14 +260402,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 if (!__pyx_tstate->exc_state.exc_type) #else if (!__pyx_tstate->exc_type) diff --git a/src/lxml/etree.h b/src/lxml/etree.h index 9b45ba1a..a2fcf335 100644 --- a/src/lxml/etree.h +++ b/src/lxml/etree.h @@ -1,4 +1,4 @@ -/* Generated by Cython 0.28.3 */ +/* Generated by Cython 0.28.5 */ #ifndef __PYX_HAVE__lxml__etree #define __PYX_HAVE__lxml__etree diff --git a/src/lxml/etree.pyx b/src/lxml/etree.pyx index f3bdf650..acea9d20 100644 --- a/src/lxml/etree.pyx +++ b/src/lxml/etree.pyx @@ -917,7 +917,7 @@ cdef public class _Element [ type LxmlElementType, object LxmlElement ]: if c_node is NULL: _appendChild(self, element) return - c_source_doc = c_node.doc + c_source_doc = element._c_node.doc c_next = element._c_node.next tree.xmlAddPrevSibling(c_node, element._c_node) _moveTail(c_next, element._c_node) diff --git a/src/lxml/etree_api.h b/src/lxml/etree_api.h index 2ebd54b4..a5dd0e14 100644 --- a/src/lxml/etree_api.h +++ b/src/lxml/etree_api.h @@ -1,4 +1,4 @@ -/* Generated by Cython 0.28.3 */ +/* Generated by Cython 0.28.5 */ #ifndef __PYX_HAVE_API__lxml__etree #define __PYX_HAVE_API__lxml__etree diff --git a/src/lxml/html/clean.c b/src/lxml/html/clean.c index 68d0616d..af6ef547 100644 --- a/src/lxml/html/clean.c +++ b/src/lxml/html/clean.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.28.3 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { @@ -18,13 +18,6 @@ "src", "src/lxml/includes" ], - "libraries": [ - "xslt", - "exslt", - "xml2", - "rt", - "m" - ], "name": "lxml.html.clean", "sources": [ "src/lxml/html/clean.py" @@ -41,7 +34,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_3" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -15525,7 +15518,7 @@ static int __Pyx_modinit_function_import_code(void) { #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -19045,6 +19038,9 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -20477,7 +20473,7 @@ bad: /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -20492,7 +20488,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -20576,7 +20572,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -21491,14 +21487,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i #ifndef offsetof @@ -21581,7 +21574,7 @@ static int __Pyx_modinit_function_import_code(void) { #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -24407,6 +24400,9 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -24638,7 +24634,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -24653,7 +24649,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -24730,14 +24726,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -27158,7 +27182,7 @@ raise_neg_overflow: #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; diff --git a/src/lxml/includes/lxml-version.h b/src/lxml/includes/lxml-version.h index eacee9bf..2f1d9985 100644 --- a/src/lxml/includes/lxml-version.h +++ b/src/lxml/includes/lxml-version.h @@ -1,3 +1,3 @@ #ifndef LXML_VERSION_STRING -#define LXML_VERSION_STRING "4.2.3" +#define LXML_VERSION_STRING "4.2.4" #endif diff --git a/src/lxml/lxml.etree.h b/src/lxml/lxml.etree.h index 9b45ba1a..a2fcf335 100644 --- a/src/lxml/lxml.etree.h +++ b/src/lxml/lxml.etree.h @@ -1,4 +1,4 @@ -/* Generated by Cython 0.28.3 */ +/* Generated by Cython 0.28.5 */ #ifndef __PYX_HAVE__lxml__etree #define __PYX_HAVE__lxml__etree diff --git a/src/lxml/lxml.etree_api.h b/src/lxml/lxml.etree_api.h index 40183ecb..efdadf27 100644 --- a/src/lxml/lxml.etree_api.h +++ b/src/lxml/lxml.etree_api.h @@ -1,4 +1,4 @@ -/* Generated by Cython 0.28.3 */ +/* Generated by Cython 0.28.5 */ #ifndef __PYX_HAVE_API__lxml__etree #define __PYX_HAVE_API__lxml__etree diff --git a/src/lxml/objectify.c b/src/lxml/objectify.c index ee5b29a3..32b64c68 100644 --- a/src/lxml/objectify.c +++ b/src/lxml/objectify.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.28.3 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { @@ -57,6 +57,7 @@ "exslt", "xml2", "rt", + "z", "m" ], "name": "lxml.objectify", @@ -75,7 +76,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_3" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -37945,7 +37946,7 @@ static int __Pyx_modinit_function_import_code(void) { #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -40505,6 +40506,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -41499,7 +41503,7 @@ static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -41514,7 +41518,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -42224,7 +42228,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -43846,14 +43850,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i'), a) + def test_insert_name_interning(self): + # See GH#268 / LP#1773749. + Element = self.etree.Element + SubElement = self.etree.SubElement + + # Use unique names to make sure they are new in the tag name dict. + import uuid + names = dict((k, 'tag-' + str(uuid.uuid4())) for k in 'abcde') + + a = Element(names['a']) + b = SubElement(a, names['b']) + c = SubElement(a, names['c']) + d = Element(names['d']) + a.insert(0, d) + + self.assertEqual( + d, + a[0]) + + self.assertXML( + _bytes('<%(a)s><%(d)s><%(b)s><%(c)s>' % names), + a) + + e = Element(names['e']) + a.insert(2, e) + self.assertEqual( + e, + a[2]) + self.assertXML( + _bytes('<%(a)s><%(d)s><%(b)s><%(e)s><%(c)s>' % names), + a) + def test_insert_beyond_index(self): Element = self.etree.Element SubElement = self.etree.SubElement diff --git a/tools/manylinux/build-wheels.sh b/tools/manylinux/build-wheels.sh index 8a50e94a..da748fbc 100755 --- a/tools/manylinux/build-wheels.sh +++ b/tools/manylinux/build-wheels.sh @@ -51,7 +51,7 @@ build_wheels() { test -n "$source" -o ! -e "$REQUIREMENTS" \ || ${PYBIN}/pip install -r "$REQUIREMENTS" - echo "Starting build with $($PYBIN -V)" + echo "Starting build with $($PYBIN/python -V)" build_wheel "$PYBIN" "$source" & THIRD=$! diff --git a/version.txt b/version.txt index f2c6cb6a..cf78d5b6 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -4.2.3 +4.2.4