[XML-SIG] Re: Some pyXML Bugs in PyXML 0.6.2 and 4Suite for Python 1.5.2

Thomas B. Passin tpassin@home.com
Wed, 7 Feb 2001 00:16:53 -0500


More problems with the XPointer TestParser script.

At line 12, the ReadFromUri() no longer exists. I hacked up a fix as shown
below:

********** XPointerParser **********
Traceback (innermost last):
  File "C:\Program Files\Python\Ft\XPointer\test_suite\TestParser.py", line
67,
in ?
    retval = test()
  File "C:\Program Files\Python\Ft\XPointer\test_suite\TestParser.py", line
12,
in test
    doc = pDomlette.ReadFromUri('addrbook.xml')
AttributeError: ReadFromUri


##    doc = pDomlette.ReadFromUri('addrbook.xml')  #Original code
    reader=pDomlette.PyExpatReader()  # Need a reader, original call is no
more
    doc = reader.fromUri('addrbook.xml')

Now the code runs, but the example being tested still fails -  Apparently the
xpointer expression no longer works.  When I try various plausible variations,
a few of them work, some of them return None (which causes an error) , and
some give this same error.

Seems to me that if no match is found for an expression, returning None would
always be appropriate.  It shouldn't return an exception unless there was
invalid syntax in the xpointer expression.

Here's the trace:

C:>TestParser.py
********** XPointerParser **********
Creating test environment                                              [
OK  ]
Traceback (innermost last):
  File "C:\Program Files\Python\Ft\XPointer\test_suite\TestParser.py", line
69,
in ?
    retval = test()
  File "C:\Program Files\Python\Ft\XPointer\test_suite\TestParser.py", line
49,
in test
    result = XPointer.SelectNode(doc, frag)
  File "C:\Program Files\Python\Ft\XPointer\__init__.py", line 57, in
SelectNode

    return xptr.select(doc, contextNode, nss)
  File "C:\Program Files\Python\Ft\XPointer\ParsedXPointer.py", line 47, in
sele
ct
    raise XPtrException(XPtrException.SUB_RESOURCE_ERROR)
Ft.XPointer.XPtrException.XPtrException: Expression does not locate a resource


Cheers,

Tom P

p.s. - That's it for tonight, no more posts on this!