ParsedXML questions

Nicolas Stein <[email protected]> Wed, 05 Oct 2005 20:31:03 +0200
Newsgroups gmane.comp.web.zope.xml
Message-ID <[email protected]>
Hi all,

I have already successfully developped part of a project using ParsedXML.

However I'm now stuck by the following problem :

A python script receives (from a form) a number of xhtml contents.
I need to store them as a ParsedXML object.
I'm creating a ParsedXML with :

container.manage_addProduct['ParsedXML'].manage_addParsedXML('article_saved','')

Then I'm filling the DOM with the content pieces as follows :

article=container['article_saved']
artroot=article.documentElement
for x in REQUEST.form:
  node = artroot.createElement(x)
  node.appendChild(artroot.createTextNode(REQUEST.form[x]))
  artroot.appendChild(node)

This works great except of course that the xhtml itself doesn't get 
parsed...

1. I don't see how I could have it parsed directly from within the script.

2. I also explored the (not so clean) idea of writing everything to a 
temporary file, and have it then parsed with the "parseFile" function 
mentionned in the help. The problem is that I don't know how to call 
this function.. it's neither a method of a ParsedXML object, or from a 
file object...

I have turned the net upside-down to find an answer, some examples or a 
good doc without success.