# HG changeset patch # User paulb # Date 1203192601 0 # Node ID a97efe934bc5a5b467218aba848c77ce9fe4e8bd # Parent bb98248dc3ade6e76d0c9c5a35cc11e9bb3817ee [project @ 2008-02-16 20:10:01 by paulb] Added an xinclude method to the Node class. Updated release information. diff -r bb98248dc3ad -r a97efe934bc5 libxml2dom/__init__.py --- a/libxml2dom/__init__.py Sat Feb 16 20:09:22 2008 +0000 +++ b/libxml2dom/__init__.py Sat Feb 16 20:10:01 2008 +0000 @@ -3,7 +3,7 @@ """ DOM wrapper around libxml2, specifically the libxml2mod Python extension module. -Copyright (C) 2003, 2004, 2005, 2006, 2007 Paul Boddie +Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free @@ -19,7 +19,7 @@ with this program. If not, see . """ -__version__ = "0.4.5" +__version__ = "0.4.6" from libxml2dom.macrolib import * from libxml2dom.macrolib import \ @@ -488,6 +488,12 @@ # NOTE: To be finished. def xpath(self, expr, variables=None, namespaces=None): + + """ + Evaluate the given expression 'expr' using the optional 'variables' and + 'namespaces' mappings. + """ + ns = {} ns.update(default_ns) ns.update(namespaces or {}) @@ -499,6 +505,18 @@ else: return result + # Other extensions to the usual PyXML API. + + def xinclude(self): + + """ + Process XInclude declarations within the document, returning the number + of substitutions performed (zero or more), raising an XIncludeException + otherwise. + """ + + return Node_xinclude(self._node) + # Convenience methods. def toString(self, encoding=None, prettyprint=0):