Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > zope xml error

Reply
Thread Tools

zope xml error

 
 
Jinu
Guest
Posts: n/a
 
      07-15-2003
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(context,'addressbook.xml')
#doc=context.objectvalues('addressbook.xml')
book=doc.documentElement # here the error is generated.
print "Number of items",len(book.childNodes)
names=[]
for item in book.childNodes:
name=item.firstChild
names.append(name.firstChild.nodeValue)
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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Re: [Zope-dev] Zope 2.7 running with Stackless 3.0 Shane Hathaway Python 2 08-29-2003 09:59 AM
Re: Zope problem: objectValues('Folder') Max M Python 6 07-11-2003 06:20 AM
doublequotes in regexp 1.5.2 - zope/externalmethod Florian Konnertz Python 1 07-08-2003 09:57 PM
eGenix mxODBC Zope DA for FreeBSD M.-A. Lemburg Python 0 07-01-2003 04:37 PM



Advertisments