[Zope] Parsed XML Problem (we may need the best minds to solve this one :-)

Adam Warner lists@consulting.net.nz
25 Sep 2001 23:36:20 +1200


Hi all,

I'm calling an external method with this DMTL:

<dtml-var "db2onehtml(_.getitem('test.xml'))">

Which works fine so long as I upload "test.xml" as a _file_.

If I upload test.xml as Parsed XML I instead receive this error message:

Error Type: TypeError
Error Value: call of non-function (type string)


<!--
Traceback (innermost last):
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 223, in
publish_module
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /usr/lib/zope/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
    (Object: Traversable)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in
mapply
    (Object: test)
  File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object
    (Object: test)
  File /usr/lib/zope/lib/python/OFS/DTMLDocument.py, line 189, in
__call__
    (Object: test)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 540,
in __call__
    (Object: test)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_Util.py, line 339,
in eval
    (Object: db2onehtml(_.getitem('test.xml')))
    (Info: db2onehtml)
  File &lt;string&gt;, line 0, in ?
  File
/usr/lib/zope/lib/python/Products/ExternalMethod/ExternalMethod.py, line
269, in __call__
    (Object: db2onehtml)
    (Info: ((&lt;ParsedXML instance at 88281c0&gt;,), {}, None))
  File /usr/lib/zope/Extensions/db2onehtml.py, line 29, in db2onehtml
    (Object: Traversable)
TypeError: (see above)

-->

It appears Parsed XML items in the Zope database are not objects like
files.

http://www.zope.org//Wikis/DevSite/Projects/ParsedXML/ParsedXMLIsNotXMLObject

I want to be able to treat Parsed XML as an object. I hope someone can
give me a clue where to proceed. I also tried calling a python method
which took the XML data from the Parsed XML and converted it to a
string. I then tried feeding my external method with the string. But I
just receive this error message: 'string' object has no attribute 'id'

My Zope details:

Zope 2.3.3 (source release, python 1.5.2, linux2)
Python Version
1.5.2 (#0, Apr 10 2001, 10:03:44) [GCC 2.95.3 20010219 (prerelease)]
System Platform
linux2

ParsedXML (Installed product ParsedXML (ParsedXML 1.0))

Thanks everyone,
Adam