[XML-SIG] Python XML DOM: problem accessing length attribute in NodeList

Mark Willey willey@protectix.com
Thu, 13 Jul 2000 17:57:05 -0700


Hi, all.  I am new to Python and XML and DOM: caveat.  I think I have found
an undocumented deviation from the spec in core.py that I had to UTSL to
get around.

I am trying to 'print "element with ", list.length, " children."' but had to
'print "element with ", list.get_length(), " children."' because NodeList
appears to have .get_length(), but not .length.

I hope this is the right place to place this report.  It was the address in
the README for "XML package v0.5.1".  I did look back at the mailing list
and saw the discussion about the attributes vs methods.  I grokked that
both were to be supported, and the reality of the class differs from the
documentation, so I am assuming this is a real bug.

class NodeList(UserList.UserList):
    """An ordered collection of nodes, equivalent to a Python list.  The only
    difference is that an .item() method and a .length attribute are added.
    """

Mark