zope xml error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jinu

    zope xml error

    while i worked with xml in zope using python i got the following error.



    Error Type: AttributeError
    Error Value: documentElement


    i've installed pyxml,xmllib ,xmldocument .

    can anyone shed some light

    thanks in advance
    Jinu

    my python script is as follows

    import string
    doc=getattr(con text,'addressbo ok.xml')
    #doc=context.ob jectvalues('add ressbook.xml')
    book=doc.docume ntElement # here the error is generated.
    print "Number of items",len(book .childNodes)
    names=[]
    for item in book.childNodes :
    name=item.first Child
    names.append(na me.firstChild.n odeValue)
    print "Names",string. join(names,",")
    return printed

    addressbook.xml

    <?xml version="1.0"?>
    <addressbook>
    <item>
    <name>Bob </name>
    <address>2118 Wildhare st </address>
    </item>
    <item>
    <name>Randolf </name>
    <address>13 E. Roundway</address>
    </item>
    </addressbook>
Working...