[Zope] ParsedXML Documentation / Examples?

sean.upton@uniontrib.com sean.upton@uniontrib.com
Tue, 01 Jul 2003 09:17:45 -0700


ParsedXML is just a persistent DOM.  Just get the ParsedXML document object
and use the DOM API to target it (traverse, read, modify).  The appendix in
the back of the book _Python & XML_ is a good DOM reference.

Simple Example:


doc = myFolder.someXMLDoc
headnode = doc.getElementsByTagName('head')[0]
titlenode = headnoce.getElementsByTagName('title')[0]
title = titlenode.firstChild.nodeValue
print title
#change title
title = 'New title'
bytes = titlenode.firstChild.length #len of current title
titlennode.firstChild.replaceData(0,bytes,title)


Sean

> -----Original Message-----
> From: zoper@disturbance.dhs.org [mailto:zoper@disturbance.dhs.org]
> Sent: Saturday, June 28, 2003 4:18 PM
> To: Zope
> Subject: [Zope] ParsedXML Documentation / Examples?
> 
> 
> Hello,
> 
> After searching all afternoon, I have found a ton of periphery 'about'
> type information re: ParsedXML, but I am having trouble locating any
> substantive documentation, or in particular, examples. I'm 
> interested in
> DTML examples, PythonScript examples, anything.
> 
> Any pointers appreciated.
> 
> -Bryan
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>