[Python-checkins] commit of r41676 - in external: README elementtree-1.2.6-20050316/CHANGES elementtree-1.2.6-20050316/PKG-INFO elementtree-1.2.6-20050316/README elementtree-1.2.6-20050316/benchmark.py elementtree-1.2.6-20050316/docs/effbot.css elementtree-1.2.6-20050316/docs/index.html elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementInclude.html elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementPath.html elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementTree.html elementtree-1.2.6-20050316/docs/pythondoc-elementtree.HTMLTreeBuilder.html elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SgmlopXMLTreeBuilder.html elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLTreeBuilder.html elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLWriter.html elementtree-1.2.6-20050316/docs/pythondoc-elementtree.TidyTools.html elementtree-1.2.6-20050316/docs/pythondoc-elementtree.XMLTreeBuilder.html elementtree-1.2.6-20050316/elementtree/ElementInclude.py elementtree-1.2.6-20050316/elementtree/ElementPath.py elementtree-1.2.6-20050316/elementtree/ElementTree.py elementtree-1.2.6-20050316/elementtree/HTMLTreeBuilder.py elementtree-1.2.6-20050316/elementtree/SgmlopXMLTreeBuilder.py elementtree-1.2.6-20050316/elementtree/SimpleXMLTreeBuilder.py elementtree-1.2.6-20050316/elementtree/SimpleXMLWriter.py elementtree-1.2.6-20050316/elementtree/TidyHTMLTreeBuilder.py elementtree-1.2.6-20050316/elementtree/TidyTools.py elementtree-1.2.6-20050316/elementtree/XMLTreeBuilder.py elementtree-1.2.6-20050316/elementtree/__init__.py elementtree-1.2.6-20050316/samples/simple-ns.xml elementtree-1.2.6-20050316/samples/simple.xml elementtree-1.2.6-20050316/selftest.py elementtree-1.2.6-20050316/setup.py

fredrik.lundh python-checkins at python.org
Wed Dec 14 19:33:45 CET 2005


Author: fredrik.lundh
Date: Wed Dec 14 19:33:39 2005
New Revision: 41676

Modified:
   external/README   (contents, props changed)
   external/elementtree-1.2.6-20050316/CHANGES   (contents, props changed)
   external/elementtree-1.2.6-20050316/PKG-INFO   (contents, props changed)
   external/elementtree-1.2.6-20050316/README   (contents, props changed)
   external/elementtree-1.2.6-20050316/benchmark.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/effbot.css   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/index.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementInclude.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementPath.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementTree.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.HTMLTreeBuilder.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SgmlopXMLTreeBuilder.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLTreeBuilder.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLWriter.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.TidyTools.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.XMLTreeBuilder.html   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/ElementInclude.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/ElementPath.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/ElementTree.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/HTMLTreeBuilder.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/SgmlopXMLTreeBuilder.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/SimpleXMLTreeBuilder.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/SimpleXMLWriter.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/TidyHTMLTreeBuilder.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/TidyTools.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/XMLTreeBuilder.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/elementtree/__init__.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/samples/simple-ns.xml   (contents, props changed)
   external/elementtree-1.2.6-20050316/samples/simple.xml   (contents, props changed)
   external/elementtree-1.2.6-20050316/selftest.py   (contents, props changed)
   external/elementtree-1.2.6-20050316/setup.py   (contents, props changed)
Log:
fixed botched eol-style setting (thanks to armin for fixing the
xml.etree copy)



Modified: external/README
==============================================================================
--- external/README	(original)
+++ external/README	Wed Dec 14 19:33:39 2005
@@ -1,8 +1,8 @@
-This directory contains snapshots of externally maintained libraries.
-To add a new library or release, import it into this repository, and
-use "svn copy" to copy relevant components to the trunk.
-
-This directory should not be used for development.  The snapshots
-should be treated as readonly copies, with the possible exception for
-critical errors and security patches.  When in doubt, consult with the
-python-dev team.
+This directory contains snapshots of externally maintained libraries.
+To add a new library or release, import it into this repository, and
+use "svn copy" to copy relevant components to the trunk.
+
+This directory should not be used for development.  The snapshots
+should be treated as readonly copies, with the possible exception for
+critical errors and security patches.  When in doubt, consult with the
+python-dev team.

Modified: external/elementtree-1.2.6-20050316/CHANGES
==============================================================================
--- external/elementtree-1.2.6-20050316/CHANGES	(original)
+++ external/elementtree-1.2.6-20050316/CHANGES	Wed Dec 14 19:33:39 2005
@@ -1,210 +1,210 @@
-The ElementTree Library
-$Id: CHANGES 2326 2005-03-17 07:45:21Z fredrik $
-
-*** Changes from release 1.1 to 1.2 ***
-
-(1.2.6 released)
-
-- Fixed handling of entities defined in internal DTD's (reported
-  by Greg Wilson).
-
-- Fixed serialization under non-standard default encodings (but
-  using non-standard default encodings is still a lousy idea ;-)
-
-(1.2.5 released)
-
-- Added 'iterparse' implementation.  This is similar to 'parse', but
-  returns a stream of events while it builds the tree.  By default,
-  the parser only returns "end" events (for completed elements):
-
-	for event, elem in iterparse(source):
-	    ...
-
-  To get other events, use the "events" option to pass in a tuple
-  containing the events you want:
-
-	for event, elem in iterparse(source, events=(...)):
-	    ...
-
-  The event tuple can contain one or more of:
-
-  "start"
-    generated for start tags, after the element has been created
-    (but before the current element has been fully populated)
-  "end"
-    generated for end tags, after all element children has been
-    created.
-  "start-ns"
-    generated when a new namespace scope is opened.  for this event,
-    the elem value is a (prefix, url) tuple.
-  "end-ns"
-    generated when the current namespace scope is closed.  elem
-    is None.
-
-  Events arrive asynchronously; the tree is usually more complete
-  than the events indicate, but this is nothing you can rely on.
-
-  The iterable itself contains context information.  In the current
-  release, the only public context attribute is "root", which is set
-  to the root element when parsing is finished.  To access the con-
-  text, assign the iterable to a variable before looping over it:
-
-	context = iterparse(source)
-	for event, elem in context:
-	    ...
-	root = context.root
-
-(1.2.4 released)
-
-- Fixed another FancyTreeBuilder bug on Python 2.3.
-
-(1.2.3 released)
-
-- Fixed the FancyTreeBuilder class, which was broken in 1.2.1
-  and 1.2.2 (broken for some Python versions, at least).
-
-(1.2.2 released)
-
-- Fixed some ASCII/Unicode issues in the HTML parser.  You can now
-  use the parser on documents that mixes encoded 8-bit data with
-  character references outside the ASCII range. (backported from 1.3)
-
-(1.2.1 released)
-
-- Changed XMLTreeBuilder to take advantage of new expat features, if
-  present.  This speeds up parsing quite a bit. (backported from 1.3)
-
-(1.2c1 released; 1.2 final released)
-
-- Added 'docs' directory, with PythonDoc documentation for the
-  ElementTree library.  See docs/index.html for an overview.
-
-(1.2b4 released)
-
-- Fixed encoding of Unicode element names and attribute names
-  (reported by Ken Rimey).
-
-(1.2b3 released)
-
-- Added default argument to 'findtext'.  Note that 'findtext' now
-  always returns an empty string if a matching element is found, but
-  has no text content.  None is only returned if no element is found,
-  and no default value is specified.
-
-- Make sure 'dump' adds a trailing linefeed.
-
-(1.2b2 released)
-
-- Added optional tree builder argument to the HTMLTreeBuilder class.
-
-(1.2b1 released)
-
-- Added XMLID() helper.  This is similar to XML(), but returns both
-  the root element and a dictionary mapping ID attributes to elements.
-
-- Added simple SgmlopXMLTreeBuilder module.  This is a very fast
-  parser, but it doesn't yet support namespaces.  To use this parser,
-  you need the sgmlop driver:
-
-      http://effbot.org/zone/sgmlop-index.htm
-
-- Fixed exception in test suite; the TidyHTMLTreeBuilder class
-  now raises a RuntimeError exception if the _elementidy module
-  is not available.
-
-(1.2a5 released)
-
-- Fixed problem that could result in repeated use of the same
-  namespace prefix in the same element (!).
-
-- Fixed import error in ElementInclude, when using the default
-  loader (Gustavo Niemeyer).
-
-(1.2a4 released)
-
-- Fixed exception when .//tag fails to find matching elements
-  (reported by Mike Kent) (@XMLTOOLKIT28)
-
-- Fall back on pre-1.2 find/findtext/findall behaviour if the
-  ElementPath module is not installed.  If you don't need path
-  support, you can simply copy the ElementTree module to your
-  own project.
-
-(1.2a3 released)
-
-- Added experimental support for XInclude-style preprocessing.  The
-  ElementInclude module expands xi:include elements, using a custom
-  resolver.  The current release ignores xi:fallback elements.
-
-- Fixed typo in ElementTree.findtext (reported by Thomas Dartsch)
-  (@XMLTOOLKIT25)
-
-- Fixed parsing of periods in element names (reported by Brian
-  Vicente) (@XMLTOOLKIT27)
-
-(1.2a2 released)
-
-- Fixed serialization of elements and attributes in the XML default
-  namespace (http://www.w3.org/XML/1998/namespace).  Added "rdf" to
-  the set of "well-known" namespace prefixes.
-
-- Added 'makeelement' factory method.  Added 'target' argument to
-  XMLTreeBuilder class.
-
-(1.2a1 released)
-
-- Added support for a very limited subset of the abbreviated XPath
-  syntax.  The following location paths are supported:
-
-	tag -- select all subelements with the given tag
-	. -- select this element
-	* -- select all subelements
-	// (empty path) -- select all subelements, on all levels
-
-  Examples:
-
-	p -- select all p subelements
-	.//a -- select all a sublements, at all sublevels
-	*/img -- select all img grandchildren
-	ul/li -- select all li elements that are children of ul elements
-	.//ul/li -- same, but select elements anywhere in the subtree
-
-  Absolute paths (paths starting with a slash) can only be used on
-  ElementTree instances.  To use // on an Element instance, add a
-  leading period (.).
-
-*** Changes from release 1.0 to 1.1 ***
-
-(1.1 final released)
-
-- Added 'fromstring' and 'tostring' helpers.  The 'XML' function is
-  an alias for 'fromstring', and provides a convenient way to add XML
-  literals to source code:
-
-	from elementtree.ElementTree import XML
-
-	element = XML('<element>content</element>')
-
-- Moved XMLTreeBuilder functionality into the ElementTree module.  If
-  all you need is basic XML support, you can simply copy the ElementTree
-  module to your own project.
-
-- Added SimpleXMLWriter module.
-
-(1.1b2 released)
-
-- Changed default encoding to US-ASCII.  Use tree.write(file, "utf-8")
-  to get the old behaviour.  If the tree contains text that cannot be
-  encoded using the given encoding, the writer uses numerical entities
-  for all non-ASCII characters in that text segment.
-
-(1.1b1 released)
-
-- Map tags and attribute names having the same value to the same
-  object.  This saves space when reading large XML trees, and also
-  gives a small speedup (less than 10%).
-
-- Added benchmark script.  This script takes a filename argument, and
-  loads the given file into memory using the XML and SimpleXML tree
-  builders.  For each parser, it reports the document size and the
-  time needed to parse the document.
+The ElementTree Library
+$Id: CHANGES 2326 2005-03-17 07:45:21Z fredrik $
+
+*** Changes from release 1.1 to 1.2 ***
+
+(1.2.6 released)
+
+- Fixed handling of entities defined in internal DTD's (reported
+  by Greg Wilson).
+
+- Fixed serialization under non-standard default encodings (but
+  using non-standard default encodings is still a lousy idea ;-)
+
+(1.2.5 released)
+
+- Added 'iterparse' implementation.  This is similar to 'parse', but
+  returns a stream of events while it builds the tree.  By default,
+  the parser only returns "end" events (for completed elements):
+
+	for event, elem in iterparse(source):
+	    ...
+
+  To get other events, use the "events" option to pass in a tuple
+  containing the events you want:
+
+	for event, elem in iterparse(source, events=(...)):
+	    ...
+
+  The event tuple can contain one or more of:
+
+  "start"
+    generated for start tags, after the element has been created
+    (but before the current element has been fully populated)
+  "end"
+    generated for end tags, after all element children has been
+    created.
+  "start-ns"
+    generated when a new namespace scope is opened.  for this event,
+    the elem value is a (prefix, url) tuple.
+  "end-ns"
+    generated when the current namespace scope is closed.  elem
+    is None.
+
+  Events arrive asynchronously; the tree is usually more complete
+  than the events indicate, but this is nothing you can rely on.
+
+  The iterable itself contains context information.  In the current
+  release, the only public context attribute is "root", which is set
+  to the root element when parsing is finished.  To access the con-
+  text, assign the iterable to a variable before looping over it:
+
+	context = iterparse(source)
+	for event, elem in context:
+	    ...
+	root = context.root
+
+(1.2.4 released)
+
+- Fixed another FancyTreeBuilder bug on Python 2.3.
+
+(1.2.3 released)
+
+- Fixed the FancyTreeBuilder class, which was broken in 1.2.1
+  and 1.2.2 (broken for some Python versions, at least).
+
+(1.2.2 released)
+
+- Fixed some ASCII/Unicode issues in the HTML parser.  You can now
+  use the parser on documents that mixes encoded 8-bit data with
+  character references outside the ASCII range. (backported from 1.3)
+
+(1.2.1 released)
+
+- Changed XMLTreeBuilder to take advantage of new expat features, if
+  present.  This speeds up parsing quite a bit. (backported from 1.3)
+
+(1.2c1 released; 1.2 final released)
+
+- Added 'docs' directory, with PythonDoc documentation for the
+  ElementTree library.  See docs/index.html for an overview.
+
+(1.2b4 released)
+
+- Fixed encoding of Unicode element names and attribute names
+  (reported by Ken Rimey).
+
+(1.2b3 released)
+
+- Added default argument to 'findtext'.  Note that 'findtext' now
+  always returns an empty string if a matching element is found, but
+  has no text content.  None is only returned if no element is found,
+  and no default value is specified.
+
+- Make sure 'dump' adds a trailing linefeed.
+
+(1.2b2 released)
+
+- Added optional tree builder argument to the HTMLTreeBuilder class.
+
+(1.2b1 released)
+
+- Added XMLID() helper.  This is similar to XML(), but returns both
+  the root element and a dictionary mapping ID attributes to elements.
+
+- Added simple SgmlopXMLTreeBuilder module.  This is a very fast
+  parser, but it doesn't yet support namespaces.  To use this parser,
+  you need the sgmlop driver:
+
+      http://effbot.org/zone/sgmlop-index.htm
+
+- Fixed exception in test suite; the TidyHTMLTreeBuilder class
+  now raises a RuntimeError exception if the _elementidy module
+  is not available.
+
+(1.2a5 released)
+
+- Fixed problem that could result in repeated use of the same
+  namespace prefix in the same element (!).
+
+- Fixed import error in ElementInclude, when using the default
+  loader (Gustavo Niemeyer).
+
+(1.2a4 released)
+
+- Fixed exception when .//tag fails to find matching elements
+  (reported by Mike Kent) (@XMLTOOLKIT28)
+
+- Fall back on pre-1.2 find/findtext/findall behaviour if the
+  ElementPath module is not installed.  If you don't need path
+  support, you can simply copy the ElementTree module to your
+  own project.
+
+(1.2a3 released)
+
+- Added experimental support for XInclude-style preprocessing.  The
+  ElementInclude module expands xi:include elements, using a custom
+  resolver.  The current release ignores xi:fallback elements.
+
+- Fixed typo in ElementTree.findtext (reported by Thomas Dartsch)
+  (@XMLTOOLKIT25)
+
+- Fixed parsing of periods in element names (reported by Brian
+  Vicente) (@XMLTOOLKIT27)
+
+(1.2a2 released)
+
+- Fixed serialization of elements and attributes in the XML default
+  namespace (http://www.w3.org/XML/1998/namespace).  Added "rdf" to
+  the set of "well-known" namespace prefixes.
+
+- Added 'makeelement' factory method.  Added 'target' argument to
+  XMLTreeBuilder class.
+
+(1.2a1 released)
+
+- Added support for a very limited subset of the abbreviated XPath
+  syntax.  The following location paths are supported:
+
+	tag -- select all subelements with the given tag
+	. -- select this element
+	* -- select all subelements
+	// (empty path) -- select all subelements, on all levels
+
+  Examples:
+
+	p -- select all p subelements
+	.//a -- select all a sublements, at all sublevels
+	*/img -- select all img grandchildren
+	ul/li -- select all li elements that are children of ul elements
+	.//ul/li -- same, but select elements anywhere in the subtree
+
+  Absolute paths (paths starting with a slash) can only be used on
+  ElementTree instances.  To use // on an Element instance, add a
+  leading period (.).
+
+*** Changes from release 1.0 to 1.1 ***
+
+(1.1 final released)
+
+- Added 'fromstring' and 'tostring' helpers.  The 'XML' function is
+  an alias for 'fromstring', and provides a convenient way to add XML
+  literals to source code:
+
+	from elementtree.ElementTree import XML
+
+	element = XML('<element>content</element>')
+
+- Moved XMLTreeBuilder functionality into the ElementTree module.  If
+  all you need is basic XML support, you can simply copy the ElementTree
+  module to your own project.
+
+- Added SimpleXMLWriter module.
+
+(1.1b2 released)
+
+- Changed default encoding to US-ASCII.  Use tree.write(file, "utf-8")
+  to get the old behaviour.  If the tree contains text that cannot be
+  encoded using the given encoding, the writer uses numerical entities
+  for all non-ASCII characters in that text segment.
+
+(1.1b1 released)
+
+- Map tags and attribute names having the same value to the same
+  object.  This saves space when reading large XML trees, and also
+  gives a small speedup (less than 10%).
+
+- Added benchmark script.  This script takes a filename argument, and
+  loads the given file into memory using the XML and SimpleXML tree
+  builders.  For each parser, it reports the document size and the
+  time needed to parse the document.

Modified: external/elementtree-1.2.6-20050316/PKG-INFO
==============================================================================
--- external/elementtree-1.2.6-20050316/PKG-INFO	(original)
+++ external/elementtree-1.2.6-20050316/PKG-INFO	Wed Dec 14 19:33:39 2005
@@ -1,17 +1,17 @@
-Metadata-Version: 1.0
-Name: elementtree
-Version: 1.2.6-20050316
-Summary: ElementTree - a light-weight XML object model for Python.
-Home-page: http://effbot.org/zone/element-index.htm
-Author: Fredrik Lundh
-Author-email: fredrik at pythonware.com
-License: Python (MIT style)
-Download-URL: http://effbot.org/downloads#elementtree
-Description: The Element type is a flexible container object, designed to store
-        hierarchical data structures in memory.  Element structures can be
-        converted to and from XML.
-Platform: Python 1.5.2 and later.
-Classifier: Development Status :: 6 - Mature
-Classifier: Operating System :: OS Independent
-Classifier: Topic :: Text Processing :: Markup :: HTML
-Classifier: Topic :: Text Processing :: Markup :: XML
+Metadata-Version: 1.0
+Name: elementtree
+Version: 1.2.6-20050316
+Summary: ElementTree - a light-weight XML object model for Python.
+Home-page: http://effbot.org/zone/element-index.htm
+Author: Fredrik Lundh
+Author-email: fredrik at pythonware.com
+License: Python (MIT style)
+Download-URL: http://effbot.org/downloads#elementtree
+Description: The Element type is a flexible container object, designed to store
+        hierarchical data structures in memory.  Element structures can be
+        converted to and from XML.
+Platform: Python 1.5.2 and later.
+Classifier: Development Status :: 6 - Mature
+Classifier: Operating System :: OS Independent
+Classifier: Topic :: Text Processing :: Markup :: HTML
+Classifier: Topic :: Text Processing :: Markup :: XML

Modified: external/elementtree-1.2.6-20050316/README
==============================================================================
--- external/elementtree-1.2.6-20050316/README	(original)
+++ external/elementtree-1.2.6-20050316/README	Wed Dec 14 19:33:39 2005
@@ -1,130 +1,130 @@
-$Id: README 2326 2005-03-17 07:45:21Z fredrik $
-
-=======================
-The elementtree library
-=======================
-
-This kit contains the ElementTree library, a light-weight toolkit for
-XML processing in Python.
-
-For more information on this library, see:
-
-    docs/index.html
-    http://effbot.org/zone/element.htm
-
-The modules are designed to work with Python 2.1 and newer.  The core
-ElementTree module and the SimpleXMLTreeBuilder class also works under
-1.5.2 and 2.0.
-
-Enjoy /F
-
-fredrik at pythonware.com
-http://www.pythonware.com
-
---------------------------------------------------------------------
-The ElementTree Library is
-
-Copyright (c) 1999-2005 by Secret Labs AB
-Copyright (c) 1999-2005 by Fredrik Lundh
-
-By obtaining, using, and/or copying this software and/or its
-associated documentation, you agree that you have read, understood,
-and will comply with the following terms and conditions:
-
-Permission to use, copy, modify, and distribute this software and its
-associated documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appears in all
-copies, and that both that copyright notice and this permission notice
-appear in supporting documentation, and that the name of Secret Labs
-AB or the author not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior
-permission.
-
-SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
-THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------------------
-
-release info
-------------
-
-This is release 1.2.6 of the ElementTree library.
-
-For a list of changes in this release, see the CHANGES document.
-
-The latest version of this library can be downloaded from:
-
-    http://effbot.org/downloads
-
-Comments, bug reports, and patches are welcome.  Send them to
-fredrik at pythonware.com.
-
-Note that this is free software, with limited support.  If you need
-commercial support on this module, contact fredrik at pythonware.com.
-
---------------------------------------------------------------------
-contents
---------------------------------------------------------------------
-
-README                        This file
-
-CHANGES                       List of changes in this release.
-
-elementtree/
-
-  ElementTree.py              Element tree implementation.  For a minimal
-                              install, this file is all you need.
-
-  ElementPath.py              Element path support module.  Adds limited
-                              XPath support to find/findtext/findall.
-
-  ElementInclude.py           Element include support module.  Adds limited
-                              XInclude support.
-
-  HTMLTreeBuilder.py          Element tree builder for HTML.  This only
-                              works for mostly well-formed HTML; if you
-                              need something that can parse arbitrary
-                              HTML at least as good as your browser, use
-                              TidyHTMLTreeBuilder or TidyTools (see below).
-
-  XMLTreeBuilder.py           Element tree builder for XML (compatibility;
-                              new code should use the tree builder in the
-                              ElementTree module).
-
-  TidyHTMLTreeBuilder.py      Element tree builder for HTML, based on the
-                              tidylib library.  This tree builder requires
-                              the _elementtidy extension module (available
-                              from http://effbot.org/downloads).
-
-  SimpleXMLTreeBuilder.py     Old element tree builder for XML, based on
-                              xmllib, for Python versions where "expat" is
-                              not available.   Due to bugs in xmllib, the
-                              namespace support is not reliable (run the
-                              module as a script to find out exactly how
-                              unreliable it is on your Python version...)
-
-  SgmlopXMLTreeBuilder.py     Simple element tree builder based on the
-                              SGMLOP parser.  Note: The current version
-                              does not support namespaces.
-
-  SimpleXMLWriter.py          Simple XML writer
-
-  TidyTools.py                Build element trees from HTML, using the
-                              external 'tidy' utility.
-
-setup.py                      Build/installation script
-
-docs/index.html		      API reference pages.
-docs/*
-
-demo*.py                      Sample scripts
-samples/*                     Sample data
-
-selftest.py                   Selftest (requires Python 2.1 or later)
-tidytest.py                   Selftest for TidyHTMLTreeBuilder components.
-
-benchmark.py                  Benchmark script (usage: benchmark.py file)
+$Id: README 2326 2005-03-17 07:45:21Z fredrik $
+
+=======================
+The elementtree library
+=======================
+
+This kit contains the ElementTree library, a light-weight toolkit for
+XML processing in Python.
+
+For more information on this library, see:
+
+    docs/index.html
+    http://effbot.org/zone/element.htm
+
+The modules are designed to work with Python 2.1 and newer.  The core
+ElementTree module and the SimpleXMLTreeBuilder class also works under
+1.5.2 and 2.0.
+
+Enjoy /F
+
+fredrik at pythonware.com
+http://www.pythonware.com
+
+--------------------------------------------------------------------
+The ElementTree Library is
+
+Copyright (c) 1999-2005 by Secret Labs AB
+Copyright (c) 1999-2005 by Fredrik Lundh
+
+By obtaining, using, and/or copying this software and/or its
+associated documentation, you agree that you have read, understood,
+and will comply with the following terms and conditions:
+
+Permission to use, copy, modify, and distribute this software and its
+associated documentation for any purpose and without fee is hereby
+granted, provided that the above copyright notice appears in all
+copies, and that both that copyright notice and this permission notice
+appear in supporting documentation, and that the name of Secret Labs
+AB or the author not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+--------------------------------------------------------------------
+
+release info
+------------
+
+This is release 1.2.6 of the ElementTree library.
+
+For a list of changes in this release, see the CHANGES document.
+
+The latest version of this library can be downloaded from:
+
+    http://effbot.org/downloads
+
+Comments, bug reports, and patches are welcome.  Send them to
+fredrik at pythonware.com.
+
+Note that this is free software, with limited support.  If you need
+commercial support on this module, contact fredrik at pythonware.com.
+
+--------------------------------------------------------------------
+contents
+--------------------------------------------------------------------
+
+README                        This file
+
+CHANGES                       List of changes in this release.
+
+elementtree/
+
+  ElementTree.py              Element tree implementation.  For a minimal
+                              install, this file is all you need.
+
+  ElementPath.py              Element path support module.  Adds limited
+                              XPath support to find/findtext/findall.
+
+  ElementInclude.py           Element include support module.  Adds limited
+                              XInclude support.
+
+  HTMLTreeBuilder.py          Element tree builder for HTML.  This only
+                              works for mostly well-formed HTML; if you
+                              need something that can parse arbitrary
+                              HTML at least as good as your browser, use
+                              TidyHTMLTreeBuilder or TidyTools (see below).
+
+  XMLTreeBuilder.py           Element tree builder for XML (compatibility;
+                              new code should use the tree builder in the
+                              ElementTree module).
+
+  TidyHTMLTreeBuilder.py      Element tree builder for HTML, based on the
+                              tidylib library.  This tree builder requires
+                              the _elementtidy extension module (available
+                              from http://effbot.org/downloads).
+
+  SimpleXMLTreeBuilder.py     Old element tree builder for XML, based on
+                              xmllib, for Python versions where "expat" is
+                              not available.   Due to bugs in xmllib, the
+                              namespace support is not reliable (run the
+                              module as a script to find out exactly how
+                              unreliable it is on your Python version...)
+
+  SgmlopXMLTreeBuilder.py     Simple element tree builder based on the
+                              SGMLOP parser.  Note: The current version
+                              does not support namespaces.
+
+  SimpleXMLWriter.py          Simple XML writer
+
+  TidyTools.py                Build element trees from HTML, using the
+                              external 'tidy' utility.
+
+setup.py                      Build/installation script
+
+docs/index.html		      API reference pages.
+docs/*
+
+demo*.py                      Sample scripts
+samples/*                     Sample data
+
+selftest.py                   Selftest (requires Python 2.1 or later)
+tidytest.py                   Selftest for TidyHTMLTreeBuilder components.
+
+benchmark.py                  Benchmark script (usage: benchmark.py file)

Modified: external/elementtree-1.2.6-20050316/benchmark.py
==============================================================================
--- external/elementtree-1.2.6-20050316/benchmark.py	(original)
+++ external/elementtree-1.2.6-20050316/benchmark.py	Wed Dec 14 19:33:39 2005
@@ -1,46 +1,46 @@
-# $Id: benchmark.py 1757 2004-03-28 17:21:25Z fredrik $
-# simple elementtree benchmark program
-
-from elementtree import XMLTreeBuilder, SimpleXMLTreeBuilder
-from elementtree import SgmlopXMLTreeBuilder
-from xml.dom import minidom
-
-import sys, time
-
-try:
-    file = sys.argv[1]
-except IndexError:
-    file = "hamlet.xml"
-
-def benchmark(file, builder_module):
-    source = open(file, "rb")
-    t0 = time.time()
-    parser = builder_module.TreeBuilder()
-    while 1:
-        data = source.read(32768)
-        if not data:
-            break
-        parser.feed(data)
-    tree = parser.close()
-    t1 = time.time()
-    print "%s: %d nodes read in %.3f seconds" % (
-        builder_module.__name__, len(tree.getiterator()), t1-t0
-        )
-    raw_input("press return to continue...")
-    del tree
-
-def benchmark_minidom(file):
-    t0 = time.time()
-    dom = minidom.parse(file)
-    t1 = time.time()
-    print "minidom tree read in %.3f seconds" % (t1-t0)
-    raw_input("press return to continue...")
-    del dom
-
-benchmark(file, XMLTreeBuilder)
-benchmark(file, SimpleXMLTreeBuilder) # use xmllib
-try:
-    benchmark(file, SgmlopXMLTreeBuilder) # use sgmlop
-except RuntimeError, v:
-    print "=== SgmlopXMLTreeBuilder not available (%s)" % v
-benchmark_minidom(file)
+# $Id: benchmark.py 1757 2004-03-28 17:21:25Z fredrik $
+# simple elementtree benchmark program
+
+from elementtree import XMLTreeBuilder, SimpleXMLTreeBuilder
+from elementtree import SgmlopXMLTreeBuilder
+from xml.dom import minidom
+
+import sys, time
+
+try:
+    file = sys.argv[1]
+except IndexError:
+    file = "hamlet.xml"
+
+def benchmark(file, builder_module):
+    source = open(file, "rb")
+    t0 = time.time()
+    parser = builder_module.TreeBuilder()
+    while 1:
+        data = source.read(32768)
+        if not data:
+            break
+        parser.feed(data)
+    tree = parser.close()
+    t1 = time.time()
+    print "%s: %d nodes read in %.3f seconds" % (
+        builder_module.__name__, len(tree.getiterator()), t1-t0
+        )
+    raw_input("press return to continue...")
+    del tree
+
+def benchmark_minidom(file):
+    t0 = time.time()
+    dom = minidom.parse(file)
+    t1 = time.time()
+    print "minidom tree read in %.3f seconds" % (t1-t0)
+    raw_input("press return to continue...")
+    del dom
+
+benchmark(file, XMLTreeBuilder)
+benchmark(file, SimpleXMLTreeBuilder) # use xmllib
+try:
+    benchmark(file, SgmlopXMLTreeBuilder) # use sgmlop
+except RuntimeError, v:
+    print "=== SgmlopXMLTreeBuilder not available (%s)" % v
+benchmark_minidom(file)

Modified: external/elementtree-1.2.6-20050316/docs/effbot.css
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/effbot.css	(original)
+++ external/elementtree-1.2.6-20050316/docs/effbot.css	Wed Dec 14 19:33:39 2005
@@ -1,118 +1,118 @@
-/* effbot.css */
-
-BODY {
-    font: 100% Georgia, Times, serif;
-    color: black;
-    margin: 0px 20px 0px 20px;
-}
-
-#effbot-body {
-    background: white;
-    padding: 10px 40px 10px 40px;
-    max-width: 50em;
-}
-
-#effbot-menu {
-    display: none;
-}
-
-.adsense {
-    background: #f8fff8;
-    border: 1px solid #084; 
-    padding: 10px 4px 4px 4px;
-}
-
-.sidebar {
-    border: 1px solid #000; 
-    float: right; clear: right;
-    width: 200px;
-    background: white;
-    padding: 10px;
-    margin: 0px -25px 10px 0px;
-}
-
-/* visual style */
-
-P {
-    line-height: 1.3em;
-}
-
-CODE, PRE {
-    font: 100% "Courier New", Courier, Monaco, monospace;
-    color: #042; margin-left: 20px; 
-}
-
-H1, H2, H3 {
-    font-family: Georgia, Times, serif;
-    color: #084; margin-top: 30px;
-}
-
-H1, H2, { border-top: 1px solid #084; }
-
-H4, H5, H6 {
-    font-family: Georgia, Times, serif;
-    color: #084; margin-top: 15px;
-}
-
-A:link, A:hover { color: #084; }
-A:visited { color: #404040; }
-
-UL LI { list-style-type: square; }
-
-.title { margin-bottom: 2px; color: #084; }
-.info { font-size: 80%; color: #084; margin-top: 0px; }
-
-.bluebox { color: #084; margin-top: 10px; }
-
-.highlight { background: #cfc; }
-.mark { color: #084; }
-.small { font-size: 80%; }
-.display { background: #eee; padding: 20px; }
-
-.note { 
-    background: #efe;
-    border-top: 1px solid #084;
-    border-bottom: 1px solid #084;
-    padding: 2px 20px;
-}
-
-.example {
-    border-top: medium solid #084;
-    border-bottom: medium solid #084;
-    padding: 5px;
-}
-
-.figure {
-    border-top: medium solid #084;
-    border-bottom: medium solid #084;
-    padding: 5px;
-}
-
-.fixme {
-    background: #eee;
-    border: 1px solid #084;
-    padding: 2x 20px;
-}
-
-.simpletable {
-    border: 1px solid #084;
-    border-collapse: collapse;
-}
-
-.simpletable TH {
-    text-align: left;
-    background: #cfc;
-    border: 1px solid #084;
-    margin: 0px;
-    padding: 1px 5px;
-}
-
-.simpletable TD {
-    border: 1px solid #084;
-    margin: 0px;
-    padding: 5px;
-}
-
-/* xmldiff markup */
-.new { text-decoration: underline; color: red; background: #fff0f0; }
-.old { text-decoration: line-through; color: blue; background: #f0f0ff; }
+/* effbot.css */
+
+BODY {
+    font: 100% Georgia, Times, serif;
+    color: black;
+    margin: 0px 20px 0px 20px;
+}
+
+#effbot-body {
+    background: white;
+    padding: 10px 40px 10px 40px;
+    max-width: 50em;
+}
+
+#effbot-menu {
+    display: none;
+}
+
+.adsense {
+    background: #f8fff8;
+    border: 1px solid #084; 
+    padding: 10px 4px 4px 4px;
+}
+
+.sidebar {
+    border: 1px solid #000; 
+    float: right; clear: right;
+    width: 200px;
+    background: white;
+    padding: 10px;
+    margin: 0px -25px 10px 0px;
+}
+
+/* visual style */
+
+P {
+    line-height: 1.3em;
+}
+
+CODE, PRE {
+    font: 100% "Courier New", Courier, Monaco, monospace;
+    color: #042; margin-left: 20px; 
+}
+
+H1, H2, H3 {
+    font-family: Georgia, Times, serif;
+    color: #084; margin-top: 30px;
+}
+
+H1, H2, { border-top: 1px solid #084; }
+
+H4, H5, H6 {
+    font-family: Georgia, Times, serif;
+    color: #084; margin-top: 15px;
+}
+
+A:link, A:hover { color: #084; }
+A:visited { color: #404040; }
+
+UL LI { list-style-type: square; }
+
+.title { margin-bottom: 2px; color: #084; }
+.info { font-size: 80%; color: #084; margin-top: 0px; }
+
+.bluebox { color: #084; margin-top: 10px; }
+
+.highlight { background: #cfc; }
+.mark { color: #084; }
+.small { font-size: 80%; }
+.display { background: #eee; padding: 20px; }
+
+.note { 
+    background: #efe;
+    border-top: 1px solid #084;
+    border-bottom: 1px solid #084;
+    padding: 2px 20px;
+}
+
+.example {
+    border-top: medium solid #084;
+    border-bottom: medium solid #084;
+    padding: 5px;
+}
+
+.figure {
+    border-top: medium solid #084;
+    border-bottom: medium solid #084;
+    padding: 5px;
+}
+
+.fixme {
+    background: #eee;
+    border: 1px solid #084;
+    padding: 2x 20px;
+}
+
+.simpletable {
+    border: 1px solid #084;
+    border-collapse: collapse;
+}
+
+.simpletable TH {
+    text-align: left;
+    background: #cfc;
+    border: 1px solid #084;
+    margin: 0px;
+    padding: 1px 5px;
+}
+
+.simpletable TD {
+    border: 1px solid #084;
+    margin: 0px;
+    padding: 5px;
+}
+
+/* xmldiff markup */
+.new { text-decoration: underline; color: red; background: #fff0f0; }
+.old { text-decoration: line-through; color: blue; background: #f0f0ff; }

Modified: external/elementtree-1.2.6-20050316/docs/index.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/index.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/index.html	Wed Dec 14 19:33:39 2005
@@ -1,35 +1,35 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree Package</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree Package</h1>
-
-<h3>Package Contents</h3>
-
-<dl>
-<dt><a href='pythondoc-elementtree.ElementTree.html'>ElementTree</a></dt>
-<dt><a href='pythondoc-elementtree.ElementPath.html'>ElementPath</a></dt>
-<dt><a href='pythondoc-elementtree.ElementInclude.html'>ElementInclude</a></dt>
-<dt><a href='pythondoc-elementtree.HTMLTreeBuilder.html'>HTMLTreeBuilder</a></dt>
-<dt><a href='pythondoc-elementtree.XMLTreeBuilder.html'>XMLTreeBuilder</a></dt>
-<dt><a href='pythondoc-elementtree.SgmlopXMLTreeBuilder.html'>SgmlopXMLTreeBuilder</a></dt>
-<dt><a href='pythondoc-elementtree.SimpleXMLTreeBuilder.html'>SimpleXMLTreeBuilder</a></dt>
-<dt><a href='pythondoc-elementtree.SimpleXMLWriter.html'>SimpleXMLWriter</a></dt>
-<dt><a href='pythondoc-elementtree.TidyTools.html'>TidyTools</a></dt>
-</dl>
-
-<h3>Online Resources</h3>
-
-<dl>
-<dt><a href='http://effbot.org/zone/element.htm'><i>Elements and Element Trees</i></a> (effbot.org)</dt>
-<dt><a href='http://effbot.org/zone/element-xpath.htm'><i>XPath Support in ElementTree 1.2</i></a> (effbot.org)</dt>
-<dt><a href='http://effbot.org/zone/element-xinclude.htm'><i>XInclude Support in ElementTree 1.2</i></a> (effbot.org)</dt>
-<dt><a href='http://www.xml.com/pub/a/2003/02/12/py-xml.html'><i>Simple XML Processing With elementtree</i></a> (xml.com)</dt>
-</dl>
-
-</body></html>
-
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree Package</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree Package</h1>
+
+<h3>Package Contents</h3>
+
+<dl>
+<dt><a href='pythondoc-elementtree.ElementTree.html'>ElementTree</a></dt>
+<dt><a href='pythondoc-elementtree.ElementPath.html'>ElementPath</a></dt>
+<dt><a href='pythondoc-elementtree.ElementInclude.html'>ElementInclude</a></dt>
+<dt><a href='pythondoc-elementtree.HTMLTreeBuilder.html'>HTMLTreeBuilder</a></dt>
+<dt><a href='pythondoc-elementtree.XMLTreeBuilder.html'>XMLTreeBuilder</a></dt>
+<dt><a href='pythondoc-elementtree.SgmlopXMLTreeBuilder.html'>SgmlopXMLTreeBuilder</a></dt>
+<dt><a href='pythondoc-elementtree.SimpleXMLTreeBuilder.html'>SimpleXMLTreeBuilder</a></dt>
+<dt><a href='pythondoc-elementtree.SimpleXMLWriter.html'>SimpleXMLWriter</a></dt>
+<dt><a href='pythondoc-elementtree.TidyTools.html'>TidyTools</a></dt>
+</dl>
+
+<h3>Online Resources</h3>
+
+<dl>
+<dt><a href='http://effbot.org/zone/element.htm'><i>Elements and Element Trees</i></a> (effbot.org)</dt>
+<dt><a href='http://effbot.org/zone/element-xpath.htm'><i>XPath Support in ElementTree 1.2</i></a> (effbot.org)</dt>
+<dt><a href='http://effbot.org/zone/element-xinclude.htm'><i>XInclude Support in ElementTree 1.2</i></a> (effbot.org)</dt>
+<dt><a href='http://www.xml.com/pub/a/2003/02/12/py-xml.html'><i>Simple XML Processing With elementtree</i></a> (xml.com)</dt>
+</dl>
+
+</body></html>
+

Modified: external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementInclude.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementInclude.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementInclude.html	Wed Dec 14 19:33:39 2005
@@ -1,69 +1,69 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree.ElementInclude Module</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree.ElementInclude Module</h1>
-<p>Limited XInclude support for the ElementTree package.</p>
-<h2>Module Contents</h2>
-<dl>
-<dt><a id='elementtree.ElementInclude.default_loader-function' name='elementtree.ElementInclude.default_loader-function'><b>default_loader(href, parse, encoding=None)</b></a> [<a href='#elementtree.ElementInclude.default_loader-function'>#</a>]</dt>
-<dd>
-<p>Default loader.  This loader reads an included resource from disk.</p>
-<dl>
-<dt><i>href</i></dt>
-<dd>
-Resource reference.</dd>
-<dt><i>parse</i></dt>
-<dd>
-Parse mode.  Either &quot;xml&quot; or &quot;text&quot;.</dd>
-<dt><i>encoding</i></dt>
-<dd>
-Optional text encoding.</dd>
-<dt>Returns:</dt>
-<dd>
-The expanded resource.  If the parse mode is &quot;xml&quot;, this
-   is an ElementTree instance.  If the parse mode is &quot;text&quot;, this
-   is a Unicode string.  If the loader fails, it can return None
-   or raise an IOError exception.</dd>
-<dt>Raises <b>IOError</b>:</dt><dd>
-If the loader fails to load the resource.</dd>
-</dl><br />
-</dd>
-<dt><b>FatalIncludeError</b> (class)  [<a href='#elementtree.ElementInclude.FatalIncludeError-class'>#</a>]</dt>
-<dd>
-<p>Fatal include error.</p>
-<p>For more information about this class, see <a href='#elementtree.ElementInclude.FatalIncludeError-class'><i>The FatalIncludeError Class</i></a>.</p>
-</dd>
-<dt><a id='elementtree.ElementInclude.include-function' name='elementtree.ElementInclude.include-function'><b>include(elem, loader=None)</b></a> [<a href='#elementtree.ElementInclude.include-function'>#</a>]</dt>
-<dd>
-<p>Expand XInclude directives.</p>
-<dl>
-<dt><i>elem</i></dt>
-<dd>
-Root element.</dd>
-<dt><i>loader</i></dt>
-<dd>
-Optional resource loader.  If omitted, it defaults
-    to <a class="link" href="#elementtree.ElementInclude.default_loader-function"><b>default_loader</b></a>.  If given, it should be a callable
-    that implements the same interface as <b>default_loader</b>.
-</dd>
-<dt>Raises <b>FatalIncludeError</b>:</dt><dd>
-If the function fails to include a given
-    resource, or if the tree contains malformed XInclude elements.</dd>
-<dt>Raises <b>IOError</b>:</dt><dd>
-If the function fails to load a given resource.</dd>
-</dl><br />
-</dd>
-</dl>
-<h2><a id='elementtree.ElementInclude.FatalIncludeError-class' name='elementtree.ElementInclude.FatalIncludeError-class'>The FatalIncludeError Class</a></h2>
-<dl>
-<dt><b>FatalIncludeError</b> (class)  [<a href='#elementtree.ElementInclude.FatalIncludeError-class'>#</a>]</dt>
-<dd>
-<p>Fatal include error.</p>
-</dd>
-</dl>
-</body></html>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree.ElementInclude Module</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree.ElementInclude Module</h1>
+<p>Limited XInclude support for the ElementTree package.</p>
+<h2>Module Contents</h2>
+<dl>
+<dt><a id='elementtree.ElementInclude.default_loader-function' name='elementtree.ElementInclude.default_loader-function'><b>default_loader(href, parse, encoding=None)</b></a> [<a href='#elementtree.ElementInclude.default_loader-function'>#</a>]</dt>
+<dd>
+<p>Default loader.  This loader reads an included resource from disk.</p>
+<dl>
+<dt><i>href</i></dt>
+<dd>
+Resource reference.</dd>
+<dt><i>parse</i></dt>
+<dd>
+Parse mode.  Either &quot;xml&quot; or &quot;text&quot;.</dd>
+<dt><i>encoding</i></dt>
+<dd>
+Optional text encoding.</dd>
+<dt>Returns:</dt>
+<dd>
+The expanded resource.  If the parse mode is &quot;xml&quot;, this
+   is an ElementTree instance.  If the parse mode is &quot;text&quot;, this
+   is a Unicode string.  If the loader fails, it can return None
+   or raise an IOError exception.</dd>
+<dt>Raises <b>IOError</b>:</dt><dd>
+If the loader fails to load the resource.</dd>
+</dl><br />
+</dd>
+<dt><b>FatalIncludeError</b> (class)  [<a href='#elementtree.ElementInclude.FatalIncludeError-class'>#</a>]</dt>
+<dd>
+<p>Fatal include error.</p>
+<p>For more information about this class, see <a href='#elementtree.ElementInclude.FatalIncludeError-class'><i>The FatalIncludeError Class</i></a>.</p>
+</dd>
+<dt><a id='elementtree.ElementInclude.include-function' name='elementtree.ElementInclude.include-function'><b>include(elem, loader=None)</b></a> [<a href='#elementtree.ElementInclude.include-function'>#</a>]</dt>
+<dd>
+<p>Expand XInclude directives.</p>
+<dl>
+<dt><i>elem</i></dt>
+<dd>
+Root element.</dd>
+<dt><i>loader</i></dt>
+<dd>
+Optional resource loader.  If omitted, it defaults
+    to <a class="link" href="#elementtree.ElementInclude.default_loader-function"><b>default_loader</b></a>.  If given, it should be a callable
+    that implements the same interface as <b>default_loader</b>.
+</dd>
+<dt>Raises <b>FatalIncludeError</b>:</dt><dd>
+If the function fails to include a given
+    resource, or if the tree contains malformed XInclude elements.</dd>
+<dt>Raises <b>IOError</b>:</dt><dd>
+If the function fails to load a given resource.</dd>
+</dl><br />
+</dd>
+</dl>
+<h2><a id='elementtree.ElementInclude.FatalIncludeError-class' name='elementtree.ElementInclude.FatalIncludeError-class'>The FatalIncludeError Class</a></h2>
+<dl>
+<dt><b>FatalIncludeError</b> (class)  [<a href='#elementtree.ElementInclude.FatalIncludeError-class'>#</a>]</dt>
+<dd>
+<p>Fatal include error.</p>
+</dd>
+</dl>
+</body></html>

Modified: external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementPath.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementPath.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementPath.html	Wed Dec 14 19:33:39 2005
@@ -1,60 +1,60 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree.ElementPath Module</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree.ElementPath Module</h1>
-<p>Implementation module for XPath support.  There's usually no reason
-to import this module directly; the <b>ElementTree</b> does this for
-you, if needed.
-</p><h2>Module Contents</h2>
-<dl>
-<dt><a id='elementtree.ElementPath._compile-function' name='elementtree.ElementPath._compile-function'><b>_compile(path)</b></a> [<a href='#elementtree.ElementPath._compile-function'>#</a>]</dt>
-<dd>
-<p>(Internal) Compile path.</p>
-</dd>
-<dt><a id='elementtree.ElementPath.find-function' name='elementtree.ElementPath.find-function'><b>find(element, path)</b></a> [<a href='#elementtree.ElementPath.find-function'>#</a>]</dt>
-<dd>
-<p>Find first matching object.</p>
-</dd>
-<dt><a id='elementtree.ElementPath.findall-function' name='elementtree.ElementPath.findall-function'><b>findall(element, path)</b></a> [<a href='#elementtree.ElementPath.findall-function'>#</a>]</dt>
-<dd>
-<p>Find all matching objects.</p>
-</dd>
-<dt><a id='elementtree.ElementPath.findtext-function' name='elementtree.ElementPath.findtext-function'><b>findtext(element, path, default=None)</b></a> [<a href='#elementtree.ElementPath.findtext-function'>#</a>]</dt>
-<dd>
-<p>Find text for first matching object.</p>
-</dd>
-<dt><b>Path(path)</b> (class) [<a href='#elementtree.ElementPath.Path-class'>#</a>]</dt>
-<dd>
-<p>Wrapper for a compiled XPath.</p>
-<p>For more information about this class, see <a href='#elementtree.ElementPath.Path-class'><i>The Path Class</i></a>.</p>
-</dd>
-</dl>
-<h2><a id='elementtree.ElementPath.Path-class' name='elementtree.ElementPath.Path-class'>The Path Class</a></h2>
-<dl>
-<dt><b>Path(path)</b> (class) [<a href='#elementtree.ElementPath.Path-class'>#</a>]</dt>
-<dd>
-<p>Wrapper for a compiled XPath.</p>
-</dd>
-<dt><a id='elementtree.ElementPath.Path.__init__-method' name='elementtree.ElementPath.Path.__init__-method'><b>__init__(path)</b></a> [<a href='#elementtree.ElementPath.Path.__init__-method'>#</a>]</dt>
-<dd>
-<p>Create an Path instance from an XPath expression.</p>
-</dd>
-<dt><a id='elementtree.ElementPath.Path.find-method' name='elementtree.ElementPath.Path.find-method'><b>find(element)</b></a> [<a href='#elementtree.ElementPath.Path.find-method'>#</a>]</dt>
-<dd>
-<p>Find first matching object.</p>
-</dd>
-<dt><a id='elementtree.ElementPath.Path.findall-method' name='elementtree.ElementPath.Path.findall-method'><b>findall(element)</b></a> [<a href='#elementtree.ElementPath.Path.findall-method'>#</a>]</dt>
-<dd>
-<p>Find all matching objects.</p>
-</dd>
-<dt><a id='elementtree.ElementPath.Path.findtext-method' name='elementtree.ElementPath.Path.findtext-method'><b>findtext(element, default=None)</b></a> [<a href='#elementtree.ElementPath.Path.findtext-method'>#</a>]</dt>
-<dd>
-<p>Find text for first matching object.</p>
-</dd>
-</dl>
-</body></html>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree.ElementPath Module</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree.ElementPath Module</h1>
+<p>Implementation module for XPath support.  There's usually no reason
+to import this module directly; the <b>ElementTree</b> does this for
+you, if needed.
+</p><h2>Module Contents</h2>
+<dl>
+<dt><a id='elementtree.ElementPath._compile-function' name='elementtree.ElementPath._compile-function'><b>_compile(path)</b></a> [<a href='#elementtree.ElementPath._compile-function'>#</a>]</dt>
+<dd>
+<p>(Internal) Compile path.</p>
+</dd>
+<dt><a id='elementtree.ElementPath.find-function' name='elementtree.ElementPath.find-function'><b>find(element, path)</b></a> [<a href='#elementtree.ElementPath.find-function'>#</a>]</dt>
+<dd>
+<p>Find first matching object.</p>
+</dd>
+<dt><a id='elementtree.ElementPath.findall-function' name='elementtree.ElementPath.findall-function'><b>findall(element, path)</b></a> [<a href='#elementtree.ElementPath.findall-function'>#</a>]</dt>
+<dd>
+<p>Find all matching objects.</p>
+</dd>
+<dt><a id='elementtree.ElementPath.findtext-function' name='elementtree.ElementPath.findtext-function'><b>findtext(element, path, default=None)</b></a> [<a href='#elementtree.ElementPath.findtext-function'>#</a>]</dt>
+<dd>
+<p>Find text for first matching object.</p>
+</dd>
+<dt><b>Path(path)</b> (class) [<a href='#elementtree.ElementPath.Path-class'>#</a>]</dt>
+<dd>
+<p>Wrapper for a compiled XPath.</p>
+<p>For more information about this class, see <a href='#elementtree.ElementPath.Path-class'><i>The Path Class</i></a>.</p>
+</dd>
+</dl>
+<h2><a id='elementtree.ElementPath.Path-class' name='elementtree.ElementPath.Path-class'>The Path Class</a></h2>
+<dl>
+<dt><b>Path(path)</b> (class) [<a href='#elementtree.ElementPath.Path-class'>#</a>]</dt>
+<dd>
+<p>Wrapper for a compiled XPath.</p>
+</dd>
+<dt><a id='elementtree.ElementPath.Path.__init__-method' name='elementtree.ElementPath.Path.__init__-method'><b>__init__(path)</b></a> [<a href='#elementtree.ElementPath.Path.__init__-method'>#</a>]</dt>
+<dd>
+<p>Create an Path instance from an XPath expression.</p>
+</dd>
+<dt><a id='elementtree.ElementPath.Path.find-method' name='elementtree.ElementPath.Path.find-method'><b>find(element)</b></a> [<a href='#elementtree.ElementPath.Path.find-method'>#</a>]</dt>
+<dd>
+<p>Find first matching object.</p>
+</dd>
+<dt><a id='elementtree.ElementPath.Path.findall-method' name='elementtree.ElementPath.Path.findall-method'><b>findall(element)</b></a> [<a href='#elementtree.ElementPath.Path.findall-method'>#</a>]</dt>
+<dd>
+<p>Find all matching objects.</p>
+</dd>
+<dt><a id='elementtree.ElementPath.Path.findtext-method' name='elementtree.ElementPath.Path.findtext-method'><b>findtext(element, default=None)</b></a> [<a href='#elementtree.ElementPath.Path.findtext-method'>#</a>]</dt>
+<dd>
+<p>Find text for first matching object.</p>
+</dd>
+</dl>
+</body></html>

Modified: external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementTree.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementTree.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.ElementTree.html	Wed Dec 14 19:33:39 2005
@@ -1,886 +1,886 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree.ElementTree Module</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree.ElementTree Module</h1>
-<p>The <b>Element</b> type is a flexible container object, designed to
-store hierarchical data structures in memory. The type can be
-described as a cross between a list and a dictionary.
-</p><p>
-Each element has a number of properties associated with it:
-<ul>
-<li>a <i>tag</i>. This is a string identifying what kind of data
-this element represents (the element type, in other words).</li>
-<li>a number of <i>attributes</i>, stored in a Python dictionary.</li>
-<li>a <i>text</i> string.</li>
-<li>an optional <i>tail</i> string.</li>
-<li>a number of <i>child elements</i>, stored in a Python sequence</li>
-</ul>
-
-To create an element instance, use the <a class="link" href="#elementtree.ElementTree.Element-function"><b>Element</b></a> or <a class="link" href="#elementtree.ElementTree.SubElement-function"><b>SubElement</b></a> factory functions.
-</p><p>
-The <a class="link" href="#elementtree.ElementTree.ElementTree-class"><b>ElementTree</b></a> class can be used to wrap an element
-structure, and convert it from and to XML.
-</p><h2>Module Contents</h2>
-<dl>
-<dt><b>_ElementInterface(tag, attrib)</b> (class) [<a href='#elementtree.ElementTree._ElementInterface-class'>#</a>]</dt>
-<dd>
-<p>Internal element class.</p>
-<p>For more information about this class, see <a href='#elementtree.ElementTree._ElementInterface-class'><i>The _ElementInterface Class</i></a>.</p>
-</dd>
-<dt><a id='elementtree.ElementTree.Comment-function' name='elementtree.ElementTree.Comment-function'><b>Comment(text=None)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.Comment-function'>#</a>]</dt>
-<dd>
-<p>Comment element factory.  This factory function creates a special
-element that will be serialized as an XML comment.
-</p><p>
-The comment string can be either an 8-bit ASCII string or a Unicode
-string.
-
-</p><dl>
-<dt><i>text</i></dt>
-<dd>
-A string containing the comment string.</dd>
-<dt>Returns:</dt>
-<dd>
-An element instance, representing a comment.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.dump-function' name='elementtree.ElementTree.dump-function'><b>dump(elem)</b></a> [<a href='#elementtree.ElementTree.dump-function'>#</a>]</dt>
-<dd>
-<p>Writes an element tree or element structure to sys.stdout.  This
-function should be used for debugging only.
-</p><p>
-The exact output format is implementation dependent.  In this
-version, it's written as an ordinary XML file.
-
-</p><dl>
-<dt><i>elem</i></dt>
-<dd>
-An element tree or an individual element.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.Element-function' name='elementtree.ElementTree.Element-function'><b>Element(tag, attrib={}, **extra)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.Element-function'>#</a>]</dt>
-<dd>
-<p>Element factory.  This function returns an object implementing the
-standard Element interface.  The exact class or type of that object
-is implementation dependent, but it will always be compatible with
-the <a class="link" href="#elementtree.ElementTree._ElementInterface-class"><b>_ElementInterface</b></a> class in this module.
-</p><p>
-The element name, attribute names, and attribute values can be
-either 8-bit ASCII strings or Unicode strings.
-
-</p><dl>
-<dt><i>tag</i></dt>
-<dd>
-The element name.</dd>
-<dt><i>attrib</i></dt>
-<dd>
-An optional dictionary, containing element attributes.</dd>
-<dt><i>**extra</i></dt>
-<dd>
-Additional attributes, given as keyword arguments.</dd>
-<dt>Returns:</dt>
-<dd>
-An element instance.</dd>
-</dl><br />
-</dd>
-<dt><b>ElementTree(element=None, file=None)</b> (class) [<a href='#elementtree.ElementTree.ElementTree-class'>#</a>]</dt>
-<dd>
-<p>ElementTree wrapper class.</p>
-<dl>
-<dt><i>element</i></dt>
-<dd>
-Optional root element.</dd>
-<dt><i>file=</i></dt>
-<dd>
-Optional file handle or name.  If given, the
-    tree is initialized with the contents of this XML file.</dd>
-</dl><br />
-<p>For more information about this class, see <a href='#elementtree.ElementTree.ElementTree-class'><i>The ElementTree Class</i></a>.</p>
-</dd>
-<dt><a id='elementtree.ElementTree.fromstring-variable' name='elementtree.ElementTree.fromstring-variable'><b>fromstring</b></a> (variable) [<a href='#elementtree.ElementTree.fromstring-variable'>#</a>]</dt>
-<dd>
-<p>Parses an XML document from a string constant.  Same as <a class="link" href="#elementtree.ElementTree.XML-function"><b>XML</b></a>.
-
-</p><dl>
-<dt><i>source</i></dt>
-<dd>
-A string containing XML data.</dd>
-<dt>Returns:</dt>
-<dd>
-An Element instance.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.iselement-function' name='elementtree.ElementTree.iselement-function'><b>iselement(element)</b></a> &rArr; flag [<a href='#elementtree.ElementTree.iselement-function'>#</a>]</dt>
-<dd>
-<p>Checks if an object appears to be a valid element object.</p>
-<dl>
-<dt><i>An</i></dt>
-<dd>
-element instance.</dd>
-<dt>Returns:</dt>
-<dd>
-A true value if this is an element object.</dd>
-</dl><br />
-</dd>
-<dt><b>iterparse(source, events=None)</b> (class) [<a href='#elementtree.ElementTree.iterparse-class'>#</a>]</dt>
-<dd>
-<p>Parses an XML document into an element tree incrementally, and reports
-what's going on to the user.</p>
-<dl>
-<dt><i>source</i></dt>
-<dd>
-A filename or file object containing XML data.</dd>
-<dt><i>events</i></dt>
-<dd>
-A list of events to report back.  If omitted, only &quot;end&quot;
-    events are reported.</dd>
-<dt>Returns:</dt>
-<dd>
-A (event, elem) iterator.</dd>
-</dl><br />
-<p>For more information about this class, see <a href='#elementtree.ElementTree.iterparse-class'><i>The iterparse Class</i></a>.</p>
-</dd>
-<dt><a id='elementtree.ElementTree.parse-function' name='elementtree.ElementTree.parse-function'><b>parse(source, parser=None)</b></a> [<a href='#elementtree.ElementTree.parse-function'>#</a>]</dt>
-<dd>
-<p>Parses an XML document into an element tree.</p>
-<dl>
-<dt><i>source</i></dt>
-<dd>
-A filename or file object containing XML data.</dd>
-<dt><i>parser</i></dt>
-<dd>
-An optional parser instance.  If not given, the
-    standard <a class="link" href="#elementtree.ElementTree.XMLTreeBuilder-class"><b>XMLTreeBuilder</b></a> parser is used.
-</dd>
-<dt>Returns:</dt>
-<dd>
-An ElementTree instance</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.ProcessingInstruction-function' name='elementtree.ElementTree.ProcessingInstruction-function'><b>ProcessingInstruction(target, text=None)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.ProcessingInstruction-function'>#</a>]</dt>
-<dd>
-<p>PI element factory.  This factory function creates a special element
-that will be serialized as an XML processing instruction.</p>
-<dl>
-<dt><i>target</i></dt>
-<dd>
-A string containing the PI target.</dd>
-<dt><i>text</i></dt>
-<dd>
-A string containing the PI contents, if any.</dd>
-<dt>Returns:</dt>
-<dd>
-An element instance, representing a PI.</dd>
-</dl><br />
-</dd>
-<dt><b>QName(text_or_uri, tag=None)</b> (class) [<a href='#elementtree.ElementTree.QName-class'>#</a>]</dt>
-<dd>
-<p>QName wrapper.</p>
-<dl>
-<dt><i>text</i></dt>
-<dd>
-A string containing the QName value, in the form {uri}local,
-    or, if the tag argument is given, the URI part of a QName.</dd>
-<dt><i>tag</i></dt>
-<dd>
-Optional tag.  If given, the first argument is interpreted as
-    an URI, and this argument is interpreted as a local name.</dd>
-<dt>Returns:</dt>
-<dd>
-An opaque object, representing the QName.</dd>
-</dl><br />
-<p>For more information about this class, see <a href='#elementtree.ElementTree.QName-class'><i>The QName Class</i></a>.</p>
-</dd>
-<dt><a id='elementtree.ElementTree.SubElement-function' name='elementtree.ElementTree.SubElement-function'><b>SubElement(parent, tag, attrib={}, **extra)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.SubElement-function'>#</a>]</dt>
-<dd>
-<p>Subelement factory.  This function creates an element instance, and
-appends it to an existing element.
-</p><p>
-The element name, attribute names, and attribute values can be
-either 8-bit ASCII strings or Unicode strings.
-
-</p><dl>
-<dt><i>parent</i></dt>
-<dd>
-The parent element.</dd>
-<dt><i>tag</i></dt>
-<dd>
-The subelement name.</dd>
-<dt><i>attrib</i></dt>
-<dd>
-An optional dictionary, containing element attributes.</dd>
-<dt><i>**extra</i></dt>
-<dd>
-Additional attributes, given as keyword arguments.</dd>
-<dt>Returns:</dt>
-<dd>
-An element instance.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.tostring-function' name='elementtree.ElementTree.tostring-function'><b>tostring(element, encoding=None)</b></a> &rArr; string [<a href='#elementtree.ElementTree.tostring-function'>#</a>]</dt>
-<dd>
-<p>Generates a string representation of an XML element, including all
-subelements.</p>
-<dl>
-<dt><i>element</i></dt>
-<dd>
-An Element instance.</dd>
-<dt>Returns:</dt>
-<dd>
-An encoded string containing the XML data.</dd>
-</dl><br />
-</dd>
-<dt><b>TreeBuilder(element_factory=None)</b> (class) [<a href='#elementtree.ElementTree.TreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>Generic element structure builder.</p>
-<dl>
-<dt><i>element_factory</i></dt>
-<dd>
-Optional element factory.  This factory
-   is called to create new Element instances, as necessary.</dd>
-</dl><br />
-<p>For more information about this class, see <a href='#elementtree.ElementTree.TreeBuilder-class'><i>The TreeBuilder Class</i></a>.</p>
-</dd>
-<dt><a id='elementtree.ElementTree.XML-function' name='elementtree.ElementTree.XML-function'><b>XML(text)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.XML-function'>#</a>]</dt>
-<dd>
-<p>Parses an XML document from a string constant.  This function can
-be used to embed &quot;XML literals&quot; in Python code.</p>
-<dl>
-<dt><i>source</i></dt>
-<dd>
-A string containing XML data.</dd>
-<dt>Returns:</dt>
-<dd>
-An Element instance.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.XMLID-function' name='elementtree.ElementTree.XMLID-function'><b>XMLID(text)</b></a> &rArr; (Element, dictionary) [<a href='#elementtree.ElementTree.XMLID-function'>#</a>]</dt>
-<dd>
-<p>Parses an XML document from a string constant, and also returns
-a dictionary which maps from element id:s to elements.</p>
-<dl>
-<dt><i>source</i></dt>
-<dd>
-A string containing XML data.</dd>
-<dt>Returns:</dt>
-<dd>
-A tuple containing an Element instance and a dictionary.</dd>
-</dl><br />
-</dd>
-<dt><b>XMLTreeBuilder(html=0, target=None)</b> (class) [<a href='#elementtree.ElementTree.XMLTreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>Element structure builder for XML source data, based on the
-expat parser.</p>
-<dl>
-<dt><i>target=</i></dt>
-<dd>
-Target object.  If omitted, the builder uses an
-    instance of the standard <a class="link" href="#elementtree.ElementTree.TreeBuilder-class"><b>TreeBuilder</b></a> class.
-</dd>
-<dt><i>html=</i></dt>
-<dd>
-Predefine HTML entities.  This flag is not supported
-    by the current implementation.</dd>
-</dl><br />
-<p>For more information about this class, see <a href='#elementtree.ElementTree.XMLTreeBuilder-class'><i>The XMLTreeBuilder Class</i></a>.</p>
-</dd>
-</dl>
-<h2><a id='elementtree.ElementTree._ElementInterface-class' name='elementtree.ElementTree._ElementInterface-class'>The _ElementInterface Class</a></h2>
-<dl>
-<dt><b>_ElementInterface(tag, attrib)</b> (class) [<a href='#elementtree.ElementTree._ElementInterface-class'>#</a>]</dt>
-<dd>
-<p>Internal element class.  This class defines the Element interface,
-and provides a reference implementation of this interface.
-</p><p>
-You should not create instances of this class directly.  Use the
-appropriate factory functions instead, such as <a class="link" href="#elementtree.ElementTree.Element-function"><b>Element</b></a>
-and <a class="link" href="#elementtree.ElementTree.SubElement-function"><b>SubElement</b></a>.
-
-</p></dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.__delitem__-method' name='elementtree.ElementTree._ElementInterface.__delitem__-method'><b>__delitem__(index)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__delitem__-method'>#</a>]</dt>
-<dd>
-<p>Deletes the given subelement.</p>
-<dl>
-<dt><i>index</i></dt>
-<dd>
-What subelement to delete.</dd>
-<dt>Raises <b>IndexError</b>:</dt><dd>
-If the given element does not exist.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.__delslice__-method' name='elementtree.ElementTree._ElementInterface.__delslice__-method'><b>__delslice__(start, stop)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__delslice__-method'>#</a>]</dt>
-<dd>
-<p>Deletes a number of subelements.</p>
-<dl>
-<dt><i>start</i></dt>
-<dd>
-The first subelement to delete.</dd>
-<dt><i>stop</i></dt>
-<dd>
-The first subelement to leave in there.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.__getitem__-method' name='elementtree.ElementTree._ElementInterface.__getitem__-method'><b>__getitem__(index)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__getitem__-method'>#</a>]</dt>
-<dd>
-<p>Returns the given subelement.</p>
-<dl>
-<dt><i>index</i></dt>
-<dd>
-What subelement to return.</dd>
-<dt>Returns:</dt>
-<dd>
-The given subelement.</dd>
-<dt>Raises <b>IndexError</b>:</dt><dd>
-If the given element does not exist.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.__getslice__-method' name='elementtree.ElementTree._ElementInterface.__getslice__-method'><b>__getslice__(start, stop)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__getslice__-method'>#</a>]</dt>
-<dd>
-<p>Returns a list containing subelements in the given range.</p>
-<dl>
-<dt><i>start</i></dt>
-<dd>
-The first subelement to return.</dd>
-<dt><i>stop</i></dt>
-<dd>
-The first subelement that shouldn't be returned.</dd>
-<dt>Returns:</dt>
-<dd>
-A sequence object containing subelements.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.__len__-method' name='elementtree.ElementTree._ElementInterface.__len__-method'><b>__len__()</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__len__-method'>#</a>]</dt>
-<dd>
-<p>Returns the number of subelements.</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-The number of subelements.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.__setitem__-method' name='elementtree.ElementTree._ElementInterface.__setitem__-method'><b>__setitem__(index, element)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__setitem__-method'>#</a>]</dt>
-<dd>
-<p>Replaces the given subelement.</p>
-<dl>
-<dt><i>index</i></dt>
-<dd>
-What subelement to replace.</dd>
-<dt><i>element</i></dt>
-<dd>
-The new element value.</dd>
-<dt>Raises <b>IndexError</b>:</dt><dd>
-If the given element does not exist.</dd>
-<dt>Raises <b>AssertionError</b>:</dt><dd>
-If element is not a valid object.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.__setslice__-method' name='elementtree.ElementTree._ElementInterface.__setslice__-method'><b>__setslice__(start, stop, elements)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__setslice__-method'>#</a>]</dt>
-<dd>
-<p>Replaces a number of subelements with elements from a sequence.</p>
-<dl>
-<dt><i>start</i></dt>
-<dd>
-The first subelement to replace.</dd>
-<dt><i>stop</i></dt>
-<dd>
-The first subelement that shouldn't be replaced.</dd>
-<dt><i>elements</i></dt>
-<dd>
-A sequence object with zero or more elements.</dd>
-<dt>Raises <b>AssertionError</b>:</dt><dd>
-If a sequence member is not a valid object.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.append-method' name='elementtree.ElementTree._ElementInterface.append-method'><b>append(element)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.append-method'>#</a>]</dt>
-<dd>
-<p>Adds a subelement to the end of this element.</p>
-<dl>
-<dt><i>element</i></dt>
-<dd>
-The element to add.</dd>
-<dt>Raises <b>AssertionError</b>:</dt><dd>
-If a sequence member is not a valid object.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.attrib-attribute' name='elementtree.ElementTree._ElementInterface.attrib-attribute'><b>attrib</b></a> [<a href='#elementtree.ElementTree._ElementInterface.attrib-attribute'>#</a>]</dt>
-<dd>
-<p>(Attribute) Element attribute dictionary.  Where possible, use
-<a class="link" href="#elementtree.ElementTree._ElementInterface.get-method"><b>get</b></a>,
-<a class="link" href="#elementtree.ElementTree._ElementInterface.set-method"><b>set</b></a>,
-<a class="link" href="#elementtree.ElementTree._ElementInterface.keys-method"><b>keys</b></a>, and
-<a class="link" href="#elementtree.ElementTree._ElementInterface.items-method"><b>items</b></a> to access
-element attributes.
-</p></dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.clear-method' name='elementtree.ElementTree._ElementInterface.clear-method'><b>clear()</b></a> [<a href='#elementtree.ElementTree._ElementInterface.clear-method'>#</a>]</dt>
-<dd>
-<p>Resets an element.  This function removes all subelements, clears
-all attributes, and sets the text and tail attributes to None.</p>
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.find-method' name='elementtree.ElementTree._ElementInterface.find-method'><b>find(path)</b></a> &rArr; Element or None [<a href='#elementtree.ElementTree._ElementInterface.find-method'>#</a>]</dt>
-<dd>
-<p>Finds the first matching subelement, by tag name or path.</p>
-<dl>
-<dt><i>path</i></dt>
-<dd>
-What element to look for.</dd>
-<dt>Returns:</dt>
-<dd>
-The first matching element, or None if no element was found.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.findall-method' name='elementtree.ElementTree._ElementInterface.findall-method'><b>findall(path)</b></a> &rArr; list of Element instances [<a href='#elementtree.ElementTree._ElementInterface.findall-method'>#</a>]</dt>
-<dd>
-<p>Finds all matching subelements, by tag name or path.</p>
-<dl>
-<dt><i>path</i></dt>
-<dd>
-What element to look for.</dd>
-<dt>Returns:</dt>
-<dd>
-A list or iterator containing all matching elements,
-   in document order.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.findtext-method' name='elementtree.ElementTree._ElementInterface.findtext-method'><b>findtext(path, default=None)</b></a> &rArr; string [<a href='#elementtree.ElementTree._ElementInterface.findtext-method'>#</a>]</dt>
-<dd>
-<p>Finds text for the first matching subelement, by tag name or path.</p>
-<dl>
-<dt><i>path</i></dt>
-<dd>
-What element to look for.</dd>
-<dt><i>default</i></dt>
-<dd>
-What to return if the element was not found.</dd>
-<dt>Returns:</dt>
-<dd>
-The text content of the first matching element, or the
-    default value no element was found.  Note that if the element
-    has is found, but has no text content, this method returns an
-    empty string.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.get-method' name='elementtree.ElementTree._ElementInterface.get-method'><b>get(key, default=None)</b></a> &rArr; string or None [<a href='#elementtree.ElementTree._ElementInterface.get-method'>#</a>]</dt>
-<dd>
-<p>Gets an element attribute.</p>
-<dl>
-<dt><i>key</i></dt>
-<dd>
-What attribute to look for.</dd>
-<dt><i>default</i></dt>
-<dd>
-What to return if the attribute was not found.</dd>
-<dt>Returns:</dt>
-<dd>
-The attribute value, or the default value, if the
-    attribute was not found.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.getchildren-method' name='elementtree.ElementTree._ElementInterface.getchildren-method'><b>getchildren()</b></a> &rArr; list of Element instances [<a href='#elementtree.ElementTree._ElementInterface.getchildren-method'>#</a>]</dt>
-<dd>
-<p>Returns all subelements.  The elements are returned in document
-order.</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-A list of subelements.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.getiterator-method' name='elementtree.ElementTree._ElementInterface.getiterator-method'><b>getiterator(tag=None)</b></a> &rArr; list or iterator [<a href='#elementtree.ElementTree._ElementInterface.getiterator-method'>#</a>]</dt>
-<dd>
-<p>Creates a tree iterator.  The iterator loops over this element
-and all subelements, in document order, and returns all elements
-with a matching tag.
-</p><p>
-If the tree structure is modified during iteration, the result
-is undefined.
-
-</p><dl>
-<dt><i>tag</i></dt>
-<dd>
-What tags to look for (default is to return all elements).</dd>
-<dt>Returns:</dt>
-<dd>
-A list or iterator containing all the matching elements.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.insert-method' name='elementtree.ElementTree._ElementInterface.insert-method'><b>insert(index, element)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.insert-method'>#</a>]</dt>
-<dd>
-<p>Inserts a subelement at the given position in this element.</p>
-<dl>
-<dt><i>index</i></dt>
-<dd>
-Where to insert the new subelement.</dd>
-<dt>Raises <b>AssertionError</b>:</dt><dd>
-If the element is not a valid object.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.items-method' name='elementtree.ElementTree._ElementInterface.items-method'><b>items()</b></a> &rArr; list of (string, string) tuples [<a href='#elementtree.ElementTree._ElementInterface.items-method'>#</a>]</dt>
-<dd>
-<p>Gets element attributes, as a sequence.  The attributes are
-returned in an arbitrary order.</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-A list of (name, value) tuples for all attributes.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.keys-method' name='elementtree.ElementTree._ElementInterface.keys-method'><b>keys()</b></a> &rArr; list of strings [<a href='#elementtree.ElementTree._ElementInterface.keys-method'>#</a>]</dt>
-<dd>
-<p>Gets a list of attribute names.  The names are returned in an
-arbitrary order (just like for an ordinary Python dictionary).</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-A list of element attribute names.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.makeelement-method' name='elementtree.ElementTree._ElementInterface.makeelement-method'><b>makeelement(tag, attrib)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.makeelement-method'>#</a>]</dt>
-<dd>
-<p>Creates a new element object of the same type as this element.</p>
-<dl>
-<dt><i>tag</i></dt>
-<dd>
-Element tag.</dd>
-<dt><i>attrib</i></dt>
-<dd>
-Element attributes, given as a dictionary.</dd>
-<dt>Returns:</dt>
-<dd>
-A new element instance.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.remove-method' name='elementtree.ElementTree._ElementInterface.remove-method'><b>remove(element)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.remove-method'>#</a>]</dt>
-<dd>
-<p>Removes a matching subelement.  Unlike the <b>find</b> methods,
-this method compares elements based on identity, not on tag
-value or contents.
-
-</p><dl>
-<dt><i>element</i></dt>
-<dd>
-What element to remove.</dd>
-<dt>Raises <b>ValueError</b>:</dt><dd>
-If a matching element could not be found.</dd>
-<dt>Raises <b>AssertionError</b>:</dt><dd>
-If the element is not a valid object.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.set-method' name='elementtree.ElementTree._ElementInterface.set-method'><b>set(key, value)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.set-method'>#</a>]</dt>
-<dd>
-<p>Sets an element attribute.</p>
-<dl>
-<dt><i>key</i></dt>
-<dd>
-What attribute to set.</dd>
-<dt><i>value</i></dt>
-<dd>
-The attribute value.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.tag-attribute' name='elementtree.ElementTree._ElementInterface.tag-attribute'><b>tag</b></a> [<a href='#elementtree.ElementTree._ElementInterface.tag-attribute'>#</a>]</dt>
-<dd>
-<p>(Attribute) Element tag.</p>
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.tail-attribute' name='elementtree.ElementTree._ElementInterface.tail-attribute'><b>tail</b></a> [<a href='#elementtree.ElementTree._ElementInterface.tail-attribute'>#</a>]</dt>
-<dd>
-<p>(Attribute) 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.</p>
-</dd>
-<dt><a id='elementtree.ElementTree._ElementInterface.text-attribute' name='elementtree.ElementTree._ElementInterface.text-attribute'><b>text</b></a> [<a href='#elementtree.ElementTree._ElementInterface.text-attribute'>#</a>]</dt>
-<dd>
-<p>(Attribute) Text before first subelement.  This is either a
-string or the value None, if there was no text.</p>
-</dd>
-</dl>
-<h2><a id='elementtree.ElementTree.ElementTree-class' name='elementtree.ElementTree.ElementTree-class'>The ElementTree Class</a></h2>
-<dl>
-<dt><b>ElementTree(element=None, file=None)</b> (class) [<a href='#elementtree.ElementTree.ElementTree-class'>#</a>]</dt>
-<dd>
-<p>ElementTree wrapper class.  This class represents an entire element
-hierarchy, and adds some extra support for serialization to and from
-standard XML.</p>
-<dl>
-<dt><i>element</i></dt>
-<dd>
-Optional root element.</dd>
-<dt><i>file=</i></dt>
-<dd>
-Optional file handle or name.  If given, the
-    tree is initialized with the contents of this XML file.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.ElementTree._setroot-method' name='elementtree.ElementTree.ElementTree._setroot-method'><b>_setroot(element)</b></a> [<a href='#elementtree.ElementTree.ElementTree._setroot-method'>#</a>]</dt>
-<dd>
-<p>Replaces the root element for this tree.  This discards the
-current contents of the tree, and replaces it with the given
-element.  Use with care.</p>
-<dl>
-<dt><i>element</i></dt>
-<dd>
-An element instance.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.ElementTree.find-method' name='elementtree.ElementTree.ElementTree.find-method'><b>find(path)</b></a> &rArr; Element or None [<a href='#elementtree.ElementTree.ElementTree.find-method'>#</a>]</dt>
-<dd>
-<p>Finds the first toplevel element with given tag.
-Same as getroot().find(path).</p>
-<dl>
-<dt><i>path</i></dt>
-<dd>
-What element to look for.</dd>
-<dt>Returns:</dt>
-<dd>
-The first matching element, or None if no element was found.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.ElementTree.findall-method' name='elementtree.ElementTree.ElementTree.findall-method'><b>findall(path)</b></a> &rArr; list of Element instances [<a href='#elementtree.ElementTree.ElementTree.findall-method'>#</a>]</dt>
-<dd>
-<p>Finds all toplevel elements with the given tag.
-Same as getroot().findall(path).</p>
-<dl>
-<dt><i>path</i></dt>
-<dd>
-What element to look for.</dd>
-<dt>Returns:</dt>
-<dd>
-A list or iterator containing all matching elements,
-   in document order.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.ElementTree.findtext-method' name='elementtree.ElementTree.ElementTree.findtext-method'><b>findtext(path, default=None)</b></a> &rArr; string [<a href='#elementtree.ElementTree.ElementTree.findtext-method'>#</a>]</dt>
-<dd>
-<p>Finds the element text for the first toplevel element with given
-tag.  Same as getroot().findtext(path).</p>
-<dl>
-<dt><i>path</i></dt>
-<dd>
-What toplevel element to look for.</dd>
-<dt><i>default</i></dt>
-<dd>
-What to return if the element was not found.</dd>
-<dt>Returns:</dt>
-<dd>
-The text content of the first matching element, or the
-    default value no element was found.  Note that if the element
-    has is found, but has no text content, this method returns an
-    empty string.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.ElementTree.getiterator-method' name='elementtree.ElementTree.ElementTree.getiterator-method'><b>getiterator(tag=None)</b></a> &rArr; iterator [<a href='#elementtree.ElementTree.ElementTree.getiterator-method'>#</a>]</dt>
-<dd>
-<p>Creates a tree iterator for the root element.  The iterator loops
-over all elements in this tree, in document order.</p>
-<dl>
-<dt><i>tag</i></dt>
-<dd>
-What tags to look for (default is to return all elements)</dd>
-<dt>Returns:</dt>
-<dd>
-An iterator.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.ElementTree.getroot-method' name='elementtree.ElementTree.ElementTree.getroot-method'><b>getroot()</b></a> &rArr; Element [<a href='#elementtree.ElementTree.ElementTree.getroot-method'>#</a>]</dt>
-<dd>
-<p>Gets the root element for this tree.</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-An element instance.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.ElementTree.parse-method' name='elementtree.ElementTree.ElementTree.parse-method'><b>parse(source, parser=None)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.ElementTree.parse-method'>#</a>]</dt>
-<dd>
-<p>Loads an external XML document into this element tree.</p>
-<dl>
-<dt><i>source</i></dt>
-<dd>
-A file name or file object.</dd>
-<dt><i>parser</i></dt>
-<dd>
-An optional parser instance.  If not given, the
-    standard <a class="link" href="#elementtree.ElementTree.XMLTreeBuilder-class"><b>XMLTreeBuilder</b></a> parser is used.
-</dd>
-<dt>Returns:</dt>
-<dd>
-The document root element.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.ElementTree.write-method' name='elementtree.ElementTree.ElementTree.write-method'><b>write(file, encoding=&quot;us-ascii&quot;)</b></a> [<a href='#elementtree.ElementTree.ElementTree.write-method'>#</a>]</dt>
-<dd>
-<p>Writes the element tree to a file, as XML.</p>
-<dl>
-<dt><i>file</i></dt>
-<dd>
-A file name, or a file object opened for writing.</dd>
-<dt><i>encoding</i></dt>
-<dd>
-Optional output encoding (default is US-ASCII).</dd>
-</dl><br />
-</dd>
-</dl>
-<h2><a id='elementtree.ElementTree.iterparse-class' name='elementtree.ElementTree.iterparse-class'>The iterparse Class</a></h2>
-<dl>
-<dt><b>iterparse(source, events=None)</b> (class) [<a href='#elementtree.ElementTree.iterparse-class'>#</a>]</dt>
-<dd>
-<p>Parses an XML document into an element tree incrementally, and reports
-what's going on to the user.</p>
-<dl>
-<dt><i>source</i></dt>
-<dd>
-A filename or file object containing XML data.</dd>
-<dt><i>events</i></dt>
-<dd>
-A list of events to report back.  If omitted, only &quot;end&quot;
-    events are reported.</dd>
-<dt>Returns:</dt>
-<dd>
-A (event, elem) iterator.</dd>
-</dl><br />
-</dd>
-</dl>
-<h2><a id='elementtree.ElementTree.QName-class' name='elementtree.ElementTree.QName-class'>The QName Class</a></h2>
-<dl>
-<dt><b>QName(text_or_uri, tag=None)</b> (class) [<a href='#elementtree.ElementTree.QName-class'>#</a>]</dt>
-<dd>
-<p>QName wrapper.  This can be used to wrap a QName attribute value, in
-order to get proper namespace handling on output.</p>
-<dl>
-<dt><i>text</i></dt>
-<dd>
-A string containing the QName value, in the form {uri}local,
-    or, if the tag argument is given, the URI part of a QName.</dd>
-<dt><i>tag</i></dt>
-<dd>
-Optional tag.  If given, the first argument is interpreted as
-    an URI, and this argument is interpreted as a local name.</dd>
-<dt>Returns:</dt>
-<dd>
-An opaque object, representing the QName.</dd>
-</dl><br />
-</dd>
-</dl>
-<h2><a id='elementtree.ElementTree.TreeBuilder-class' name='elementtree.ElementTree.TreeBuilder-class'>The TreeBuilder Class</a></h2>
-<dl>
-<dt><b>TreeBuilder(element_factory=None)</b> (class) [<a href='#elementtree.ElementTree.TreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>Generic element structure builder.  This builder converts a sequence
-of <a class="link" href="#elementtree.ElementTree.TreeBuilder.start-method"><b>start</b></a>, <a class="link" href="#elementtree.ElementTree.TreeBuilder.data-method"><b>data</b></a>, and <a class="link" href="#elementtree.ElementTree.TreeBuilder.end-method"><b>end</b></a> method calls to a well-formed element structure.
-</p><p>
-You can use this class to build an element structure using a custom XML
-parser, or a parser for some other XML-like format.
-
-</p><dl>
-<dt><i>element_factory</i></dt>
-<dd>
-Optional element factory.  This factory
-   is called to create new Element instances, as necessary.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.TreeBuilder.close-method' name='elementtree.ElementTree.TreeBuilder.close-method'><b>close()</b></a> &rArr; Element [<a href='#elementtree.ElementTree.TreeBuilder.close-method'>#</a>]</dt>
-<dd>
-<p>Flushes the parser buffers, and returns the toplevel documen
-element.</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-An Element instance.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.TreeBuilder.data-method' name='elementtree.ElementTree.TreeBuilder.data-method'><b>data(data)</b></a> [<a href='#elementtree.ElementTree.TreeBuilder.data-method'>#</a>]</dt>
-<dd>
-<p>Adds text to the current element.</p>
-<dl>
-<dt><i>data</i></dt>
-<dd>
-A string.  This should be either an 8-bit string
-   containing ASCII text, or a Unicode string.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.TreeBuilder.end-method' name='elementtree.ElementTree.TreeBuilder.end-method'><b>end(tag)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.TreeBuilder.end-method'>#</a>]</dt>
-<dd>
-<p>Closes the current element.</p>
-<dl>
-<dt><i>tag</i></dt>
-<dd>
-The element name.</dd>
-<dt>Returns:</dt>
-<dd>
-The closed element.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.TreeBuilder.start-method' name='elementtree.ElementTree.TreeBuilder.start-method'><b>start(tag, attrs)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.TreeBuilder.start-method'>#</a>]</dt>
-<dd>
-<p>Opens a new element.</p>
-<dl>
-<dt><i>tag</i></dt>
-<dd>
-The element name.</dd>
-<dt><i>attrib</i></dt>
-<dd>
-A dictionary containing element attributes.</dd>
-<dt>Returns:</dt>
-<dd>
-The opened element.</dd>
-</dl><br />
-</dd>
-</dl>
-<h2><a id='elementtree.ElementTree.XMLTreeBuilder-class' name='elementtree.ElementTree.XMLTreeBuilder-class'>The XMLTreeBuilder Class</a></h2>
-<dl>
-<dt><b>XMLTreeBuilder(html=0, target=None)</b> (class) [<a href='#elementtree.ElementTree.XMLTreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>Element structure builder for XML source data, based on the
-<b>expat</b> parser.
-
-</p><dl>
-<dt><i>target=</i></dt>
-<dd>
-Target object.  If omitted, the builder uses an
-    instance of the standard <a class="link" href="#elementtree.ElementTree.TreeBuilder-class"><b>TreeBuilder</b></a> class.
-</dd>
-<dt><i>html=</i></dt>
-<dd>
-Predefine HTML entities.  This flag is not supported
-    by the current implementation.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.XMLTreeBuilder.close-method' name='elementtree.ElementTree.XMLTreeBuilder.close-method'><b>close()</b></a> &rArr; Element [<a href='#elementtree.ElementTree.XMLTreeBuilder.close-method'>#</a>]</dt>
-<dd>
-<p>Finishes feeding data to the parser.</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-An element structure.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.XMLTreeBuilder.doctype-method' name='elementtree.ElementTree.XMLTreeBuilder.doctype-method'><b>doctype(name, pubid, system)</b></a> [<a href='#elementtree.ElementTree.XMLTreeBuilder.doctype-method'>#</a>]</dt>
-<dd>
-<p>Handles a doctype declaration.</p>
-<dl>
-<dt><i>name</i></dt>
-<dd>
-Doctype name.</dd>
-<dt><i>pubid</i></dt>
-<dd>
-Public identifier.</dd>
-<dt><i>system</i></dt>
-<dd>
-System identifier.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.ElementTree.XMLTreeBuilder.feed-method' name='elementtree.ElementTree.XMLTreeBuilder.feed-method'><b>feed(data)</b></a> [<a href='#elementtree.ElementTree.XMLTreeBuilder.feed-method'>#</a>]</dt>
-<dd>
-<p>Feeds data to the parser.</p>
-<dl>
-<dt><i>data</i></dt>
-<dd>
-Encoded data.</dd>
-</dl><br />
-</dd>
-</dl>
-</body></html>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree.ElementTree Module</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree.ElementTree Module</h1>
+<p>The <b>Element</b> type is a flexible container object, designed to
+store hierarchical data structures in memory. The type can be
+described as a cross between a list and a dictionary.
+</p><p>
+Each element has a number of properties associated with it:
+<ul>
+<li>a <i>tag</i>. This is a string identifying what kind of data
+this element represents (the element type, in other words).</li>
+<li>a number of <i>attributes</i>, stored in a Python dictionary.</li>
+<li>a <i>text</i> string.</li>
+<li>an optional <i>tail</i> string.</li>
+<li>a number of <i>child elements</i>, stored in a Python sequence</li>
+</ul>
+
+To create an element instance, use the <a class="link" href="#elementtree.ElementTree.Element-function"><b>Element</b></a> or <a class="link" href="#elementtree.ElementTree.SubElement-function"><b>SubElement</b></a> factory functions.
+</p><p>
+The <a class="link" href="#elementtree.ElementTree.ElementTree-class"><b>ElementTree</b></a> class can be used to wrap an element
+structure, and convert it from and to XML.
+</p><h2>Module Contents</h2>
+<dl>
+<dt><b>_ElementInterface(tag, attrib)</b> (class) [<a href='#elementtree.ElementTree._ElementInterface-class'>#</a>]</dt>
+<dd>
+<p>Internal element class.</p>
+<p>For more information about this class, see <a href='#elementtree.ElementTree._ElementInterface-class'><i>The _ElementInterface Class</i></a>.</p>
+</dd>
+<dt><a id='elementtree.ElementTree.Comment-function' name='elementtree.ElementTree.Comment-function'><b>Comment(text=None)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.Comment-function'>#</a>]</dt>
+<dd>
+<p>Comment element factory.  This factory function creates a special
+element that will be serialized as an XML comment.
+</p><p>
+The comment string can be either an 8-bit ASCII string or a Unicode
+string.
+
+</p><dl>
+<dt><i>text</i></dt>
+<dd>
+A string containing the comment string.</dd>
+<dt>Returns:</dt>
+<dd>
+An element instance, representing a comment.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.dump-function' name='elementtree.ElementTree.dump-function'><b>dump(elem)</b></a> [<a href='#elementtree.ElementTree.dump-function'>#</a>]</dt>
+<dd>
+<p>Writes an element tree or element structure to sys.stdout.  This
+function should be used for debugging only.
+</p><p>
+The exact output format is implementation dependent.  In this
+version, it's written as an ordinary XML file.
+
+</p><dl>
+<dt><i>elem</i></dt>
+<dd>
+An element tree or an individual element.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.Element-function' name='elementtree.ElementTree.Element-function'><b>Element(tag, attrib={}, **extra)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.Element-function'>#</a>]</dt>
+<dd>
+<p>Element factory.  This function returns an object implementing the
+standard Element interface.  The exact class or type of that object
+is implementation dependent, but it will always be compatible with
+the <a class="link" href="#elementtree.ElementTree._ElementInterface-class"><b>_ElementInterface</b></a> class in this module.
+</p><p>
+The element name, attribute names, and attribute values can be
+either 8-bit ASCII strings or Unicode strings.
+
+</p><dl>
+<dt><i>tag</i></dt>
+<dd>
+The element name.</dd>
+<dt><i>attrib</i></dt>
+<dd>
+An optional dictionary, containing element attributes.</dd>
+<dt><i>**extra</i></dt>
+<dd>
+Additional attributes, given as keyword arguments.</dd>
+<dt>Returns:</dt>
+<dd>
+An element instance.</dd>
+</dl><br />
+</dd>
+<dt><b>ElementTree(element=None, file=None)</b> (class) [<a href='#elementtree.ElementTree.ElementTree-class'>#</a>]</dt>
+<dd>
+<p>ElementTree wrapper class.</p>
+<dl>
+<dt><i>element</i></dt>
+<dd>
+Optional root element.</dd>
+<dt><i>file=</i></dt>
+<dd>
+Optional file handle or name.  If given, the
+    tree is initialized with the contents of this XML file.</dd>
+</dl><br />
+<p>For more information about this class, see <a href='#elementtree.ElementTree.ElementTree-class'><i>The ElementTree Class</i></a>.</p>
+</dd>
+<dt><a id='elementtree.ElementTree.fromstring-variable' name='elementtree.ElementTree.fromstring-variable'><b>fromstring</b></a> (variable) [<a href='#elementtree.ElementTree.fromstring-variable'>#</a>]</dt>
+<dd>
+<p>Parses an XML document from a string constant.  Same as <a class="link" href="#elementtree.ElementTree.XML-function"><b>XML</b></a>.
+
+</p><dl>
+<dt><i>source</i></dt>
+<dd>
+A string containing XML data.</dd>
+<dt>Returns:</dt>
+<dd>
+An Element instance.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.iselement-function' name='elementtree.ElementTree.iselement-function'><b>iselement(element)</b></a> &rArr; flag [<a href='#elementtree.ElementTree.iselement-function'>#</a>]</dt>
+<dd>
+<p>Checks if an object appears to be a valid element object.</p>
+<dl>
+<dt><i>An</i></dt>
+<dd>
+element instance.</dd>
+<dt>Returns:</dt>
+<dd>
+A true value if this is an element object.</dd>
+</dl><br />
+</dd>
+<dt><b>iterparse(source, events=None)</b> (class) [<a href='#elementtree.ElementTree.iterparse-class'>#</a>]</dt>
+<dd>
+<p>Parses an XML document into an element tree incrementally, and reports
+what's going on to the user.</p>
+<dl>
+<dt><i>source</i></dt>
+<dd>
+A filename or file object containing XML data.</dd>
+<dt><i>events</i></dt>
+<dd>
+A list of events to report back.  If omitted, only &quot;end&quot;
+    events are reported.</dd>
+<dt>Returns:</dt>
+<dd>
+A (event, elem) iterator.</dd>
+</dl><br />
+<p>For more information about this class, see <a href='#elementtree.ElementTree.iterparse-class'><i>The iterparse Class</i></a>.</p>
+</dd>
+<dt><a id='elementtree.ElementTree.parse-function' name='elementtree.ElementTree.parse-function'><b>parse(source, parser=None)</b></a> [<a href='#elementtree.ElementTree.parse-function'>#</a>]</dt>
+<dd>
+<p>Parses an XML document into an element tree.</p>
+<dl>
+<dt><i>source</i></dt>
+<dd>
+A filename or file object containing XML data.</dd>
+<dt><i>parser</i></dt>
+<dd>
+An optional parser instance.  If not given, the
+    standard <a class="link" href="#elementtree.ElementTree.XMLTreeBuilder-class"><b>XMLTreeBuilder</b></a> parser is used.
+</dd>
+<dt>Returns:</dt>
+<dd>
+An ElementTree instance</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.ProcessingInstruction-function' name='elementtree.ElementTree.ProcessingInstruction-function'><b>ProcessingInstruction(target, text=None)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.ProcessingInstruction-function'>#</a>]</dt>
+<dd>
+<p>PI element factory.  This factory function creates a special element
+that will be serialized as an XML processing instruction.</p>
+<dl>
+<dt><i>target</i></dt>
+<dd>
+A string containing the PI target.</dd>
+<dt><i>text</i></dt>
+<dd>
+A string containing the PI contents, if any.</dd>
+<dt>Returns:</dt>
+<dd>
+An element instance, representing a PI.</dd>
+</dl><br />
+</dd>
+<dt><b>QName(text_or_uri, tag=None)</b> (class) [<a href='#elementtree.ElementTree.QName-class'>#</a>]</dt>
+<dd>
+<p>QName wrapper.</p>
+<dl>
+<dt><i>text</i></dt>
+<dd>
+A string containing the QName value, in the form {uri}local,
+    or, if the tag argument is given, the URI part of a QName.</dd>
+<dt><i>tag</i></dt>
+<dd>
+Optional tag.  If given, the first argument is interpreted as
+    an URI, and this argument is interpreted as a local name.</dd>
+<dt>Returns:</dt>
+<dd>
+An opaque object, representing the QName.</dd>
+</dl><br />
+<p>For more information about this class, see <a href='#elementtree.ElementTree.QName-class'><i>The QName Class</i></a>.</p>
+</dd>
+<dt><a id='elementtree.ElementTree.SubElement-function' name='elementtree.ElementTree.SubElement-function'><b>SubElement(parent, tag, attrib={}, **extra)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.SubElement-function'>#</a>]</dt>
+<dd>
+<p>Subelement factory.  This function creates an element instance, and
+appends it to an existing element.
+</p><p>
+The element name, attribute names, and attribute values can be
+either 8-bit ASCII strings or Unicode strings.
+
+</p><dl>
+<dt><i>parent</i></dt>
+<dd>
+The parent element.</dd>
+<dt><i>tag</i></dt>
+<dd>
+The subelement name.</dd>
+<dt><i>attrib</i></dt>
+<dd>
+An optional dictionary, containing element attributes.</dd>
+<dt><i>**extra</i></dt>
+<dd>
+Additional attributes, given as keyword arguments.</dd>
+<dt>Returns:</dt>
+<dd>
+An element instance.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.tostring-function' name='elementtree.ElementTree.tostring-function'><b>tostring(element, encoding=None)</b></a> &rArr; string [<a href='#elementtree.ElementTree.tostring-function'>#</a>]</dt>
+<dd>
+<p>Generates a string representation of an XML element, including all
+subelements.</p>
+<dl>
+<dt><i>element</i></dt>
+<dd>
+An Element instance.</dd>
+<dt>Returns:</dt>
+<dd>
+An encoded string containing the XML data.</dd>
+</dl><br />
+</dd>
+<dt><b>TreeBuilder(element_factory=None)</b> (class) [<a href='#elementtree.ElementTree.TreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>Generic element structure builder.</p>
+<dl>
+<dt><i>element_factory</i></dt>
+<dd>
+Optional element factory.  This factory
+   is called to create new Element instances, as necessary.</dd>
+</dl><br />
+<p>For more information about this class, see <a href='#elementtree.ElementTree.TreeBuilder-class'><i>The TreeBuilder Class</i></a>.</p>
+</dd>
+<dt><a id='elementtree.ElementTree.XML-function' name='elementtree.ElementTree.XML-function'><b>XML(text)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.XML-function'>#</a>]</dt>
+<dd>
+<p>Parses an XML document from a string constant.  This function can
+be used to embed &quot;XML literals&quot; in Python code.</p>
+<dl>
+<dt><i>source</i></dt>
+<dd>
+A string containing XML data.</dd>
+<dt>Returns:</dt>
+<dd>
+An Element instance.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.XMLID-function' name='elementtree.ElementTree.XMLID-function'><b>XMLID(text)</b></a> &rArr; (Element, dictionary) [<a href='#elementtree.ElementTree.XMLID-function'>#</a>]</dt>
+<dd>
+<p>Parses an XML document from a string constant, and also returns
+a dictionary which maps from element id:s to elements.</p>
+<dl>
+<dt><i>source</i></dt>
+<dd>
+A string containing XML data.</dd>
+<dt>Returns:</dt>
+<dd>
+A tuple containing an Element instance and a dictionary.</dd>
+</dl><br />
+</dd>
+<dt><b>XMLTreeBuilder(html=0, target=None)</b> (class) [<a href='#elementtree.ElementTree.XMLTreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>Element structure builder for XML source data, based on the
+expat parser.</p>
+<dl>
+<dt><i>target=</i></dt>
+<dd>
+Target object.  If omitted, the builder uses an
+    instance of the standard <a class="link" href="#elementtree.ElementTree.TreeBuilder-class"><b>TreeBuilder</b></a> class.
+</dd>
+<dt><i>html=</i></dt>
+<dd>
+Predefine HTML entities.  This flag is not supported
+    by the current implementation.</dd>
+</dl><br />
+<p>For more information about this class, see <a href='#elementtree.ElementTree.XMLTreeBuilder-class'><i>The XMLTreeBuilder Class</i></a>.</p>
+</dd>
+</dl>
+<h2><a id='elementtree.ElementTree._ElementInterface-class' name='elementtree.ElementTree._ElementInterface-class'>The _ElementInterface Class</a></h2>
+<dl>
+<dt><b>_ElementInterface(tag, attrib)</b> (class) [<a href='#elementtree.ElementTree._ElementInterface-class'>#</a>]</dt>
+<dd>
+<p>Internal element class.  This class defines the Element interface,
+and provides a reference implementation of this interface.
+</p><p>
+You should not create instances of this class directly.  Use the
+appropriate factory functions instead, such as <a class="link" href="#elementtree.ElementTree.Element-function"><b>Element</b></a>
+and <a class="link" href="#elementtree.ElementTree.SubElement-function"><b>SubElement</b></a>.
+
+</p></dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.__delitem__-method' name='elementtree.ElementTree._ElementInterface.__delitem__-method'><b>__delitem__(index)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__delitem__-method'>#</a>]</dt>
+<dd>
+<p>Deletes the given subelement.</p>
+<dl>
+<dt><i>index</i></dt>
+<dd>
+What subelement to delete.</dd>
+<dt>Raises <b>IndexError</b>:</dt><dd>
+If the given element does not exist.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.__delslice__-method' name='elementtree.ElementTree._ElementInterface.__delslice__-method'><b>__delslice__(start, stop)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__delslice__-method'>#</a>]</dt>
+<dd>
+<p>Deletes a number of subelements.</p>
+<dl>
+<dt><i>start</i></dt>
+<dd>
+The first subelement to delete.</dd>
+<dt><i>stop</i></dt>
+<dd>
+The first subelement to leave in there.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.__getitem__-method' name='elementtree.ElementTree._ElementInterface.__getitem__-method'><b>__getitem__(index)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__getitem__-method'>#</a>]</dt>
+<dd>
+<p>Returns the given subelement.</p>
+<dl>
+<dt><i>index</i></dt>
+<dd>
+What subelement to return.</dd>
+<dt>Returns:</dt>
+<dd>
+The given subelement.</dd>
+<dt>Raises <b>IndexError</b>:</dt><dd>
+If the given element does not exist.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.__getslice__-method' name='elementtree.ElementTree._ElementInterface.__getslice__-method'><b>__getslice__(start, stop)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__getslice__-method'>#</a>]</dt>
+<dd>
+<p>Returns a list containing subelements in the given range.</p>
+<dl>
+<dt><i>start</i></dt>
+<dd>
+The first subelement to return.</dd>
+<dt><i>stop</i></dt>
+<dd>
+The first subelement that shouldn't be returned.</dd>
+<dt>Returns:</dt>
+<dd>
+A sequence object containing subelements.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.__len__-method' name='elementtree.ElementTree._ElementInterface.__len__-method'><b>__len__()</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__len__-method'>#</a>]</dt>
+<dd>
+<p>Returns the number of subelements.</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+The number of subelements.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.__setitem__-method' name='elementtree.ElementTree._ElementInterface.__setitem__-method'><b>__setitem__(index, element)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__setitem__-method'>#</a>]</dt>
+<dd>
+<p>Replaces the given subelement.</p>
+<dl>
+<dt><i>index</i></dt>
+<dd>
+What subelement to replace.</dd>
+<dt><i>element</i></dt>
+<dd>
+The new element value.</dd>
+<dt>Raises <b>IndexError</b>:</dt><dd>
+If the given element does not exist.</dd>
+<dt>Raises <b>AssertionError</b>:</dt><dd>
+If element is not a valid object.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.__setslice__-method' name='elementtree.ElementTree._ElementInterface.__setslice__-method'><b>__setslice__(start, stop, elements)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.__setslice__-method'>#</a>]</dt>
+<dd>
+<p>Replaces a number of subelements with elements from a sequence.</p>
+<dl>
+<dt><i>start</i></dt>
+<dd>
+The first subelement to replace.</dd>
+<dt><i>stop</i></dt>
+<dd>
+The first subelement that shouldn't be replaced.</dd>
+<dt><i>elements</i></dt>
+<dd>
+A sequence object with zero or more elements.</dd>
+<dt>Raises <b>AssertionError</b>:</dt><dd>
+If a sequence member is not a valid object.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.append-method' name='elementtree.ElementTree._ElementInterface.append-method'><b>append(element)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.append-method'>#</a>]</dt>
+<dd>
+<p>Adds a subelement to the end of this element.</p>
+<dl>
+<dt><i>element</i></dt>
+<dd>
+The element to add.</dd>
+<dt>Raises <b>AssertionError</b>:</dt><dd>
+If a sequence member is not a valid object.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.attrib-attribute' name='elementtree.ElementTree._ElementInterface.attrib-attribute'><b>attrib</b></a> [<a href='#elementtree.ElementTree._ElementInterface.attrib-attribute'>#</a>]</dt>
+<dd>
+<p>(Attribute) Element attribute dictionary.  Where possible, use
+<a class="link" href="#elementtree.ElementTree._ElementInterface.get-method"><b>get</b></a>,
+<a class="link" href="#elementtree.ElementTree._ElementInterface.set-method"><b>set</b></a>,
+<a class="link" href="#elementtree.ElementTree._ElementInterface.keys-method"><b>keys</b></a>, and
+<a class="link" href="#elementtree.ElementTree._ElementInterface.items-method"><b>items</b></a> to access
+element attributes.
+</p></dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.clear-method' name='elementtree.ElementTree._ElementInterface.clear-method'><b>clear()</b></a> [<a href='#elementtree.ElementTree._ElementInterface.clear-method'>#</a>]</dt>
+<dd>
+<p>Resets an element.  This function removes all subelements, clears
+all attributes, and sets the text and tail attributes to None.</p>
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.find-method' name='elementtree.ElementTree._ElementInterface.find-method'><b>find(path)</b></a> &rArr; Element or None [<a href='#elementtree.ElementTree._ElementInterface.find-method'>#</a>]</dt>
+<dd>
+<p>Finds the first matching subelement, by tag name or path.</p>
+<dl>
+<dt><i>path</i></dt>
+<dd>
+What element to look for.</dd>
+<dt>Returns:</dt>
+<dd>
+The first matching element, or None if no element was found.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.findall-method' name='elementtree.ElementTree._ElementInterface.findall-method'><b>findall(path)</b></a> &rArr; list of Element instances [<a href='#elementtree.ElementTree._ElementInterface.findall-method'>#</a>]</dt>
+<dd>
+<p>Finds all matching subelements, by tag name or path.</p>
+<dl>
+<dt><i>path</i></dt>
+<dd>
+What element to look for.</dd>
+<dt>Returns:</dt>
+<dd>
+A list or iterator containing all matching elements,
+   in document order.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.findtext-method' name='elementtree.ElementTree._ElementInterface.findtext-method'><b>findtext(path, default=None)</b></a> &rArr; string [<a href='#elementtree.ElementTree._ElementInterface.findtext-method'>#</a>]</dt>
+<dd>
+<p>Finds text for the first matching subelement, by tag name or path.</p>
+<dl>
+<dt><i>path</i></dt>
+<dd>
+What element to look for.</dd>
+<dt><i>default</i></dt>
+<dd>
+What to return if the element was not found.</dd>
+<dt>Returns:</dt>
+<dd>
+The text content of the first matching element, or the
+    default value no element was found.  Note that if the element
+    has is found, but has no text content, this method returns an
+    empty string.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.get-method' name='elementtree.ElementTree._ElementInterface.get-method'><b>get(key, default=None)</b></a> &rArr; string or None [<a href='#elementtree.ElementTree._ElementInterface.get-method'>#</a>]</dt>
+<dd>
+<p>Gets an element attribute.</p>
+<dl>
+<dt><i>key</i></dt>
+<dd>
+What attribute to look for.</dd>
+<dt><i>default</i></dt>
+<dd>
+What to return if the attribute was not found.</dd>
+<dt>Returns:</dt>
+<dd>
+The attribute value, or the default value, if the
+    attribute was not found.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.getchildren-method' name='elementtree.ElementTree._ElementInterface.getchildren-method'><b>getchildren()</b></a> &rArr; list of Element instances [<a href='#elementtree.ElementTree._ElementInterface.getchildren-method'>#</a>]</dt>
+<dd>
+<p>Returns all subelements.  The elements are returned in document
+order.</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+A list of subelements.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.getiterator-method' name='elementtree.ElementTree._ElementInterface.getiterator-method'><b>getiterator(tag=None)</b></a> &rArr; list or iterator [<a href='#elementtree.ElementTree._ElementInterface.getiterator-method'>#</a>]</dt>
+<dd>
+<p>Creates a tree iterator.  The iterator loops over this element
+and all subelements, in document order, and returns all elements
+with a matching tag.
+</p><p>
+If the tree structure is modified during iteration, the result
+is undefined.
+
+</p><dl>
+<dt><i>tag</i></dt>
+<dd>
+What tags to look for (default is to return all elements).</dd>
+<dt>Returns:</dt>
+<dd>
+A list or iterator containing all the matching elements.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.insert-method' name='elementtree.ElementTree._ElementInterface.insert-method'><b>insert(index, element)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.insert-method'>#</a>]</dt>
+<dd>
+<p>Inserts a subelement at the given position in this element.</p>
+<dl>
+<dt><i>index</i></dt>
+<dd>
+Where to insert the new subelement.</dd>
+<dt>Raises <b>AssertionError</b>:</dt><dd>
+If the element is not a valid object.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.items-method' name='elementtree.ElementTree._ElementInterface.items-method'><b>items()</b></a> &rArr; list of (string, string) tuples [<a href='#elementtree.ElementTree._ElementInterface.items-method'>#</a>]</dt>
+<dd>
+<p>Gets element attributes, as a sequence.  The attributes are
+returned in an arbitrary order.</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+A list of (name, value) tuples for all attributes.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.keys-method' name='elementtree.ElementTree._ElementInterface.keys-method'><b>keys()</b></a> &rArr; list of strings [<a href='#elementtree.ElementTree._ElementInterface.keys-method'>#</a>]</dt>
+<dd>
+<p>Gets a list of attribute names.  The names are returned in an
+arbitrary order (just like for an ordinary Python dictionary).</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+A list of element attribute names.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.makeelement-method' name='elementtree.ElementTree._ElementInterface.makeelement-method'><b>makeelement(tag, attrib)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.makeelement-method'>#</a>]</dt>
+<dd>
+<p>Creates a new element object of the same type as this element.</p>
+<dl>
+<dt><i>tag</i></dt>
+<dd>
+Element tag.</dd>
+<dt><i>attrib</i></dt>
+<dd>
+Element attributes, given as a dictionary.</dd>
+<dt>Returns:</dt>
+<dd>
+A new element instance.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.remove-method' name='elementtree.ElementTree._ElementInterface.remove-method'><b>remove(element)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.remove-method'>#</a>]</dt>
+<dd>
+<p>Removes a matching subelement.  Unlike the <b>find</b> methods,
+this method compares elements based on identity, not on tag
+value or contents.
+
+</p><dl>
+<dt><i>element</i></dt>
+<dd>
+What element to remove.</dd>
+<dt>Raises <b>ValueError</b>:</dt><dd>
+If a matching element could not be found.</dd>
+<dt>Raises <b>AssertionError</b>:</dt><dd>
+If the element is not a valid object.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.set-method' name='elementtree.ElementTree._ElementInterface.set-method'><b>set(key, value)</b></a> [<a href='#elementtree.ElementTree._ElementInterface.set-method'>#</a>]</dt>
+<dd>
+<p>Sets an element attribute.</p>
+<dl>
+<dt><i>key</i></dt>
+<dd>
+What attribute to set.</dd>
+<dt><i>value</i></dt>
+<dd>
+The attribute value.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.tag-attribute' name='elementtree.ElementTree._ElementInterface.tag-attribute'><b>tag</b></a> [<a href='#elementtree.ElementTree._ElementInterface.tag-attribute'>#</a>]</dt>
+<dd>
+<p>(Attribute) Element tag.</p>
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.tail-attribute' name='elementtree.ElementTree._ElementInterface.tail-attribute'><b>tail</b></a> [<a href='#elementtree.ElementTree._ElementInterface.tail-attribute'>#</a>]</dt>
+<dd>
+<p>(Attribute) 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.</p>
+</dd>
+<dt><a id='elementtree.ElementTree._ElementInterface.text-attribute' name='elementtree.ElementTree._ElementInterface.text-attribute'><b>text</b></a> [<a href='#elementtree.ElementTree._ElementInterface.text-attribute'>#</a>]</dt>
+<dd>
+<p>(Attribute) Text before first subelement.  This is either a
+string or the value None, if there was no text.</p>
+</dd>
+</dl>
+<h2><a id='elementtree.ElementTree.ElementTree-class' name='elementtree.ElementTree.ElementTree-class'>The ElementTree Class</a></h2>
+<dl>
+<dt><b>ElementTree(element=None, file=None)</b> (class) [<a href='#elementtree.ElementTree.ElementTree-class'>#</a>]</dt>
+<dd>
+<p>ElementTree wrapper class.  This class represents an entire element
+hierarchy, and adds some extra support for serialization to and from
+standard XML.</p>
+<dl>
+<dt><i>element</i></dt>
+<dd>
+Optional root element.</dd>
+<dt><i>file=</i></dt>
+<dd>
+Optional file handle or name.  If given, the
+    tree is initialized with the contents of this XML file.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.ElementTree._setroot-method' name='elementtree.ElementTree.ElementTree._setroot-method'><b>_setroot(element)</b></a> [<a href='#elementtree.ElementTree.ElementTree._setroot-method'>#</a>]</dt>
+<dd>
+<p>Replaces the root element for this tree.  This discards the
+current contents of the tree, and replaces it with the given
+element.  Use with care.</p>
+<dl>
+<dt><i>element</i></dt>
+<dd>
+An element instance.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.ElementTree.find-method' name='elementtree.ElementTree.ElementTree.find-method'><b>find(path)</b></a> &rArr; Element or None [<a href='#elementtree.ElementTree.ElementTree.find-method'>#</a>]</dt>
+<dd>
+<p>Finds the first toplevel element with given tag.
+Same as getroot().find(path).</p>
+<dl>
+<dt><i>path</i></dt>
+<dd>
+What element to look for.</dd>
+<dt>Returns:</dt>
+<dd>
+The first matching element, or None if no element was found.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.ElementTree.findall-method' name='elementtree.ElementTree.ElementTree.findall-method'><b>findall(path)</b></a> &rArr; list of Element instances [<a href='#elementtree.ElementTree.ElementTree.findall-method'>#</a>]</dt>
+<dd>
+<p>Finds all toplevel elements with the given tag.
+Same as getroot().findall(path).</p>
+<dl>
+<dt><i>path</i></dt>
+<dd>
+What element to look for.</dd>
+<dt>Returns:</dt>
+<dd>
+A list or iterator containing all matching elements,
+   in document order.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.ElementTree.findtext-method' name='elementtree.ElementTree.ElementTree.findtext-method'><b>findtext(path, default=None)</b></a> &rArr; string [<a href='#elementtree.ElementTree.ElementTree.findtext-method'>#</a>]</dt>
+<dd>
+<p>Finds the element text for the first toplevel element with given
+tag.  Same as getroot().findtext(path).</p>
+<dl>
+<dt><i>path</i></dt>
+<dd>
+What toplevel element to look for.</dd>
+<dt><i>default</i></dt>
+<dd>
+What to return if the element was not found.</dd>
+<dt>Returns:</dt>
+<dd>
+The text content of the first matching element, or the
+    default value no element was found.  Note that if the element
+    has is found, but has no text content, this method returns an
+    empty string.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.ElementTree.getiterator-method' name='elementtree.ElementTree.ElementTree.getiterator-method'><b>getiterator(tag=None)</b></a> &rArr; iterator [<a href='#elementtree.ElementTree.ElementTree.getiterator-method'>#</a>]</dt>
+<dd>
+<p>Creates a tree iterator for the root element.  The iterator loops
+over all elements in this tree, in document order.</p>
+<dl>
+<dt><i>tag</i></dt>
+<dd>
+What tags to look for (default is to return all elements)</dd>
+<dt>Returns:</dt>
+<dd>
+An iterator.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.ElementTree.getroot-method' name='elementtree.ElementTree.ElementTree.getroot-method'><b>getroot()</b></a> &rArr; Element [<a href='#elementtree.ElementTree.ElementTree.getroot-method'>#</a>]</dt>
+<dd>
+<p>Gets the root element for this tree.</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+An element instance.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.ElementTree.parse-method' name='elementtree.ElementTree.ElementTree.parse-method'><b>parse(source, parser=None)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.ElementTree.parse-method'>#</a>]</dt>
+<dd>
+<p>Loads an external XML document into this element tree.</p>
+<dl>
+<dt><i>source</i></dt>
+<dd>
+A file name or file object.</dd>
+<dt><i>parser</i></dt>
+<dd>
+An optional parser instance.  If not given, the
+    standard <a class="link" href="#elementtree.ElementTree.XMLTreeBuilder-class"><b>XMLTreeBuilder</b></a> parser is used.
+</dd>
+<dt>Returns:</dt>
+<dd>
+The document root element.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.ElementTree.write-method' name='elementtree.ElementTree.ElementTree.write-method'><b>write(file, encoding=&quot;us-ascii&quot;)</b></a> [<a href='#elementtree.ElementTree.ElementTree.write-method'>#</a>]</dt>
+<dd>
+<p>Writes the element tree to a file, as XML.</p>
+<dl>
+<dt><i>file</i></dt>
+<dd>
+A file name, or a file object opened for writing.</dd>
+<dt><i>encoding</i></dt>
+<dd>
+Optional output encoding (default is US-ASCII).</dd>
+</dl><br />
+</dd>
+</dl>
+<h2><a id='elementtree.ElementTree.iterparse-class' name='elementtree.ElementTree.iterparse-class'>The iterparse Class</a></h2>
+<dl>
+<dt><b>iterparse(source, events=None)</b> (class) [<a href='#elementtree.ElementTree.iterparse-class'>#</a>]</dt>
+<dd>
+<p>Parses an XML document into an element tree incrementally, and reports
+what's going on to the user.</p>
+<dl>
+<dt><i>source</i></dt>
+<dd>
+A filename or file object containing XML data.</dd>
+<dt><i>events</i></dt>
+<dd>
+A list of events to report back.  If omitted, only &quot;end&quot;
+    events are reported.</dd>
+<dt>Returns:</dt>
+<dd>
+A (event, elem) iterator.</dd>
+</dl><br />
+</dd>
+</dl>
+<h2><a id='elementtree.ElementTree.QName-class' name='elementtree.ElementTree.QName-class'>The QName Class</a></h2>
+<dl>
+<dt><b>QName(text_or_uri, tag=None)</b> (class) [<a href='#elementtree.ElementTree.QName-class'>#</a>]</dt>
+<dd>
+<p>QName wrapper.  This can be used to wrap a QName attribute value, in
+order to get proper namespace handling on output.</p>
+<dl>
+<dt><i>text</i></dt>
+<dd>
+A string containing the QName value, in the form {uri}local,
+    or, if the tag argument is given, the URI part of a QName.</dd>
+<dt><i>tag</i></dt>
+<dd>
+Optional tag.  If given, the first argument is interpreted as
+    an URI, and this argument is interpreted as a local name.</dd>
+<dt>Returns:</dt>
+<dd>
+An opaque object, representing the QName.</dd>
+</dl><br />
+</dd>
+</dl>
+<h2><a id='elementtree.ElementTree.TreeBuilder-class' name='elementtree.ElementTree.TreeBuilder-class'>The TreeBuilder Class</a></h2>
+<dl>
+<dt><b>TreeBuilder(element_factory=None)</b> (class) [<a href='#elementtree.ElementTree.TreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>Generic element structure builder.  This builder converts a sequence
+of <a class="link" href="#elementtree.ElementTree.TreeBuilder.start-method"><b>start</b></a>, <a class="link" href="#elementtree.ElementTree.TreeBuilder.data-method"><b>data</b></a>, and <a class="link" href="#elementtree.ElementTree.TreeBuilder.end-method"><b>end</b></a> method calls to a well-formed element structure.
+</p><p>
+You can use this class to build an element structure using a custom XML
+parser, or a parser for some other XML-like format.
+
+</p><dl>
+<dt><i>element_factory</i></dt>
+<dd>
+Optional element factory.  This factory
+   is called to create new Element instances, as necessary.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.TreeBuilder.close-method' name='elementtree.ElementTree.TreeBuilder.close-method'><b>close()</b></a> &rArr; Element [<a href='#elementtree.ElementTree.TreeBuilder.close-method'>#</a>]</dt>
+<dd>
+<p>Flushes the parser buffers, and returns the toplevel documen
+element.</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+An Element instance.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.TreeBuilder.data-method' name='elementtree.ElementTree.TreeBuilder.data-method'><b>data(data)</b></a> [<a href='#elementtree.ElementTree.TreeBuilder.data-method'>#</a>]</dt>
+<dd>
+<p>Adds text to the current element.</p>
+<dl>
+<dt><i>data</i></dt>
+<dd>
+A string.  This should be either an 8-bit string
+   containing ASCII text, or a Unicode string.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.TreeBuilder.end-method' name='elementtree.ElementTree.TreeBuilder.end-method'><b>end(tag)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.TreeBuilder.end-method'>#</a>]</dt>
+<dd>
+<p>Closes the current element.</p>
+<dl>
+<dt><i>tag</i></dt>
+<dd>
+The element name.</dd>
+<dt>Returns:</dt>
+<dd>
+The closed element.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.TreeBuilder.start-method' name='elementtree.ElementTree.TreeBuilder.start-method'><b>start(tag, attrs)</b></a> &rArr; Element [<a href='#elementtree.ElementTree.TreeBuilder.start-method'>#</a>]</dt>
+<dd>
+<p>Opens a new element.</p>
+<dl>
+<dt><i>tag</i></dt>
+<dd>
+The element name.</dd>
+<dt><i>attrib</i></dt>
+<dd>
+A dictionary containing element attributes.</dd>
+<dt>Returns:</dt>
+<dd>
+The opened element.</dd>
+</dl><br />
+</dd>
+</dl>
+<h2><a id='elementtree.ElementTree.XMLTreeBuilder-class' name='elementtree.ElementTree.XMLTreeBuilder-class'>The XMLTreeBuilder Class</a></h2>
+<dl>
+<dt><b>XMLTreeBuilder(html=0, target=None)</b> (class) [<a href='#elementtree.ElementTree.XMLTreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>Element structure builder for XML source data, based on the
+<b>expat</b> parser.
+
+</p><dl>
+<dt><i>target=</i></dt>
+<dd>
+Target object.  If omitted, the builder uses an
+    instance of the standard <a class="link" href="#elementtree.ElementTree.TreeBuilder-class"><b>TreeBuilder</b></a> class.
+</dd>
+<dt><i>html=</i></dt>
+<dd>
+Predefine HTML entities.  This flag is not supported
+    by the current implementation.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.XMLTreeBuilder.close-method' name='elementtree.ElementTree.XMLTreeBuilder.close-method'><b>close()</b></a> &rArr; Element [<a href='#elementtree.ElementTree.XMLTreeBuilder.close-method'>#</a>]</dt>
+<dd>
+<p>Finishes feeding data to the parser.</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+An element structure.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.XMLTreeBuilder.doctype-method' name='elementtree.ElementTree.XMLTreeBuilder.doctype-method'><b>doctype(name, pubid, system)</b></a> [<a href='#elementtree.ElementTree.XMLTreeBuilder.doctype-method'>#</a>]</dt>
+<dd>
+<p>Handles a doctype declaration.</p>
+<dl>
+<dt><i>name</i></dt>
+<dd>
+Doctype name.</dd>
+<dt><i>pubid</i></dt>
+<dd>
+Public identifier.</dd>
+<dt><i>system</i></dt>
+<dd>
+System identifier.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.ElementTree.XMLTreeBuilder.feed-method' name='elementtree.ElementTree.XMLTreeBuilder.feed-method'><b>feed(data)</b></a> [<a href='#elementtree.ElementTree.XMLTreeBuilder.feed-method'>#</a>]</dt>
+<dd>
+<p>Feeds data to the parser.</p>
+<dl>
+<dt><i>data</i></dt>
+<dd>
+Encoded data.</dd>
+</dl><br />
+</dd>
+</dl>
+</body></html>

Modified: external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.HTMLTreeBuilder.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.HTMLTreeBuilder.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.HTMLTreeBuilder.html	Wed Dec 14 19:33:39 2005
@@ -1,118 +1,118 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree.HTMLTreeBuilder Module</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree.HTMLTreeBuilder Module</h1>
-<p>Tools to build element trees from HTML files.</p>
-<h2>Module Contents</h2>
-<dl>
-<dt><b>HTMLTreeBuilder(builder=None, encoding=None)</b> (class) [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>ElementTree builder for HTML source code.</p>
-<dl>
-<dt><i>builder=</i></dt>
-<dd>
-Optional builder object.  If omitted, the parser
-    uses the standard <b>elementtree</b> builder.
-</dd>
-<dt><i>encoding=</i></dt>
-<dd>
-Optional character encoding, if known.  If omitted,
-    the parser looks for META tags inside the document.  If no tags
-    are found, the parser defaults to ISO-8859-1.  Note that if your
-    document uses a non-ASCII compatible encoding, you must decode
-    the document before parsing.</dd>
-</dl><br />
-<p>For more information about this class, see <a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class'><i>The HTMLTreeBuilder Class</i></a>.</p>
-</dd>
-<dt><a id='elementtree.HTMLTreeBuilder.parse-function' name='elementtree.HTMLTreeBuilder.parse-function'><b>parse(source, encoding=None)</b></a> [<a href='#elementtree.HTMLTreeBuilder.parse-function'>#</a>]</dt>
-<dd>
-<p>Parse an HTML document or document fragment.</p>
-<dl>
-<dt><i>source</i></dt>
-<dd>
-A filename or file object containing HTML data.</dd>
-<dt><i>encoding</i></dt>
-<dd>
-Optional character encoding, if known.  If omitted,
-    the parser looks for META tags inside the document.  If no tags
-    are found, the parser defaults to ISO-8859-1.</dd>
-<dt>Returns:</dt>
-<dd>
-An ElementTree instance</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.HTMLTreeBuilder.TreeBuilder-variable' name='elementtree.HTMLTreeBuilder.TreeBuilder-variable'><b>TreeBuilder</b></a> (variable) [<a href='#elementtree.HTMLTreeBuilder.TreeBuilder-variable'>#</a>]</dt>
-<dd>
-<p>An alias for the <b>HTMLTreeBuilder</b> class.
-</p></dd>
-</dl>
-<h2><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class'>The HTMLTreeBuilder Class</a></h2>
-<dl>
-<dt><b>HTMLTreeBuilder(builder=None, encoding=None)</b> (class) [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>ElementTree builder for HTML source code.  This builder converts an
-HTML document or fragment to an ElementTree.
-</p><p>
-The parser is relatively picky, and requires balanced tags for most
-elements.  However, elements belonging to the following group are
-automatically closed: P, LI, TR, TH, and TD.  In addition, the
-parser automatically inserts end tags immediately after the start
-tag, and ignores any end tags for the following group: IMG, HR,
-META, and LINK.
-
-</p><dl>
-<dt><i>builder=</i></dt>
-<dd>
-Optional builder object.  If omitted, the parser
-    uses the standard <b>elementtree</b> builder.
-</dd>
-<dt><i>encoding=</i></dt>
-<dd>
-Optional character encoding, if known.  If omitted,
-    the parser looks for META tags inside the document.  If no tags
-    are found, the parser defaults to ISO-8859-1.  Note that if your
-    document uses a non-ASCII compatible encoding, you must decode
-    the document before parsing.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.close-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.close-method'><b>close()</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.close-method'>#</a>]</dt>
-<dd>
-<p>Flushes parser buffers, and return the root element.</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-An Element instance.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_charref-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_charref-method'><b>handle_charref(char)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_charref-method'>#</a>]</dt>
-<dd>
-<p>(Internal) Handles character references.</p>
-</dd>
-<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_data-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_data-method'><b>handle_data(data)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_data-method'>#</a>]</dt>
-<dd>
-<p>(Internal) Handles character data.</p>
-</dd>
-<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_endtag-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_endtag-method'><b>handle_endtag(tag)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_endtag-method'>#</a>]</dt>
-<dd>
-<p>(Internal) Handles end tags.</p>
-</dd>
-<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_entityref-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_entityref-method'><b>handle_entityref(name)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_entityref-method'>#</a>]</dt>
-<dd>
-<p>(Internal) Handles entity references.</p>
-</dd>
-<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_starttag-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_starttag-method'><b>handle_starttag(tag, attrs)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_starttag-method'>#</a>]</dt>
-<dd>
-<p>(Internal) Handles start tags.</p>
-</dd>
-<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.unknown_entityref-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.unknown_entityref-method'><b>unknown_entityref(name)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.unknown_entityref-method'>#</a>]</dt>
-<dd>
-<p>(Hook) Handles unknown entity references.  The default action
-is to ignore unknown entities.</p>
-</dd>
-</dl>
-</body></html>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree.HTMLTreeBuilder Module</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree.HTMLTreeBuilder Module</h1>
+<p>Tools to build element trees from HTML files.</p>
+<h2>Module Contents</h2>
+<dl>
+<dt><b>HTMLTreeBuilder(builder=None, encoding=None)</b> (class) [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>ElementTree builder for HTML source code.</p>
+<dl>
+<dt><i>builder=</i></dt>
+<dd>
+Optional builder object.  If omitted, the parser
+    uses the standard <b>elementtree</b> builder.
+</dd>
+<dt><i>encoding=</i></dt>
+<dd>
+Optional character encoding, if known.  If omitted,
+    the parser looks for META tags inside the document.  If no tags
+    are found, the parser defaults to ISO-8859-1.  Note that if your
+    document uses a non-ASCII compatible encoding, you must decode
+    the document before parsing.</dd>
+</dl><br />
+<p>For more information about this class, see <a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class'><i>The HTMLTreeBuilder Class</i></a>.</p>
+</dd>
+<dt><a id='elementtree.HTMLTreeBuilder.parse-function' name='elementtree.HTMLTreeBuilder.parse-function'><b>parse(source, encoding=None)</b></a> [<a href='#elementtree.HTMLTreeBuilder.parse-function'>#</a>]</dt>
+<dd>
+<p>Parse an HTML document or document fragment.</p>
+<dl>
+<dt><i>source</i></dt>
+<dd>
+A filename or file object containing HTML data.</dd>
+<dt><i>encoding</i></dt>
+<dd>
+Optional character encoding, if known.  If omitted,
+    the parser looks for META tags inside the document.  If no tags
+    are found, the parser defaults to ISO-8859-1.</dd>
+<dt>Returns:</dt>
+<dd>
+An ElementTree instance</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.HTMLTreeBuilder.TreeBuilder-variable' name='elementtree.HTMLTreeBuilder.TreeBuilder-variable'><b>TreeBuilder</b></a> (variable) [<a href='#elementtree.HTMLTreeBuilder.TreeBuilder-variable'>#</a>]</dt>
+<dd>
+<p>An alias for the <b>HTMLTreeBuilder</b> class.
+</p></dd>
+</dl>
+<h2><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class'>The HTMLTreeBuilder Class</a></h2>
+<dl>
+<dt><b>HTMLTreeBuilder(builder=None, encoding=None)</b> (class) [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>ElementTree builder for HTML source code.  This builder converts an
+HTML document or fragment to an ElementTree.
+</p><p>
+The parser is relatively picky, and requires balanced tags for most
+elements.  However, elements belonging to the following group are
+automatically closed: P, LI, TR, TH, and TD.  In addition, the
+parser automatically inserts end tags immediately after the start
+tag, and ignores any end tags for the following group: IMG, HR,
+META, and LINK.
+
+</p><dl>
+<dt><i>builder=</i></dt>
+<dd>
+Optional builder object.  If omitted, the parser
+    uses the standard <b>elementtree</b> builder.
+</dd>
+<dt><i>encoding=</i></dt>
+<dd>
+Optional character encoding, if known.  If omitted,
+    the parser looks for META tags inside the document.  If no tags
+    are found, the parser defaults to ISO-8859-1.  Note that if your
+    document uses a non-ASCII compatible encoding, you must decode
+    the document before parsing.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.close-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.close-method'><b>close()</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.close-method'>#</a>]</dt>
+<dd>
+<p>Flushes parser buffers, and return the root element.</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+An Element instance.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_charref-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_charref-method'><b>handle_charref(char)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_charref-method'>#</a>]</dt>
+<dd>
+<p>(Internal) Handles character references.</p>
+</dd>
+<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_data-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_data-method'><b>handle_data(data)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_data-method'>#</a>]</dt>
+<dd>
+<p>(Internal) Handles character data.</p>
+</dd>
+<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_endtag-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_endtag-method'><b>handle_endtag(tag)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_endtag-method'>#</a>]</dt>
+<dd>
+<p>(Internal) Handles end tags.</p>
+</dd>
+<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_entityref-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_entityref-method'><b>handle_entityref(name)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_entityref-method'>#</a>]</dt>
+<dd>
+<p>(Internal) Handles entity references.</p>
+</dd>
+<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_starttag-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_starttag-method'><b>handle_starttag(tag, attrs)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.handle_starttag-method'>#</a>]</dt>
+<dd>
+<p>(Internal) Handles start tags.</p>
+</dd>
+<dt><a id='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.unknown_entityref-method' name='elementtree.HTMLTreeBuilder.HTMLTreeBuilder.unknown_entityref-method'><b>unknown_entityref(name)</b></a> [<a href='#elementtree.HTMLTreeBuilder.HTMLTreeBuilder.unknown_entityref-method'>#</a>]</dt>
+<dd>
+<p>(Hook) Handles unknown entity references.  The default action
+is to ignore unknown entities.</p>
+</dd>
+</dl>
+</body></html>

Modified: external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SgmlopXMLTreeBuilder.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SgmlopXMLTreeBuilder.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SgmlopXMLTreeBuilder.html	Wed Dec 14 19:33:39 2005
@@ -1,50 +1,50 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree.SgmlopXMLTreeBuilder Module</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree.SgmlopXMLTreeBuilder Module</h1>
-<p>Tools to build element trees from XML, based on the SGMLOP parser.
-</p><p>
-The current version does not support XML namespaces.
-</p><p>
-This tree builder requires the <b>sgmlop</b> extension module
-(available from
-<a href="http://effbot.org/downloads">http://effbot.org/downloads</a>).
-</p><h2>Module Contents</h2>
-<dl>
-<dt><b>TreeBuilder(html=0)</b> (class) [<a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>ElementTree builder for XML source data, based on the SGMLOP parser.</p>
-<p>For more information about this class, see <a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class'><i>The TreeBuilder Class</i></a>.</p>
-</dd>
-</dl>
-<h2><a id='elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class' name='elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class'>The TreeBuilder Class</a></h2>
-<dl>
-<dt><b>TreeBuilder(html=0)</b> (class) [<a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>ElementTree builder for XML source data, based on the SGMLOP parser.</p>
-</dd>
-<dt><a id='elementtree.SgmlopXMLTreeBuilder.TreeBuilder.close-method' name='elementtree.SgmlopXMLTreeBuilder.TreeBuilder.close-method'><b>close()</b></a> &rArr; Element [<a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder.close-method'>#</a>]</dt>
-<dd>
-<p>Finishes feeding data to the parser.</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-An element structure.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.SgmlopXMLTreeBuilder.TreeBuilder.feed-method' name='elementtree.SgmlopXMLTreeBuilder.TreeBuilder.feed-method'><b>feed(data)</b></a> [<a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder.feed-method'>#</a>]</dt>
-<dd>
-<p>Feeds data to the parser.</p>
-<dl>
-<dt><i>data</i></dt>
-<dd>
-Encoded data.</dd>
-</dl><br />
-</dd>
-</dl>
-</body></html>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree.SgmlopXMLTreeBuilder Module</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree.SgmlopXMLTreeBuilder Module</h1>
+<p>Tools to build element trees from XML, based on the SGMLOP parser.
+</p><p>
+The current version does not support XML namespaces.
+</p><p>
+This tree builder requires the <b>sgmlop</b> extension module
+(available from
+<a href="http://effbot.org/downloads">http://effbot.org/downloads</a>).
+</p><h2>Module Contents</h2>
+<dl>
+<dt><b>TreeBuilder(html=0)</b> (class) [<a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>ElementTree builder for XML source data, based on the SGMLOP parser.</p>
+<p>For more information about this class, see <a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class'><i>The TreeBuilder Class</i></a>.</p>
+</dd>
+</dl>
+<h2><a id='elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class' name='elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class'>The TreeBuilder Class</a></h2>
+<dl>
+<dt><b>TreeBuilder(html=0)</b> (class) [<a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>ElementTree builder for XML source data, based on the SGMLOP parser.</p>
+</dd>
+<dt><a id='elementtree.SgmlopXMLTreeBuilder.TreeBuilder.close-method' name='elementtree.SgmlopXMLTreeBuilder.TreeBuilder.close-method'><b>close()</b></a> &rArr; Element [<a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder.close-method'>#</a>]</dt>
+<dd>
+<p>Finishes feeding data to the parser.</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+An element structure.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.SgmlopXMLTreeBuilder.TreeBuilder.feed-method' name='elementtree.SgmlopXMLTreeBuilder.TreeBuilder.feed-method'><b>feed(data)</b></a> [<a href='#elementtree.SgmlopXMLTreeBuilder.TreeBuilder.feed-method'>#</a>]</dt>
+<dd>
+<p>Feeds data to the parser.</p>
+<dl>
+<dt><i>data</i></dt>
+<dd>
+Encoded data.</dd>
+</dl><br />
+</dd>
+</dl>
+</body></html>

Modified: external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLTreeBuilder.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLTreeBuilder.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLTreeBuilder.html	Wed Dec 14 19:33:39 2005
@@ -1,50 +1,50 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree.SimpleXMLTreeBuilder Module</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree.SimpleXMLTreeBuilder Module</h1>
-<p>Tools to build element trees from XML files, using <b>xmllib</b>.
-This module can be used instead of the standard tree builder, for
-Python versions where "expat" is not available (such as 1.5.2).
-</p><p>
-Note that due to bugs in <b>xmllib</b>, the namespace support is
-not reliable (you can run the module as a script to find out exactly
-how unreliable it is on your Python version).
-</p><h2>Module Contents</h2>
-<dl>
-<dt><b>TreeBuilder(html=0)</b> (class) [<a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>ElementTree builder for XML source data.</p>
-<p>For more information about this class, see <a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder-class'><i>The TreeBuilder Class</i></a>.</p>
-</dd>
-</dl>
-<h2><a id='elementtree.SimpleXMLTreeBuilder.TreeBuilder-class' name='elementtree.SimpleXMLTreeBuilder.TreeBuilder-class'>The TreeBuilder Class</a></h2>
-<dl>
-<dt><b>TreeBuilder(html=0)</b> (class) [<a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>ElementTree builder for XML source data.</p>
-</dd>
-<dt><a id='elementtree.SimpleXMLTreeBuilder.TreeBuilder.close-method' name='elementtree.SimpleXMLTreeBuilder.TreeBuilder.close-method'><b>close()</b></a> &rArr; Element [<a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder.close-method'>#</a>]</dt>
-<dd>
-<p>Finishes feeding data to the parser.</p>
-<dl>
-<dt>Returns:</dt>
-<dd>
-An element structure.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.SimpleXMLTreeBuilder.TreeBuilder.feed-method' name='elementtree.SimpleXMLTreeBuilder.TreeBuilder.feed-method'><b>feed(data)</b></a> [<a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder.feed-method'>#</a>]</dt>
-<dd>
-<p>Feeds data to the parser.</p>
-<dl>
-<dt><i>data</i></dt>
-<dd>
-Encoded data.</dd>
-</dl><br />
-</dd>
-</dl>
-</body></html>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree.SimpleXMLTreeBuilder Module</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree.SimpleXMLTreeBuilder Module</h1>
+<p>Tools to build element trees from XML files, using <b>xmllib</b>.
+This module can be used instead of the standard tree builder, for
+Python versions where "expat" is not available (such as 1.5.2).
+</p><p>
+Note that due to bugs in <b>xmllib</b>, the namespace support is
+not reliable (you can run the module as a script to find out exactly
+how unreliable it is on your Python version).
+</p><h2>Module Contents</h2>
+<dl>
+<dt><b>TreeBuilder(html=0)</b> (class) [<a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>ElementTree builder for XML source data.</p>
+<p>For more information about this class, see <a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder-class'><i>The TreeBuilder Class</i></a>.</p>
+</dd>
+</dl>
+<h2><a id='elementtree.SimpleXMLTreeBuilder.TreeBuilder-class' name='elementtree.SimpleXMLTreeBuilder.TreeBuilder-class'>The TreeBuilder Class</a></h2>
+<dl>
+<dt><b>TreeBuilder(html=0)</b> (class) [<a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>ElementTree builder for XML source data.</p>
+</dd>
+<dt><a id='elementtree.SimpleXMLTreeBuilder.TreeBuilder.close-method' name='elementtree.SimpleXMLTreeBuilder.TreeBuilder.close-method'><b>close()</b></a> &rArr; Element [<a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder.close-method'>#</a>]</dt>
+<dd>
+<p>Finishes feeding data to the parser.</p>
+<dl>
+<dt>Returns:</dt>
+<dd>
+An element structure.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.SimpleXMLTreeBuilder.TreeBuilder.feed-method' name='elementtree.SimpleXMLTreeBuilder.TreeBuilder.feed-method'><b>feed(data)</b></a> [<a href='#elementtree.SimpleXMLTreeBuilder.TreeBuilder.feed-method'>#</a>]</dt>
+<dd>
+<p>Feeds data to the parser.</p>
+<dl>
+<dt><i>data</i></dt>
+<dd>
+Encoded data.</dd>
+</dl><br />
+</dd>
+</dl>
+</body></html>

Modified: external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLWriter.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLWriter.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.SimpleXMLWriter.html	Wed Dec 14 19:33:39 2005
@@ -1,161 +1,161 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree.SimpleXMLWriter Module</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree.SimpleXMLWriter Module</h1>
-<p>Tools to write XML files, without having to deal with encoding
-issues, well-formedness, etc.
-</p><p>
-The current version does not provide built-in support for
-namespaces. To create files using namespaces, you have to provide
-"xmlns" attributes and explicitly add prefixes to tags and
-attributes.
-
-<h3>Patterns</h3>
-
-The following example generates a small XHTML document.
-<pre>
-
-from elementtree.SimpleXMLWriter import XMLWriter
-import sys
-
-w = XMLWriter(sys.stdout)
-
-html = w.start("html")
-
-w.start("head")
-w.element("title", "my document")
-w.element("meta", name="generator", value="my application 1.0")
-w.end()
-
-w.start("body")
-w.element("h1", "this is a heading")
-w.element("p", "this is a paragraph")
-
-w.start("p")
-w.data("this is ")
-w.element("b", "bold")
-w.data(" and ")
-w.element("i", "italic")
-w.data(".")
-w.end("p")
-
-w.close(html)
-</pre>
-</p><h2>Module Contents</h2>
-<dl>
-<dt><b>XMLWriter(file, encoding=&quot;us-ascii&quot;)</b> (class) [<a href='#elementtree.SimpleXMLWriter.XMLWriter-class'>#</a>]</dt>
-<dd>
-<p>XML writer class.</p>
-<dl>
-<dt><i>file</i></dt>
-<dd>
-A file or file-like object.  This object must implement
-   a <b>write</b> method that takes an 8-bit string.
-</dd>
-<dt><i>encoding</i></dt>
-<dd>
-Optional encoding.</dd>
-</dl><br />
-<p>For more information about this class, see <a href='#elementtree.SimpleXMLWriter.XMLWriter-class'><i>The XMLWriter Class</i></a>.</p>
-</dd>
-</dl>
-<h2><a id='elementtree.SimpleXMLWriter.XMLWriter-class' name='elementtree.SimpleXMLWriter.XMLWriter-class'>The XMLWriter Class</a></h2>
-<dl>
-<dt><b>XMLWriter(file, encoding=&quot;us-ascii&quot;)</b> (class) [<a href='#elementtree.SimpleXMLWriter.XMLWriter-class'>#</a>]</dt>
-<dd>
-<p>XML writer class.</p>
-<dl>
-<dt><i>file</i></dt>
-<dd>
-A file or file-like object.  This object must implement
-   a <b>write</b> method that takes an 8-bit string.
-</dd>
-<dt><i>encoding</i></dt>
-<dd>
-Optional encoding.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.close-method' name='elementtree.SimpleXMLWriter.XMLWriter.close-method'><b>close(id)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.close-method'>#</a>]</dt>
-<dd>
-<p>Closes open elements, up to (and including) the element identified
-by the given identifier.</p>
-<dl>
-<dt><i>id</i></dt>
-<dd>
-Element identifier, as returned by the <b>start</b> method.
-</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.comment-method' name='elementtree.SimpleXMLWriter.XMLWriter.comment-method'><b>comment(comment)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.comment-method'>#</a>]</dt>
-<dd>
-<p>Adds a comment to the output stream.</p>
-<dl>
-<dt><i>comment</i></dt>
-<dd>
-Comment text, as an 8-bit string or Unicode string.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.data-method' name='elementtree.SimpleXMLWriter.XMLWriter.data-method'><b>data(text)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.data-method'>#</a>]</dt>
-<dd>
-<p>Adds character data to the output stream.</p>
-<dl>
-<dt><i>text</i></dt>
-<dd>
-Character data, as an 8-bit string or Unicode string.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.declaration-method' name='elementtree.SimpleXMLWriter.XMLWriter.declaration-method'><b>declaration()</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.declaration-method'>#</a>]</dt>
-<dd>
-<p>Writes an XML declaration.</p>
-</dd>
-<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.element-method' name='elementtree.SimpleXMLWriter.XMLWriter.element-method'><b>element(tag, text=None, attrib={}, **extra)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.element-method'>#</a>]</dt>
-<dd>
-<p>Adds an entire element.  This is the same as calling <b>start</b>,
-<b>data</b>, and <b>end</b> in sequence. The <b>text</b> argument
-can be omitted.
-</p></dd>
-<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.end-method' name='elementtree.SimpleXMLWriter.XMLWriter.end-method'><b>end(tag=None)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.end-method'>#</a>]</dt>
-<dd>
-<p>Closes the current element (opened by the most recent call to
-<b>start</b>).
-
-</p><dl>
-<dt><i>tag</i></dt>
-<dd>
-Element tag.  If given, the tag must match the start
-   tag.  If omitted, the current element is closed.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.flush-method' name='elementtree.SimpleXMLWriter.XMLWriter.flush-method'><b>flush()</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.flush-method'>#</a>]</dt>
-<dd>
-<p>Flushes the output stream.</p>
-</dd>
-<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.start-method' name='elementtree.SimpleXMLWriter.XMLWriter.start-method'><b>start(tag, attrib={}, **extra)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.start-method'>#</a>]</dt>
-<dd>
-<p>Opens a new element.  Attributes can be given as keyword
-arguments, or as a string/string dictionary. You can pass in
-8-bit strings or Unicode strings; the former are assumed to use
-the encoding passed to the constructor.  The method returns an
-opaque identifier that can be passed to the <b>close</b> method,
-to close all open elements up to and including this one.
-
-</p><dl>
-<dt><i>tag</i></dt>
-<dd>
-Element tag.</dd>
-<dt><i>attrib</i></dt>
-<dd>
-Attribute dictionary.  Alternatively, attributes
-   can be given as keyword arguments.</dd>
-<dt>Returns:</dt>
-<dd>
-An element identifier.</dd>
-</dl><br />
-</dd>
-</dl>
-</body></html>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree.SimpleXMLWriter Module</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree.SimpleXMLWriter Module</h1>
+<p>Tools to write XML files, without having to deal with encoding
+issues, well-formedness, etc.
+</p><p>
+The current version does not provide built-in support for
+namespaces. To create files using namespaces, you have to provide
+"xmlns" attributes and explicitly add prefixes to tags and
+attributes.
+
+<h3>Patterns</h3>
+
+The following example generates a small XHTML document.
+<pre>
+
+from elementtree.SimpleXMLWriter import XMLWriter
+import sys
+
+w = XMLWriter(sys.stdout)
+
+html = w.start("html")
+
+w.start("head")
+w.element("title", "my document")
+w.element("meta", name="generator", value="my application 1.0")
+w.end()
+
+w.start("body")
+w.element("h1", "this is a heading")
+w.element("p", "this is a paragraph")
+
+w.start("p")
+w.data("this is ")
+w.element("b", "bold")
+w.data(" and ")
+w.element("i", "italic")
+w.data(".")
+w.end("p")
+
+w.close(html)
+</pre>
+</p><h2>Module Contents</h2>
+<dl>
+<dt><b>XMLWriter(file, encoding=&quot;us-ascii&quot;)</b> (class) [<a href='#elementtree.SimpleXMLWriter.XMLWriter-class'>#</a>]</dt>
+<dd>
+<p>XML writer class.</p>
+<dl>
+<dt><i>file</i></dt>
+<dd>
+A file or file-like object.  This object must implement
+   a <b>write</b> method that takes an 8-bit string.
+</dd>
+<dt><i>encoding</i></dt>
+<dd>
+Optional encoding.</dd>
+</dl><br />
+<p>For more information about this class, see <a href='#elementtree.SimpleXMLWriter.XMLWriter-class'><i>The XMLWriter Class</i></a>.</p>
+</dd>
+</dl>
+<h2><a id='elementtree.SimpleXMLWriter.XMLWriter-class' name='elementtree.SimpleXMLWriter.XMLWriter-class'>The XMLWriter Class</a></h2>
+<dl>
+<dt><b>XMLWriter(file, encoding=&quot;us-ascii&quot;)</b> (class) [<a href='#elementtree.SimpleXMLWriter.XMLWriter-class'>#</a>]</dt>
+<dd>
+<p>XML writer class.</p>
+<dl>
+<dt><i>file</i></dt>
+<dd>
+A file or file-like object.  This object must implement
+   a <b>write</b> method that takes an 8-bit string.
+</dd>
+<dt><i>encoding</i></dt>
+<dd>
+Optional encoding.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.close-method' name='elementtree.SimpleXMLWriter.XMLWriter.close-method'><b>close(id)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.close-method'>#</a>]</dt>
+<dd>
+<p>Closes open elements, up to (and including) the element identified
+by the given identifier.</p>
+<dl>
+<dt><i>id</i></dt>
+<dd>
+Element identifier, as returned by the <b>start</b> method.
+</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.comment-method' name='elementtree.SimpleXMLWriter.XMLWriter.comment-method'><b>comment(comment)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.comment-method'>#</a>]</dt>
+<dd>
+<p>Adds a comment to the output stream.</p>
+<dl>
+<dt><i>comment</i></dt>
+<dd>
+Comment text, as an 8-bit string or Unicode string.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.data-method' name='elementtree.SimpleXMLWriter.XMLWriter.data-method'><b>data(text)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.data-method'>#</a>]</dt>
+<dd>
+<p>Adds character data to the output stream.</p>
+<dl>
+<dt><i>text</i></dt>
+<dd>
+Character data, as an 8-bit string or Unicode string.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.declaration-method' name='elementtree.SimpleXMLWriter.XMLWriter.declaration-method'><b>declaration()</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.declaration-method'>#</a>]</dt>
+<dd>
+<p>Writes an XML declaration.</p>
+</dd>
+<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.element-method' name='elementtree.SimpleXMLWriter.XMLWriter.element-method'><b>element(tag, text=None, attrib={}, **extra)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.element-method'>#</a>]</dt>
+<dd>
+<p>Adds an entire element.  This is the same as calling <b>start</b>,
+<b>data</b>, and <b>end</b> in sequence. The <b>text</b> argument
+can be omitted.
+</p></dd>
+<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.end-method' name='elementtree.SimpleXMLWriter.XMLWriter.end-method'><b>end(tag=None)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.end-method'>#</a>]</dt>
+<dd>
+<p>Closes the current element (opened by the most recent call to
+<b>start</b>).
+
+</p><dl>
+<dt><i>tag</i></dt>
+<dd>
+Element tag.  If given, the tag must match the start
+   tag.  If omitted, the current element is closed.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.flush-method' name='elementtree.SimpleXMLWriter.XMLWriter.flush-method'><b>flush()</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.flush-method'>#</a>]</dt>
+<dd>
+<p>Flushes the output stream.</p>
+</dd>
+<dt><a id='elementtree.SimpleXMLWriter.XMLWriter.start-method' name='elementtree.SimpleXMLWriter.XMLWriter.start-method'><b>start(tag, attrib={}, **extra)</b></a> [<a href='#elementtree.SimpleXMLWriter.XMLWriter.start-method'>#</a>]</dt>
+<dd>
+<p>Opens a new element.  Attributes can be given as keyword
+arguments, or as a string/string dictionary. You can pass in
+8-bit strings or Unicode strings; the former are assumed to use
+the encoding passed to the constructor.  The method returns an
+opaque identifier that can be passed to the <b>close</b> method,
+to close all open elements up to and including this one.
+
+</p><dl>
+<dt><i>tag</i></dt>
+<dd>
+Element tag.</dd>
+<dt><i>attrib</i></dt>
+<dd>
+Attribute dictionary.  Alternatively, attributes
+   can be given as keyword arguments.</dd>
+<dt>Returns:</dt>
+<dd>
+An element identifier.</dd>
+</dl><br />
+</dd>
+</dl>
+</body></html>

Modified: external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.TidyTools.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.TidyTools.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.TidyTools.html	Wed Dec 14 19:33:39 2005
@@ -1,65 +1,65 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree.TidyTools Module</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree.TidyTools Module</h1>
-<p>Tools to build element trees from HTML, using the external <b>tidy</b>
-utility.
-</p><h2>Module Contents</h2>
-<dl>
-<dt><a id='elementtree.TidyTools.getbody-function' name='elementtree.TidyTools.getbody-function'><b>getbody(file, **options)</b></a> [<a href='#elementtree.TidyTools.getbody-function'>#</a>]</dt>
-<dd>
-<p>Get document body from a an HTML or HTML-like file.  This function
-uses the <b>tidy</b> function to convert HTML to XHTML, and cleans
-up the resulting XML tree.
-
-</p><dl>
-<dt><i>file</i></dt>
-<dd>
-Filename.</dd>
-<dt>Returns:</dt>
-<dd>
-A <b>body</b> element, or None if not successful.
-</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.TidyTools.getzonebody-function' name='elementtree.TidyTools.getzonebody-function'><b>getzonebody(file, **options)</b></a> [<a href='#elementtree.TidyTools.getzonebody-function'>#</a>]</dt>
-<dd>
-<p>Same as <b>getbody</b>, but turns plain text at the start of the
-document into an H1 tag.  This function can be used to parse zone
-documents.
-
-</p><dl>
-<dt><i>file</i></dt>
-<dd>
-Filename.</dd>
-<dt>Returns:</dt>
-<dd>
-A <b>body</b> element, or None if not successful.
-</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.TidyTools.tidy-function' name='elementtree.TidyTools.tidy-function'><b>tidy(file, new_inline_tags=None)</b></a> [<a href='#elementtree.TidyTools.tidy-function'>#</a>]</dt>
-<dd>
-<p>Convert an HTML or HTML-like file to XHTML, using the <b>tidy</b>
-command line utility.
-
-</p><dl>
-<dt><i>file</i></dt>
-<dd>
-Filename.</dd>
-<dt><i>new_inline_tags</i></dt>
-<dd>
-An optional list of valid but non-standard
-    inline tags.</dd>
-<dt>Returns:</dt>
-<dd>
-An element tree, or None if not successful.</dd>
-</dl><br />
-</dd>
-</dl>
-</body></html>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree.TidyTools Module</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree.TidyTools Module</h1>
+<p>Tools to build element trees from HTML, using the external <b>tidy</b>
+utility.
+</p><h2>Module Contents</h2>
+<dl>
+<dt><a id='elementtree.TidyTools.getbody-function' name='elementtree.TidyTools.getbody-function'><b>getbody(file, **options)</b></a> [<a href='#elementtree.TidyTools.getbody-function'>#</a>]</dt>
+<dd>
+<p>Get document body from a an HTML or HTML-like file.  This function
+uses the <b>tidy</b> function to convert HTML to XHTML, and cleans
+up the resulting XML tree.
+
+</p><dl>
+<dt><i>file</i></dt>
+<dd>
+Filename.</dd>
+<dt>Returns:</dt>
+<dd>
+A <b>body</b> element, or None if not successful.
+</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.TidyTools.getzonebody-function' name='elementtree.TidyTools.getzonebody-function'><b>getzonebody(file, **options)</b></a> [<a href='#elementtree.TidyTools.getzonebody-function'>#</a>]</dt>
+<dd>
+<p>Same as <b>getbody</b>, but turns plain text at the start of the
+document into an H1 tag.  This function can be used to parse zone
+documents.
+
+</p><dl>
+<dt><i>file</i></dt>
+<dd>
+Filename.</dd>
+<dt>Returns:</dt>
+<dd>
+A <b>body</b> element, or None if not successful.
+</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.TidyTools.tidy-function' name='elementtree.TidyTools.tidy-function'><b>tidy(file, new_inline_tags=None)</b></a> [<a href='#elementtree.TidyTools.tidy-function'>#</a>]</dt>
+<dd>
+<p>Convert an HTML or HTML-like file to XHTML, using the <b>tidy</b>
+command line utility.
+
+</p><dl>
+<dt><i>file</i></dt>
+<dd>
+Filename.</dd>
+<dt><i>new_inline_tags</i></dt>
+<dd>
+An optional list of valid but non-standard
+    inline tags.</dd>
+<dt>Returns:</dt>
+<dd>
+An element tree, or None if not successful.</dd>
+</dl><br />
+</dd>
+</dl>
+</body></html>

Modified: external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.XMLTreeBuilder.html
==============================================================================
--- external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.XMLTreeBuilder.html	(original)
+++ external/elementtree-1.2.6-20050316/docs/pythondoc-elementtree.XMLTreeBuilder.html	Wed Dec 14 19:33:39 2005
@@ -1,70 +1,70 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
-<html>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
-<title>The elementtree.XMLTreeBuilder Module</title>
-<link rel='stylesheet' href='effbot.css' type='text/css' />
-</head>
-<body>
-<h1>The elementtree.XMLTreeBuilder Module</h1>
-<p>Tools to build element trees from XML files.</p>
-<h2>Module Contents</h2>
-<dl>
-<dt><b>FancyTreeBuilder(html=0)</b> (class) [<a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>(experimental) An alternate builder that supports manipulation of
-new elements.</p>
-<p>For more information about this class, see <a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder-class'><i>The FancyTreeBuilder Class</i></a>.</p>
-</dd>
-<dt><b>TreeBuilder</b> (class)  [<a href='#elementtree.XMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>(obsolete) ElementTree builder for XML source data, based on the
-expat parser.</p>
-<p>For more information about this class, see <a href='#elementtree.XMLTreeBuilder.TreeBuilder-class'><i>The TreeBuilder Class</i></a>.</p>
-</dd>
-</dl>
-<h2><a id='elementtree.XMLTreeBuilder.FancyTreeBuilder-class' name='elementtree.XMLTreeBuilder.FancyTreeBuilder-class'>The FancyTreeBuilder Class</a></h2>
-<dl>
-<dt><b>FancyTreeBuilder(html=0)</b> (class) [<a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>(experimental) An alternate builder that supports manipulation of
-new elements.</p>
-</dd>
-<dt><a id='elementtree.XMLTreeBuilder.FancyTreeBuilder.end-method' name='elementtree.XMLTreeBuilder.FancyTreeBuilder.end-method'><b>end(element)</b></a> [<a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder.end-method'>#</a>]</dt>
-<dd>
-<p>Hook method that's called when a new element has been closed.
-May access the <b>namespaces</b> attribute.
-
-</p><dl>
-<dt><i>element</i></dt>
-<dd>
-The new element.</dd>
-</dl><br />
-</dd>
-<dt><a id='elementtree.XMLTreeBuilder.FancyTreeBuilder.start-method' name='elementtree.XMLTreeBuilder.FancyTreeBuilder.start-method'><b>start(element)</b></a> [<a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder.start-method'>#</a>]</dt>
-<dd>
-<p>Hook method that's called when a new element has been opened.
-May access the <b>namespaces</b> attribute.
-
-</p><dl>
-<dt><i>element</i></dt>
-<dd>
-The new element.  The tag name and attributes are,
-    set, but it has no children, and the text and tail attributes
-    are still empty.</dd>
-</dl><br />
-</dd>
-</dl>
-<h2><a id='elementtree.XMLTreeBuilder.TreeBuilder-class' name='elementtree.XMLTreeBuilder.TreeBuilder-class'>The TreeBuilder Class</a></h2>
-<dl>
-<dt><b>TreeBuilder</b> (class)  [<a href='#elementtree.XMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
-<dd>
-<p>(obsolete) ElementTree builder for XML source data, based on the
-<b>expat</b> parser.
-</p><p>
-This class is an alias for ElementTree.XMLTreeBuilder.  New code
-should use that version instead.
-
-</p></dd>
-</dl>
-</body></html>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
+<html>
+<head>
+<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
+<title>The elementtree.XMLTreeBuilder Module</title>
+<link rel='stylesheet' href='effbot.css' type='text/css' />
+</head>
+<body>
+<h1>The elementtree.XMLTreeBuilder Module</h1>
+<p>Tools to build element trees from XML files.</p>
+<h2>Module Contents</h2>
+<dl>
+<dt><b>FancyTreeBuilder(html=0)</b> (class) [<a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>(experimental) An alternate builder that supports manipulation of
+new elements.</p>
+<p>For more information about this class, see <a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder-class'><i>The FancyTreeBuilder Class</i></a>.</p>
+</dd>
+<dt><b>TreeBuilder</b> (class)  [<a href='#elementtree.XMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>(obsolete) ElementTree builder for XML source data, based on the
+expat parser.</p>
+<p>For more information about this class, see <a href='#elementtree.XMLTreeBuilder.TreeBuilder-class'><i>The TreeBuilder Class</i></a>.</p>
+</dd>
+</dl>
+<h2><a id='elementtree.XMLTreeBuilder.FancyTreeBuilder-class' name='elementtree.XMLTreeBuilder.FancyTreeBuilder-class'>The FancyTreeBuilder Class</a></h2>
+<dl>
+<dt><b>FancyTreeBuilder(html=0)</b> (class) [<a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>(experimental) An alternate builder that supports manipulation of
+new elements.</p>
+</dd>
+<dt><a id='elementtree.XMLTreeBuilder.FancyTreeBuilder.end-method' name='elementtree.XMLTreeBuilder.FancyTreeBuilder.end-method'><b>end(element)</b></a> [<a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder.end-method'>#</a>]</dt>
+<dd>
+<p>Hook method that's called when a new element has been closed.
+May access the <b>namespaces</b> attribute.
+
+</p><dl>
+<dt><i>element</i></dt>
+<dd>
+The new element.</dd>
+</dl><br />
+</dd>
+<dt><a id='elementtree.XMLTreeBuilder.FancyTreeBuilder.start-method' name='elementtree.XMLTreeBuilder.FancyTreeBuilder.start-method'><b>start(element)</b></a> [<a href='#elementtree.XMLTreeBuilder.FancyTreeBuilder.start-method'>#</a>]</dt>
+<dd>
+<p>Hook method that's called when a new element has been opened.
+May access the <b>namespaces</b> attribute.
+
+</p><dl>
+<dt><i>element</i></dt>
+<dd>
+The new element.  The tag name and attributes are,
+    set, but it has no children, and the text and tail attributes
+    are still empty.</dd>
+</dl><br />
+</dd>
+</dl>
+<h2><a id='elementtree.XMLTreeBuilder.TreeBuilder-class' name='elementtree.XMLTreeBuilder.TreeBuilder-class'>The TreeBuilder Class</a></h2>
+<dl>
+<dt><b>TreeBuilder</b> (class)  [<a href='#elementtree.XMLTreeBuilder.TreeBuilder-class'>#</a>]</dt>
+<dd>
+<p>(obsolete) ElementTree builder for XML source data, based on the
+<b>expat</b> parser.
+</p><p>
+This class is an alias for ElementTree.XMLTreeBuilder.  New code
+should use that version instead.
+
+</p></dd>
+</dl>
+</body></html>

Modified: external/elementtree-1.2.6-20050316/elementtree/ElementInclude.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/ElementInclude.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/ElementInclude.py	Wed Dec 14 19:33:39 2005
@@ -1,141 +1,141 @@
-#
-# ElementTree
-# $Id: ElementInclude.py 1862 2004-06-18 07:31:02Z Fredrik $
-#
-# limited xinclude support for element trees
-#
-# history:
-# 2003-08-15 fl   created
-# 2003-11-14 fl   fixed default loader
-#
-# Copyright (c) 2003-2004 by Fredrik Lundh.  All rights reserved.
-#
-# fredrik at pythonware.com
-# http://www.pythonware.com
-#
-# --------------------------------------------------------------------
-# The ElementTree toolkit is
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh
-#
-# By obtaining, using, and/or copying this software and/or its
-# associated documentation, you agree that you have read, understood,
-# and will comply with the following terms and conditions:
-#
-# Permission to use, copy, modify, and distribute this software and
-# its associated documentation for any purpose and without fee is
-# hereby granted, provided that the above copyright notice appears in
-# all copies, and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of
-# Secret Labs AB or the author not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
-# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-# --------------------------------------------------------------------
-
-##
-# Limited XInclude support for the ElementTree package.
-##
-
-import copy
-import ElementTree
-
-XINCLUDE = "{http://www.w3.org/2001/XInclude}"
-
-XINCLUDE_INCLUDE = XINCLUDE + "include"
-XINCLUDE_FALLBACK = XINCLUDE + "fallback"
-
-##
-# Fatal include error.
-
-class FatalIncludeError(SyntaxError):
-    pass
-
-##
-# Default loader.  This loader reads an included resource from disk.
-#
-# @param href Resource reference.
-# @param parse Parse mode.  Either "xml" or "text".
-# @param encoding Optional text encoding.
-# @return The expanded resource.  If the parse mode is "xml", this
-#    is an ElementTree instance.  If the parse mode is "text", this
-#    is a Unicode string.  If the loader fails, it can return None
-#    or raise an IOError exception.
-# @throws IOError If the loader fails to load the resource.
-
-def default_loader(href, parse, encoding=None):
-    file = open(href)
-    if parse == "xml":
-        data = ElementTree.parse(file).getroot()
-    else:
-        data = file.read()
-        if encoding:
-            data = data.decode(encoding)
-    file.close()
-    return data
-
-##
-# Expand XInclude directives.
-#
-# @param elem Root element.
-# @param loader Optional resource loader.  If omitted, it defaults
-#     to {@link default_loader}.  If given, it should be a callable
-#     that implements the same interface as <b>default_loader</b>.
-# @throws FatalIncludeError If the function fails to include a given
-#     resource, or if the tree contains malformed XInclude elements.
-# @throws IOError If the function fails to load a given resource.
-
-def include(elem, loader=None):
-    if loader is None:
-        loader = default_loader
-    # look for xinclude elements
-    i = 0
-    while i < len(elem):
-        e = elem[i]
-        if e.tag == XINCLUDE_INCLUDE:
-            # process xinclude directive
-            href = e.get("href")
-            parse = e.get("parse", "xml")
-            if parse == "xml":
-                node = loader(href, parse)
-                if node is None:
-                    raise FatalIncludeError(
-                        "cannot load %r as %r" % (href, parse)
-                        )
-                node = copy.copy(node)
-                if e.tail:
-                    node.tail = (node.tail or "") + e.tail
-                elem[i] = node
-            elif parse == "text":
-                text = loader(href, parse, e.get("encoding"))
-                if text is None:
-                    raise FatalIncludeError(
-                        "cannot load %r as %r" % (href, parse)
-                        )
-                if i:
-                    node = elem[i-1]
-                    node.tail = (node.tail or "") + text
-                else:
-                    elem.text = (elem.text or "") + text + (e.tail or "")
-                del elem[i]
-                continue
-            else:
-                raise FatalIncludeError(
-                    "unknown parse type in xi:include tag (%r)" % parse
-                )
-        elif e.tag == XINCLUDE_FALLBACK:
-            raise FatalIncludeError(
-                "xi:fallback tag must be child of xi:include (%r)" % e.tag
-                )
-        else:
-            include(e, loader)
-        i = i + 1
-
+#
+# ElementTree
+# $Id: ElementInclude.py 1862 2004-06-18 07:31:02Z Fredrik $
+#
+# limited xinclude support for element trees
+#
+# history:
+# 2003-08-15 fl   created
+# 2003-11-14 fl   fixed default loader
+#
+# Copyright (c) 2003-2004 by Fredrik Lundh.  All rights reserved.
+#
+# fredrik at pythonware.com
+# http://www.pythonware.com
+#
+# --------------------------------------------------------------------
+# The ElementTree toolkit is
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------
+
+##
+# Limited XInclude support for the ElementTree package.
+##
+
+import copy
+import ElementTree
+
+XINCLUDE = "{http://www.w3.org/2001/XInclude}"
+
+XINCLUDE_INCLUDE = XINCLUDE + "include"
+XINCLUDE_FALLBACK = XINCLUDE + "fallback"
+
+##
+# Fatal include error.
+
+class FatalIncludeError(SyntaxError):
+    pass
+
+##
+# Default loader.  This loader reads an included resource from disk.
+#
+# @param href Resource reference.
+# @param parse Parse mode.  Either "xml" or "text".
+# @param encoding Optional text encoding.
+# @return The expanded resource.  If the parse mode is "xml", this
+#    is an ElementTree instance.  If the parse mode is "text", this
+#    is a Unicode string.  If the loader fails, it can return None
+#    or raise an IOError exception.
+# @throws IOError If the loader fails to load the resource.
+
+def default_loader(href, parse, encoding=None):
+    file = open(href)
+    if parse == "xml":
+        data = ElementTree.parse(file).getroot()
+    else:
+        data = file.read()
+        if encoding:
+            data = data.decode(encoding)
+    file.close()
+    return data
+
+##
+# Expand XInclude directives.
+#
+# @param elem Root element.
+# @param loader Optional resource loader.  If omitted, it defaults
+#     to {@link default_loader}.  If given, it should be a callable
+#     that implements the same interface as <b>default_loader</b>.
+# @throws FatalIncludeError If the function fails to include a given
+#     resource, or if the tree contains malformed XInclude elements.
+# @throws IOError If the function fails to load a given resource.
+
+def include(elem, loader=None):
+    if loader is None:
+        loader = default_loader
+    # look for xinclude elements
+    i = 0
+    while i < len(elem):
+        e = elem[i]
+        if e.tag == XINCLUDE_INCLUDE:
+            # process xinclude directive
+            href = e.get("href")
+            parse = e.get("parse", "xml")
+            if parse == "xml":
+                node = loader(href, parse)
+                if node is None:
+                    raise FatalIncludeError(
+                        "cannot load %r as %r" % (href, parse)
+                        )
+                node = copy.copy(node)
+                if e.tail:
+                    node.tail = (node.tail or "") + e.tail
+                elem[i] = node
+            elif parse == "text":
+                text = loader(href, parse, e.get("encoding"))
+                if text is None:
+                    raise FatalIncludeError(
+                        "cannot load %r as %r" % (href, parse)
+                        )
+                if i:
+                    node = elem[i-1]
+                    node.tail = (node.tail or "") + text
+                else:
+                    elem.text = (elem.text or "") + text + (e.tail or "")
+                del elem[i]
+                continue
+            else:
+                raise FatalIncludeError(
+                    "unknown parse type in xi:include tag (%r)" % parse
+                )
+        elif e.tag == XINCLUDE_FALLBACK:
+            raise FatalIncludeError(
+                "xi:fallback tag must be child of xi:include (%r)" % e.tag
+                )
+        else:
+            include(e, loader)
+        i = i + 1
+

Modified: external/elementtree-1.2.6-20050316/elementtree/ElementPath.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/ElementPath.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/ElementPath.py	Wed Dec 14 19:33:39 2005
@@ -1,196 +1,196 @@
-#
-# ElementTree
-# $Id: ElementPath.py 1858 2004-06-17 21:31:41Z Fredrik $
-#
-# limited xpath support for element trees
-#
-# history:
-# 2003-05-23 fl   created
-# 2003-05-28 fl   added support for // etc
-# 2003-08-27 fl   fixed parsing of periods in element names
-#
-# Copyright (c) 2003-2004 by Fredrik Lundh.  All rights reserved.
-#
-# fredrik at pythonware.com
-# http://www.pythonware.com
-#
-# --------------------------------------------------------------------
-# The ElementTree toolkit is
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh
-#
-# By obtaining, using, and/or copying this software and/or its
-# associated documentation, you agree that you have read, understood,
-# and will comply with the following terms and conditions:
-#
-# Permission to use, copy, modify, and distribute this software and
-# its associated documentation for any purpose and without fee is
-# hereby granted, provided that the above copyright notice appears in
-# all copies, and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of
-# Secret Labs AB or the author not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
-# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-# --------------------------------------------------------------------
-
-##
-# Implementation module for XPath support.  There's usually no reason
-# to import this module directly; the <b>ElementTree</b> does this for
-# you, if needed.
-##
-
-import re
-
-xpath_tokenizer = re.compile(
-    "(::|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/:\[\]\(\)@=\s]+)|\s+"
-    ).findall
-
-class xpath_descendant_or_self:
-    pass
-
-##
-# Wrapper for a compiled XPath.
-
-class Path:
-
-    ##
-    # Create an Path instance from an XPath expression.
-
-    def __init__(self, path):
-        tokens = xpath_tokenizer(path)
-        # the current version supports 'path/path'-style expressions only
-        self.path = []
-        self.tag = None
-        if tokens and tokens[0][0] == "/":
-            raise SyntaxError("cannot use absolute path on element")
-        while tokens:
-            op, tag = tokens.pop(0)
-            if tag or op == "*":
-                self.path.append(tag or op)
-            elif op == ".":
-                pass
-            elif op == "/":
-                self.path.append(xpath_descendant_or_self())
-                continue
-            else:
-                raise SyntaxError("unsupported path syntax (%s)" % op)
-            if tokens:
-                op, tag = tokens.pop(0)
-                if op != "/":
-                    raise SyntaxError(
-                        "expected path separator (%s)" % (op or tag)
-                        )
-        if self.path and isinstance(self.path[-1], xpath_descendant_or_self):
-            raise SyntaxError("path cannot end with //")
-        if len(self.path) == 1 and isinstance(self.path[0], type("")):
-            self.tag = self.path[0]
-
-    ##
-    # Find first matching object.
-
-    def find(self, element):
-        tag = self.tag
-        if tag is None:
-            nodeset = self.findall(element)
-            if not nodeset:
-                return None
-            return nodeset[0]
-        for elem in element:
-            if elem.tag == tag:
-                return elem
-        return None
-
-    ##
-    # Find text for first matching object.
-
-    def findtext(self, element, default=None):
-        tag = self.tag
-        if tag is None:
-            nodeset = self.findall(element)
-            if not nodeset:
-                return default
-            return nodeset[0].text or ""
-        for elem in element:
-            if elem.tag == tag:
-                return elem.text or ""
-        return default
-
-    ##
-    # Find all matching objects.
-
-    def findall(self, element):
-        nodeset = [element]
-        index = 0
-        while 1:
-            try:
-                path = self.path[index]
-                index = index + 1
-            except IndexError:
-                return nodeset
-            set = []
-            if isinstance(path, xpath_descendant_or_self):
-                try:
-                    tag = self.path[index]
-                    if not isinstance(tag, type("")):
-                        tag = None
-                    else:
-                        index = index + 1
-                except IndexError:
-                    tag = None # invalid path
-                for node in nodeset:
-                    new = list(node.getiterator(tag))
-                    if new and new[0] is node:
-                        set.extend(new[1:])
-                    else:
-                        set.extend(new)
-            else:
-                for node in nodeset:
-                    for node in node:
-                        if path == "*" or node.tag == path:
-                            set.append(node)
-            if not set:
-                return []
-            nodeset = set
-
-_cache = {}
-
-##
-# (Internal) Compile path.
-
-def _compile(path):
-    p = _cache.get(path)
-    if p is not None:
-        return p
-    p = Path(path)
-    if len(_cache) >= 100:
-        _cache.clear()
-    _cache[path] = p
-    return p
-
-##
-# Find first matching object.
-
-def find(element, path):
-    return _compile(path).find(element)
-
-##
-# Find text for first matching object.
-
-def findtext(element, path, default=None):
-    return _compile(path).findtext(element, default)
-
-##
-# Find all matching objects.
-
-def findall(element, path):
-    return _compile(path).findall(element)
-
+#
+# ElementTree
+# $Id: ElementPath.py 1858 2004-06-17 21:31:41Z Fredrik $
+#
+# limited xpath support for element trees
+#
+# history:
+# 2003-05-23 fl   created
+# 2003-05-28 fl   added support for // etc
+# 2003-08-27 fl   fixed parsing of periods in element names
+#
+# Copyright (c) 2003-2004 by Fredrik Lundh.  All rights reserved.
+#
+# fredrik at pythonware.com
+# http://www.pythonware.com
+#
+# --------------------------------------------------------------------
+# The ElementTree toolkit is
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------
+
+##
+# Implementation module for XPath support.  There's usually no reason
+# to import this module directly; the <b>ElementTree</b> does this for
+# you, if needed.
+##
+
+import re
+
+xpath_tokenizer = re.compile(
+    "(::|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/:\[\]\(\)@=\s]+)|\s+"
+    ).findall
+
+class xpath_descendant_or_self:
+    pass
+
+##
+# Wrapper for a compiled XPath.
+
+class Path:
+
+    ##
+    # Create an Path instance from an XPath expression.
+
+    def __init__(self, path):
+        tokens = xpath_tokenizer(path)
+        # the current version supports 'path/path'-style expressions only
+        self.path = []
+        self.tag = None
+        if tokens and tokens[0][0] == "/":
+            raise SyntaxError("cannot use absolute path on element")
+        while tokens:
+            op, tag = tokens.pop(0)
+            if tag or op == "*":
+                self.path.append(tag or op)
+            elif op == ".":
+                pass
+            elif op == "/":
+                self.path.append(xpath_descendant_or_self())
+                continue
+            else:
+                raise SyntaxError("unsupported path syntax (%s)" % op)
+            if tokens:
+                op, tag = tokens.pop(0)
+                if op != "/":
+                    raise SyntaxError(
+                        "expected path separator (%s)" % (op or tag)
+                        )
+        if self.path and isinstance(self.path[-1], xpath_descendant_or_self):
+            raise SyntaxError("path cannot end with //")
+        if len(self.path) == 1 and isinstance(self.path[0], type("")):
+            self.tag = self.path[0]
+
+    ##
+    # Find first matching object.
+
+    def find(self, element):
+        tag = self.tag
+        if tag is None:
+            nodeset = self.findall(element)
+            if not nodeset:
+                return None
+            return nodeset[0]
+        for elem in element:
+            if elem.tag == tag:
+                return elem
+        return None
+
+    ##
+    # Find text for first matching object.
+
+    def findtext(self, element, default=None):
+        tag = self.tag
+        if tag is None:
+            nodeset = self.findall(element)
+            if not nodeset:
+                return default
+            return nodeset[0].text or ""
+        for elem in element:
+            if elem.tag == tag:
+                return elem.text or ""
+        return default
+
+    ##
+    # Find all matching objects.
+
+    def findall(self, element):
+        nodeset = [element]
+        index = 0
+        while 1:
+            try:
+                path = self.path[index]
+                index = index + 1
+            except IndexError:
+                return nodeset
+            set = []
+            if isinstance(path, xpath_descendant_or_self):
+                try:
+                    tag = self.path[index]
+                    if not isinstance(tag, type("")):
+                        tag = None
+                    else:
+                        index = index + 1
+                except IndexError:
+                    tag = None # invalid path
+                for node in nodeset:
+                    new = list(node.getiterator(tag))
+                    if new and new[0] is node:
+                        set.extend(new[1:])
+                    else:
+                        set.extend(new)
+            else:
+                for node in nodeset:
+                    for node in node:
+                        if path == "*" or node.tag == path:
+                            set.append(node)
+            if not set:
+                return []
+            nodeset = set
+
+_cache = {}
+
+##
+# (Internal) Compile path.
+
+def _compile(path):
+    p = _cache.get(path)
+    if p is not None:
+        return p
+    p = Path(path)
+    if len(_cache) >= 100:
+        _cache.clear()
+    _cache[path] = p
+    return p
+
+##
+# Find first matching object.
+
+def find(element, path):
+    return _compile(path).find(element)
+
+##
+# Find text for first matching object.
+
+def findtext(element, path, default=None):
+    return _compile(path).findtext(element, default)
+
+##
+# Find all matching objects.
+
+def findall(element, path):
+    return _compile(path).findall(element)
+

Modified: external/elementtree-1.2.6-20050316/elementtree/ElementTree.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/ElementTree.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/ElementTree.py	Wed Dec 14 19:33:39 2005
@@ -1,1254 +1,1254 @@
-#
-# ElementTree
-# $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $
-#
-# light-weight XML support for Python 1.5.2 and later.
-#
-# history:
-# 2001-10-20 fl   created (from various sources)
-# 2001-11-01 fl   return root from parse method
-# 2002-02-16 fl   sort attributes in lexical order
-# 2002-04-06 fl   TreeBuilder refactoring, added PythonDoc markup
-# 2002-05-01 fl   finished TreeBuilder refactoring
-# 2002-07-14 fl   added basic namespace support to ElementTree.write
-# 2002-07-25 fl   added QName attribute support
-# 2002-10-20 fl   fixed encoding in write
-# 2002-11-24 fl   changed default encoding to ascii; fixed attribute encoding
-# 2002-11-27 fl   accept file objects or file names for parse/write
-# 2002-12-04 fl   moved XMLTreeBuilder back to this module
-# 2003-01-11 fl   fixed entity encoding glitch for us-ascii
-# 2003-02-13 fl   added XML literal factory
-# 2003-02-21 fl   added ProcessingInstruction/PI factory
-# 2003-05-11 fl   added tostring/fromstring helpers
-# 2003-05-26 fl   added ElementPath support
-# 2003-07-05 fl   added makeelement factory method
-# 2003-07-28 fl   added more well-known namespace prefixes
-# 2003-08-15 fl   fixed typo in ElementTree.findtext (Thomas Dartsch)
-# 2003-09-04 fl   fall back on emulator if ElementPath is not installed
-# 2003-10-31 fl   markup updates
-# 2003-11-15 fl   fixed nested namespace bug
-# 2004-03-28 fl   added XMLID helper
-# 2004-06-02 fl   added default support to findtext
-# 2004-06-08 fl   fixed encoding of non-ascii element/attribute names
-# 2004-08-23 fl   take advantage of post-2.1 expat features
-# 2005-02-01 fl   added iterparse implementation
-# 2005-03-02 fl   fixed iterparse support for pre-2.2 versions
-#
-# Copyright (c) 1999-2005 by Fredrik Lundh.  All rights reserved.
-#
-# fredrik at pythonware.com
-# http://www.pythonware.com
-#
-# --------------------------------------------------------------------
-# The ElementTree toolkit is
-#
-# Copyright (c) 1999-2005 by Fredrik Lundh
-#
-# By obtaining, using, and/or copying this software and/or its
-# associated documentation, you agree that you have read, understood,
-# and will comply with the following terms and conditions:
-#
-# Permission to use, copy, modify, and distribute this software and
-# its associated documentation for any purpose and without fee is
-# hereby granted, provided that the above copyright notice appears in
-# all copies, and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of
-# Secret Labs AB or the author not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
-# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-# --------------------------------------------------------------------
-
-__all__ = [
-    # public symbols
-    "Comment",
-    "dump",
-    "Element", "ElementTree",
-    "fromstring",
-    "iselement", "iterparse",
-    "parse",
-    "PI", "ProcessingInstruction",
-    "QName",
-    "SubElement",
-    "tostring",
-    "TreeBuilder",
-    "VERSION", "XML",
-    "XMLTreeBuilder",
-    ]
-
-##
-# The <b>Element</b> type is a flexible container object, designed to
-# store hierarchical data structures in memory. The type can be
-# described as a cross between a list and a dictionary.
-# <p>
-# Each element has a number of properties associated with it:
-# <ul>
-# <li>a <i>tag</i>. This is a string identifying what kind of data
-# this element represents (the element type, in other words).</li>
-# <li>a number of <i>attributes</i>, stored in a Python dictionary.</li>
-# <li>a <i>text</i> string.</li>
-# <li>an optional <i>tail</i> string.</li>
-# <li>a number of <i>child elements</i>, stored in a Python sequence</li>
-# </ul>
-#
-# To create an element instance, use the {@link #Element} or {@link
-# #SubElement} factory functions.
-# <p>
-# The {@link #ElementTree} class can be used to wrap an element
-# structure, and convert it from and to XML.
-##
-
-import string, sys, re
-
-class _SimpleElementPath:
-    # emulate pre-1.2 find/findtext/findall behaviour
-    def find(self, element, tag):
-        for elem in element:
-            if elem.tag == tag:
-                return elem
-        return None
-    def findtext(self, element, tag, default=None):
-        for elem in element:
-            if elem.tag == tag:
-                return elem.text or ""
-        return default
-    def findall(self, element, tag):
-        if tag[:3] == ".//":
-            return element.getiterator(tag[3:])
-        result = []
-        for elem in element:
-            if elem.tag == tag:
-                result.append(elem)
-        return result
-
-try:
-    import ElementPath
-except ImportError:
-    # FIXME: issue warning in this case?
-    ElementPath = _SimpleElementPath()
-
-# TODO: add support for custom namespace resolvers/default namespaces
-# TODO: add improved support for incremental parsing
-
-VERSION = "1.2.6"
-
-##
-# Internal element class.  This class defines the Element interface,
-# and provides a reference implementation of this interface.
-# <p>
-# You should not create instances of this class directly.  Use the
-# appropriate factory functions instead, such as {@link #Element}
-# and {@link #SubElement}.
-#
-# @see Element
-# @see SubElement
-# @see Comment
-# @see ProcessingInstruction
-
-class _ElementInterface:
-    # <tag attrib>text<child/>...</tag>tail
-
-    ##
-    # (Attribute) Element tag.
-
-    tag = None
-
-    ##
-    # (Attribute) Element attribute dictionary.  Where possible, use
-    # {@link #_ElementInterface.get},
-    # {@link #_ElementInterface.set},
-    # {@link #_ElementInterface.keys}, and
-    # {@link #_ElementInterface.items} to access
-    # element attributes.
-
-    attrib = None
-
-    ##
-    # (Attribute) Text before first subelement.  This is either a
-    # string or the value None, if there was no text.
-
-    text = None
-
-    ##
-    # (Attribute) 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.
-
-    tail = None # text after end tag, if any
-
-    def __init__(self, tag, attrib):
-        self.tag = tag
-        self.attrib = attrib
-        self._children = []
-
-    def __repr__(self):
-        return "<Element %s at %x>" % (self.tag, id(self))
-
-    ##
-    # Creates a new element object of the same type as this element.
-    #
-    # @param tag Element tag.
-    # @param attrib Element attributes, given as a dictionary.
-    # @return A new element instance.
-
-    def makeelement(self, tag, attrib):
-        return Element(tag, attrib)
-
-    ##
-    # Returns the number of subelements.
-    #
-    # @return The number of subelements.
-
-    def __len__(self):
-        return len(self._children)
-
-    ##
-    # Returns the given subelement.
-    #
-    # @param index What subelement to return.
-    # @return The given subelement.
-    # @exception IndexError If the given element does not exist.
-
-    def __getitem__(self, index):
-        return self._children[index]
-
-    ##
-    # Replaces the given subelement.
-    #
-    # @param index What subelement to replace.
-    # @param element The new element value.
-    # @exception IndexError If the given element does not exist.
-    # @exception AssertionError If element is not a valid object.
-
-    def __setitem__(self, index, element):
-        assert iselement(element)
-        self._children[index] = element
-
-    ##
-    # Deletes the given subelement.
-    #
-    # @param index What subelement to delete.
-    # @exception IndexError If the given element does not exist.
-
-    def __delitem__(self, index):
-        del self._children[index]
-
-    ##
-    # Returns a list containing subelements in the given range.
-    #
-    # @param start The first subelement to return.
-    # @param stop The first subelement that shouldn't be returned.
-    # @return A sequence object containing subelements.
-
-    def __getslice__(self, start, stop):
-        return self._children[start:stop]
-
-    ##
-    # Replaces a number of subelements with elements from a sequence.
-    #
-    # @param start The first subelement to replace.
-    # @param stop The first subelement that shouldn't be replaced.
-    # @param elements A sequence object with zero or more elements.
-    # @exception AssertionError If a sequence member is not a valid object.
-
-    def __setslice__(self, start, stop, elements):
-        for element in elements:
-            assert iselement(element)
-        self._children[start:stop] = list(elements)
-
-    ##
-    # Deletes a number of subelements.
-    #
-    # @param start The first subelement to delete.
-    # @param stop The first subelement to leave in there.
-
-    def __delslice__(self, start, stop):
-        del self._children[start:stop]
-
-    ##
-    # Adds a subelement to the end of this element.
-    #
-    # @param element The element to add.
-    # @exception AssertionError If a sequence member is not a valid object.
-
-    def append(self, element):
-        assert iselement(element)
-        self._children.append(element)
-
-    ##
-    # Inserts a subelement at the given position in this element.
-    #
-    # @param index Where to insert the new subelement.
-    # @exception AssertionError If the element is not a valid object.
-
-    def insert(self, index, element):
-        assert iselement(element)
-        self._children.insert(index, element)
-
-    ##
-    # Removes a matching subelement.  Unlike the <b>find</b> methods,
-    # this method compares elements based on identity, not on tag
-    # value or contents.
-    #
-    # @param element What element to remove.
-    # @exception ValueError If a matching element could not be found.
-    # @exception AssertionError If the element is not a valid object.
-
-    def remove(self, element):
-        assert iselement(element)
-        self._children.remove(element)
-
-    ##
-    # Returns all subelements.  The elements are returned in document
-    # order.
-    #
-    # @return A list of subelements.
-    # @defreturn list of Element instances
-
-    def getchildren(self):
-        return self._children
-
-    ##
-    # Finds the first matching subelement, by tag name or path.
-    #
-    # @param path What element to look for.
-    # @return The first matching element, or None if no element was found.
-    # @defreturn Element or None
-
-    def find(self, path):
-        return ElementPath.find(self, path)
-
-    ##
-    # Finds text for the first matching subelement, by tag name or path.
-    #
-    # @param path What element to look for.
-    # @param default What to return if the element was not found.
-    # @return The text content of the first matching element, or the
-    #     default value no element was found.  Note that if the element
-    #     has is found, but has no text content, this method returns an
-    #     empty string.
-    # @defreturn string
-
-    def findtext(self, path, default=None):
-        return ElementPath.findtext(self, path, default)
-
-    ##
-    # Finds all matching subelements, by tag name or path.
-    #
-    # @param path What element to look for.
-    # @return A list or iterator containing all matching elements,
-    #    in document order.
-    # @defreturn list of Element instances
-
-    def findall(self, path):
-        return ElementPath.findall(self, path)
-
-    ##
-    # Resets an element.  This function removes all subelements, clears
-    # all attributes, and sets the text and tail attributes to None.
-
-    def clear(self):
-        self.attrib.clear()
-        self._children = []
-        self.text = self.tail = None
-
-    ##
-    # Gets an element attribute.
-    #
-    # @param key What attribute to look for.
-    # @param default What to return if the attribute was not found.
-    # @return The attribute value, or the default value, if the
-    #     attribute was not found.
-    # @defreturn string or None
-
-    def get(self, key, default=None):
-        return self.attrib.get(key, default)
-
-    ##
-    # Sets an element attribute.
-    #
-    # @param key What attribute to set.
-    # @param value The attribute value.
-
-    def set(self, key, value):
-        self.attrib[key] = value
-
-    ##
-    # Gets a list of attribute names.  The names are returned in an
-    # arbitrary order (just like for an ordinary Python dictionary).
-    #
-    # @return A list of element attribute names.
-    # @defreturn list of strings
-
-    def keys(self):
-        return self.attrib.keys()
-
-    ##
-    # Gets element attributes, as a sequence.  The attributes are
-    # returned in an arbitrary order.
-    #
-    # @return A list of (name, value) tuples for all attributes.
-    # @defreturn list of (string, string) tuples
-
-    def items(self):
-        return self.attrib.items()
-
-    ##
-    # Creates a tree iterator.  The iterator loops over this element
-    # and all subelements, in document order, and returns all elements
-    # with a matching tag.
-    # <p>
-    # If the tree structure is modified during iteration, the result
-    # is undefined.
-    #
-    # @param tag What tags to look for (default is to return all elements).
-    # @return A list or iterator containing all the matching elements.
-    # @defreturn list or iterator
-
-    def getiterator(self, tag=None):
-        nodes = []
-        if tag == "*":
-            tag = None
-        if tag is None or self.tag == tag:
-            nodes.append(self)
-        for node in self._children:
-            nodes.extend(node.getiterator(tag))
-        return nodes
-
-# compatibility
-_Element = _ElementInterface
-
-##
-# Element factory.  This function returns an object implementing the
-# standard Element interface.  The exact class or type of that object
-# is implementation dependent, but it will always be compatible with
-# the {@link #_ElementInterface} class in this module.
-# <p>
-# The element name, attribute names, and attribute values can be
-# either 8-bit ASCII strings or Unicode strings.
-#
-# @param tag The element name.
-# @param attrib An optional dictionary, containing element attributes.
-# @param **extra Additional attributes, given as keyword arguments.
-# @return An element instance.
-# @defreturn Element
-
-def Element(tag, attrib={}, **extra):
-    attrib = attrib.copy()
-    attrib.update(extra)
-    return _ElementInterface(tag, attrib)
-
-##
-# Subelement factory.  This function creates an element instance, and
-# appends it to an existing element.
-# <p>
-# The element name, attribute names, and attribute values can be
-# either 8-bit ASCII strings or Unicode strings.
-#
-# @param parent The parent element.
-# @param tag The subelement name.
-# @param attrib An optional dictionary, containing element attributes.
-# @param **extra Additional attributes, given as keyword arguments.
-# @return An element instance.
-# @defreturn Element
-
-def SubElement(parent, tag, attrib={}, **extra):
-    attrib = attrib.copy()
-    attrib.update(extra)
-    element = parent.makeelement(tag, attrib)
-    parent.append(element)
-    return element
-
-##
-# Comment element factory.  This factory function creates a special
-# element that will be serialized as an XML comment.
-# <p>
-# The comment string can be either an 8-bit ASCII string or a Unicode
-# string.
-#
-# @param text A string containing the comment string.
-# @return An element instance, representing a comment.
-# @defreturn Element
-
-def Comment(text=None):
-    element = Element(Comment)
-    element.text = text
-    return element
-
-##
-# PI element factory.  This factory function creates a special element
-# that will be serialized as an XML processing instruction.
-#
-# @param target A string containing the PI target.
-# @param text A string containing the PI contents, if any.
-# @return An element instance, representing a PI.
-# @defreturn Element
-
-def ProcessingInstruction(target, text=None):
-    element = Element(ProcessingInstruction)
-    element.text = target
-    if text:
-        element.text = element.text + " " + text
-    return element
-
-PI = ProcessingInstruction
-
-##
-# QName wrapper.  This can be used to wrap a QName attribute value, in
-# order to get proper namespace handling on output.
-#
-# @param text A string containing the QName value, in the form {uri}local,
-#     or, if the tag argument is given, the URI part of a QName.
-# @param tag Optional tag.  If given, the first argument is interpreted as
-#     an URI, and this argument is interpreted as a local name.
-# @return An opaque object, representing the QName.
-
-class QName:
-    def __init__(self, text_or_uri, tag=None):
-        if tag:
-            text_or_uri = "{%s}%s" % (text_or_uri, tag)
-        self.text = text_or_uri
-    def __str__(self):
-        return self.text
-    def __hash__(self):
-        return hash(self.text)
-    def __cmp__(self, other):
-        if isinstance(other, QName):
-            return cmp(self.text, other.text)
-        return cmp(self.text, other)
-
-##
-# ElementTree wrapper class.  This class represents an entire element
-# hierarchy, and adds some extra support for serialization to and from
-# standard XML.
-#
-# @param element Optional root element.
-# @keyparam file Optional file handle or name.  If given, the
-#     tree is initialized with the contents of this XML file.
-
-class ElementTree:
-
-    def __init__(self, element=None, file=None):
-        assert element is None or iselement(element)
-        self._root = element # first node
-        if file:
-            self.parse(file)
-
-    ##
-    # Gets the root element for this tree.
-    #
-    # @return An element instance.
-    # @defreturn Element
-
-    def getroot(self):
-        return self._root
-
-    ##
-    # Replaces the root element for this tree.  This discards the
-    # current contents of the tree, and replaces it with the given
-    # element.  Use with care.
-    #
-    # @param element An element instance.
-
-    def _setroot(self, element):
-        assert iselement(element)
-        self._root = element
-
-    ##
-    # Loads an external XML document into this element tree.
-    #
-    # @param source A file name or file object.
-    # @param parser An optional parser instance.  If not given, the
-    #     standard {@link XMLTreeBuilder} parser is used.
-    # @return The document root element.
-    # @defreturn Element
-
-    def parse(self, source, parser=None):
-        if not hasattr(source, "read"):
-            source = open(source, "rb")
-        if not parser:
-            parser = XMLTreeBuilder()
-        while 1:
-            data = source.read(32768)
-            if not data:
-                break
-            parser.feed(data)
-        self._root = parser.close()
-        return self._root
-
-    ##
-    # Creates a tree iterator for the root element.  The iterator loops
-    # over all elements in this tree, in document order.
-    #
-    # @param tag What tags to look for (default is to return all elements)
-    # @return An iterator.
-    # @defreturn iterator
-
-    def getiterator(self, tag=None):
-        assert self._root is not None
-        return self._root.getiterator(tag)
-
-    ##
-    # Finds the first toplevel element with given tag.
-    # Same as getroot().find(path).
-    #
-    # @param path What element to look for.
-    # @return The first matching element, or None if no element was found.
-    # @defreturn Element or None
-
-    def find(self, path):
-        assert self._root is not None
-        if path[:1] == "/":
-            path = "." + path
-        return self._root.find(path)
-
-    ##
-    # Finds the element text for the first toplevel element with given
-    # tag.  Same as getroot().findtext(path).
-    #
-    # @param path What toplevel element to look for.
-    # @param default What to return if the element was not found.
-    # @return The text content of the first matching element, or the
-    #     default value no element was found.  Note that if the element
-    #     has is found, but has no text content, this method returns an
-    #     empty string.
-    # @defreturn string
-
-    def findtext(self, path, default=None):
-        assert self._root is not None
-        if path[:1] == "/":
-            path = "." + path
-        return self._root.findtext(path, default)
-
-    ##
-    # Finds all toplevel elements with the given tag.
-    # Same as getroot().findall(path).
-    #
-    # @param path What element to look for.
-    # @return A list or iterator containing all matching elements,
-    #    in document order.
-    # @defreturn list of Element instances
-
-    def findall(self, path):
-        assert self._root is not None
-        if path[:1] == "/":
-            path = "." + path
-        return self._root.findall(path)
-
-    ##
-    # Writes the element tree to a file, as XML.
-    #
-    # @param file A file name, or a file object opened for writing.
-    # @param encoding Optional output encoding (default is US-ASCII).
-
-    def write(self, file, encoding="us-ascii"):
-        assert self._root is not None
-        if not hasattr(file, "write"):
-            file = open(file, "wb")
-        if not encoding:
-            encoding = "us-ascii"
-        elif encoding != "utf-8" and encoding != "us-ascii":
-            file.write("<?xml version='1.0' encoding='%s'?>\n" % encoding)
-        self._write(file, self._root, encoding, {})
-
-    def _write(self, file, node, encoding, namespaces):
-        # write XML to file
-        tag = node.tag
-        if tag is Comment:
-            file.write("<!-- %s -->" % _escape_cdata(node.text, encoding))
-        elif tag is ProcessingInstruction:
-            file.write("<?%s?>" % _escape_cdata(node.text, encoding))
-        else:
-            items = node.items()
-            xmlns_items = [] # new namespaces in this scope
-            try:
-                if isinstance(tag, QName) or tag[:1] == "{":
-                    tag, xmlns = fixtag(tag, namespaces)
-                    if xmlns: xmlns_items.append(xmlns)
-            except TypeError:
-                _raise_serialization_error(tag)
-            file.write("<" + _encode(tag, encoding))
-            if items or xmlns_items:
-                items.sort() # lexical order
-                for k, v in items:
-                    try:
-                        if isinstance(k, QName) or k[:1] == "{":
-                            k, xmlns = fixtag(k, namespaces)
-                            if xmlns: xmlns_items.append(xmlns)
-                    except TypeError:
-                        _raise_serialization_error(k)
-                    try:
-                        if isinstance(v, QName):
-                            v, xmlns = fixtag(v, namespaces)
-                            if xmlns: xmlns_items.append(xmlns)
-                    except TypeError:
-                        _raise_serialization_error(v)
-                    file.write(" %s=\"%s\"" % (_encode(k, encoding),
-                                               _escape_attrib(v, encoding)))
-                for k, v in xmlns_items:
-                    file.write(" %s=\"%s\"" % (_encode(k, encoding),
-                                               _escape_attrib(v, encoding)))
-            if node.text or len(node):
-                file.write(">")
-                if node.text:
-                    file.write(_escape_cdata(node.text, encoding))
-                for n in node:
-                    self._write(file, n, encoding, namespaces)
-                file.write("</" + _encode(tag, encoding) + ">")
-            else:
-                file.write(" />")
-            for k, v in xmlns_items:
-                del namespaces[v]
-        if node.tail:
-            file.write(_escape_cdata(node.tail, encoding))
-
-# --------------------------------------------------------------------
-# helpers
-
-##
-# Checks if an object appears to be a valid element object.
-#
-# @param An element instance.
-# @return A true value if this is an element object.
-# @defreturn flag
-
-def iselement(element):
-    # FIXME: not sure about this; might be a better idea to look
-    # for tag/attrib/text attributes
-    return isinstance(element, _ElementInterface) or hasattr(element, "tag")
-
-##
-# Writes an element tree or element structure to sys.stdout.  This
-# function should be used for debugging only.
-# <p>
-# The exact output format is implementation dependent.  In this
-# version, it's written as an ordinary XML file.
-#
-# @param elem An element tree or an individual element.
-
-def dump(elem):
-    # debugging
-    if not isinstance(elem, ElementTree):
-        elem = ElementTree(elem)
-    elem.write(sys.stdout)
-    tail = elem.getroot().tail
-    if not tail or tail[-1] != "\n":
-        sys.stdout.write("\n")
-
-def _encode(s, encoding):
-    try:
-        return s.encode(encoding)
-    except AttributeError:
-        return s # 1.5.2: assume the string uses the right encoding
-
-if sys.version[:3] == "1.5":
-    _escape = re.compile(r"[&<>\"\x80-\xff]+") # 1.5.2
-else:
-    _escape = re.compile(eval(r'u"[&<>\"\u0080-\uffff]+"'))
-
-_escape_map = {
-    "&": "&amp;",
-    "<": "&lt;",
-    ">": "&gt;",
-    '"': "&quot;",
-}
-
-_namespace_map = {
-    # "well-known" namespace prefixes
-    "http://www.w3.org/XML/1998/namespace": "xml",
-    "http://www.w3.org/1999/xhtml": "html",
-    "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
-    "http://schemas.xmlsoap.org/wsdl/": "wsdl",
-}
-
-def _raise_serialization_error(text):
-    raise TypeError(
-        "cannot serialize %r (type %s)" % (text, type(text).__name__)
-        )
-
-def _encode_entity(text, pattern=_escape):
-    # map reserved and non-ascii characters to numerical entities
-    def escape_entities(m, map=_escape_map):
-        out = []
-        append = out.append
-        for char in m.group():
-            text = map.get(char)
-            if text is None:
-                text = "&#%d;" % ord(char)
-            append(text)
-        return string.join(out, "")
-    try:
-        return _encode(pattern.sub(escape_entities, text), "ascii")
-    except TypeError:
-        _raise_serialization_error(text)
-
-#
-# the following functions assume an ascii-compatible encoding
-# (or "utf-16")
-
-def _escape_cdata(text, encoding=None, replace=string.replace):
-    # escape character data
-    try:
-        if encoding:
-            try:
-                text = _encode(text, encoding)
-            except UnicodeError:
-                return _encode_entity(text)
-        text = replace(text, "&", "&amp;")
-        text = replace(text, "<", "&lt;")
-        text = replace(text, ">", "&gt;")
-        return text
-    except (TypeError, AttributeError):
-        _raise_serialization_error(text)
-
-def _escape_attrib(text, encoding=None, replace=string.replace):
-    # escape attribute value
-    try:
-        if encoding:
-            try:
-                text = _encode(text, encoding)
-            except UnicodeError:
-                return _encode_entity(text)
-        text = replace(text, "&", "&amp;")
-        text = replace(text, "'", "&apos;") # FIXME: overkill
-        text = replace(text, "\"", "&quot;")
-        text = replace(text, "<", "&lt;")
-        text = replace(text, ">", "&gt;")
-        return text
-    except (TypeError, AttributeError):
-        _raise_serialization_error(text)
-
-def fixtag(tag, namespaces):
-    # given a decorated tag (of the form {uri}tag), return prefixed
-    # tag and namespace declaration, if any
-    if isinstance(tag, QName):
-        tag = tag.text
-    namespace_uri, tag = string.split(tag[1:], "}", 1)
-    prefix = namespaces.get(namespace_uri)
-    if prefix is None:
-        prefix = _namespace_map.get(namespace_uri)
-        if prefix is None:
-            prefix = "ns%d" % len(namespaces)
-        namespaces[namespace_uri] = prefix
-        if prefix == "xml":
-            xmlns = None
-        else:
-            xmlns = ("xmlns:%s" % prefix, namespace_uri)
-    else:
-        xmlns = None
-    return "%s:%s" % (prefix, tag), xmlns
-
-##
-# Parses an XML document into an element tree.
-#
-# @param source A filename or file object containing XML data.
-# @param parser An optional parser instance.  If not given, the
-#     standard {@link XMLTreeBuilder} parser is used.
-# @return An ElementTree instance
-
-def parse(source, parser=None):
-    tree = ElementTree()
-    tree.parse(source, parser)
-    return tree
-
-##
-# Parses an XML document into an element tree incrementally, and reports
-# what's going on to the user.
-#
-# @param source A filename or file object containing XML data.
-# @param events A list of events to report back.  If omitted, only "end"
-#     events are reported.
-# @return A (event, elem) iterator.
-
-class iterparse:
-
-    def __init__(self, source, events=None):
-        if not hasattr(source, "read"):
-            source = open(source, "rb")
-        self._file = source
-        self._events = []
-        self._index = 0
-        self.root = self._root = None
-        self._parser = XMLTreeBuilder()
-        # wire up the parser for event reporting
-        parser = self._parser._parser
-        append = self._events.append
-        if events is None:
-            events = ["end"]
-        for event in events:
-            if event == "start":
-                try:
-                    parser.ordered_attributes = 1
-                    parser.specified_attributes = 1
-                    def handler(tag, attrib_in, event=event, append=append,
-                                start=self._parser._start_list):
-                        append((event, start(tag, attrib_in)))
-                    parser.StartElementHandler = handler
-                except AttributeError:
-                    def handler(tag, attrib_in, event=event, append=append,
-                                start=self._parser._start):
-                        append((event, start(tag, attrib_in)))
-                    parser.StartElementHandler = handler
-            elif event == "end":
-                def handler(tag, event=event, append=append,
-                            end=self._parser._end):
-                    append((event, end(tag)))
-                parser.EndElementHandler = handler
-            elif event == "start-ns":
-                def handler(prefix, uri, event=event, append=append):
-                    try:
-                        uri = _encode(uri, "ascii")
-                    except UnicodeError:
-                        pass
-                    append((event, (prefix or "", uri)))
-                parser.StartNamespaceDeclHandler = handler
-            elif event == "end-ns":
-                def handler(prefix, event=event, append=append):
-                    append((event, None))
-                parser.EndNamespaceDeclHandler = handler
-
-    def next(self):
-        while 1:
-            try:
-                item = self._events[self._index]
-            except IndexError:
-                if self._parser is None:
-                    self.root = self._root
-                    try:
-                        raise StopIteration
-                    except NameError:
-                        raise IndexError
-                # load event buffer
-                del self._events[:]
-                self._index = 0
-                data = self._file.read(16384)
-                if data:
-                    self._parser.feed(data)
-                else:
-                    self._root = self._parser.close()
-                    self._parser = None
-            else:
-                self._index = self._index + 1
-                return item
-
-    try:
-        iter
-        def __iter__(self):
-            return self
-    except NameError:
-        def __getitem__(self, index):
-            return self.next()
-
-##
-# Parses an XML document from a string constant.  This function can
-# be used to embed "XML literals" in Python code.
-#
-# @param source A string containing XML data.
-# @return An Element instance.
-# @defreturn Element
-
-def XML(text):
-    parser = XMLTreeBuilder()
-    parser.feed(text)
-    return parser.close()
-
-##
-# Parses an XML document from a string constant, and also returns
-# a dictionary which maps from element id:s to elements.
-#
-# @param source A string containing XML data.
-# @return A tuple containing an Element instance and a dictionary.
-# @defreturn (Element, dictionary)
-
-def XMLID(text):
-    parser = XMLTreeBuilder()
-    parser.feed(text)
-    tree = parser.close()
-    ids = {}
-    for elem in tree.getiterator():
-        id = elem.get("id")
-        if id:
-            ids[id] = elem
-    return tree, ids
-
-##
-# Parses an XML document from a string constant.  Same as {@link #XML}.
-#
-# @def fromstring(text)
-# @param source A string containing XML data.
-# @return An Element instance.
-# @defreturn Element
-
-fromstring = XML
-
-##
-# Generates a string representation of an XML element, including all
-# subelements.
-#
-# @param element An Element instance.
-# @return An encoded string containing the XML data.
-# @defreturn string
-
-def tostring(element, encoding=None):
-    class dummy:
-        pass
-    data = []
-    file = dummy()
-    file.write = data.append
-    ElementTree(element).write(file, encoding)
-    return string.join(data, "")
-
-##
-# Generic element structure builder.  This builder converts a sequence
-# of {@link #TreeBuilder.start}, {@link #TreeBuilder.data}, and {@link
-# #TreeBuilder.end} method calls to a well-formed element structure.
-# <p>
-# You can use this class to build an element structure using a custom XML
-# parser, or a parser for some other XML-like format.
-#
-# @param element_factory Optional element factory.  This factory
-#    is called to create new Element instances, as necessary.
-
-class TreeBuilder:
-
-    def __init__(self, element_factory=None):
-        self._data = [] # data collector
-        self._elem = [] # element stack
-        self._last = None # last element
-        self._tail = None # true if we're after an end tag
-        if element_factory is None:
-            element_factory = _ElementInterface
-        self._factory = element_factory
-
-    ##
-    # Flushes the parser buffers, and returns the toplevel documen
-    # element.
-    #
-    # @return An Element instance.
-    # @defreturn Element
-
-    def close(self):
-        assert len(self._elem) == 0, "missing end tags"
-        assert self._last != None, "missing toplevel element"
-        return self._last
-
-    def _flush(self):
-        if self._data:
-            if self._last is not None:
-                text = string.join(self._data, "")
-                if self._tail:
-                    assert self._last.tail is None, "internal error (tail)"
-                    self._last.tail = text
-                else:
-                    assert self._last.text is None, "internal error (text)"
-                    self._last.text = text
-            self._data = []
-
-    ##
-    # Adds text to the current element.
-    #
-    # @param data A string.  This should be either an 8-bit string
-    #    containing ASCII text, or a Unicode string.
-
-    def data(self, data):
-        self._data.append(data)
-
-    ##
-    # Opens a new element.
-    #
-    # @param tag The element name.
-    # @param attrib A dictionary containing element attributes.
-    # @return The opened element.
-    # @defreturn Element
-
-    def start(self, tag, attrs):
-        self._flush()
-        self._last = elem = self._factory(tag, attrs)
-        if self._elem:
-            self._elem[-1].append(elem)
-        self._elem.append(elem)
-        self._tail = 0
-        return elem
-
-    ##
-    # Closes the current element.
-    #
-    # @param tag The element name.
-    # @return The closed element.
-    # @defreturn Element
-
-    def end(self, tag):
-        self._flush()
-        self._last = self._elem.pop()
-        assert self._last.tag == tag,\
-               "end tag mismatch (expected %s, got %s)" % (
-                   self._last.tag, tag)
-        self._tail = 1
-        return self._last
-
-##
-# Element structure builder for XML source data, based on the
-# <b>expat</b> parser.
-#
-# @keyparam target Target object.  If omitted, the builder uses an
-#     instance of the standard {@link #TreeBuilder} class.
-# @keyparam html Predefine HTML entities.  This flag is not supported
-#     by the current implementation.
-# @see #ElementTree
-# @see #TreeBuilder
-
-class XMLTreeBuilder:
-
-    def __init__(self, html=0, target=None):
-        try:
-            from xml.parsers import expat
-        except ImportError:
-            raise ImportError(
-                "No module named expat; use SimpleXMLTreeBuilder instead"
-                )
-        self._parser = parser = expat.ParserCreate(None, "}")
-        if target is None:
-            target = TreeBuilder()
-        self._target = target
-        self._names = {} # name memo cache
-        # callbacks
-        parser.DefaultHandlerExpand = self._default
-        parser.StartElementHandler = self._start
-        parser.EndElementHandler = self._end
-        parser.CharacterDataHandler = self._data
-        # let expat do the buffering, if supported
-        try:
-            self._parser.buffer_text = 1
-        except AttributeError:
-            pass
-        # use new-style attribute handling, if supported
-        try:
-            self._parser.ordered_attributes = 1
-            self._parser.specified_attributes = 1
-            parser.StartElementHandler = self._start_list
-        except AttributeError:
-            pass
-        encoding = None
-        if not parser.returns_unicode:
-            encoding = "utf-8"
-        # target.xml(encoding, None)
-        self._doctype = None
-        self.entity = {}
-
-    def _fixtext(self, text):
-        # convert text string to ascii, if possible
-        try:
-            return _encode(text, "ascii")
-        except UnicodeError:
-            return text
-
-    def _fixname(self, key):
-        # expand qname, and convert name string to ascii, if possible
-        try:
-            name = self._names[key]
-        except KeyError:
-            name = key
-            if "}" in name:
-                name = "{" + name
-            self._names[key] = name = self._fixtext(name)
-        return name
-
-    def _start(self, tag, attrib_in):
-        fixname = self._fixname
-        tag = fixname(tag)
-        attrib = {}
-        for key, value in attrib_in.items():
-            attrib[fixname(key)] = self._fixtext(value)
-        return self._target.start(tag, attrib)
-
-    def _start_list(self, tag, attrib_in):
-        fixname = self._fixname
-        tag = fixname(tag)
-        attrib = {}
-        if attrib_in:
-            for i in range(0, len(attrib_in), 2):
-                attrib[fixname(attrib_in[i])] = self._fixtext(attrib_in[i+1])
-        return self._target.start(tag, attrib)
-
-    def _data(self, text):
-        return self._target.data(self._fixtext(text))
-
-    def _end(self, tag):
-        return self._target.end(self._fixname(tag))
-
-    def _default(self, text):
-        prefix = text[:1]
-        if prefix == "&":
-            # deal with undefined entities
-            try:
-                self._target.data(self.entity[text[1:-1]])
-            except KeyError:
-                from xml.parsers import expat
-                raise expat.error(
-                    "undefined entity %s: line %d, column %d" %
-                    (text, self._parser.ErrorLineNumber,
-                    self._parser.ErrorColumnNumber)
-                    )
-        elif prefix == "<" and text[:9] == "<!DOCTYPE":
-            self._doctype = [] # inside a doctype declaration
-        elif self._doctype is not None:
-            # parse doctype contents
-            if prefix == ">":
-                self._doctype = None
-                return
-            text = string.strip(text)
-            if not text:
-                return
-            self._doctype.append(text)
-            n = len(self._doctype)
-            if n > 2:
-                type = self._doctype[1]
-                if type == "PUBLIC" and n == 4:
-                    name, type, pubid, system = self._doctype
-                elif type == "SYSTEM" and n == 3:
-                    name, type, system = self._doctype
-                    pubid = None
-                else:
-                    return
-                if pubid:
-                    pubid = pubid[1:-1]
-                self.doctype(name, pubid, system[1:-1])
-                self._doctype = None
-
-    ##
-    # Handles a doctype declaration.
-    #
-    # @param name Doctype name.
-    # @param pubid Public identifier.
-    # @param system System identifier.
-
-    def doctype(self, name, pubid, system):
-        pass
-
-    ##
-    # Feeds data to the parser.
-    #
-    # @param data Encoded data.
-
-    def feed(self, data):
-        self._parser.Parse(data, 0)
-
-    ##
-    # Finishes feeding data to the parser.
-    #
-    # @return An element structure.
-    # @defreturn Element
-
-    def close(self):
-        self._parser.Parse("", 1) # end of data
-        tree = self._target.close()
-        del self._target, self._parser # get rid of circular references
-        return tree
+#
+# ElementTree
+# $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $
+#
+# light-weight XML support for Python 1.5.2 and later.
+#
+# history:
+# 2001-10-20 fl   created (from various sources)
+# 2001-11-01 fl   return root from parse method
+# 2002-02-16 fl   sort attributes in lexical order
+# 2002-04-06 fl   TreeBuilder refactoring, added PythonDoc markup
+# 2002-05-01 fl   finished TreeBuilder refactoring
+# 2002-07-14 fl   added basic namespace support to ElementTree.write
+# 2002-07-25 fl   added QName attribute support
+# 2002-10-20 fl   fixed encoding in write
+# 2002-11-24 fl   changed default encoding to ascii; fixed attribute encoding
+# 2002-11-27 fl   accept file objects or file names for parse/write
+# 2002-12-04 fl   moved XMLTreeBuilder back to this module
+# 2003-01-11 fl   fixed entity encoding glitch for us-ascii
+# 2003-02-13 fl   added XML literal factory
+# 2003-02-21 fl   added ProcessingInstruction/PI factory
+# 2003-05-11 fl   added tostring/fromstring helpers
+# 2003-05-26 fl   added ElementPath support
+# 2003-07-05 fl   added makeelement factory method
+# 2003-07-28 fl   added more well-known namespace prefixes
+# 2003-08-15 fl   fixed typo in ElementTree.findtext (Thomas Dartsch)
+# 2003-09-04 fl   fall back on emulator if ElementPath is not installed
+# 2003-10-31 fl   markup updates
+# 2003-11-15 fl   fixed nested namespace bug
+# 2004-03-28 fl   added XMLID helper
+# 2004-06-02 fl   added default support to findtext
+# 2004-06-08 fl   fixed encoding of non-ascii element/attribute names
+# 2004-08-23 fl   take advantage of post-2.1 expat features
+# 2005-02-01 fl   added iterparse implementation
+# 2005-03-02 fl   fixed iterparse support for pre-2.2 versions
+#
+# Copyright (c) 1999-2005 by Fredrik Lundh.  All rights reserved.
+#
+# fredrik at pythonware.com
+# http://www.pythonware.com
+#
+# --------------------------------------------------------------------
+# The ElementTree toolkit is
+#
+# Copyright (c) 1999-2005 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------
+
+__all__ = [
+    # public symbols
+    "Comment",
+    "dump",
+    "Element", "ElementTree",
+    "fromstring",
+    "iselement", "iterparse",
+    "parse",
+    "PI", "ProcessingInstruction",
+    "QName",
+    "SubElement",
+    "tostring",
+    "TreeBuilder",
+    "VERSION", "XML",
+    "XMLTreeBuilder",
+    ]
+
+##
+# The <b>Element</b> type is a flexible container object, designed to
+# store hierarchical data structures in memory. The type can be
+# described as a cross between a list and a dictionary.
+# <p>
+# Each element has a number of properties associated with it:
+# <ul>
+# <li>a <i>tag</i>. This is a string identifying what kind of data
+# this element represents (the element type, in other words).</li>
+# <li>a number of <i>attributes</i>, stored in a Python dictionary.</li>
+# <li>a <i>text</i> string.</li>
+# <li>an optional <i>tail</i> string.</li>
+# <li>a number of <i>child elements</i>, stored in a Python sequence</li>
+# </ul>
+#
+# To create an element instance, use the {@link #Element} or {@link
+# #SubElement} factory functions.
+# <p>
+# The {@link #ElementTree} class can be used to wrap an element
+# structure, and convert it from and to XML.
+##
+
+import string, sys, re
+
+class _SimpleElementPath:
+    # emulate pre-1.2 find/findtext/findall behaviour
+    def find(self, element, tag):
+        for elem in element:
+            if elem.tag == tag:
+                return elem
+        return None
+    def findtext(self, element, tag, default=None):
+        for elem in element:
+            if elem.tag == tag:
+                return elem.text or ""
+        return default
+    def findall(self, element, tag):
+        if tag[:3] == ".//":
+            return element.getiterator(tag[3:])
+        result = []
+        for elem in element:
+            if elem.tag == tag:
+                result.append(elem)
+        return result
+
+try:
+    import ElementPath
+except ImportError:
+    # FIXME: issue warning in this case?
+    ElementPath = _SimpleElementPath()
+
+# TODO: add support for custom namespace resolvers/default namespaces
+# TODO: add improved support for incremental parsing
+
+VERSION = "1.2.6"
+
+##
+# Internal element class.  This class defines the Element interface,
+# and provides a reference implementation of this interface.
+# <p>
+# You should not create instances of this class directly.  Use the
+# appropriate factory functions instead, such as {@link #Element}
+# and {@link #SubElement}.
+#
+# @see Element
+# @see SubElement
+# @see Comment
+# @see ProcessingInstruction
+
+class _ElementInterface:
+    # <tag attrib>text<child/>...</tag>tail
+
+    ##
+    # (Attribute) Element tag.
+
+    tag = None
+
+    ##
+    # (Attribute) Element attribute dictionary.  Where possible, use
+    # {@link #_ElementInterface.get},
+    # {@link #_ElementInterface.set},
+    # {@link #_ElementInterface.keys}, and
+    # {@link #_ElementInterface.items} to access
+    # element attributes.
+
+    attrib = None
+
+    ##
+    # (Attribute) Text before first subelement.  This is either a
+    # string or the value None, if there was no text.
+
+    text = None
+
+    ##
+    # (Attribute) 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.
+
+    tail = None # text after end tag, if any
+
+    def __init__(self, tag, attrib):
+        self.tag = tag
+        self.attrib = attrib
+        self._children = []
+
+    def __repr__(self):
+        return "<Element %s at %x>" % (self.tag, id(self))
+
+    ##
+    # Creates a new element object of the same type as this element.
+    #
+    # @param tag Element tag.
+    # @param attrib Element attributes, given as a dictionary.
+    # @return A new element instance.
+
+    def makeelement(self, tag, attrib):
+        return Element(tag, attrib)
+
+    ##
+    # Returns the number of subelements.
+    #
+    # @return The number of subelements.
+
+    def __len__(self):
+        return len(self._children)
+
+    ##
+    # Returns the given subelement.
+    #
+    # @param index What subelement to return.
+    # @return The given subelement.
+    # @exception IndexError If the given element does not exist.
+
+    def __getitem__(self, index):
+        return self._children[index]
+
+    ##
+    # Replaces the given subelement.
+    #
+    # @param index What subelement to replace.
+    # @param element The new element value.
+    # @exception IndexError If the given element does not exist.
+    # @exception AssertionError If element is not a valid object.
+
+    def __setitem__(self, index, element):
+        assert iselement(element)
+        self._children[index] = element
+
+    ##
+    # Deletes the given subelement.
+    #
+    # @param index What subelement to delete.
+    # @exception IndexError If the given element does not exist.
+
+    def __delitem__(self, index):
+        del self._children[index]
+
+    ##
+    # Returns a list containing subelements in the given range.
+    #
+    # @param start The first subelement to return.
+    # @param stop The first subelement that shouldn't be returned.
+    # @return A sequence object containing subelements.
+
+    def __getslice__(self, start, stop):
+        return self._children[start:stop]
+
+    ##
+    # Replaces a number of subelements with elements from a sequence.
+    #
+    # @param start The first subelement to replace.
+    # @param stop The first subelement that shouldn't be replaced.
+    # @param elements A sequence object with zero or more elements.
+    # @exception AssertionError If a sequence member is not a valid object.
+
+    def __setslice__(self, start, stop, elements):
+        for element in elements:
+            assert iselement(element)
+        self._children[start:stop] = list(elements)
+
+    ##
+    # Deletes a number of subelements.
+    #
+    # @param start The first subelement to delete.
+    # @param stop The first subelement to leave in there.
+
+    def __delslice__(self, start, stop):
+        del self._children[start:stop]
+
+    ##
+    # Adds a subelement to the end of this element.
+    #
+    # @param element The element to add.
+    # @exception AssertionError If a sequence member is not a valid object.
+
+    def append(self, element):
+        assert iselement(element)
+        self._children.append(element)
+
+    ##
+    # Inserts a subelement at the given position in this element.
+    #
+    # @param index Where to insert the new subelement.
+    # @exception AssertionError If the element is not a valid object.
+
+    def insert(self, index, element):
+        assert iselement(element)
+        self._children.insert(index, element)
+
+    ##
+    # Removes a matching subelement.  Unlike the <b>find</b> methods,
+    # this method compares elements based on identity, not on tag
+    # value or contents.
+    #
+    # @param element What element to remove.
+    # @exception ValueError If a matching element could not be found.
+    # @exception AssertionError If the element is not a valid object.
+
+    def remove(self, element):
+        assert iselement(element)
+        self._children.remove(element)
+
+    ##
+    # Returns all subelements.  The elements are returned in document
+    # order.
+    #
+    # @return A list of subelements.
+    # @defreturn list of Element instances
+
+    def getchildren(self):
+        return self._children
+
+    ##
+    # Finds the first matching subelement, by tag name or path.
+    #
+    # @param path What element to look for.
+    # @return The first matching element, or None if no element was found.
+    # @defreturn Element or None
+
+    def find(self, path):
+        return ElementPath.find(self, path)
+
+    ##
+    # Finds text for the first matching subelement, by tag name or path.
+    #
+    # @param path What element to look for.
+    # @param default What to return if the element was not found.
+    # @return The text content of the first matching element, or the
+    #     default value no element was found.  Note that if the element
+    #     has is found, but has no text content, this method returns an
+    #     empty string.
+    # @defreturn string
+
+    def findtext(self, path, default=None):
+        return ElementPath.findtext(self, path, default)
+
+    ##
+    # Finds all matching subelements, by tag name or path.
+    #
+    # @param path What element to look for.
+    # @return A list or iterator containing all matching elements,
+    #    in document order.
+    # @defreturn list of Element instances
+
+    def findall(self, path):
+        return ElementPath.findall(self, path)
+
+    ##
+    # Resets an element.  This function removes all subelements, clears
+    # all attributes, and sets the text and tail attributes to None.
+
+    def clear(self):
+        self.attrib.clear()
+        self._children = []
+        self.text = self.tail = None
+
+    ##
+    # Gets an element attribute.
+    #
+    # @param key What attribute to look for.
+    # @param default What to return if the attribute was not found.
+    # @return The attribute value, or the default value, if the
+    #     attribute was not found.
+    # @defreturn string or None
+
+    def get(self, key, default=None):
+        return self.attrib.get(key, default)
+
+    ##
+    # Sets an element attribute.
+    #
+    # @param key What attribute to set.
+    # @param value The attribute value.
+
+    def set(self, key, value):
+        self.attrib[key] = value
+
+    ##
+    # Gets a list of attribute names.  The names are returned in an
+    # arbitrary order (just like for an ordinary Python dictionary).
+    #
+    # @return A list of element attribute names.
+    # @defreturn list of strings
+
+    def keys(self):
+        return self.attrib.keys()
+
+    ##
+    # Gets element attributes, as a sequence.  The attributes are
+    # returned in an arbitrary order.
+    #
+    # @return A list of (name, value) tuples for all attributes.
+    # @defreturn list of (string, string) tuples
+
+    def items(self):
+        return self.attrib.items()
+
+    ##
+    # Creates a tree iterator.  The iterator loops over this element
+    # and all subelements, in document order, and returns all elements
+    # with a matching tag.
+    # <p>
+    # If the tree structure is modified during iteration, the result
+    # is undefined.
+    #
+    # @param tag What tags to look for (default is to return all elements).
+    # @return A list or iterator containing all the matching elements.
+    # @defreturn list or iterator
+
+    def getiterator(self, tag=None):
+        nodes = []
+        if tag == "*":
+            tag = None
+        if tag is None or self.tag == tag:
+            nodes.append(self)
+        for node in self._children:
+            nodes.extend(node.getiterator(tag))
+        return nodes
+
+# compatibility
+_Element = _ElementInterface
+
+##
+# Element factory.  This function returns an object implementing the
+# standard Element interface.  The exact class or type of that object
+# is implementation dependent, but it will always be compatible with
+# the {@link #_ElementInterface} class in this module.
+# <p>
+# The element name, attribute names, and attribute values can be
+# either 8-bit ASCII strings or Unicode strings.
+#
+# @param tag The element name.
+# @param attrib An optional dictionary, containing element attributes.
+# @param **extra Additional attributes, given as keyword arguments.
+# @return An element instance.
+# @defreturn Element
+
+def Element(tag, attrib={}, **extra):
+    attrib = attrib.copy()
+    attrib.update(extra)
+    return _ElementInterface(tag, attrib)
+
+##
+# Subelement factory.  This function creates an element instance, and
+# appends it to an existing element.
+# <p>
+# The element name, attribute names, and attribute values can be
+# either 8-bit ASCII strings or Unicode strings.
+#
+# @param parent The parent element.
+# @param tag The subelement name.
+# @param attrib An optional dictionary, containing element attributes.
+# @param **extra Additional attributes, given as keyword arguments.
+# @return An element instance.
+# @defreturn Element
+
+def SubElement(parent, tag, attrib={}, **extra):
+    attrib = attrib.copy()
+    attrib.update(extra)
+    element = parent.makeelement(tag, attrib)
+    parent.append(element)
+    return element
+
+##
+# Comment element factory.  This factory function creates a special
+# element that will be serialized as an XML comment.
+# <p>
+# The comment string can be either an 8-bit ASCII string or a Unicode
+# string.
+#
+# @param text A string containing the comment string.
+# @return An element instance, representing a comment.
+# @defreturn Element
+
+def Comment(text=None):
+    element = Element(Comment)
+    element.text = text
+    return element
+
+##
+# PI element factory.  This factory function creates a special element
+# that will be serialized as an XML processing instruction.
+#
+# @param target A string containing the PI target.
+# @param text A string containing the PI contents, if any.
+# @return An element instance, representing a PI.
+# @defreturn Element
+
+def ProcessingInstruction(target, text=None):
+    element = Element(ProcessingInstruction)
+    element.text = target
+    if text:
+        element.text = element.text + " " + text
+    return element
+
+PI = ProcessingInstruction
+
+##
+# QName wrapper.  This can be used to wrap a QName attribute value, in
+# order to get proper namespace handling on output.
+#
+# @param text A string containing the QName value, in the form {uri}local,
+#     or, if the tag argument is given, the URI part of a QName.
+# @param tag Optional tag.  If given, the first argument is interpreted as
+#     an URI, and this argument is interpreted as a local name.
+# @return An opaque object, representing the QName.
+
+class QName:
+    def __init__(self, text_or_uri, tag=None):
+        if tag:
+            text_or_uri = "{%s}%s" % (text_or_uri, tag)
+        self.text = text_or_uri
+    def __str__(self):
+        return self.text
+    def __hash__(self):
+        return hash(self.text)
+    def __cmp__(self, other):
+        if isinstance(other, QName):
+            return cmp(self.text, other.text)
+        return cmp(self.text, other)
+
+##
+# ElementTree wrapper class.  This class represents an entire element
+# hierarchy, and adds some extra support for serialization to and from
+# standard XML.
+#
+# @param element Optional root element.
+# @keyparam file Optional file handle or name.  If given, the
+#     tree is initialized with the contents of this XML file.
+
+class ElementTree:
+
+    def __init__(self, element=None, file=None):
+        assert element is None or iselement(element)
+        self._root = element # first node
+        if file:
+            self.parse(file)
+
+    ##
+    # Gets the root element for this tree.
+    #
+    # @return An element instance.
+    # @defreturn Element
+
+    def getroot(self):
+        return self._root
+
+    ##
+    # Replaces the root element for this tree.  This discards the
+    # current contents of the tree, and replaces it with the given
+    # element.  Use with care.
+    #
+    # @param element An element instance.
+
+    def _setroot(self, element):
+        assert iselement(element)
+        self._root = element
+
+    ##
+    # Loads an external XML document into this element tree.
+    #
+    # @param source A file name or file object.
+    # @param parser An optional parser instance.  If not given, the
+    #     standard {@link XMLTreeBuilder} parser is used.
+    # @return The document root element.
+    # @defreturn Element
+
+    def parse(self, source, parser=None):
+        if not hasattr(source, "read"):
+            source = open(source, "rb")
+        if not parser:
+            parser = XMLTreeBuilder()
+        while 1:
+            data = source.read(32768)
+            if not data:
+                break
+            parser.feed(data)
+        self._root = parser.close()
+        return self._root
+
+    ##
+    # Creates a tree iterator for the root element.  The iterator loops
+    # over all elements in this tree, in document order.
+    #
+    # @param tag What tags to look for (default is to return all elements)
+    # @return An iterator.
+    # @defreturn iterator
+
+    def getiterator(self, tag=None):
+        assert self._root is not None
+        return self._root.getiterator(tag)
+
+    ##
+    # Finds the first toplevel element with given tag.
+    # Same as getroot().find(path).
+    #
+    # @param path What element to look for.
+    # @return The first matching element, or None if no element was found.
+    # @defreturn Element or None
+
+    def find(self, path):
+        assert self._root is not None
+        if path[:1] == "/":
+            path = "." + path
+        return self._root.find(path)
+
+    ##
+    # Finds the element text for the first toplevel element with given
+    # tag.  Same as getroot().findtext(path).
+    #
+    # @param path What toplevel element to look for.
+    # @param default What to return if the element was not found.
+    # @return The text content of the first matching element, or the
+    #     default value no element was found.  Note that if the element
+    #     has is found, but has no text content, this method returns an
+    #     empty string.
+    # @defreturn string
+
+    def findtext(self, path, default=None):
+        assert self._root is not None
+        if path[:1] == "/":
+            path = "." + path
+        return self._root.findtext(path, default)
+
+    ##
+    # Finds all toplevel elements with the given tag.
+    # Same as getroot().findall(path).
+    #
+    # @param path What element to look for.
+    # @return A list or iterator containing all matching elements,
+    #    in document order.
+    # @defreturn list of Element instances
+
+    def findall(self, path):
+        assert self._root is not None
+        if path[:1] == "/":
+            path = "." + path
+        return self._root.findall(path)
+
+    ##
+    # Writes the element tree to a file, as XML.
+    #
+    # @param file A file name, or a file object opened for writing.
+    # @param encoding Optional output encoding (default is US-ASCII).
+
+    def write(self, file, encoding="us-ascii"):
+        assert self._root is not None
+        if not hasattr(file, "write"):
+            file = open(file, "wb")
+        if not encoding:
+            encoding = "us-ascii"
+        elif encoding != "utf-8" and encoding != "us-ascii":
+            file.write("<?xml version='1.0' encoding='%s'?>\n" % encoding)
+        self._write(file, self._root, encoding, {})
+
+    def _write(self, file, node, encoding, namespaces):
+        # write XML to file
+        tag = node.tag
+        if tag is Comment:
+            file.write("<!-- %s -->" % _escape_cdata(node.text, encoding))
+        elif tag is ProcessingInstruction:
+            file.write("<?%s?>" % _escape_cdata(node.text, encoding))
+        else:
+            items = node.items()
+            xmlns_items = [] # new namespaces in this scope
+            try:
+                if isinstance(tag, QName) or tag[:1] == "{":
+                    tag, xmlns = fixtag(tag, namespaces)
+                    if xmlns: xmlns_items.append(xmlns)
+            except TypeError:
+                _raise_serialization_error(tag)
+            file.write("<" + _encode(tag, encoding))
+            if items or xmlns_items:
+                items.sort() # lexical order
+                for k, v in items:
+                    try:
+                        if isinstance(k, QName) or k[:1] == "{":
+                            k, xmlns = fixtag(k, namespaces)
+                            if xmlns: xmlns_items.append(xmlns)
+                    except TypeError:
+                        _raise_serialization_error(k)
+                    try:
+                        if isinstance(v, QName):
+                            v, xmlns = fixtag(v, namespaces)
+                            if xmlns: xmlns_items.append(xmlns)
+                    except TypeError:
+                        _raise_serialization_error(v)
+                    file.write(" %s=\"%s\"" % (_encode(k, encoding),
+                                               _escape_attrib(v, encoding)))
+                for k, v in xmlns_items:
+                    file.write(" %s=\"%s\"" % (_encode(k, encoding),
+                                               _escape_attrib(v, encoding)))
+            if node.text or len(node):
+                file.write(">")
+                if node.text:
+                    file.write(_escape_cdata(node.text, encoding))
+                for n in node:
+                    self._write(file, n, encoding, namespaces)
+                file.write("</" + _encode(tag, encoding) + ">")
+            else:
+                file.write(" />")
+            for k, v in xmlns_items:
+                del namespaces[v]
+        if node.tail:
+            file.write(_escape_cdata(node.tail, encoding))
+
+# --------------------------------------------------------------------
+# helpers
+
+##
+# Checks if an object appears to be a valid element object.
+#
+# @param An element instance.
+# @return A true value if this is an element object.
+# @defreturn flag
+
+def iselement(element):
+    # FIXME: not sure about this; might be a better idea to look
+    # for tag/attrib/text attributes
+    return isinstance(element, _ElementInterface) or hasattr(element, "tag")
+
+##
+# Writes an element tree or element structure to sys.stdout.  This
+# function should be used for debugging only.
+# <p>
+# The exact output format is implementation dependent.  In this
+# version, it's written as an ordinary XML file.
+#
+# @param elem An element tree or an individual element.
+
+def dump(elem):
+    # debugging
+    if not isinstance(elem, ElementTree):
+        elem = ElementTree(elem)
+    elem.write(sys.stdout)
+    tail = elem.getroot().tail
+    if not tail or tail[-1] != "\n":
+        sys.stdout.write("\n")
+
+def _encode(s, encoding):
+    try:
+        return s.encode(encoding)
+    except AttributeError:
+        return s # 1.5.2: assume the string uses the right encoding
+
+if sys.version[:3] == "1.5":
+    _escape = re.compile(r"[&<>\"\x80-\xff]+") # 1.5.2
+else:
+    _escape = re.compile(eval(r'u"[&<>\"\u0080-\uffff]+"'))
+
+_escape_map = {
+    "&": "&amp;",
+    "<": "&lt;",
+    ">": "&gt;",
+    '"': "&quot;",
+}
+
+_namespace_map = {
+    # "well-known" namespace prefixes
+    "http://www.w3.org/XML/1998/namespace": "xml",
+    "http://www.w3.org/1999/xhtml": "html",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
+    "http://schemas.xmlsoap.org/wsdl/": "wsdl",
+}
+
+def _raise_serialization_error(text):
+    raise TypeError(
+        "cannot serialize %r (type %s)" % (text, type(text).__name__)
+        )
+
+def _encode_entity(text, pattern=_escape):
+    # map reserved and non-ascii characters to numerical entities
+    def escape_entities(m, map=_escape_map):
+        out = []
+        append = out.append
+        for char in m.group():
+            text = map.get(char)
+            if text is None:
+                text = "&#%d;" % ord(char)
+            append(text)
+        return string.join(out, "")
+    try:
+        return _encode(pattern.sub(escape_entities, text), "ascii")
+    except TypeError:
+        _raise_serialization_error(text)
+
+#
+# the following functions assume an ascii-compatible encoding
+# (or "utf-16")
+
+def _escape_cdata(text, encoding=None, replace=string.replace):
+    # escape character data
+    try:
+        if encoding:
+            try:
+                text = _encode(text, encoding)
+            except UnicodeError:
+                return _encode_entity(text)
+        text = replace(text, "&", "&amp;")
+        text = replace(text, "<", "&lt;")
+        text = replace(text, ">", "&gt;")
+        return text
+    except (TypeError, AttributeError):
+        _raise_serialization_error(text)
+
+def _escape_attrib(text, encoding=None, replace=string.replace):
+    # escape attribute value
+    try:
+        if encoding:
+            try:
+                text = _encode(text, encoding)
+            except UnicodeError:
+                return _encode_entity(text)
+        text = replace(text, "&", "&amp;")
+        text = replace(text, "'", "&apos;") # FIXME: overkill
+        text = replace(text, "\"", "&quot;")
+        text = replace(text, "<", "&lt;")
+        text = replace(text, ">", "&gt;")
+        return text
+    except (TypeError, AttributeError):
+        _raise_serialization_error(text)
+
+def fixtag(tag, namespaces):
+    # given a decorated tag (of the form {uri}tag), return prefixed
+    # tag and namespace declaration, if any
+    if isinstance(tag, QName):
+        tag = tag.text
+    namespace_uri, tag = string.split(tag[1:], "}", 1)
+    prefix = namespaces.get(namespace_uri)
+    if prefix is None:
+        prefix = _namespace_map.get(namespace_uri)
+        if prefix is None:
+            prefix = "ns%d" % len(namespaces)
+        namespaces[namespace_uri] = prefix
+        if prefix == "xml":
+            xmlns = None
+        else:
+            xmlns = ("xmlns:%s" % prefix, namespace_uri)
+    else:
+        xmlns = None
+    return "%s:%s" % (prefix, tag), xmlns
+
+##
+# Parses an XML document into an element tree.
+#
+# @param source A filename or file object containing XML data.
+# @param parser An optional parser instance.  If not given, the
+#     standard {@link XMLTreeBuilder} parser is used.
+# @return An ElementTree instance
+
+def parse(source, parser=None):
+    tree = ElementTree()
+    tree.parse(source, parser)
+    return tree
+
+##
+# Parses an XML document into an element tree incrementally, and reports
+# what's going on to the user.
+#
+# @param source A filename or file object containing XML data.
+# @param events A list of events to report back.  If omitted, only "end"
+#     events are reported.
+# @return A (event, elem) iterator.
+
+class iterparse:
+
+    def __init__(self, source, events=None):
+        if not hasattr(source, "read"):
+            source = open(source, "rb")
+        self._file = source
+        self._events = []
+        self._index = 0
+        self.root = self._root = None
+        self._parser = XMLTreeBuilder()
+        # wire up the parser for event reporting
+        parser = self._parser._parser
+        append = self._events.append
+        if events is None:
+            events = ["end"]
+        for event in events:
+            if event == "start":
+                try:
+                    parser.ordered_attributes = 1
+                    parser.specified_attributes = 1
+                    def handler(tag, attrib_in, event=event, append=append,
+                                start=self._parser._start_list):
+                        append((event, start(tag, attrib_in)))
+                    parser.StartElementHandler = handler
+                except AttributeError:
+                    def handler(tag, attrib_in, event=event, append=append,
+                                start=self._parser._start):
+                        append((event, start(tag, attrib_in)))
+                    parser.StartElementHandler = handler
+            elif event == "end":
+                def handler(tag, event=event, append=append,
+                            end=self._parser._end):
+                    append((event, end(tag)))
+                parser.EndElementHandler = handler
+            elif event == "start-ns":
+                def handler(prefix, uri, event=event, append=append):
+                    try:
+                        uri = _encode(uri, "ascii")
+                    except UnicodeError:
+                        pass
+                    append((event, (prefix or "", uri)))
+                parser.StartNamespaceDeclHandler = handler
+            elif event == "end-ns":
+                def handler(prefix, event=event, append=append):
+                    append((event, None))
+                parser.EndNamespaceDeclHandler = handler
+
+    def next(self):
+        while 1:
+            try:
+                item = self._events[self._index]
+            except IndexError:
+                if self._parser is None:
+                    self.root = self._root
+                    try:
+                        raise StopIteration
+                    except NameError:
+                        raise IndexError
+                # load event buffer
+                del self._events[:]
+                self._index = 0
+                data = self._file.read(16384)
+                if data:
+                    self._parser.feed(data)
+                else:
+                    self._root = self._parser.close()
+                    self._parser = None
+            else:
+                self._index = self._index + 1
+                return item
+
+    try:
+        iter
+        def __iter__(self):
+            return self
+    except NameError:
+        def __getitem__(self, index):
+            return self.next()
+
+##
+# Parses an XML document from a string constant.  This function can
+# be used to embed "XML literals" in Python code.
+#
+# @param source A string containing XML data.
+# @return An Element instance.
+# @defreturn Element
+
+def XML(text):
+    parser = XMLTreeBuilder()
+    parser.feed(text)
+    return parser.close()
+
+##
+# Parses an XML document from a string constant, and also returns
+# a dictionary which maps from element id:s to elements.
+#
+# @param source A string containing XML data.
+# @return A tuple containing an Element instance and a dictionary.
+# @defreturn (Element, dictionary)
+
+def XMLID(text):
+    parser = XMLTreeBuilder()
+    parser.feed(text)
+    tree = parser.close()
+    ids = {}
+    for elem in tree.getiterator():
+        id = elem.get("id")
+        if id:
+            ids[id] = elem
+    return tree, ids
+
+##
+# Parses an XML document from a string constant.  Same as {@link #XML}.
+#
+# @def fromstring(text)
+# @param source A string containing XML data.
+# @return An Element instance.
+# @defreturn Element
+
+fromstring = XML
+
+##
+# Generates a string representation of an XML element, including all
+# subelements.
+#
+# @param element An Element instance.
+# @return An encoded string containing the XML data.
+# @defreturn string
+
+def tostring(element, encoding=None):
+    class dummy:
+        pass
+    data = []
+    file = dummy()
+    file.write = data.append
+    ElementTree(element).write(file, encoding)
+    return string.join(data, "")
+
+##
+# Generic element structure builder.  This builder converts a sequence
+# of {@link #TreeBuilder.start}, {@link #TreeBuilder.data}, and {@link
+# #TreeBuilder.end} method calls to a well-formed element structure.
+# <p>
+# You can use this class to build an element structure using a custom XML
+# parser, or a parser for some other XML-like format.
+#
+# @param element_factory Optional element factory.  This factory
+#    is called to create new Element instances, as necessary.
+
+class TreeBuilder:
+
+    def __init__(self, element_factory=None):
+        self._data = [] # data collector
+        self._elem = [] # element stack
+        self._last = None # last element
+        self._tail = None # true if we're after an end tag
+        if element_factory is None:
+            element_factory = _ElementInterface
+        self._factory = element_factory
+
+    ##
+    # Flushes the parser buffers, and returns the toplevel documen
+    # element.
+    #
+    # @return An Element instance.
+    # @defreturn Element
+
+    def close(self):
+        assert len(self._elem) == 0, "missing end tags"
+        assert self._last != None, "missing toplevel element"
+        return self._last
+
+    def _flush(self):
+        if self._data:
+            if self._last is not None:
+                text = string.join(self._data, "")
+                if self._tail:
+                    assert self._last.tail is None, "internal error (tail)"
+                    self._last.tail = text
+                else:
+                    assert self._last.text is None, "internal error (text)"
+                    self._last.text = text
+            self._data = []
+
+    ##
+    # Adds text to the current element.
+    #
+    # @param data A string.  This should be either an 8-bit string
+    #    containing ASCII text, or a Unicode string.
+
+    def data(self, data):
+        self._data.append(data)
+
+    ##
+    # Opens a new element.
+    #
+    # @param tag The element name.
+    # @param attrib A dictionary containing element attributes.
+    # @return The opened element.
+    # @defreturn Element
+
+    def start(self, tag, attrs):
+        self._flush()
+        self._last = elem = self._factory(tag, attrs)
+        if self._elem:
+            self._elem[-1].append(elem)
+        self._elem.append(elem)
+        self._tail = 0
+        return elem
+
+    ##
+    # Closes the current element.
+    #
+    # @param tag The element name.
+    # @return The closed element.
+    # @defreturn Element
+
+    def end(self, tag):
+        self._flush()
+        self._last = self._elem.pop()
+        assert self._last.tag == tag,\
+               "end tag mismatch (expected %s, got %s)" % (
+                   self._last.tag, tag)
+        self._tail = 1
+        return self._last
+
+##
+# Element structure builder for XML source data, based on the
+# <b>expat</b> parser.
+#
+# @keyparam target Target object.  If omitted, the builder uses an
+#     instance of the standard {@link #TreeBuilder} class.
+# @keyparam html Predefine HTML entities.  This flag is not supported
+#     by the current implementation.
+# @see #ElementTree
+# @see #TreeBuilder
+
+class XMLTreeBuilder:
+
+    def __init__(self, html=0, target=None):
+        try:
+            from xml.parsers import expat
+        except ImportError:
+            raise ImportError(
+                "No module named expat; use SimpleXMLTreeBuilder instead"
+                )
+        self._parser = parser = expat.ParserCreate(None, "}")
+        if target is None:
+            target = TreeBuilder()
+        self._target = target
+        self._names = {} # name memo cache
+        # callbacks
+        parser.DefaultHandlerExpand = self._default
+        parser.StartElementHandler = self._start
+        parser.EndElementHandler = self._end
+        parser.CharacterDataHandler = self._data
+        # let expat do the buffering, if supported
+        try:
+            self._parser.buffer_text = 1
+        except AttributeError:
+            pass
+        # use new-style attribute handling, if supported
+        try:
+            self._parser.ordered_attributes = 1
+            self._parser.specified_attributes = 1
+            parser.StartElementHandler = self._start_list
+        except AttributeError:
+            pass
+        encoding = None
+        if not parser.returns_unicode:
+            encoding = "utf-8"
+        # target.xml(encoding, None)
+        self._doctype = None
+        self.entity = {}
+
+    def _fixtext(self, text):
+        # convert text string to ascii, if possible
+        try:
+            return _encode(text, "ascii")
+        except UnicodeError:
+            return text
+
+    def _fixname(self, key):
+        # expand qname, and convert name string to ascii, if possible
+        try:
+            name = self._names[key]
+        except KeyError:
+            name = key
+            if "}" in name:
+                name = "{" + name
+            self._names[key] = name = self._fixtext(name)
+        return name
+
+    def _start(self, tag, attrib_in):
+        fixname = self._fixname
+        tag = fixname(tag)
+        attrib = {}
+        for key, value in attrib_in.items():
+            attrib[fixname(key)] = self._fixtext(value)
+        return self._target.start(tag, attrib)
+
+    def _start_list(self, tag, attrib_in):
+        fixname = self._fixname
+        tag = fixname(tag)
+        attrib = {}
+        if attrib_in:
+            for i in range(0, len(attrib_in), 2):
+                attrib[fixname(attrib_in[i])] = self._fixtext(attrib_in[i+1])
+        return self._target.start(tag, attrib)
+
+    def _data(self, text):
+        return self._target.data(self._fixtext(text))
+
+    def _end(self, tag):
+        return self._target.end(self._fixname(tag))
+
+    def _default(self, text):
+        prefix = text[:1]
+        if prefix == "&":
+            # deal with undefined entities
+            try:
+                self._target.data(self.entity[text[1:-1]])
+            except KeyError:
+                from xml.parsers import expat
+                raise expat.error(
+                    "undefined entity %s: line %d, column %d" %
+                    (text, self._parser.ErrorLineNumber,
+                    self._parser.ErrorColumnNumber)
+                    )
+        elif prefix == "<" and text[:9] == "<!DOCTYPE":
+            self._doctype = [] # inside a doctype declaration
+        elif self._doctype is not None:
+            # parse doctype contents
+            if prefix == ">":
+                self._doctype = None
+                return
+            text = string.strip(text)
+            if not text:
+                return
+            self._doctype.append(text)
+            n = len(self._doctype)
+            if n > 2:
+                type = self._doctype[1]
+                if type == "PUBLIC" and n == 4:
+                    name, type, pubid, system = self._doctype
+                elif type == "SYSTEM" and n == 3:
+                    name, type, system = self._doctype
+                    pubid = None
+                else:
+                    return
+                if pubid:
+                    pubid = pubid[1:-1]
+                self.doctype(name, pubid, system[1:-1])
+                self._doctype = None
+
+    ##
+    # Handles a doctype declaration.
+    #
+    # @param name Doctype name.
+    # @param pubid Public identifier.
+    # @param system System identifier.
+
+    def doctype(self, name, pubid, system):
+        pass
+
+    ##
+    # Feeds data to the parser.
+    #
+    # @param data Encoded data.
+
+    def feed(self, data):
+        self._parser.Parse(data, 0)
+
+    ##
+    # Finishes feeding data to the parser.
+    #
+    # @return An element structure.
+    # @defreturn Element
+
+    def close(self):
+        self._parser.Parse("", 1) # end of data
+        tree = self._target.close()
+        del self._target, self._parser # get rid of circular references
+        return tree

Modified: external/elementtree-1.2.6-20050316/elementtree/HTMLTreeBuilder.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/HTMLTreeBuilder.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/HTMLTreeBuilder.py	Wed Dec 14 19:33:39 2005
@@ -1,230 +1,230 @@
-#
-# ElementTree
-# $Id: HTMLTreeBuilder.py 2325 2005-03-16 15:50:43Z fredrik $
-#
-# a simple tree builder, for HTML input
-#
-# history:
-# 2002-04-06 fl   created
-# 2002-04-07 fl   ignore IMG and HR end tags
-# 2002-04-07 fl   added support for 1.5.2 and later
-# 2003-04-13 fl   added HTMLTreeBuilder alias
-# 2004-12-02 fl   don't feed non-ASCII charrefs/entities as 8-bit strings
-# 2004-12-05 fl   don't feed non-ASCII CDATA as 8-bit strings
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
-#
-# fredrik at pythonware.com
-# http://www.pythonware.com
-#
-# --------------------------------------------------------------------
-# The ElementTree toolkit is
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh
-#
-# By obtaining, using, and/or copying this software and/or its
-# associated documentation, you agree that you have read, understood,
-# and will comply with the following terms and conditions:
-#
-# Permission to use, copy, modify, and distribute this software and
-# its associated documentation for any purpose and without fee is
-# hereby granted, provided that the above copyright notice appears in
-# all copies, and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of
-# Secret Labs AB or the author not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
-# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-# --------------------------------------------------------------------
-
-##
-# Tools to build element trees from HTML files.
-##
-
-import htmlentitydefs
-import re, string, sys
-import mimetools, StringIO
-
-import ElementTree
-
-AUTOCLOSE = "p", "li", "tr", "th", "td", "head", "body"
-IGNOREEND = "img", "hr", "meta", "link", "br"
-
-if sys.version[:3] == "1.5":
-    is_not_ascii = re.compile(r"[\x80-\xff]").search # 1.5.2
-else:
-    is_not_ascii = re.compile(eval(r'u"[\u0080-\uffff]"')).search
-
-try:
-    from HTMLParser import HTMLParser
-except ImportError:
-    from sgmllib import SGMLParser
-    # hack to use sgmllib's SGMLParser to emulate 2.2's HTMLParser
-    class HTMLParser(SGMLParser):
-        # the following only works as long as this class doesn't
-        # provide any do, start, or end handlers
-        def unknown_starttag(self, tag, attrs):
-            self.handle_starttag(tag, attrs)
-        def unknown_endtag(self, tag):
-            self.handle_endtag(tag)
-
-##
-# ElementTree builder for HTML source code.  This builder converts an
-# HTML document or fragment to an ElementTree.
-# <p>
-# The parser is relatively picky, and requires balanced tags for most
-# elements.  However, elements belonging to the following group are
-# automatically closed: P, LI, TR, TH, and TD.  In addition, the
-# parser automatically inserts end tags immediately after the start
-# tag, and ignores any end tags for the following group: IMG, HR,
-# META, and LINK.
-#
-# @keyparam builder Optional builder object.  If omitted, the parser
-#     uses the standard <b>elementtree</b> builder.
-# @keyparam encoding Optional character encoding, if known.  If omitted,
-#     the parser looks for META tags inside the document.  If no tags
-#     are found, the parser defaults to ISO-8859-1.  Note that if your
-#     document uses a non-ASCII compatible encoding, you must decode
-#     the document before parsing.
-#
-# @see elementtree.ElementTree
-
-class HTMLTreeBuilder(HTMLParser):
-
-    # FIXME: shouldn't this class be named Parser, not Builder?
-
-    def __init__(self, builder=None, encoding=None):
-        self.__stack = []
-        if builder is None:
-            builder = ElementTree.TreeBuilder()
-        self.__builder = builder
-        self.encoding = encoding or "iso-8859-1"
-        HTMLParser.__init__(self)
-
-    ##
-    # Flushes parser buffers, and return the root element.
-    #
-    # @return An Element instance.
-
-    def close(self):
-        HTMLParser.close(self)
-        return self.__builder.close()
-
-    ##
-    # (Internal) Handles start tags.
-
-    def handle_starttag(self, tag, attrs):
-        if tag == "meta":
-            # look for encoding directives
-            http_equiv = content = None
-            for k, v in attrs:
-                if k == "http-equiv":
-                    http_equiv = string.lower(v)
-                elif k == "content":
-                    content = v
-            if http_equiv == "content-type" and content:
-                # use mimetools to parse the http header
-                header = mimetools.Message(
-                    StringIO.StringIO("%s: %s\n\n" % (http_equiv, content))
-                    )
-                encoding = header.getparam("charset")
-                if encoding:
-                    self.encoding = encoding
-        if tag in AUTOCLOSE:
-            if self.__stack and self.__stack[-1] == tag:
-                self.handle_endtag(tag)
-        self.__stack.append(tag)
-        attrib = {}
-        if attrs:
-            for k, v in attrs:
-                attrib[string.lower(k)] = v
-        self.__builder.start(tag, attrib)
-        if tag in IGNOREEND:
-            self.__stack.pop()
-            self.__builder.end(tag)
-
-    ##
-    # (Internal) Handles end tags.
-
-    def handle_endtag(self, tag):
-        if tag in IGNOREEND:
-            return
-        lasttag = self.__stack.pop()
-        if tag != lasttag and lasttag in AUTOCLOSE:
-            self.handle_endtag(lasttag)
-        self.__builder.end(tag)
-
-    ##
-    # (Internal) Handles character references.
-
-    def handle_charref(self, char):
-        if char[:1] == "x":
-            char = int(char[1:], 16)
-        else:
-            char = int(char)
-        if 0 <= char < 128:
-            self.__builder.data(chr(char))
-        else:
-            self.__builder.data(unichr(char))
-
-    ##
-    # (Internal) Handles entity references.
-
-    def handle_entityref(self, name):
-        entity = htmlentitydefs.entitydefs.get(name)
-        if entity:
-            if len(entity) == 1:
-                entity = ord(entity)
-            else:
-                entity = int(entity[2:-1])
-            if 0 <= entity < 128:
-                self.__builder.data(chr(entity))
-            else:
-                self.__builder.data(unichr(entity))
-        else:
-            self.unknown_entityref(name)
-
-    ##
-    # (Internal) Handles character data.
-
-    def handle_data(self, data):
-        if isinstance(data, type('')) and is_not_ascii(data):
-            # convert to unicode, but only if necessary
-            data = unicode(data, self.encoding, "ignore")
-        self.__builder.data(data)
-
-    ##
-    # (Hook) Handles unknown entity references.  The default action
-    # is to ignore unknown entities.
-
-    def unknown_entityref(self, name):
-        pass # ignore by default; override if necessary
-
-##
-# An alias for the <b>HTMLTreeBuilder</b> class.
-
-TreeBuilder = HTMLTreeBuilder
-
-##
-# Parse an HTML document or document fragment.
-#
-# @param source A filename or file object containing HTML data.
-# @param encoding Optional character encoding, if known.  If omitted,
-#     the parser looks for META tags inside the document.  If no tags
-#     are found, the parser defaults to ISO-8859-1.
-# @return An ElementTree instance
-
-def parse(source, encoding=None):
-    return ElementTree.parse(source, HTMLTreeBuilder(encoding=encoding))
-
-if __name__ == "__main__":
-    import sys
-    ElementTree.dump(parse(open(sys.argv[1])))
+#
+# ElementTree
+# $Id: HTMLTreeBuilder.py 2325 2005-03-16 15:50:43Z fredrik $
+#
+# a simple tree builder, for HTML input
+#
+# history:
+# 2002-04-06 fl   created
+# 2002-04-07 fl   ignore IMG and HR end tags
+# 2002-04-07 fl   added support for 1.5.2 and later
+# 2003-04-13 fl   added HTMLTreeBuilder alias
+# 2004-12-02 fl   don't feed non-ASCII charrefs/entities as 8-bit strings
+# 2004-12-05 fl   don't feed non-ASCII CDATA as 8-bit strings
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
+#
+# fredrik at pythonware.com
+# http://www.pythonware.com
+#
+# --------------------------------------------------------------------
+# The ElementTree toolkit is
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------
+
+##
+# Tools to build element trees from HTML files.
+##
+
+import htmlentitydefs
+import re, string, sys
+import mimetools, StringIO
+
+import ElementTree
+
+AUTOCLOSE = "p", "li", "tr", "th", "td", "head", "body"
+IGNOREEND = "img", "hr", "meta", "link", "br"
+
+if sys.version[:3] == "1.5":
+    is_not_ascii = re.compile(r"[\x80-\xff]").search # 1.5.2
+else:
+    is_not_ascii = re.compile(eval(r'u"[\u0080-\uffff]"')).search
+
+try:
+    from HTMLParser import HTMLParser
+except ImportError:
+    from sgmllib import SGMLParser
+    # hack to use sgmllib's SGMLParser to emulate 2.2's HTMLParser
+    class HTMLParser(SGMLParser):
+        # the following only works as long as this class doesn't
+        # provide any do, start, or end handlers
+        def unknown_starttag(self, tag, attrs):
+            self.handle_starttag(tag, attrs)
+        def unknown_endtag(self, tag):
+            self.handle_endtag(tag)
+
+##
+# ElementTree builder for HTML source code.  This builder converts an
+# HTML document or fragment to an ElementTree.
+# <p>
+# The parser is relatively picky, and requires balanced tags for most
+# elements.  However, elements belonging to the following group are
+# automatically closed: P, LI, TR, TH, and TD.  In addition, the
+# parser automatically inserts end tags immediately after the start
+# tag, and ignores any end tags for the following group: IMG, HR,
+# META, and LINK.
+#
+# @keyparam builder Optional builder object.  If omitted, the parser
+#     uses the standard <b>elementtree</b> builder.
+# @keyparam encoding Optional character encoding, if known.  If omitted,
+#     the parser looks for META tags inside the document.  If no tags
+#     are found, the parser defaults to ISO-8859-1.  Note that if your
+#     document uses a non-ASCII compatible encoding, you must decode
+#     the document before parsing.
+#
+# @see elementtree.ElementTree
+
+class HTMLTreeBuilder(HTMLParser):
+
+    # FIXME: shouldn't this class be named Parser, not Builder?
+
+    def __init__(self, builder=None, encoding=None):
+        self.__stack = []
+        if builder is None:
+            builder = ElementTree.TreeBuilder()
+        self.__builder = builder
+        self.encoding = encoding or "iso-8859-1"
+        HTMLParser.__init__(self)
+
+    ##
+    # Flushes parser buffers, and return the root element.
+    #
+    # @return An Element instance.
+
+    def close(self):
+        HTMLParser.close(self)
+        return self.__builder.close()
+
+    ##
+    # (Internal) Handles start tags.
+
+    def handle_starttag(self, tag, attrs):
+        if tag == "meta":
+            # look for encoding directives
+            http_equiv = content = None
+            for k, v in attrs:
+                if k == "http-equiv":
+                    http_equiv = string.lower(v)
+                elif k == "content":
+                    content = v
+            if http_equiv == "content-type" and content:
+                # use mimetools to parse the http header
+                header = mimetools.Message(
+                    StringIO.StringIO("%s: %s\n\n" % (http_equiv, content))
+                    )
+                encoding = header.getparam("charset")
+                if encoding:
+                    self.encoding = encoding
+        if tag in AUTOCLOSE:
+            if self.__stack and self.__stack[-1] == tag:
+                self.handle_endtag(tag)
+        self.__stack.append(tag)
+        attrib = {}
+        if attrs:
+            for k, v in attrs:
+                attrib[string.lower(k)] = v
+        self.__builder.start(tag, attrib)
+        if tag in IGNOREEND:
+            self.__stack.pop()
+            self.__builder.end(tag)
+
+    ##
+    # (Internal) Handles end tags.
+
+    def handle_endtag(self, tag):
+        if tag in IGNOREEND:
+            return
+        lasttag = self.__stack.pop()
+        if tag != lasttag and lasttag in AUTOCLOSE:
+            self.handle_endtag(lasttag)
+        self.__builder.end(tag)
+
+    ##
+    # (Internal) Handles character references.
+
+    def handle_charref(self, char):
+        if char[:1] == "x":
+            char = int(char[1:], 16)
+        else:
+            char = int(char)
+        if 0 <= char < 128:
+            self.__builder.data(chr(char))
+        else:
+            self.__builder.data(unichr(char))
+
+    ##
+    # (Internal) Handles entity references.
+
+    def handle_entityref(self, name):
+        entity = htmlentitydefs.entitydefs.get(name)
+        if entity:
+            if len(entity) == 1:
+                entity = ord(entity)
+            else:
+                entity = int(entity[2:-1])
+            if 0 <= entity < 128:
+                self.__builder.data(chr(entity))
+            else:
+                self.__builder.data(unichr(entity))
+        else:
+            self.unknown_entityref(name)
+
+    ##
+    # (Internal) Handles character data.
+
+    def handle_data(self, data):
+        if isinstance(data, type('')) and is_not_ascii(data):
+            # convert to unicode, but only if necessary
+            data = unicode(data, self.encoding, "ignore")
+        self.__builder.data(data)
+
+    ##
+    # (Hook) Handles unknown entity references.  The default action
+    # is to ignore unknown entities.
+
+    def unknown_entityref(self, name):
+        pass # ignore by default; override if necessary
+
+##
+# An alias for the <b>HTMLTreeBuilder</b> class.
+
+TreeBuilder = HTMLTreeBuilder
+
+##
+# Parse an HTML document or document fragment.
+#
+# @param source A filename or file object containing HTML data.
+# @param encoding Optional character encoding, if known.  If omitted,
+#     the parser looks for META tags inside the document.  If no tags
+#     are found, the parser defaults to ISO-8859-1.
+# @return An ElementTree instance
+
+def parse(source, encoding=None):
+    return ElementTree.parse(source, HTMLTreeBuilder(encoding=encoding))
+
+if __name__ == "__main__":
+    import sys
+    ElementTree.dump(parse(open(sys.argv[1])))

Modified: external/elementtree-1.2.6-20050316/elementtree/SgmlopXMLTreeBuilder.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/SgmlopXMLTreeBuilder.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/SgmlopXMLTreeBuilder.py	Wed Dec 14 19:33:39 2005
@@ -1,103 +1,103 @@
-#
-# ElementTree
-# $Id$
-#
-# A simple XML tree builder, based on the sgmlop library.
-#
-# Note that this version does not support namespaces.  This may be
-# changed in future versions.
-#
-# history:
-# 2004-03-28 fl   created
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
-#
-# fredrik at pythonware.com
-# http://www.pythonware.com
-#
-# --------------------------------------------------------------------
-# The ElementTree toolkit is
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh
-#
-# By obtaining, using, and/or copying this software and/or its
-# associated documentation, you agree that you have read, understood,
-# and will comply with the following terms and conditions:
-#
-# Permission to use, copy, modify, and distribute this software and
-# its associated documentation for any purpose and without fee is
-# hereby granted, provided that the above copyright notice appears in
-# all copies, and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of
-# Secret Labs AB or the author not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
-# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-# --------------------------------------------------------------------
-
-##
-# Tools to build element trees from XML, based on the SGMLOP parser.
-# <p>
-# The current version does not support XML namespaces.
-# <p>
-# This tree builder requires the <b>sgmlop</b> extension module
-# (available from
-# <a href='http://effbot.org/downloads'>http://effbot.org/downloads</a>).
-##
-
-import ElementTree
-
-##
-# ElementTree builder for XML source data, based on the SGMLOP parser.
-#
-# @see elementtree.ElementTree
-
-class TreeBuilder:
-
-    def __init__(self, html=0):
-        try:
-            import sgmlop
-        except ImportError:
-            raise RuntimeError("sgmlop parser not available")
-        self.__builder = ElementTree.TreeBuilder()
-        if html:
-            import htmlentitydefs
-            self.entitydefs.update(htmlentitydefs.entitydefs)
-        self.__parser = sgmlop.XMLParser()
-        self.__parser.register(self)
-
-    ##
-    # Feeds data to the parser.
-    #
-    # @param data Encoded data.
-
-    def feed(self, data):
-        self.__parser.feed(data)
-
-    ##
-    # Finishes feeding data to the parser.
-    #
-    # @return An element structure.
-    # @defreturn Element
-
-    def close(self):
-        self.__parser.close()
-        self.__parser = None
-        return self.__builder.close()
-
-    def finish_starttag(self, tag, attrib):
-        self.__builder.start(tag, attrib)
-
-    def finish_endtag(self, tag):
-        self.__builder.end(tag)
-
-    def handle_data(self, data):
-        self.__builder.data(data)
+#
+# ElementTree
+# $Id$
+#
+# A simple XML tree builder, based on the sgmlop library.
+#
+# Note that this version does not support namespaces.  This may be
+# changed in future versions.
+#
+# history:
+# 2004-03-28 fl   created
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
+#
+# fredrik at pythonware.com
+# http://www.pythonware.com
+#
+# --------------------------------------------------------------------
+# The ElementTree toolkit is
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------
+
+##
+# Tools to build element trees from XML, based on the SGMLOP parser.
+# <p>
+# The current version does not support XML namespaces.
+# <p>
+# This tree builder requires the <b>sgmlop</b> extension module
+# (available from
+# <a href='http://effbot.org/downloads'>http://effbot.org/downloads</a>).
+##
+
+import ElementTree
+
+##
+# ElementTree builder for XML source data, based on the SGMLOP parser.
+#
+# @see elementtree.ElementTree
+
+class TreeBuilder:
+
+    def __init__(self, html=0):
+        try:
+            import sgmlop
+        except ImportError:
+            raise RuntimeError("sgmlop parser not available")
+        self.__builder = ElementTree.TreeBuilder()
+        if html:
+            import htmlentitydefs
+            self.entitydefs.update(htmlentitydefs.entitydefs)
+        self.__parser = sgmlop.XMLParser()
+        self.__parser.register(self)
+
+    ##
+    # Feeds data to the parser.
+    #
+    # @param data Encoded data.
+
+    def feed(self, data):
+        self.__parser.feed(data)
+
+    ##
+    # Finishes feeding data to the parser.
+    #
+    # @return An element structure.
+    # @defreturn Element
+
+    def close(self):
+        self.__parser.close()
+        self.__parser = None
+        return self.__builder.close()
+
+    def finish_starttag(self, tag, attrib):
+        self.__builder.start(tag, attrib)
+
+    def finish_endtag(self, tag):
+        self.__builder.end(tag)
+
+    def handle_data(self, data):
+        self.__builder.data(data)

Modified: external/elementtree-1.2.6-20050316/elementtree/SimpleXMLTreeBuilder.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/SimpleXMLTreeBuilder.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/SimpleXMLTreeBuilder.py	Wed Dec 14 19:33:39 2005
@@ -1,144 +1,144 @@
-#
-# ElementTree
-# $Id: SimpleXMLTreeBuilder.py 1862 2004-06-18 07:31:02Z Fredrik $
-#
-# A simple XML tree builder, based on Python's xmllib
-#
-# Note that due to bugs in xmllib, this builder does not fully support
-# namespaces (unqualified attributes are put in the default namespace,
-# instead of being left as is).  Run this module as a script to find
-# out if this affects your Python version.
-#
-# history:
-# 2001-10-20 fl   created
-# 2002-05-01 fl   added namespace support for xmllib
-# 2002-08-17 fl   added xmllib sanity test
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
-#
-# fredrik at pythonware.com
-# http://www.pythonware.com
-#
-# --------------------------------------------------------------------
-# The ElementTree toolkit is
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh
-#
-# By obtaining, using, and/or copying this software and/or its
-# associated documentation, you agree that you have read, understood,
-# and will comply with the following terms and conditions:
-#
-# Permission to use, copy, modify, and distribute this software and
-# its associated documentation for any purpose and without fee is
-# hereby granted, provided that the above copyright notice appears in
-# all copies, and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of
-# Secret Labs AB or the author not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
-# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-# --------------------------------------------------------------------
-
-##
-# Tools to build element trees from XML files, using <b>xmllib</b>.
-# This module can be used instead of the standard tree builder, for
-# Python versions where "expat" is not available (such as 1.5.2).
-# <p>
-# Note that due to bugs in <b>xmllib</b>, the namespace support is
-# not reliable (you can run the module as a script to find out exactly
-# how unreliable it is on your Python version).
-##
-
-import xmllib, string
-
-import ElementTree
-
-##
-# ElementTree builder for XML source data.
-#
-# @see elementtree.ElementTree
-
-class TreeBuilder(xmllib.XMLParser):
-
-    def __init__(self, html=0):
-        self.__builder = ElementTree.TreeBuilder()
-        if html:
-            import htmlentitydefs
-            self.entitydefs.update(htmlentitydefs.entitydefs)
-        xmllib.XMLParser.__init__(self)
-
-    ##
-    # Feeds data to the parser.
-    #
-    # @param data Encoded data.
-
-    def feed(self, data):
-        xmllib.XMLParser.feed(self, data)
-
-    ##
-    # Finishes feeding data to the parser.
-    #
-    # @return An element structure.
-    # @defreturn Element
-
-    def close(self):
-        xmllib.XMLParser.close(self)
-        return self.__builder.close()
-
-    def handle_data(self, data):
-        self.__builder.data(data)
-
-    handle_cdata = handle_data
-
-    def unknown_starttag(self, tag, attrs):
-        attrib = {}
-        for key, value in attrs.items():
-            attrib[fixname(key)] = value
-        self.__builder.start(fixname(tag), attrib)
-
-    def unknown_endtag(self, tag):
-        self.__builder.end(fixname(tag))
-
-
-def fixname(name, split=string.split):
-    # xmllib in 2.0 and later provides limited (and slightly broken)
-    # support for XML namespaces.
-    if " " not in name:
-        return name
-    return "{%s}%s" % tuple(split(name, " ", 1))
-
-
-if __name__ == "__main__":
-    import sys
-    # sanity check: look for known namespace bugs in xmllib
-    p = TreeBuilder()
-    text = """\
-    <root xmlns='default'>
-       <tag attribute='value' />
-    </root>
-    """
-    p.feed(text)
-    tree = p.close()
-    status = []
-    # check for bugs in the xmllib implementation
-    tag = tree.find("{default}tag")
-    if tag is None:
-        status.append("namespaces not supported")
-    if tag is not None and tag.get("{default}attribute"):
-        status.append("default namespace applied to unqualified attribute")
-    # report bugs
-    if status:
-        print "xmllib doesn't work properly in this Python version:"
-        for bug in status:
-            print "-", bug
-    else:
-        print "congratulations; no problems found in xmllib"
-
+#
+# ElementTree
+# $Id: SimpleXMLTreeBuilder.py 1862 2004-06-18 07:31:02Z Fredrik $
+#
+# A simple XML tree builder, based on Python's xmllib
+#
+# Note that due to bugs in xmllib, this builder does not fully support
+# namespaces (unqualified attributes are put in the default namespace,
+# instead of being left as is).  Run this module as a script to find
+# out if this affects your Python version.
+#
+# history:
+# 2001-10-20 fl   created
+# 2002-05-01 fl   added namespace support for xmllib
+# 2002-08-17 fl   added xmllib sanity test
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
+#
+# fredrik at pythonware.com
+# http://www.pythonware.com
+#
+# --------------------------------------------------------------------
+# The ElementTree toolkit is
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------
+
+##
+# Tools to build element trees from XML files, using <b>xmllib</b>.
+# This module can be used instead of the standard tree builder, for
+# Python versions where "expat" is not available (such as 1.5.2).
+# <p>
+# Note that due to bugs in <b>xmllib</b>, the namespace support is
+# not reliable (you can run the module as a script to find out exactly
+# how unreliable it is on your Python version).
+##
+
+import xmllib, string
+
+import ElementTree
+
+##
+# ElementTree builder for XML source data.
+#
+# @see elementtree.ElementTree
+
+class TreeBuilder(xmllib.XMLParser):
+
+    def __init__(self, html=0):
+        self.__builder = ElementTree.TreeBuilder()
+        if html:
+            import htmlentitydefs
+            self.entitydefs.update(htmlentitydefs.entitydefs)
+        xmllib.XMLParser.__init__(self)
+
+    ##
+    # Feeds data to the parser.
+    #
+    # @param data Encoded data.
+
+    def feed(self, data):
+        xmllib.XMLParser.feed(self, data)
+
+    ##
+    # Finishes feeding data to the parser.
+    #
+    # @return An element structure.
+    # @defreturn Element
+
+    def close(self):
+        xmllib.XMLParser.close(self)
+        return self.__builder.close()
+
+    def handle_data(self, data):
+        self.__builder.data(data)
+
+    handle_cdata = handle_data
+
+    def unknown_starttag(self, tag, attrs):
+        attrib = {}
+        for key, value in attrs.items():
+            attrib[fixname(key)] = value
+        self.__builder.start(fixname(tag), attrib)
+
+    def unknown_endtag(self, tag):
+        self.__builder.end(fixname(tag))
+
+
+def fixname(name, split=string.split):
+    # xmllib in 2.0 and later provides limited (and slightly broken)
+    # support for XML namespaces.
+    if " " not in name:
+        return name
+    return "{%s}%s" % tuple(split(name, " ", 1))
+
+
+if __name__ == "__main__":
+    import sys
+    # sanity check: look for known namespace bugs in xmllib
+    p = TreeBuilder()
+    text = """\
+    <root xmlns='default'>
+       <tag attribute='value' />
+    </root>
+    """
+    p.feed(text)
+    tree = p.close()
+    status = []
+    # check for bugs in the xmllib implementation
+    tag = tree.find("{default}tag")
+    if tag is None:
+        status.append("namespaces not supported")
+    if tag is not None and tag.get("{default}attribute"):
+        status.append("default namespace applied to unqualified attribute")
+    # report bugs
+    if status:
+        print "xmllib doesn't work properly in this Python version:"
+        for bug in status:
+            print "-", bug
+    else:
+        print "congratulations; no problems found in xmllib"
+

Modified: external/elementtree-1.2.6-20050316/elementtree/SimpleXMLWriter.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/SimpleXMLWriter.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/SimpleXMLWriter.py	Wed Dec 14 19:33:39 2005
@@ -1,279 +1,279 @@
-#
-# SimpleXMLWriter
-# $Id: SimpleXMLWriter.py 2312 2005-03-02 18:13:39Z fredrik $
-#
-# a simple XML writer
-#
-# history:
-# 2001-12-28 fl   created
-# 2002-11-25 fl   fixed attribute encoding
-# 2002-12-02 fl   minor fixes for 1.5.2
-# 2004-06-17 fl   added pythondoc markup
-# 2004-07-23 fl   added flush method (from Jay Graves)
-# 2004-10-03 fl   added declaration method
-#
-# Copyright (c) 2001-2004 by Fredrik Lundh
-#
-# fredrik at pythonware.com
-# http://www.pythonware.com
-#
-# --------------------------------------------------------------------
-# The SimpleXMLWriter module is
-#
-# Copyright (c) 2001-2004 by Fredrik Lundh
-#
-# By obtaining, using, and/or copying this software and/or its
-# associated documentation, you agree that you have read, understood,
-# and will comply with the following terms and conditions:
-#
-# Permission to use, copy, modify, and distribute this software and
-# its associated documentation for any purpose and without fee is
-# hereby granted, provided that the above copyright notice appears in
-# all copies, and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of
-# Secret Labs AB or the author not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
-# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-# --------------------------------------------------------------------
-
-##
-# Tools to write XML files, without having to deal with encoding
-# issues, well-formedness, etc.
-# <p>
-# The current version does not provide built-in support for
-# namespaces. To create files using namespaces, you have to provide
-# "xmlns" attributes and explicitly add prefixes to tags and
-# attributes.
-#
-# <h3>Patterns</h3>
-#
-# The following example generates a small XHTML document.
-# <pre>
-#
-# from elementtree.SimpleXMLWriter import XMLWriter
-# import sys
-#
-# w = XMLWriter(sys.stdout)
-#
-# html = w.start("html")
-#
-# w.start("head")
-# w.element("title", "my document")
-# w.element("meta", name="generator", value="my application 1.0")
-# w.end()
-#
-# w.start("body")
-# w.element("h1", "this is a heading")
-# w.element("p", "this is a paragraph")
-#
-# w.start("p")
-# w.data("this is ")
-# w.element("b", "bold")
-# w.data(" and ")
-# w.element("i", "italic")
-# w.data(".")
-# w.end("p")
-#
-# w.close(html)
-# </pre>
-##
-
-import re, sys, string
-
-try:
-    unicode("")
-except NameError:
-    def encode(s, encoding):
-        # 1.5.2: application must use the right encoding
-        return s
-    _escape = re.compile(r"[&<>\"\x80-\xff]+") # 1.5.2
-else:
-    def encode(s, encoding):
-        return s.encode(encoding)
-    _escape = re.compile(eval(r'u"[&<>\"\u0080-\uffff]+"'))
-
-def encode_entity(text, pattern=_escape):
-    # map reserved and non-ascii characters to numerical entities
-    def escape_entities(m):
-        out = []
-        for char in m.group():
-            out.append("&#%d;" % ord(char))
-        return string.join(out, "")
-    return encode(pattern.sub(escape_entities, text), "ascii")
-
-del _escape
-
-#
-# the following functions assume an ascii-compatible encoding
-# (or "utf-16")
-
-def escape_cdata(s, encoding=None, replace=string.replace):
-    s = replace(s, "&", "&amp;")
-    s = replace(s, "<", "&lt;")
-    s = replace(s, ">", "&gt;")
-    if encoding:
-        try:
-            return encode(s, encoding)
-        except UnicodeError:
-            return encode_entity(s)
-    return s
-
-def escape_attrib(s, encoding=None, replace=string.replace):
-    s = replace(s, "&", "&amp;")
-    s = replace(s, "'", "&apos;")
-    s = replace(s, "\"", "&quot;")
-    s = replace(s, "<", "&lt;")
-    s = replace(s, ">", "&gt;")
-    if encoding:
-        try:
-            return encode(s, encoding)
-        except UnicodeError:
-            return encode_entity(s)
-    return s
-
-##
-# XML writer class.
-#
-# @param file A file or file-like object.  This object must implement
-#    a <b>write</b> method that takes an 8-bit string.
-# @param encoding Optional encoding.
-
-class XMLWriter:
-
-    def __init__(self, file, encoding="us-ascii"):
-        if not hasattr(file, "write"):
-            file = open(file, "w")
-        self.__write = file.write
-        if hasattr(file, "flush"):
-            self.flush = file.flush
-        self.__open = 0 # true if start tag is open
-        self.__tags = []
-        self.__data = []
-        self.__encoding = encoding
-
-    def __flush(self):
-        # flush internal buffers
-        if self.__open:
-            self.__write(">")
-            self.__open = 0
-        if self.__data:
-            data = string.join(self.__data, "")
-            self.__write(escape_cdata(data, self.__encoding))
-            self.__data = []
-
-    ##
-    # Writes an XML declaration.
-
-    def declaration(self):
-        encoding = self.__encoding
-        if encoding == "us-ascii" or encoding == "utf-8":
-            self.__write("<?xml version='1.0'?>\n")
-        else:
-            self.__write("<?xml version='1.0' encoding='%s'?>\n" % encoding)
-
-    ##
-    # Opens a new element.  Attributes can be given as keyword
-    # arguments, or as a string/string dictionary. You can pass in
-    # 8-bit strings or Unicode strings; the former are assumed to use
-    # the encoding passed to the constructor.  The method returns an
-    # opaque identifier that can be passed to the <b>close</b> method,
-    # to close all open elements up to and including this one.
-    #
-    # @param tag Element tag.
-    # @param attrib Attribute dictionary.  Alternatively, attributes
-    #    can be given as keyword arguments.
-    # @return An element identifier.
-
-    def start(self, tag, attrib={}, **extra):
-        self.__flush()
-        tag = escape_cdata(tag, self.__encoding)
-        self.__data = []
-        self.__tags.append(tag)
-        self.__write("<%s" % tag)
-        if attrib or extra:
-            attrib = attrib.copy()
-            attrib.update(extra)
-            attrib = attrib.items()
-            attrib.sort()
-            for k, v in attrib:
-                k = escape_cdata(k, self.__encoding)
-                v = escape_attrib(v, self.__encoding)
-                self.__write(" %s=\"%s\"" % (k, v))
-        self.__open = 1
-        return len(self.__tags)-1
-
-    ##
-    # Adds a comment to the output stream.
-    #
-    # @param comment Comment text, as an 8-bit string or Unicode string.
-
-    def comment(self, comment):
-        self.__flush()
-        self.__write("<!-- %s -->\n" % escape_cdata(comment, self.__encoding))
-
-    ##
-    # Adds character data to the output stream.
-    #
-    # @param text Character data, as an 8-bit string or Unicode string.
-
-    def data(self, text):
-        self.__data.append(text)
-
-    ##
-    # Closes the current element (opened by the most recent call to
-    # <b>start</b>).
-    #
-    # @param tag Element tag.  If given, the tag must match the start
-    #    tag.  If omitted, the current element is closed.
-
-    def end(self, tag=None):
-        if tag:
-            assert self.__tags, "unbalanced end(%s)" % tag
-            assert escape_cdata(tag, self.__encoding) == self.__tags[-1],\
-                   "expected end(%s), got %s" % (self.__tags[-1], tag)
-        else:
-            assert self.__tags, "unbalanced end()"
-        tag = self.__tags.pop()
-        if self.__data:
-            self.__flush()
-        elif self.__open:
-            self.__open = 0
-            self.__write(" />")
-            return
-        self.__write("</%s>" % tag)
-
-    ##
-    # Closes open elements, up to (and including) the element identified
-    # by the given identifier.
-    #
-    # @param id Element identifier, as returned by the <b>start</b> method.
-
-    def close(self, id):
-        while len(self.__tags) > id:
-            self.end()
-
-    ##
-    # Adds an entire element.  This is the same as calling <b>start</b>,
-    # <b>data</b>, and <b>end</b> in sequence. The <b>text</b> argument
-    # can be omitted.
-
-    def element(self, tag, text=None, attrib={}, **extra):
-        apply(self.start, (tag, attrib), extra)
-        if text:
-            self.data(text)
-        self.end()
-
-    ##
-    # Flushes the output stream.
-
-    def flush(self):
-        pass # replaced by the constructor
+#
+# SimpleXMLWriter
+# $Id: SimpleXMLWriter.py 2312 2005-03-02 18:13:39Z fredrik $
+#
+# a simple XML writer
+#
+# history:
+# 2001-12-28 fl   created
+# 2002-11-25 fl   fixed attribute encoding
+# 2002-12-02 fl   minor fixes for 1.5.2
+# 2004-06-17 fl   added pythondoc markup
+# 2004-07-23 fl   added flush method (from Jay Graves)
+# 2004-10-03 fl   added declaration method
+#
+# Copyright (c) 2001-2004 by Fredrik Lundh
+#
+# fredrik at pythonware.com
+# http://www.pythonware.com
+#
+# --------------------------------------------------------------------
+# The SimpleXMLWriter module is
+#
+# Copyright (c) 2001-2004 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------
+
+##
+# Tools to write XML files, without having to deal with encoding
+# issues, well-formedness, etc.
+# <p>
+# The current version does not provide built-in support for
+# namespaces. To create files using namespaces, you have to provide
+# "xmlns" attributes and explicitly add prefixes to tags and
+# attributes.
+#
+# <h3>Patterns</h3>
+#
+# The following example generates a small XHTML document.
+# <pre>
+#
+# from elementtree.SimpleXMLWriter import XMLWriter
+# import sys
+#
+# w = XMLWriter(sys.stdout)
+#
+# html = w.start("html")
+#
+# w.start("head")
+# w.element("title", "my document")
+# w.element("meta", name="generator", value="my application 1.0")
+# w.end()
+#
+# w.start("body")
+# w.element("h1", "this is a heading")
+# w.element("p", "this is a paragraph")
+#
+# w.start("p")
+# w.data("this is ")
+# w.element("b", "bold")
+# w.data(" and ")
+# w.element("i", "italic")
+# w.data(".")
+# w.end("p")
+#
+# w.close(html)
+# </pre>
+##
+
+import re, sys, string
+
+try:
+    unicode("")
+except NameError:
+    def encode(s, encoding):
+        # 1.5.2: application must use the right encoding
+        return s
+    _escape = re.compile(r"[&<>\"\x80-\xff]+") # 1.5.2
+else:
+    def encode(s, encoding):
+        return s.encode(encoding)
+    _escape = re.compile(eval(r'u"[&<>\"\u0080-\uffff]+"'))
+
+def encode_entity(text, pattern=_escape):
+    # map reserved and non-ascii characters to numerical entities
+    def escape_entities(m):
+        out = []
+        for char in m.group():
+            out.append("&#%d;" % ord(char))
+        return string.join(out, "")
+    return encode(pattern.sub(escape_entities, text), "ascii")
+
+del _escape
+
+#
+# the following functions assume an ascii-compatible encoding
+# (or "utf-16")
+
+def escape_cdata(s, encoding=None, replace=string.replace):
+    s = replace(s, "&", "&amp;")
+    s = replace(s, "<", "&lt;")
+    s = replace(s, ">", "&gt;")
+    if encoding:
+        try:
+            return encode(s, encoding)
+        except UnicodeError:
+            return encode_entity(s)
+    return s
+
+def escape_attrib(s, encoding=None, replace=string.replace):
+    s = replace(s, "&", "&amp;")
+    s = replace(s, "'", "&apos;")
+    s = replace(s, "\"", "&quot;")
+    s = replace(s, "<", "&lt;")
+    s = replace(s, ">", "&gt;")
+    if encoding:
+        try:
+            return encode(s, encoding)
+        except UnicodeError:
+            return encode_entity(s)
+    return s
+
+##
+# XML writer class.
+#
+# @param file A file or file-like object.  This object must implement
+#    a <b>write</b> method that takes an 8-bit string.
+# @param encoding Optional encoding.
+
+class XMLWriter:
+
+    def __init__(self, file, encoding="us-ascii"):
+        if not hasattr(file, "write"):
+            file = open(file, "w")
+        self.__write = file.write
+        if hasattr(file, "flush"):
+            self.flush = file.flush
+        self.__open = 0 # true if start tag is open
+        self.__tags = []
+        self.__data = []
+        self.__encoding = encoding
+
+    def __flush(self):
+        # flush internal buffers
+        if self.__open:
+            self.__write(">")
+            self.__open = 0
+        if self.__data:
+            data = string.join(self.__data, "")
+            self.__write(escape_cdata(data, self.__encoding))
+            self.__data = []
+
+    ##
+    # Writes an XML declaration.
+
+    def declaration(self):
+        encoding = self.__encoding
+        if encoding == "us-ascii" or encoding == "utf-8":
+            self.__write("<?xml version='1.0'?>\n")
+        else:
+            self.__write("<?xml version='1.0' encoding='%s'?>\n" % encoding)
+
+    ##
+    # Opens a new element.  Attributes can be given as keyword
+    # arguments, or as a string/string dictionary. You can pass in
+    # 8-bit strings or Unicode strings; the former are assumed to use
+    # the encoding passed to the constructor.  The method returns an
+    # opaque identifier that can be passed to the <b>close</b> method,
+    # to close all open elements up to and including this one.
+    #
+    # @param tag Element tag.
+    # @param attrib Attribute dictionary.  Alternatively, attributes
+    #    can be given as keyword arguments.
+    # @return An element identifier.
+
+    def start(self, tag, attrib={}, **extra):
+        self.__flush()
+        tag = escape_cdata(tag, self.__encoding)
+        self.__data = []
+        self.__tags.append(tag)
+        self.__write("<%s" % tag)
+        if attrib or extra:
+            attrib = attrib.copy()
+            attrib.update(extra)
+            attrib = attrib.items()
+            attrib.sort()
+            for k, v in attrib:
+                k = escape_cdata(k, self.__encoding)
+                v = escape_attrib(v, self.__encoding)
+                self.__write(" %s=\"%s\"" % (k, v))
+        self.__open = 1
+        return len(self.__tags)-1
+
+    ##
+    # Adds a comment to the output stream.
+    #
+    # @param comment Comment text, as an 8-bit string or Unicode string.
+
+    def comment(self, comment):
+        self.__flush()
+        self.__write("<!-- %s -->\n" % escape_cdata(comment, self.__encoding))
+
+    ##
+    # Adds character data to the output stream.
+    #
+    # @param text Character data, as an 8-bit string or Unicode string.
+
+    def data(self, text):
+        self.__data.append(text)
+
+    ##
+    # Closes the current element (opened by the most recent call to
+    # <b>start</b>).
+    #
+    # @param tag Element tag.  If given, the tag must match the start
+    #    tag.  If omitted, the current element is closed.
+
+    def end(self, tag=None):
+        if tag:
+            assert self.__tags, "unbalanced end(%s)" % tag
+            assert escape_cdata(tag, self.__encoding) == self.__tags[-1],\
+                   "expected end(%s), got %s" % (self.__tags[-1], tag)
+        else:
+            assert self.__tags, "unbalanced end()"
+        tag = self.__tags.pop()
+        if self.__data:
+            self.__flush()
+        elif self.__open:
+            self.__open = 0
+            self.__write(" />")
+            return
+        self.__write("</%s>" % tag)
+
+    ##
+    # Closes open elements, up to (and including) the element identified
+    # by the given identifier.
+    #
+    # @param id Element identifier, as returned by the <b>start</b> method.
+
+    def close(self, id):
+        while len(self.__tags) > id:
+            self.end()
+
+    ##
+    # Adds an entire element.  This is the same as calling <b>start</b>,
+    # <b>data</b>, and <b>end</b> in sequence. The <b>text</b> argument
+    # can be omitted.
+
+    def element(self, tag, text=None, attrib={}, **extra):
+        apply(self.start, (tag, attrib), extra)
+        if text:
+            self.data(text)
+        self.end()
+
+    ##
+    # Flushes the output stream.
+
+    def flush(self):
+        pass # replaced by the constructor

Modified: external/elementtree-1.2.6-20050316/elementtree/TidyHTMLTreeBuilder.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/TidyHTMLTreeBuilder.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/TidyHTMLTreeBuilder.py	Wed Dec 14 19:33:39 2005
@@ -1,6 +1,6 @@
-#
-# ElementTree
-# $Id: TidyHTMLTreeBuilder.py 2304 2005-03-01 17:42:41Z fredrik $
-#
-
-from elementtidy.TidyHTMLTreeBuilder import *
+#
+# ElementTree
+# $Id: TidyHTMLTreeBuilder.py 2304 2005-03-01 17:42:41Z fredrik $
+#
+
+from elementtidy.TidyHTMLTreeBuilder import *

Modified: external/elementtree-1.2.6-20050316/elementtree/TidyTools.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/TidyTools.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/TidyTools.py	Wed Dec 14 19:33:39 2005
@@ -1,128 +1,128 @@
-#
-# ElementTree
-# $Id: TidyTools.py 1862 2004-06-18 07:31:02Z Fredrik $
-#
-# tools to run the "tidy" command on an HTML or XHTML file, and return
-# the contents as an XHTML element tree.
-#
-# history:
-# 2002-10-19 fl   added to ElementTree library; added getzonebody function
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
-#
-# fredrik at pythonware.com
-# http://www.pythonware.com
-#
-
-##
-# Tools to build element trees from HTML, using the external <b>tidy</b>
-# utility.
-##
-
-import glob, string, os, sys
-
-from ElementTree import ElementTree, Element
-
-NS_XHTML = "{http://www.w3.org/1999/xhtml}"
-
-##
-# Convert an HTML or HTML-like file to XHTML, using the <b>tidy</b>
-# command line utility.
-#
-# @param file Filename.
-# @param new_inline_tags An optional list of valid but non-standard
-#     inline tags.
-# @return An element tree, or None if not successful.
-
-def tidy(file, new_inline_tags=None):
-
-    command = ["tidy", "-qn", "-asxml"]
-
-    if new_inline_tags:
-        command.append("--new-inline-tags")
-        command.append(string.join(new_inline_tags, ","))
-
-    # FIXME: support more tidy options!
-
-    # convert
-    os.system(
-        "%s %s >%s.out 2>%s.err" % (string.join(command), file, file, file)
-        )
-    # check that the result is valid XML
-    try:
-        tree = ElementTree()
-        tree.parse(file + ".out")
-    except:
-        print "*** %s:%s" % sys.exc_info()[:2]
-        print ("*** %s is not valid XML "
-               "(check %s.err for info)" % (file, file))
-        tree = None
-    else:
-        if os.path.isfile(file + ".out"):
-            os.remove(file + ".out")
-        if os.path.isfile(file + ".err"):
-            os.remove(file + ".err")
-
-    return tree
-
-##
-# Get document body from a an HTML or HTML-like file.  This function
-# uses the <b>tidy</b> function to convert HTML to XHTML, and cleans
-# up the resulting XML tree.
-#
-# @param file Filename.
-# @return A <b>body</b> element, or None if not successful.
-
-def getbody(file, **options):
-    # get clean body from text file
-
-    # get xhtml tree
-    try:
-        tree = apply(tidy, (file,), options)
-        if tree is None:
-            return
-    except IOError, v:
-        print "***", v
-        return None
-
-    NS = NS_XHTML
-
-    # remove namespace uris
-    for node in tree.getiterator():
-        if node.tag.startswith(NS):
-            node.tag = node.tag[len(NS):]
-
-    body = tree.getroot().find("body")
-
-    return body
-
-##
-# Same as <b>getbody</b>, but turns plain text at the start of the
-# document into an H1 tag.  This function can be used to parse zone
-# documents.
-#
-# @param file Filename.
-# @return A <b>body</b> element, or None if not successful.
-
-def getzonebody(file, **options):
-
-    body = getbody(file, **options)
-    if body is None:
-        return
-
-    if body.text and string.strip(body.text):
-        title = Element("h1")
-        title.text = string.strip(body.text)
-        title.tail = "\n\n"
-        body.insert(0, title)
-
-    body.text = None
-
-    return body
-
-if __name__ == "__main__":
-
-    import sys
-    for arg in sys.argv[1:]:
-        for file in glob.glob(arg):
-            print file, "...", tidy(file)
+#
+# ElementTree
+# $Id: TidyTools.py 1862 2004-06-18 07:31:02Z Fredrik $
+#
+# tools to run the "tidy" command on an HTML or XHTML file, and return
+# the contents as an XHTML element tree.
+#
+# history:
+# 2002-10-19 fl   added to ElementTree library; added getzonebody function
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
+#
+# fredrik at pythonware.com
+# http://www.pythonware.com
+#
+
+##
+# Tools to build element trees from HTML, using the external <b>tidy</b>
+# utility.
+##
+
+import glob, string, os, sys
+
+from ElementTree import ElementTree, Element
+
+NS_XHTML = "{http://www.w3.org/1999/xhtml}"
+
+##
+# Convert an HTML or HTML-like file to XHTML, using the <b>tidy</b>
+# command line utility.
+#
+# @param file Filename.
+# @param new_inline_tags An optional list of valid but non-standard
+#     inline tags.
+# @return An element tree, or None if not successful.
+
+def tidy(file, new_inline_tags=None):
+
+    command = ["tidy", "-qn", "-asxml"]
+
+    if new_inline_tags:
+        command.append("--new-inline-tags")
+        command.append(string.join(new_inline_tags, ","))
+
+    # FIXME: support more tidy options!
+
+    # convert
+    os.system(
+        "%s %s >%s.out 2>%s.err" % (string.join(command), file, file, file)
+        )
+    # check that the result is valid XML
+    try:
+        tree = ElementTree()
+        tree.parse(file + ".out")
+    except:
+        print "*** %s:%s" % sys.exc_info()[:2]
+        print ("*** %s is not valid XML "
+               "(check %s.err for info)" % (file, file))
+        tree = None
+    else:
+        if os.path.isfile(file + ".out"):
+            os.remove(file + ".out")
+        if os.path.isfile(file + ".err"):
+            os.remove(file + ".err")
+
+    return tree
+
+##
+# Get document body from a an HTML or HTML-like file.  This function
+# uses the <b>tidy</b> function to convert HTML to XHTML, and cleans
+# up the resulting XML tree.
+#
+# @param file Filename.
+# @return A <b>body</b> element, or None if not successful.
+
+def getbody(file, **options):
+    # get clean body from text file
+
+    # get xhtml tree
+    try:
+        tree = apply(tidy, (file,), options)
+        if tree is None:
+            return
+    except IOError, v:
+        print "***", v
+        return None
+
+    NS = NS_XHTML
+
+    # remove namespace uris
+    for node in tree.getiterator():
+        if node.tag.startswith(NS):
+            node.tag = node.tag[len(NS):]
+
+    body = tree.getroot().find("body")
+
+    return body
+
+##
+# Same as <b>getbody</b>, but turns plain text at the start of the
+# document into an H1 tag.  This function can be used to parse zone
+# documents.
+#
+# @param file Filename.
+# @return A <b>body</b> element, or None if not successful.
+
+def getzonebody(file, **options):
+
+    body = getbody(file, **options)
+    if body is None:
+        return
+
+    if body.text and string.strip(body.text):
+        title = Element("h1")
+        title.text = string.strip(body.text)
+        title.tail = "\n\n"
+        body.insert(0, title)
+
+    body.text = None
+
+    return body
+
+if __name__ == "__main__":
+
+    import sys
+    for arg in sys.argv[1:]:
+        for file in glob.glob(arg):
+            print file, "...", tidy(file)

Modified: external/elementtree-1.2.6-20050316/elementtree/XMLTreeBuilder.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/XMLTreeBuilder.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/XMLTreeBuilder.py	Wed Dec 14 19:33:39 2005
@@ -1,113 +1,113 @@
-#
-# ElementTree
-# $Id: XMLTreeBuilder.py 2305 2005-03-01 17:43:09Z fredrik $
-#
-# an XML tree builder
-#
-# history:
-# 2001-10-20 fl   created
-# 2002-05-01 fl   added namespace support for xmllib
-# 2002-07-27 fl   require expat (1.5.2 code can use SimpleXMLTreeBuilder)
-# 2002-08-17 fl   use tag/attribute name memo cache
-# 2002-12-04 fl   moved XMLTreeBuilder to the ElementTree module
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
-#
-# fredrik at pythonware.com
-# http://www.pythonware.com
-#
-# --------------------------------------------------------------------
-# The ElementTree toolkit is
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh
-#
-# By obtaining, using, and/or copying this software and/or its
-# associated documentation, you agree that you have read, understood,
-# and will comply with the following terms and conditions:
-#
-# Permission to use, copy, modify, and distribute this software and
-# its associated documentation for any purpose and without fee is
-# hereby granted, provided that the above copyright notice appears in
-# all copies, and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of
-# Secret Labs AB or the author not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
-# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-# --------------------------------------------------------------------
-
-##
-# Tools to build element trees from XML files.
-##
-
-import ElementTree
-
-##
-# (obsolete) ElementTree builder for XML source data, based on the
-# <b>expat</b> parser.
-# <p>
-# This class is an alias for ElementTree.XMLTreeBuilder.  New code
-# should use that version instead.
-#
-# @see elementtree.ElementTree
-
-class TreeBuilder(ElementTree.XMLTreeBuilder):
-    pass
-
-##
-# (experimental) An alternate builder that supports manipulation of
-# new elements.
-
-class FancyTreeBuilder(TreeBuilder):
-
-    def __init__(self, html=0):
-        TreeBuilder.__init__(self, html)
-        self._parser.StartNamespaceDeclHandler = self._start_ns
-        self._parser.EndNamespaceDeclHandler = self._end_ns
-        self.namespaces = []
-
-    def _start(self, tag, attrib_in):
-        elem = TreeBuilder._start(self, tag, attrib_in)
-        self.start(elem)
-
-    def _start_list(self, tag, attrib_in):
-        elem = TreeBuilder._start_list(self, tag, attrib_in)
-        self.start(elem)
-
-    def _end(self, tag):
-        elem = TreeBuilder._end(self, tag)
-        self.end(elem)
-
-    def _start_ns(self, prefix, value):
-        self.namespaces.insert(0, (prefix, value))
-
-    def _end_ns(self, prefix):
-        assert self.namespaces.pop(0)[0] == prefix, "implementation confused"
-
-    ##
-    # Hook method that's called when a new element has been opened.
-    # May access the <b>namespaces</b> attribute.
-    #
-    # @param element The new element.  The tag name and attributes are,
-    #     set, but it has no children, and the text and tail attributes
-    #     are still empty.
-
-    def start(self, element):
-        pass
-
-    ##
-    # Hook method that's called when a new element has been closed.
-    # May access the <b>namespaces</b> attribute.
-    #
-    # @param element The new element.
-
-    def end(self, element):
-        pass
+#
+# ElementTree
+# $Id: XMLTreeBuilder.py 2305 2005-03-01 17:43:09Z fredrik $
+#
+# an XML tree builder
+#
+# history:
+# 2001-10-20 fl   created
+# 2002-05-01 fl   added namespace support for xmllib
+# 2002-07-27 fl   require expat (1.5.2 code can use SimpleXMLTreeBuilder)
+# 2002-08-17 fl   use tag/attribute name memo cache
+# 2002-12-04 fl   moved XMLTreeBuilder to the ElementTree module
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh.  All rights reserved.
+#
+# fredrik at pythonware.com
+# http://www.pythonware.com
+#
+# --------------------------------------------------------------------
+# The ElementTree toolkit is
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------
+
+##
+# Tools to build element trees from XML files.
+##
+
+import ElementTree
+
+##
+# (obsolete) ElementTree builder for XML source data, based on the
+# <b>expat</b> parser.
+# <p>
+# This class is an alias for ElementTree.XMLTreeBuilder.  New code
+# should use that version instead.
+#
+# @see elementtree.ElementTree
+
+class TreeBuilder(ElementTree.XMLTreeBuilder):
+    pass
+
+##
+# (experimental) An alternate builder that supports manipulation of
+# new elements.
+
+class FancyTreeBuilder(TreeBuilder):
+
+    def __init__(self, html=0):
+        TreeBuilder.__init__(self, html)
+        self._parser.StartNamespaceDeclHandler = self._start_ns
+        self._parser.EndNamespaceDeclHandler = self._end_ns
+        self.namespaces = []
+
+    def _start(self, tag, attrib_in):
+        elem = TreeBuilder._start(self, tag, attrib_in)
+        self.start(elem)
+
+    def _start_list(self, tag, attrib_in):
+        elem = TreeBuilder._start_list(self, tag, attrib_in)
+        self.start(elem)
+
+    def _end(self, tag):
+        elem = TreeBuilder._end(self, tag)
+        self.end(elem)
+
+    def _start_ns(self, prefix, value):
+        self.namespaces.insert(0, (prefix, value))
+
+    def _end_ns(self, prefix):
+        assert self.namespaces.pop(0)[0] == prefix, "implementation confused"
+
+    ##
+    # Hook method that's called when a new element has been opened.
+    # May access the <b>namespaces</b> attribute.
+    #
+    # @param element The new element.  The tag name and attributes are,
+    #     set, but it has no children, and the text and tail attributes
+    #     are still empty.
+
+    def start(self, element):
+        pass
+
+    ##
+    # Hook method that's called when a new element has been closed.
+    # May access the <b>namespaces</b> attribute.
+    #
+    # @param element The new element.
+
+    def end(self, element):
+        pass

Modified: external/elementtree-1.2.6-20050316/elementtree/__init__.py
==============================================================================
--- external/elementtree-1.2.6-20050316/elementtree/__init__.py	(original)
+++ external/elementtree-1.2.6-20050316/elementtree/__init__.py	Wed Dec 14 19:33:39 2005
@@ -1,30 +1,30 @@
-# $Id: __init__.py 1821 2004-06-03 16:57:49Z fredrik $
-# elementtree package
-
-# --------------------------------------------------------------------
-# The ElementTree toolkit is
-#
-# Copyright (c) 1999-2004 by Fredrik Lundh
-#
-# By obtaining, using, and/or copying this software and/or its
-# associated documentation, you agree that you have read, understood,
-# and will comply with the following terms and conditions:
-#
-# Permission to use, copy, modify, and distribute this software and
-# its associated documentation for any purpose and without fee is
-# hereby granted, provided that the above copyright notice appears in
-# all copies, and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of
-# Secret Labs AB or the author not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
-# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-# --------------------------------------------------------------------
+# $Id: __init__.py 1821 2004-06-03 16:57:49Z fredrik $
+# elementtree package
+
+# --------------------------------------------------------------------
+# The ElementTree toolkit is
+#
+# Copyright (c) 1999-2004 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------

Modified: external/elementtree-1.2.6-20050316/samples/simple-ns.xml
==============================================================================
--- external/elementtree-1.2.6-20050316/samples/simple-ns.xml	(original)
+++ external/elementtree-1.2.6-20050316/samples/simple-ns.xml	Wed Dec 14 19:33:39 2005
@@ -1,5 +1,5 @@
-<root xmlns='namespace'>
-   <element key='value'>text</element>
-   <element>text</element>tail
-   <empty-element/>
-</root>
+<root xmlns='namespace'>
+   <element key='value'>text</element>
+   <element>text</element>tail
+   <empty-element/>
+</root>

Modified: external/elementtree-1.2.6-20050316/samples/simple.xml
==============================================================================
--- external/elementtree-1.2.6-20050316/samples/simple.xml	(original)
+++ external/elementtree-1.2.6-20050316/samples/simple.xml	Wed Dec 14 19:33:39 2005
@@ -1,5 +1,5 @@
-<root>
-   <element key='value'>text</element>
-   <element>text</element>tail
-   <empty-element/>
-</root>
+<root>
+   <element key='value'>text</element>
+   <element>text</element>tail
+   <empty-element/>
+</root>

Modified: external/elementtree-1.2.6-20050316/selftest.py
==============================================================================
--- external/elementtree-1.2.6-20050316/selftest.py	(original)
+++ external/elementtree-1.2.6-20050316/selftest.py	Wed Dec 14 19:33:39 2005
@@ -1,1005 +1,1005 @@
-# $Id: selftest.py 2326 2005-03-17 07:45:21Z fredrik $
-# -*- coding: iso-8859-1 -*-
-# elementtree selftest program
-
-# this test script uses Python's "doctest" module to check that the
-# *test script* works as expected.
-
-# TODO: add more elementtree method tests
-# TODO: add xml/html parsing tests
-# TODO: etc
-
-import sys, string, StringIO
-
-from elementtree import ElementTree
-from elementtree import ElementPath
-from elementtree import ElementInclude
-from elementtree import HTMLTreeBuilder
-from elementtree import SimpleXMLWriter
-
-def serialize(elem, encoding=None):
-    import StringIO
-    file = StringIO.StringIO()
-    tree = ElementTree.ElementTree(elem)
-    if encoding:
-        tree.write(file, encoding)
-    else:
-        tree.write(file)
-    return file.getvalue()
-
-def summarize(elem):
-    return elem.tag
-
-def summarize_list(seq):
-    return map(summarize, seq)
-
-def normalize_crlf(tree):
-    for elem in tree.getiterator():
-        if elem.text: elem.text = string.replace(elem.text, "\r\n", "\n")
-        if elem.tail: elem.tail = string.replace(elem.tail, "\r\n", "\n")
-
-SAMPLE_XML = ElementTree.XML("""
-<body>
-  <tag>text</tag>
-  <tag />
-  <section>
-    <tag>subtext</tag>
-  </section>
-</body>
-""")
-
-#
-# interface tests
-
-def check_string(string):
-    len(string)
-    for char in string:
-        if len(char) != 1:
-            print "expected one-character string, got %r" % char
-    new_string = string + ""
-    new_string = string + " "
-    string[:0]
-
-def check_string_or_none(value):
-    if value is None:
-        return
-    return check_string(value)
-
-def check_mapping(mapping):
-    len(mapping)
-    keys = mapping.keys()
-    items = mapping.items()
-    for key in keys:
-        item = mapping[key]
-    mapping["key"] = "value"
-    if mapping["key"] != "value":
-        print "expected value string, got %r" % mapping["key"]
-
-def check_element(element):
-    if not hasattr(element, "tag"):
-        print "no tag member"
-    if not hasattr(element, "attrib"):
-        print "no attrib member"
-    if not hasattr(element, "text"):
-        print "no text member"
-    if not hasattr(element, "tail"):
-        print "no tail member"
-    check_string(element.tag)
-    check_mapping(element.attrib)
-    check_string_or_none(element.text)
-    check_string_or_none(element.tail)
-    for elem in element:
-        check_element(elem)
-
-def check_element_tree(tree):
-    check_element(tree.getroot())
-
-# --------------------------------------------------------------------
-# element tree tests
-
-def sanity():
-    """
-    >>> from elementtree.ElementTree import *
-    >>> from elementtree.ElementInclude import *
-    >>> from elementtree.ElementPath import *
-    >>> from elementtree.HTMLTreeBuilder import *
-    >>> from elementtree.SimpleXMLTreeBuilder import *
-    >>> from elementtree.SimpleXMLWriter import *
-    >>> from elementtree.TidyTools import *
-    >>> from elementtree.XMLTreeBuilder import *
-    """
-
-def version():
-    """
-    >>> ElementTree.VERSION
-    '1.2.6'
-    """
-
-def interface():
-    """
-    Test element tree interface.
-
-    >>> element = ElementTree.Element("tag")
-    >>> check_element(element)
-    >>> tree = ElementTree.ElementTree(element)
-    >>> check_element_tree(tree)
-    """
-
-def simplefind():
-    """
-    Test find methods using the elementpath fallback.
-
-    >>> CurrentElementPath = ElementTree.ElementPath
-    >>> ElementTree.ElementPath = ElementTree._SimpleElementPath()
-    >>> elem = SAMPLE_XML
-    >>> elem.find("tag").tag
-    'tag'
-    >>> ElementTree.ElementTree(elem).find("tag").tag
-    'tag'
-    >>> elem.findtext("tag")
-    'text'
-    >>> elem.findtext("tog")
-    >>> elem.findtext("tog", "default")
-    'default'
-    >>> ElementTree.ElementTree(elem).findtext("tag")
-    'text'
-    >>> summarize_list(elem.findall("tag"))
-    ['tag', 'tag']
-    >>> summarize_list(elem.findall(".//tag"))
-    ['tag', 'tag', 'tag']
-
-    Path syntax doesn't work in this case.
-
-    >>> elem.find("section/tag")
-    >>> elem.findtext("section/tag")
-    >>> elem.findall("section/tag")
-    []
-
-    >>> ElementTree.ElementPath = CurrentElementPath
-    """
-
-def find():
-    """
-    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(ElementTree.ElementTree(elem).findall("/tag"))
-    ['tag', 'tag']
-    >>> summarize_list(ElementTree.ElementTree(elem).findall("./tag"))
-    ['tag', 'tag']
-    """
-
-def bad_find():
-    """
-    Check bad or unsupported path expressions.
-
-    >>> elem = SAMPLE_XML
-    >>> elem.findall("/tag")
-    Traceback (most recent call last):
-    SyntaxError: cannot use absolute path on element
-    >>> elem.findall("../tag")
-    Traceback (most recent call last):
-    SyntaxError: unsupported path syntax (..)
-    >>> elem.findall("section//")
-    Traceback (most recent call last):
-    SyntaxError: path cannot end with //
-    >>> elem.findall("tag[tag]")
-    Traceback (most recent call last):
-    SyntaxError: expected path separator ([)
-    """
-
-def parsefile():
-    """
-    Test parsing from file.
-
-    >>> tree = ElementTree.parse("samples/simple.xml")
-    >>> normalize_crlf(tree)
-    >>> tree.write(sys.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(sys.stdout)
-    <ns0:root xmlns:ns0="namespace">
-       <ns0:element key="value">text</ns0:element>
-       <ns0:element>text</ns0:element>tail
-       <ns0:empty-element />
-    </ns0:root>
-    """
-
-def parsehtml():
-    """
-    Test HTML parsing.
-
-    >>> p = HTMLTreeBuilder.TreeBuilder()
-    >>> p.feed("<p><p>spam<b>egg</b></p>")
-    >>> serialize(p.close())
-    '<p>spam<b>egg</b></p>'
-    """
-
-def parseliteral():
-    r"""
-    >>> element = ElementTree.XML("<html><body>text</body></html>")
-    >>> ElementTree.ElementTree(element).write(sys.stdout)
-    <html><body>text</body></html>
-    >>> element = ElementTree.fromstring("<html><body>text</body></html>")
-    >>> ElementTree.ElementTree(element).write(sys.stdout)
-    <html><body>text</body></html>
-    >>> print ElementTree.tostring(element)
-    <html><body>text</body></html>
-    >>> 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'
-    """
-
-def simpleparsefile():
-    """
-    Test the xmllib-based parser.
-
-    >>> from elementtree import SimpleXMLTreeBuilder
-    >>> parser = SimpleXMLTreeBuilder.TreeBuilder()
-    >>> tree = ElementTree.parse("samples/simple.xml", parser)
-    >>> normalize_crlf(tree)
-    >>> tree.write(sys.stdout)
-    <root>
-       <element key="value">text</element>
-       <element>text</element>tail
-       <empty-element />
-    </root>
-    """
-
-def iterparse():
-    """
-    Test iterparse interface.
-
-    >>> iterparse = ElementTree.iterparse
-
-    >>> context = iterparse("samples/simple.xml")
-    >>> for action, elem in context:
-    ...   print action, elem.tag
-    end element
-    end element
-    end empty-element
-    end root
-    >>> context.root.tag
-    'root'
-
-    >>> context = iterparse("samples/simple-ns.xml")
-    >>> for action, elem in context:
-    ...   print action, elem.tag
-    end {namespace}element
-    end {namespace}element
-    end {namespace}empty-element
-    end {namespace}root
-
-    >>> events = ()
-    >>> context = iterparse("samples/simple.xml", events)
-    >>> for action, elem in context:
-    ...   print action, elem.tag
-
-    >>> events = ()
-    >>> context = iterparse("samples/simple.xml", events=events)
-    >>> for action, elem in context:
-    ...   print action, elem.tag
-
-    >>> events = ("start", "end")
-    >>> context = iterparse("samples/simple.xml", events)
-    >>> for action, elem in context:
-    ...   print action, elem.tag
-    start root
-    start element
-    end element
-    start element
-    end element
-    start empty-element
-    end empty-element
-    end root
-
-    >>> events = ("start", "end", "start-ns", "end-ns")
-    >>> context = iterparse("samples/simple-ns.xml", events)
-    >>> for action, elem in context:
-    ...   if action in ("start", "end"):
-    ...     print action, elem.tag
-    ...   else:
-    ...     print action, elem
-    start-ns ('', 'namespace')
-    start {namespace}root
-    start {namespace}element
-    end {namespace}element
-    start {namespace}element
-    end {namespace}element
-    start {namespace}empty-element
-    end {namespace}empty-element
-    end {namespace}root
-    end-ns None
-
-    """
-
-def fancyparsefile():
-    """
-    Test the "fancy" parser.
-
-    Sanity check.
-    >>> from elementtree import XMLTreeBuilder
-    >>> parser = XMLTreeBuilder.FancyTreeBuilder()
-    >>> tree = ElementTree.parse("samples/simple.xml", parser)
-    >>> normalize_crlf(tree)
-    >>> tree.write(sys.stdout)
-    <root>
-       <element key="value">text</element>
-       <element>text</element>tail
-       <empty-element />
-    </root>
-
-    Callback check.
-    >>> class MyFancyParser(XMLTreeBuilder.FancyTreeBuilder):
-    ...     def start(self, elem):
-    ...         print "START", elem.tag
-    ...     def end(self, elem):
-    ...         print "END", elem.tag
-    >>> parser = MyFancyParser()
-    >>> tree = ElementTree.parse("samples/simple.xml", parser)
-    START root
-    START element
-    END element
-    START element
-    END element
-    START empty-element
-    END empty-element
-    END root
-    """
-
-def writefile():
-    """
-    >>> elem = ElementTree.Element("tag")
-    >>> elem.text = "text"
-    >>> serialize(elem)
-    '<tag>text</tag>'
-    >>> ElementTree.SubElement(elem, "subtag").text = "subtext"
-    >>> serialize(elem)
-    '<tag>text<subtag>subtext</subtag></tag>'
-    """
-
-def writestring():
-    """
-    >>> elem = ElementTree.XML("<html><body>text</body></html>")
-    >>> ElementTree.tostring(elem)
-    '<html><body>text</body></html>'
-    >>> elem = ElementTree.fromstring("<html><body>text</body></html>")
-    >>> ElementTree.tostring(elem)
-    '<html><body>text</body></html>'
-    """
-
-def encoding():
-    r"""
-    Test encoding issues.
-
-    >>> elem = ElementTree.Element("tag")
-    >>> elem.text = u"abc"
-    >>> serialize(elem)
-    '<tag>abc</tag>'
-    >>> serialize(elem, "utf-8")
-    '<tag>abc</tag>'
-    >>> serialize(elem, "us-ascii")
-    '<tag>abc</tag>'
-    >>> serialize(elem, "iso-8859-1")
-    "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>abc</tag>"
-
-    >>> elem.text = "<&\"\'>"
-    >>> serialize(elem)
-    '<tag>&lt;&amp;"\'&gt;</tag>'
-    >>> serialize(elem, "utf-8")
-    '<tag>&lt;&amp;"\'&gt;</tag>'
-    >>> serialize(elem, "us-ascii") # cdata characters
-    '<tag>&lt;&amp;"\'&gt;</tag>'
-    >>> serialize(elem, "iso-8859-1")
-    '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag>&lt;&amp;"\'&gt;</tag>'
-
-    >>> elem.attrib["key"] = "<&\"\'>"
-    >>> elem.text = None
-    >>> serialize(elem)
-    '<tag key="&lt;&amp;&quot;&apos;&gt;" />'
-    >>> serialize(elem, "utf-8")
-    '<tag key="&lt;&amp;&quot;&apos;&gt;" />'
-    >>> serialize(elem, "us-ascii")
-    '<tag key="&lt;&amp;&quot;&apos;&gt;" />'
-    >>> serialize(elem, "iso-8859-1")
-    '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="&lt;&amp;&quot;&apos;&gt;" />'
-
-    >>> elem.text = u'\xe5\xf6\xf6<>'
-    >>> elem.attrib.clear()
-    >>> serialize(elem)
-    '<tag>&#229;&#246;&#246;&lt;&gt;</tag>'
-    >>> serialize(elem, "utf-8")
-    '<tag>\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;</tag>'
-    >>> serialize(elem, "us-ascii")
-    '<tag>&#229;&#246;&#246;&lt;&gt;</tag>'
-    >>> serialize(elem, "iso-8859-1")
-    "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>\xe5\xf6\xf6&lt;&gt;</tag>"
-
-    >>> elem.attrib["key"] = u'\xe5\xf6\xf6<>'
-    >>> elem.text = None
-    >>> serialize(elem)
-    '<tag key="&#229;&#246;&#246;&lt;&gt;" />'
-    >>> serialize(elem, "utf-8")
-    '<tag key="\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;" />'
-    >>> serialize(elem, "us-ascii")
-    '<tag key="&#229;&#246;&#246;&lt;&gt;" />'
-    >>> serialize(elem, "iso-8859-1")
-    '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="\xe5\xf6\xf6&lt;&gt;" />'
-
-    """
-
-ENTITY_XML = """\
-<!DOCTYPE points [
-<!ENTITY % user-entities SYSTEM 'user-entities.xml'>
-%user-entities;
-]>
-<document>&entity;</document>
-"""
-
-def entity():
-    """
-    Test entity handling.
-
-    1) bad entities
-
-    >>> ElementTree.XML("<document>&entity;</document>")
-    Traceback (most recent call last):
-    ExpatError: undefined entity: line 1, column 10
-
-    >>> ElementTree.XML(ENTITY_XML)
-    Traceback (most recent call last):
-    ExpatError: undefined entity &entity;: line 5, column 10
-
-    (add more tests here)
-
-    """
-
-def namespace():
-    """
-    Test namespace issues.
-
-    1) xml namespace
-
-    >>> elem = ElementTree.XML("<tag xml:lang='en' />")
-    >>> serialize(elem) # 1.1
-    '<tag xml:lang="en" />'
-
-    2) other "well-known" namespaces
-
-    >>> 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
-    '<ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope" />'
-
-    3) unknown namespaces
-
-    """
-
-def qname():
-    """
-    Test QName handling.
-
-    1) decorated tags
-
-    >>> 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" />'
-
-    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>'
-
-    """
-
-def xpath_tokenizer(p):
-    """
-    Test the XPath tokenizer.
-
-    >>> # tests from the xml specification
-    >>> xpath_tokenizer("*")
-    ['*']
-    >>> xpath_tokenizer("text()")
-    ['text', '()']
-    >>> xpath_tokenizer("@name")
-    ['@', 'name']
-    >>> xpath_tokenizer("@*")
-    ['@', '*']
-    >>> xpath_tokenizer("para[1]")
-    ['para', '[', '1', ']']
-    >>> xpath_tokenizer("para[last()]")
-    ['para', '[', 'last', '()', ']']
-    >>> xpath_tokenizer("*/para")
-    ['*', '/', 'para']
-    >>> xpath_tokenizer("/doc/chapter[5]/section[2]")
-    ['/', 'doc', '/', 'chapter', '[', '5', ']', '/', 'section', '[', '2', ']']
-    >>> xpath_tokenizer("chapter//para")
-    ['chapter', '/', '/', 'para']
-    >>> xpath_tokenizer("//para")
-    ['/', '/', 'para']
-    >>> xpath_tokenizer("//olist/item")
-    ['/', '/', 'olist', '/', 'item']
-    >>> xpath_tokenizer(".")
-    ['.']
-    >>> xpath_tokenizer(".//para")
-    ['.', '/', '/', 'para']
-    >>> xpath_tokenizer("..")
-    ['..']
-    >>> xpath_tokenizer("../@lang")
-    ['..', '/', '@', 'lang']
-    >>> xpath_tokenizer("chapter[title]")
-    ['chapter', '[', 'title', ']']
-    >>> xpath_tokenizer("employee[@secretary and @assistant]")
-    ['employee', '[', '@', 'secretary', '', 'and', '', '@', 'assistant', ']']
-
-    >>> # additional tests
-    >>> xpath_tokenizer("{http://spam}egg")
-    ['{http://spam}egg']
-    >>> xpath_tokenizer("./spam.egg")
-    ['.', '/', 'spam.egg']
-    >>> xpath_tokenizer(".//{http://spam}egg")
-    ['.', '/', '/', '{http://spam}egg']
-    """
-    out = []
-    for op, tag in ElementPath.xpath_tokenizer(p):
-        out.append(op or tag)
-    return out
-
-#
-# xinclude tests (samples from appendix C of the xinclude specification)
-
-XINCLUDE = {}
-
-XINCLUDE["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>
-"""
-
-XINCLUDE["disclaimer.xml"] = """\
-<?xml version='1.0'?>
-<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>
-"""
-
-XINCLUDE["C2.xml"] = """\
-<?xml version='1.0'?>
-<document xmlns:xi="http://www.w3.org/2001/XInclude">
-  <p>This document has been accessed
-  <xi:include href="count.txt" parse="text"/> times.</p>
-</document>
-"""
-
-XINCLUDE["count.txt"] = "324387"
-
-XINCLUDE["C3.xml"] = """\
-<?xml version='1.0'?>
-<document xmlns:xi="http://www.w3.org/2001/XInclude">
-  <p>The following is the source of the "data.xml" resource:</p>
-  <example><xi:include href="data.xml" parse="text"/></example>
-</document>
-"""
-
-XINCLUDE["data.xml"] = """\
-<?xml version='1.0'?>
-<data>
-  <item><![CDATA[Brooks & Shields]]></item>
-</data>
-"""
-
-XINCLUDE["C5.xml"] = """\
-<?xml version='1.0'?>
-<div xmlns:xi="http://www.w3.org/2001/XInclude">
-  <xi:include href="example.txt" parse="text">
-    <xi:fallback>
-      <xi:include href="fallback-example.txt" parse="text">
-        <xi:fallback><a href="mailto:bob at example.org">Report error</a></xi:fallback>
-      </xi:include>
-    </xi:fallback>
-  </xi:include>
-</div>
-"""
-
-XINCLUDE["default.xml"] = """\
-<?xml version='1.0'?>
-<document xmlns:xi="http://www.w3.org/2001/XInclude">
-  <p>Example.</p>
-  <xi:include href="samples/simple.xml"/>
-</document>
-"""
-
-def xinclude_loader(href, parse="xml", encoding=None):
-    try:
-        data = XINCLUDE[href]
-    except KeyError:
-        raise IOError("resource not found")
-    if parse == "xml":
-        return ElementTree.XML(data)
-    return data
-
-def xinclude():
-    r"""
-    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
-
-    """
-
-def xinclude_default():
-    """
-    >>> document = xinclude_loader("default.xml")
-    >>> ElementInclude.include(document)
-    >>> print serialize(document) # default
-    <document>
-      <p>Example.</p>
-      <root>
-       <element key="value">text</element>
-       <element>text</element>tail
-       <empty-element />
-    </root>
-    </document>
-    """
-
-#
-# xmlwriter
-
-def xmlwriter():
-    r"""
-    >>> file = StringIO.StringIO()
-    >>> w = SimpleXMLWriter.XMLWriter(file)
-    >>> html = w.start("html")
-    >>> x = w.start("head")
-    >>> w.element("title", "my document")
-    >>> w.data("\n")
-    >>> w.element("meta", name="hello", value="goodbye")
-    >>> w.data("\n")
-    >>> w.end()
-    >>> x = w.start("body")
-    >>> w.element("h1", "this is a heading")
-    >>> w.data("\n")
-    >>> w.element("p", u"this is a paragraph")
-    >>> w.data("\n")
-    >>> w.element("p", u"reserved characters: <&>")
-    >>> w.data("\n")
-    >>> w.element("p", u"detta är också ett stycke")
-    >>> w.data("\n")
-    >>> w.close(html)
-    >>> print file.getvalue()
-    <html><head><title>my document</title>
-    <meta name="hello" value="goodbye" />
-    </head><body><h1>this is a heading</h1>
-    <p>this is a paragraph</p>
-    <p>reserved characters: &lt;&amp;&gt;</p>
-    <p>detta &#228;r ocks&#229; ett stycke</p>
-    </body></html>
-    """
-
-# --------------------------------------------------------------------
-# reported bugs
-
-def bug_xmltoolkit21():
-    """
-    marshaller gives obscure errors for non-string values
-
-    >>> elem = ElementTree.Element(123)
-    >>> serialize(elem) # tag
-    Traceback (most recent call last):
-    TypeError: cannot serialize 123 (type int)
-    >>> elem = ElementTree.Element("elem")
-    >>> elem.text = 123
-    >>> serialize(elem) # text
-    Traceback (most recent call last):
-    TypeError: cannot serialize 123 (type int)
-    >>> elem = ElementTree.Element("elem")
-    >>> elem.tail = 123
-    >>> serialize(elem) # tail
-    Traceback (most recent call last):
-    TypeError: cannot serialize 123 (type int)
-    >>> elem = ElementTree.Element("elem")
-    >>> elem.set(123, "123")
-    >>> serialize(elem) # attribute key
-    Traceback (most recent call last):
-    TypeError: cannot serialize 123 (type int)
-    >>> elem = ElementTree.Element("elem")
-    >>> elem.set("123", 123)
-    >>> serialize(elem) # attribute value
-    Traceback (most recent call last):
-    TypeError: cannot serialize 123 (type int)
-
-    """
-
-def bug_xmltoolkit25():
-    """
-    typo in ElementTree.findtext
-
-    >>> tree = ElementTree.ElementTree(SAMPLE_XML)
-    >>> tree.findtext("tag")
-    'text'
-    >>> tree.findtext("section/tag")
-    'subtext'
-    """
-
-def bug_xmltoolkit28():
-    """
-    .//tag causes exceptions
-
-    >>> tree = ElementTree.XML("<doc><table><tbody/></table></doc>")
-    >>> summarize_list(tree.findall(".//thead"))
-    []
-    >>> summarize_list(tree.findall(".//tbody"))
-    ['tbody']
-    """
-
-def bug_xmltoolkitX1():
-    """
-    dump() doesn't flush the output buffer
-
-    >>> tree = ElementTree.XML("<doc><table><tbody/></table></doc>")
-    >>> ElementTree.dump(tree); sys.stdout.write("tail")
-    <doc><table><tbody /></table></doc>
-    tail
-    """
-
-def bug_xmltoolkit39():
-    """
-    non-ascii element and attribute names doesn't work
-
-    >>> tree = ElementTree.XML("<?xml version='1.0' encoding='iso-8859-1'?><täg />")
-    >>> ElementTree.tostring(tree, "utf-8")
-    '<t\\xc3\\xa4g />'
-
-    >>> tree = ElementTree.XML("<?xml version='1.0' encoding='iso-8859-1'?><tag ättr='v&#228;lue' />")
-    >>> tree.attrib
-    {u'\\xe4ttr': u'v\\xe4lue'}
-    >>> ElementTree.tostring(tree, "utf-8")
-    '<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />'
-
-    >>> tree = ElementTree.XML("<?xml version='1.0' encoding='iso-8859-1'?><täg>text</täg>")
-    >>> ElementTree.tostring(tree, "utf-8")
-    '<t\\xc3\\xa4g>text</t\\xc3\\xa4g>'
-
-    >>> tree = ElementTree.Element(u"täg")
-    >>> ElementTree.tostring(tree, "utf-8")
-    '<t\\xc3\\xa4g />'
-
-    >>> tree = ElementTree.Element("tag")
-    >>> tree.set(u"ättr", u"välue")
-    >>> ElementTree.tostring(tree, "utf-8")
-    '<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />'
-
-    """
-
-def bug_xmltoolkit45():
-    """
-    problems parsing mixed unicode/non-ascii html documents
-
-    latin-1 text
-    >>> p = HTMLTreeBuilder.TreeBuilder()
-    >>> p.feed("<p>välue</p>")
-    >>> serialize(p.close())
-    '<p>v&#228;lue</p>'
-
-    utf-8 text
-    >>> p = HTMLTreeBuilder.TreeBuilder(encoding="utf-8")
-    >>> p.feed("<p>v\xc3\xa4lue</p>")
-    >>> serialize(p.close())
-    '<p>v&#228;lue</p>'
-
-    utf-8 text using meta tag
-    >>> p = HTMLTreeBuilder.TreeBuilder()
-    >>> p.feed("<html><meta http-equiv='Content-Type' content='text/html; charset=utf-8'><p>v\xc3\xa4lue</p></html>")
-    >>> serialize(p.close().find("p"))
-    '<p>v&#228;lue</p>'
-
-    latin-1 character references
-    >>> p = HTMLTreeBuilder.TreeBuilder()
-    >>> p.feed("<p>v&#228;lue</p>")
-    >>> serialize(p.close())
-    '<p>v&#228;lue</p>'
-
-    latin-1 character entities
-    >>> p = HTMLTreeBuilder.TreeBuilder()
-    >>> p.feed("<p>v&auml;lue</p>")
-    >>> serialize(p.close())
-    '<p>v&#228;lue</p>'
-
-    mixed latin-1 text and unicode entities
-    >>> p = HTMLTreeBuilder.TreeBuilder()
-    >>> p.feed("<p>&#8221;välue&#8221;</p>")
-    >>> serialize(p.close())
-    '<p>&#8221;v&#228;lue&#8221;</p>'
-
-    mixed unicode and latin-1 entities
-    >>> p = HTMLTreeBuilder.TreeBuilder()
-    >>> p.feed("<p>&#8221;v&auml;lue&#8221;</p>")
-    >>> serialize(p.close())
-    '<p>&#8221;v&#228;lue&#8221;</p>'
-
-    """
-
-def bug_xmltoolkit46():
-    """
-    problems parsing open BR tags
-
-    >>> p = HTMLTreeBuilder.TreeBuilder()
-    >>> p.feed("<p>key<br>value</p>")
-    >>> serialize(p.close())
-    '<p>key<br />value</p>'
-
-    """
-
-def bug_xmltoolkit54():
-    """
-    problems handling internally defined entities
-
-    >>> e = ElementTree.XML("<!DOCTYPE doc [<!ENTITY ldots '&#x8230;'>]><doc>&ldots;</doc>")
-    >>> serialize(e)
-    '<doc>&#33328;</doc>'
-    """
-
-def bug_xmltoolkit55():
-    """
-    make sure we're reporting the first error, not the last
-
-    >>> e = ElementTree.XML("<!DOCTYPE doc SYSTEM 'doc.dtd'><doc>&ldots;&ndots;&rdots;</doc>")
-    Traceback (most recent call last):
-    ExpatError: undefined entity &ldots;: line 1, column 36
-    """
-
-# --------------------------------------------------------------------
-
-if __name__ == "__main__":
-    import doctest, selftest
-    failed, tested = doctest.testmod(selftest)
-    print tested - failed, "tests ok."
+# $Id: selftest.py 2326 2005-03-17 07:45:21Z fredrik $
+# -*- coding: iso-8859-1 -*-
+# elementtree selftest program
+
+# this test script uses Python's "doctest" module to check that the
+# *test script* works as expected.
+
+# TODO: add more elementtree method tests
+# TODO: add xml/html parsing tests
+# TODO: etc
+
+import sys, string, StringIO
+
+from elementtree import ElementTree
+from elementtree import ElementPath
+from elementtree import ElementInclude
+from elementtree import HTMLTreeBuilder
+from elementtree import SimpleXMLWriter
+
+def serialize(elem, encoding=None):
+    import StringIO
+    file = StringIO.StringIO()
+    tree = ElementTree.ElementTree(elem)
+    if encoding:
+        tree.write(file, encoding)
+    else:
+        tree.write(file)
+    return file.getvalue()
+
+def summarize(elem):
+    return elem.tag
+
+def summarize_list(seq):
+    return map(summarize, seq)
+
+def normalize_crlf(tree):
+    for elem in tree.getiterator():
+        if elem.text: elem.text = string.replace(elem.text, "\r\n", "\n")
+        if elem.tail: elem.tail = string.replace(elem.tail, "\r\n", "\n")
+
+SAMPLE_XML = ElementTree.XML("""
+<body>
+  <tag>text</tag>
+  <tag />
+  <section>
+    <tag>subtext</tag>
+  </section>
+</body>
+""")
+
+#
+# interface tests
+
+def check_string(string):
+    len(string)
+    for char in string:
+        if len(char) != 1:
+            print "expected one-character string, got %r" % char
+    new_string = string + ""
+    new_string = string + " "
+    string[:0]
+
+def check_string_or_none(value):
+    if value is None:
+        return
+    return check_string(value)
+
+def check_mapping(mapping):
+    len(mapping)
+    keys = mapping.keys()
+    items = mapping.items()
+    for key in keys:
+        item = mapping[key]
+    mapping["key"] = "value"
+    if mapping["key"] != "value":
+        print "expected value string, got %r" % mapping["key"]
+
+def check_element(element):
+    if not hasattr(element, "tag"):
+        print "no tag member"
+    if not hasattr(element, "attrib"):
+        print "no attrib member"
+    if not hasattr(element, "text"):
+        print "no text member"
+    if not hasattr(element, "tail"):
+        print "no tail member"
+    check_string(element.tag)
+    check_mapping(element.attrib)
+    check_string_or_none(element.text)
+    check_string_or_none(element.tail)
+    for elem in element:
+        check_element(elem)
+
+def check_element_tree(tree):
+    check_element(tree.getroot())
+
+# --------------------------------------------------------------------
+# element tree tests
+
+def sanity():
+    """
+    >>> from elementtree.ElementTree import *
+    >>> from elementtree.ElementInclude import *
+    >>> from elementtree.ElementPath import *
+    >>> from elementtree.HTMLTreeBuilder import *
+    >>> from elementtree.SimpleXMLTreeBuilder import *
+    >>> from elementtree.SimpleXMLWriter import *
+    >>> from elementtree.TidyTools import *
+    >>> from elementtree.XMLTreeBuilder import *
+    """
+
+def version():
+    """
+    >>> ElementTree.VERSION
+    '1.2.6'
+    """
+
+def interface():
+    """
+    Test element tree interface.
+
+    >>> element = ElementTree.Element("tag")
+    >>> check_element(element)
+    >>> tree = ElementTree.ElementTree(element)
+    >>> check_element_tree(tree)
+    """
+
+def simplefind():
+    """
+    Test find methods using the elementpath fallback.
+
+    >>> CurrentElementPath = ElementTree.ElementPath
+    >>> ElementTree.ElementPath = ElementTree._SimpleElementPath()
+    >>> elem = SAMPLE_XML
+    >>> elem.find("tag").tag
+    'tag'
+    >>> ElementTree.ElementTree(elem).find("tag").tag
+    'tag'
+    >>> elem.findtext("tag")
+    'text'
+    >>> elem.findtext("tog")
+    >>> elem.findtext("tog", "default")
+    'default'
+    >>> ElementTree.ElementTree(elem).findtext("tag")
+    'text'
+    >>> summarize_list(elem.findall("tag"))
+    ['tag', 'tag']
+    >>> summarize_list(elem.findall(".//tag"))
+    ['tag', 'tag', 'tag']
+
+    Path syntax doesn't work in this case.
+
+    >>> elem.find("section/tag")
+    >>> elem.findtext("section/tag")
+    >>> elem.findall("section/tag")
+    []
+
+    >>> ElementTree.ElementPath = CurrentElementPath
+    """
+
+def find():
+    """
+    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(ElementTree.ElementTree(elem).findall("/tag"))
+    ['tag', 'tag']
+    >>> summarize_list(ElementTree.ElementTree(elem).findall("./tag"))
+    ['tag', 'tag']
+    """
+
+def bad_find():
+    """
+    Check bad or unsupported path expressions.
+
+    >>> elem = SAMPLE_XML
+    >>> elem.findall("/tag")
+    Traceback (most recent call last):
+    SyntaxError: cannot use absolute path on element
+    >>> elem.findall("../tag")
+    Traceback (most recent call last):
+    SyntaxError: unsupported path syntax (..)
+    >>> elem.findall("section//")
+    Traceback (most recent call last):
+    SyntaxError: path cannot end with //
+    >>> elem.findall("tag[tag]")
+    Traceback (most recent call last):
+    SyntaxError: expected path separator ([)
+    """
+
+def parsefile():
+    """
+    Test parsing from file.
+
+    >>> tree = ElementTree.parse("samples/simple.xml")
+    >>> normalize_crlf(tree)
+    >>> tree.write(sys.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(sys.stdout)
+    <ns0:root xmlns:ns0="namespace">
+       <ns0:element key="value">text</ns0:element>
+       <ns0:element>text</ns0:element>tail
+       <ns0:empty-element />
+    </ns0:root>
+    """
+
+def parsehtml():
+    """
+    Test HTML parsing.
+
+    >>> p = HTMLTreeBuilder.TreeBuilder()
+    >>> p.feed("<p><p>spam<b>egg</b></p>")
+    >>> serialize(p.close())
+    '<p>spam<b>egg</b></p>'
+    """
+
+def parseliteral():
+    r"""
+    >>> element = ElementTree.XML("<html><body>text</body></html>")
+    >>> ElementTree.ElementTree(element).write(sys.stdout)
+    <html><body>text</body></html>
+    >>> element = ElementTree.fromstring("<html><body>text</body></html>")
+    >>> ElementTree.ElementTree(element).write(sys.stdout)
+    <html><body>text</body></html>
+    >>> print ElementTree.tostring(element)
+    <html><body>text</body></html>
+    >>> 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'
+    """
+
+def simpleparsefile():
+    """
+    Test the xmllib-based parser.
+
+    >>> from elementtree import SimpleXMLTreeBuilder
+    >>> parser = SimpleXMLTreeBuilder.TreeBuilder()
+    >>> tree = ElementTree.parse("samples/simple.xml", parser)
+    >>> normalize_crlf(tree)
+    >>> tree.write(sys.stdout)
+    <root>
+       <element key="value">text</element>
+       <element>text</element>tail
+       <empty-element />
+    </root>
+    """
+
+def iterparse():
+    """
+    Test iterparse interface.
+
+    >>> iterparse = ElementTree.iterparse
+
+    >>> context = iterparse("samples/simple.xml")
+    >>> for action, elem in context:
+    ...   print action, elem.tag
+    end element
+    end element
+    end empty-element
+    end root
+    >>> context.root.tag
+    'root'
+
+    >>> context = iterparse("samples/simple-ns.xml")
+    >>> for action, elem in context:
+    ...   print action, elem.tag
+    end {namespace}element
+    end {namespace}element
+    end {namespace}empty-element
+    end {namespace}root
+
+    >>> events = ()
+    >>> context = iterparse("samples/simple.xml", events)
+    >>> for action, elem in context:
+    ...   print action, elem.tag
+
+    >>> events = ()
+    >>> context = iterparse("samples/simple.xml", events=events)
+    >>> for action, elem in context:
+    ...   print action, elem.tag
+
+    >>> events = ("start", "end")
+    >>> context = iterparse("samples/simple.xml", events)
+    >>> for action, elem in context:
+    ...   print action, elem.tag
+    start root
+    start element
+    end element
+    start element
+    end element
+    start empty-element
+    end empty-element
+    end root
+
+    >>> events = ("start", "end", "start-ns", "end-ns")
+    >>> context = iterparse("samples/simple-ns.xml", events)
+    >>> for action, elem in context:
+    ...   if action in ("start", "end"):
+    ...     print action, elem.tag
+    ...   else:
+    ...     print action, elem
+    start-ns ('', 'namespace')
+    start {namespace}root
+    start {namespace}element
+    end {namespace}element
+    start {namespace}element
+    end {namespace}element
+    start {namespace}empty-element
+    end {namespace}empty-element
+    end {namespace}root
+    end-ns None
+
+    """
+
+def fancyparsefile():
+    """
+    Test the "fancy" parser.
+
+    Sanity check.
+    >>> from elementtree import XMLTreeBuilder
+    >>> parser = XMLTreeBuilder.FancyTreeBuilder()
+    >>> tree = ElementTree.parse("samples/simple.xml", parser)
+    >>> normalize_crlf(tree)
+    >>> tree.write(sys.stdout)
+    <root>
+       <element key="value">text</element>
+       <element>text</element>tail
+       <empty-element />
+    </root>
+
+    Callback check.
+    >>> class MyFancyParser(XMLTreeBuilder.FancyTreeBuilder):
+    ...     def start(self, elem):
+    ...         print "START", elem.tag
+    ...     def end(self, elem):
+    ...         print "END", elem.tag
+    >>> parser = MyFancyParser()
+    >>> tree = ElementTree.parse("samples/simple.xml", parser)
+    START root
+    START element
+    END element
+    START element
+    END element
+    START empty-element
+    END empty-element
+    END root
+    """
+
+def writefile():
+    """
+    >>> elem = ElementTree.Element("tag")
+    >>> elem.text = "text"
+    >>> serialize(elem)
+    '<tag>text</tag>'
+    >>> ElementTree.SubElement(elem, "subtag").text = "subtext"
+    >>> serialize(elem)
+    '<tag>text<subtag>subtext</subtag></tag>'
+    """
+
+def writestring():
+    """
+    >>> elem = ElementTree.XML("<html><body>text</body></html>")
+    >>> ElementTree.tostring(elem)
+    '<html><body>text</body></html>'
+    >>> elem = ElementTree.fromstring("<html><body>text</body></html>")
+    >>> ElementTree.tostring(elem)
+    '<html><body>text</body></html>'
+    """
+
+def encoding():
+    r"""
+    Test encoding issues.
+
+    >>> elem = ElementTree.Element("tag")
+    >>> elem.text = u"abc"
+    >>> serialize(elem)
+    '<tag>abc</tag>'
+    >>> serialize(elem, "utf-8")
+    '<tag>abc</tag>'
+    >>> serialize(elem, "us-ascii")
+    '<tag>abc</tag>'
+    >>> serialize(elem, "iso-8859-1")
+    "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>abc</tag>"
+
+    >>> elem.text = "<&\"\'>"
+    >>> serialize(elem)
+    '<tag>&lt;&amp;"\'&gt;</tag>'
+    >>> serialize(elem, "utf-8")
+    '<tag>&lt;&amp;"\'&gt;</tag>'
+    >>> serialize(elem, "us-ascii") # cdata characters
+    '<tag>&lt;&amp;"\'&gt;</tag>'
+    >>> serialize(elem, "iso-8859-1")
+    '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag>&lt;&amp;"\'&gt;</tag>'
+
+    >>> elem.attrib["key"] = "<&\"\'>"
+    >>> elem.text = None
+    >>> serialize(elem)
+    '<tag key="&lt;&amp;&quot;&apos;&gt;" />'
+    >>> serialize(elem, "utf-8")
+    '<tag key="&lt;&amp;&quot;&apos;&gt;" />'
+    >>> serialize(elem, "us-ascii")
+    '<tag key="&lt;&amp;&quot;&apos;&gt;" />'
+    >>> serialize(elem, "iso-8859-1")
+    '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="&lt;&amp;&quot;&apos;&gt;" />'
+
+    >>> elem.text = u'\xe5\xf6\xf6<>'
+    >>> elem.attrib.clear()
+    >>> serialize(elem)
+    '<tag>&#229;&#246;&#246;&lt;&gt;</tag>'
+    >>> serialize(elem, "utf-8")
+    '<tag>\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;</tag>'
+    >>> serialize(elem, "us-ascii")
+    '<tag>&#229;&#246;&#246;&lt;&gt;</tag>'
+    >>> serialize(elem, "iso-8859-1")
+    "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>\xe5\xf6\xf6&lt;&gt;</tag>"
+
+    >>> elem.attrib["key"] = u'\xe5\xf6\xf6<>'
+    >>> elem.text = None
+    >>> serialize(elem)
+    '<tag key="&#229;&#246;&#246;&lt;&gt;" />'
+    >>> serialize(elem, "utf-8")
+    '<tag key="\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;" />'
+    >>> serialize(elem, "us-ascii")
+    '<tag key="&#229;&#246;&#246;&lt;&gt;" />'
+    >>> serialize(elem, "iso-8859-1")
+    '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="\xe5\xf6\xf6&lt;&gt;" />'
+
+    """
+
+ENTITY_XML = """\
+<!DOCTYPE points [
+<!ENTITY % user-entities SYSTEM 'user-entities.xml'>
+%user-entities;
+]>
+<document>&entity;</document>
+"""
+
+def entity():
+    """
+    Test entity handling.
+
+    1) bad entities
+
+    >>> ElementTree.XML("<document>&entity;</document>")
+    Traceback (most recent call last):
+    ExpatError: undefined entity: line 1, column 10
+
+    >>> ElementTree.XML(ENTITY_XML)
+    Traceback (most recent call last):
+    ExpatError: undefined entity &entity;: line 5, column 10
+
+    (add more tests here)
+
+    """
+
+def namespace():
+    """
+    Test namespace issues.
+
+    1) xml namespace
+
+    >>> elem = ElementTree.XML("<tag xml:lang='en' />")
+    >>> serialize(elem) # 1.1
+    '<tag xml:lang="en" />'
+
+    2) other "well-known" namespaces
+
+    >>> 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
+    '<ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope" />'
+
+    3) unknown namespaces
+
+    """
+
+def qname():
+    """
+    Test QName handling.
+
+    1) decorated tags
+
+    >>> 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" />'
+
+    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>'
+
+    """
+
+def xpath_tokenizer(p):
+    """
+    Test the XPath tokenizer.
+
+    >>> # tests from the xml specification
+    >>> xpath_tokenizer("*")
+    ['*']
+    >>> xpath_tokenizer("text()")
+    ['text', '()']
+    >>> xpath_tokenizer("@name")
+    ['@', 'name']
+    >>> xpath_tokenizer("@*")
+    ['@', '*']
+    >>> xpath_tokenizer("para[1]")
+    ['para', '[', '1', ']']
+    >>> xpath_tokenizer("para[last()]")
+    ['para', '[', 'last', '()', ']']
+    >>> xpath_tokenizer("*/para")
+    ['*', '/', 'para']
+    >>> xpath_tokenizer("/doc/chapter[5]/section[2]")
+    ['/', 'doc', '/', 'chapter', '[', '5', ']', '/', 'section', '[', '2', ']']
+    >>> xpath_tokenizer("chapter//para")
+    ['chapter', '/', '/', 'para']
+    >>> xpath_tokenizer("//para")
+    ['/', '/', 'para']
+    >>> xpath_tokenizer("//olist/item")
+    ['/', '/', 'olist', '/', 'item']
+    >>> xpath_tokenizer(".")
+    ['.']
+    >>> xpath_tokenizer(".//para")
+    ['.', '/', '/', 'para']
+    >>> xpath_tokenizer("..")
+    ['..']
+    >>> xpath_tokenizer("../@lang")
+    ['..', '/', '@', 'lang']
+    >>> xpath_tokenizer("chapter[title]")
+    ['chapter', '[', 'title', ']']
+    >>> xpath_tokenizer("employee[@secretary and @assistant]")
+    ['employee', '[', '@', 'secretary', '', 'and', '', '@', 'assistant', ']']
+
+    >>> # additional tests
+    >>> xpath_tokenizer("{http://spam}egg")
+    ['{http://spam}egg']
+    >>> xpath_tokenizer("./spam.egg")
+    ['.', '/', 'spam.egg']
+    >>> xpath_tokenizer(".//{http://spam}egg")
+    ['.', '/', '/', '{http://spam}egg']
+    """
+    out = []
+    for op, tag in ElementPath.xpath_tokenizer(p):
+        out.append(op or tag)
+    return out
+
+#
+# xinclude tests (samples from appendix C of the xinclude specification)
+
+XINCLUDE = {}
+
+XINCLUDE["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>
+"""
+
+XINCLUDE["disclaimer.xml"] = """\
+<?xml version='1.0'?>
+<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>
+"""
+
+XINCLUDE["C2.xml"] = """\
+<?xml version='1.0'?>
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+  <p>This document has been accessed
+  <xi:include href="count.txt" parse="text"/> times.</p>
+</document>
+"""
+
+XINCLUDE["count.txt"] = "324387"
+
+XINCLUDE["C3.xml"] = """\
+<?xml version='1.0'?>
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+  <p>The following is the source of the "data.xml" resource:</p>
+  <example><xi:include href="data.xml" parse="text"/></example>
+</document>
+"""
+
+XINCLUDE["data.xml"] = """\
+<?xml version='1.0'?>
+<data>
+  <item><![CDATA[Brooks & Shields]]></item>
+</data>
+"""
+
+XINCLUDE["C5.xml"] = """\
+<?xml version='1.0'?>
+<div xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:include href="example.txt" parse="text">
+    <xi:fallback>
+      <xi:include href="fallback-example.txt" parse="text">
+        <xi:fallback><a href="mailto:bob at example.org">Report error</a></xi:fallback>
+      </xi:include>
+    </xi:fallback>
+  </xi:include>
+</div>
+"""
+
+XINCLUDE["default.xml"] = """\
+<?xml version='1.0'?>
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+  <p>Example.</p>
+  <xi:include href="samples/simple.xml"/>
+</document>
+"""
+
+def xinclude_loader(href, parse="xml", encoding=None):
+    try:
+        data = XINCLUDE[href]
+    except KeyError:
+        raise IOError("resource not found")
+    if parse == "xml":
+        return ElementTree.XML(data)
+    return data
+
+def xinclude():
+    r"""
+    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
+
+    """
+
+def xinclude_default():
+    """
+    >>> document = xinclude_loader("default.xml")
+    >>> ElementInclude.include(document)
+    >>> print serialize(document) # default
+    <document>
+      <p>Example.</p>
+      <root>
+       <element key="value">text</element>
+       <element>text</element>tail
+       <empty-element />
+    </root>
+    </document>
+    """
+
+#
+# xmlwriter
+
+def xmlwriter():
+    r"""
+    >>> file = StringIO.StringIO()
+    >>> w = SimpleXMLWriter.XMLWriter(file)
+    >>> html = w.start("html")
+    >>> x = w.start("head")
+    >>> w.element("title", "my document")
+    >>> w.data("\n")
+    >>> w.element("meta", name="hello", value="goodbye")
+    >>> w.data("\n")
+    >>> w.end()
+    >>> x = w.start("body")
+    >>> w.element("h1", "this is a heading")
+    >>> w.data("\n")
+    >>> w.element("p", u"this is a paragraph")
+    >>> w.data("\n")
+    >>> w.element("p", u"reserved characters: <&>")
+    >>> w.data("\n")
+    >>> w.element("p", u"detta är också ett stycke")
+    >>> w.data("\n")
+    >>> w.close(html)
+    >>> print file.getvalue()
+    <html><head><title>my document</title>
+    <meta name="hello" value="goodbye" />
+    </head><body><h1>this is a heading</h1>
+    <p>this is a paragraph</p>
+    <p>reserved characters: &lt;&amp;&gt;</p>
+    <p>detta &#228;r ocks&#229; ett stycke</p>
+    </body></html>
+    """
+
+# --------------------------------------------------------------------
+# reported bugs
+
+def bug_xmltoolkit21():
+    """
+    marshaller gives obscure errors for non-string values
+
+    >>> elem = ElementTree.Element(123)
+    >>> serialize(elem) # tag
+    Traceback (most recent call last):
+    TypeError: cannot serialize 123 (type int)
+    >>> elem = ElementTree.Element("elem")
+    >>> elem.text = 123
+    >>> serialize(elem) # text
+    Traceback (most recent call last):
+    TypeError: cannot serialize 123 (type int)
+    >>> elem = ElementTree.Element("elem")
+    >>> elem.tail = 123
+    >>> serialize(elem) # tail
+    Traceback (most recent call last):
+    TypeError: cannot serialize 123 (type int)
+    >>> elem = ElementTree.Element("elem")
+    >>> elem.set(123, "123")
+    >>> serialize(elem) # attribute key
+    Traceback (most recent call last):
+    TypeError: cannot serialize 123 (type int)
+    >>> elem = ElementTree.Element("elem")
+    >>> elem.set("123", 123)
+    >>> serialize(elem) # attribute value
+    Traceback (most recent call last):
+    TypeError: cannot serialize 123 (type int)
+
+    """
+
+def bug_xmltoolkit25():
+    """
+    typo in ElementTree.findtext
+
+    >>> tree = ElementTree.ElementTree(SAMPLE_XML)
+    >>> tree.findtext("tag")
+    'text'
+    >>> tree.findtext("section/tag")
+    'subtext'
+    """
+
+def bug_xmltoolkit28():
+    """
+    .//tag causes exceptions
+
+    >>> tree = ElementTree.XML("<doc><table><tbody/></table></doc>")
+    >>> summarize_list(tree.findall(".//thead"))
+    []
+    >>> summarize_list(tree.findall(".//tbody"))
+    ['tbody']
+    """
+
+def bug_xmltoolkitX1():
+    """
+    dump() doesn't flush the output buffer
+
+    >>> tree = ElementTree.XML("<doc><table><tbody/></table></doc>")
+    >>> ElementTree.dump(tree); sys.stdout.write("tail")
+    <doc><table><tbody /></table></doc>
+    tail
+    """
+
+def bug_xmltoolkit39():
+    """
+    non-ascii element and attribute names doesn't work
+
+    >>> tree = ElementTree.XML("<?xml version='1.0' encoding='iso-8859-1'?><täg />")
+    >>> ElementTree.tostring(tree, "utf-8")
+    '<t\\xc3\\xa4g />'
+
+    >>> tree = ElementTree.XML("<?xml version='1.0' encoding='iso-8859-1'?><tag ättr='v&#228;lue' />")
+    >>> tree.attrib
+    {u'\\xe4ttr': u'v\\xe4lue'}
+    >>> ElementTree.tostring(tree, "utf-8")
+    '<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />'
+
+    >>> tree = ElementTree.XML("<?xml version='1.0' encoding='iso-8859-1'?><täg>text</täg>")
+    >>> ElementTree.tostring(tree, "utf-8")
+    '<t\\xc3\\xa4g>text</t\\xc3\\xa4g>'
+
+    >>> tree = ElementTree.Element(u"täg")
+    >>> ElementTree.tostring(tree, "utf-8")
+    '<t\\xc3\\xa4g />'
+
+    >>> tree = ElementTree.Element("tag")
+    >>> tree.set(u"ättr", u"välue")
+    >>> ElementTree.tostring(tree, "utf-8")
+    '<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />'
+
+    """
+
+def bug_xmltoolkit45():
+    """
+    problems parsing mixed unicode/non-ascii html documents
+
+    latin-1 text
+    >>> p = HTMLTreeBuilder.TreeBuilder()
+    >>> p.feed("<p>välue</p>")
+    >>> serialize(p.close())
+    '<p>v&#228;lue</p>'
+
+    utf-8 text
+    >>> p = HTMLTreeBuilder.TreeBuilder(encoding="utf-8")
+    >>> p.feed("<p>v\xc3\xa4lue</p>")
+    >>> serialize(p.close())
+    '<p>v&#228;lue</p>'
+
+    utf-8 text using meta tag
+    >>> p = HTMLTreeBuilder.TreeBuilder()
+    >>> p.feed("<html><meta http-equiv='Content-Type' content='text/html; charset=utf-8'><p>v\xc3\xa4lue</p></html>")
+    >>> serialize(p.close().find("p"))
+    '<p>v&#228;lue</p>'
+
+    latin-1 character references
+    >>> p = HTMLTreeBuilder.TreeBuilder()
+    >>> p.feed("<p>v&#228;lue</p>")
+    >>> serialize(p.close())
+    '<p>v&#228;lue</p>'
+
+    latin-1 character entities
+    >>> p = HTMLTreeBuilder.TreeBuilder()
+    >>> p.feed("<p>v&auml;lue</p>")
+    >>> serialize(p.close())
+    '<p>v&#228;lue</p>'
+
+    mixed latin-1 text and unicode entities
+    >>> p = HTMLTreeBuilder.TreeBuilder()
+    >>> p.feed("<p>&#8221;välue&#8221;</p>")
+    >>> serialize(p.close())
+    '<p>&#8221;v&#228;lue&#8221;</p>'
+
+    mixed unicode and latin-1 entities
+    >>> p = HTMLTreeBuilder.TreeBuilder()
+    >>> p.feed("<p>&#8221;v&auml;lue&#8221;</p>")
+    >>> serialize(p.close())
+    '<p>&#8221;v&#228;lue&#8221;</p>'
+
+    """
+
+def bug_xmltoolkit46():
+    """
+    problems parsing open BR tags
+
+    >>> p = HTMLTreeBuilder.TreeBuilder()
+    >>> p.feed("<p>key<br>value</p>")
+    >>> serialize(p.close())
+    '<p>key<br />value</p>'
+
+    """
+
+def bug_xmltoolkit54():
+    """
+    problems handling internally defined entities
+
+    >>> e = ElementTree.XML("<!DOCTYPE doc [<!ENTITY ldots '&#x8230;'>]><doc>&ldots;</doc>")
+    >>> serialize(e)
+    '<doc>&#33328;</doc>'
+    """
+
+def bug_xmltoolkit55():
+    """
+    make sure we're reporting the first error, not the last
+
+    >>> e = ElementTree.XML("<!DOCTYPE doc SYSTEM 'doc.dtd'><doc>&ldots;&ndots;&rdots;</doc>")
+    Traceback (most recent call last):
+    ExpatError: undefined entity &ldots;: line 1, column 36
+    """
+
+# --------------------------------------------------------------------
+
+if __name__ == "__main__":
+    import doctest, selftest
+    failed, tested = doctest.testmod(selftest)
+    print tested - failed, "tests ok."

Modified: external/elementtree-1.2.6-20050316/setup.py
==============================================================================
--- external/elementtree-1.2.6-20050316/setup.py	(original)
+++ external/elementtree-1.2.6-20050316/setup.py	Wed Dec 14 19:33:39 2005
@@ -1,44 +1,44 @@
-#!/usr/bin/env python
-#
-# Setup script for the elementtree library
-# $Id: setup.py 2326 2005-03-17 07:45:21Z fredrik $
-#
-# Usage: python setup.py install
-#
-
-from distutils.core import setup
-
-try:
-    # add download_url syntax to distutils
-    from distutils.dist import DistributionMetadata
-    DistributionMetadata.classifiers = None
-    DistributionMetadata.download_url = None
-except:
-    pass
-
-DESCRIPTION="ElementTree - a light-weight XML object model for Python."
-
-LONG_DESCRIPTION="""\
-The Element type is a flexible container object, designed to store
-hierarchical data structures in memory.  Element structures can be
-converted to and from XML."""
-
-setup(
-    name="elementtree",
-    version="1.2.6-20050316",
-    author="Fredrik Lundh",
-    author_email="fredrik at pythonware.com",
-    url="http://effbot.org/zone/element-index.htm",
-    description=DESCRIPTION,
-    long_description=LONG_DESCRIPTION,
-    download_url="http://effbot.org/downloads#elementtree",
-    license="Python (MIT style)",
-    packages=["elementtree"],
-    platforms="Python 1.5.2 and later.",
-    classifiers=[
-        "Development Status :: 6 - Mature",
-        "Operating System :: OS Independent",
-        "Topic :: Text Processing :: Markup :: HTML",
-        "Topic :: Text Processing :: Markup :: XML",
-        ]
-    )
+#!/usr/bin/env python
+#
+# Setup script for the elementtree library
+# $Id: setup.py 2326 2005-03-17 07:45:21Z fredrik $
+#
+# Usage: python setup.py install
+#
+
+from distutils.core import setup
+
+try:
+    # add download_url syntax to distutils
+    from distutils.dist import DistributionMetadata
+    DistributionMetadata.classifiers = None
+    DistributionMetadata.download_url = None
+except:
+    pass
+
+DESCRIPTION="ElementTree - a light-weight XML object model for Python."
+
+LONG_DESCRIPTION="""\
+The Element type is a flexible container object, designed to store
+hierarchical data structures in memory.  Element structures can be
+converted to and from XML."""
+
+setup(
+    name="elementtree",
+    version="1.2.6-20050316",
+    author="Fredrik Lundh",
+    author_email="fredrik at pythonware.com",
+    url="http://effbot.org/zone/element-index.htm",
+    description=DESCRIPTION,
+    long_description=LONG_DESCRIPTION,
+    download_url="http://effbot.org/downloads#elementtree",
+    license="Python (MIT style)",
+    packages=["elementtree"],
+    platforms="Python 1.5.2 and later.",
+    classifiers=[
+        "Development Status :: 6 - Mature",
+        "Operating System :: OS Independent",
+        "Topic :: Text Processing :: Markup :: HTML",
+        "Topic :: Text Processing :: Markup :: XML",
+        ]
+    )


More information about the Python-checkins mailing list