[XML-SIG] Documenting xpath

Rich Salz rsalz@zolera.com
Thu, 5 Apr 2001 09:51:33 -0400


Next week I want to start documenting the xpath (nee 4XPath) classes.
I'll work bottom-up.

First, is there documentation on the Node class, other than the DOM and
Python mapping?  If not, what do folks think should be documented?

General model: scanner (currently only pyxpath) uses a parser factory
(currently only FtFactory) to build up its "compiled scanner" object.
This compiled scanner must support an evaluate(context) method which
returns a nodeset (list of nodes).

Parsing, pyxpath, parsed expressions
	pyxpath.Compile -- module-level method for compiling a query

Context class

Package-level:
    Errors: SyntaxException(pos,msg), GeneralException, Error class(?)

    def Evaluate(expr, contextNode=None, context=None):
	registers $EXTMODULES, creates context, compiles, evaluates

    def Compile(expr):
	calls "a" compiler (currently only pyxpath)
    def CreateContext(contextNode):

Writing extensions:
    if os.environ.has_key('EXTMODULES'):
    def RegisterExtensionModules(moduleNames):
	(a dictionary of (namespace-string localname-string):method)

Comments?