# HG changeset patch # User paulb # Date 1117225890 0 # Node ID a4ead372eaa2bd11867788950b6002f0a8209ebf # Parent faa7233673fc45868ba8248ef10e733778330e31 [project @ 2005-05-27 20:31:30 by paulb] Added comments about XPath variable and namespace support. diff -r faa7233673fc -r a4ead372eaa2 libxml2dom/macrolib/macrolib.py --- a/libxml2dom/macrolib/macrolib.py Fri Jun 20 21:41:50 2008 +0200 +++ b/libxml2dom/macrolib/macrolib.py Fri May 27 20:31:30 2005 +0000 @@ -310,8 +310,13 @@ context = libxml2mod.xmlXPathNewContext(Node_ownerDocument(node)) libxml2mod.xmlXPathSetContextNode(context, node) # NOTE: Discover namespaces from the node. + # NOTE: Work out how to specify paths without having to use prefixes on + # NOTE: names all the time. for prefix, ns in (namespaces or {}).items(): libxml2mod.xmlXPathRegisterNs(context, prefix, ns) + # NOTE: No such functions are exposed in current versions of libxml2. + #for (prefix, ns), value in (variables or {}).items(): + # libxml2mod.xmlXPathRegisterVariableNS(context, prefix, ns, value) result = libxml2mod.xmlXPathEval(expr, context) libxml2mod.xmlXPathFreeContext(context) return result