Error fixed... but another one....

Falcor il FortunaBarbaro <[email protected]> Tue, 22 Jul 2003 17:46:12 +0200
Newsgroups gmane.comp.web.zope.parsed-xml
Message-ID <[email protected]>
Hello,

I removed ParsedXML-1.0 product and installed 1.3 version.
I previously installed PyXML too (as simply python library without
consideringit as  zope Products).

New product so has been accepted and from Add menu (on ZMI) I can
choose Parsed XML file and so play with it... but...

i tried to compose a simply pythonINzope script, that is:

----
from xml.dom.ext.reader import Sax2
from xml.dom import EMPTY_NAMESPACE

def find_mobile_phone(name):
  reader = Sax2.Reader()
  doc = reader.fromStream(open('addressbook.xml'))
  person_names = doc.getElementsByTagName('name')

  for n in person_names:
    if n.firstChild.data == name:
      phones = n.parentNode.getElementsByTagName('phone')

      for p in phones:
        if p.getAttributeNS(EMPTY_NAMESPACE,'type') == 'mobile':
          return p.firstChild.data
  return None
-----

got from a PyXml tutorial and when i click on TEST tab, browser remind
me the autentication window ???? so evenif I have tried some (correct) manager
identity he returned me following Zope error message:

---
 Zope Error
Zope has encountered an error while publishing this resource.

Error Type: Unauthorized
Error Value: You are not allowed to access dom in this context

...
---



What is wrong in what i do?

On the other hand, I could be happy if someone could inizialize me to
use DOM (in an another correct way) to manipulate XML resources with
pythonINzope scripts... i.e imports I have to do, and so on.

Like in sig... Best Regards ;)
 

-- 
Best regards,
 Alessandro                          mailto:[email protected]