[Zope] yet another how-to question

Dennis Allison allison@sumeru.stanford.EDU
Thu, 18 Apr 2002 12:19:09 -0700 (PDT)


Here's my problem --

I'm using the ParsedXML product.  I want to display, using the tree
widget, a portion of the XML DOM tree.  Now, the tree widget is controlled
by a pair of methods, "branches" and "leaves".

"leaves" is a DTML-Method called to render a leaf.

"branches" specifies a method that generates a list of child note objects.
In fact the default, tpValues is simply a call to the wrapped DOM to
return the list childNodes.  So, to control the output, I need to prune
the list of childNodes to exclude the nodes I don't want to be included.
The code for tpValues looks like

	def tpValues(self):
		retList={}
		for child in self.childNodes:
			retList.append(child)
		return retList

Now, to decide whether to include a note or not, I need to look at 
the contents of the childNode, in particular, it's attributes.  But 
how does one reference the child node instance to enquire about its
nodeName, for example.  The obvious approach

	child.__get_nodeName()

fails in an External Method (the code is in the Python-level Extensions
directory, not the Product's own Extension directory--is that a problem?).

There are several layers of wrappers which complicates the problem.  :-(

There is the alternative "branches-expr" mechanism, but it appears to have 
the same reference questions.

Thanks in advance for help.