[XML-SIG] Accessing DOM nodes in Python

Thomas Gagne tgagne@efinnet.com
Wed, 04 Oct 2000 16:04:39 -0400

I was just going through the XML howto about creating DOMs.  I have a buffer
that looks like:

<isResultInfo rows="-1" status="-6"/>

And I want to get the value of the "status" attribute.  My subroutine looks
def isResultValue(buffer):
    print buffer
    parser = saxexts.make_parser()

    dh = SaxBuilder()


    fh = StringIO.StringIO(buffer)

    print dh.get_parentNode()


Now, the problem is, I don't know how to get the first node from dh.  I
usually try to print variables to see what they can do, but I'm not seeing
anything when I try "print dh".  I've tried printing dh.parentNode and
dh.get_parentNode() without success.  I think if someone could just point me
in the right direction I'd be zooming right along.