[Zope] How do I control iteration over XML elements?

Jean Jordaan Jean@mosaicsoftware.com
Tue, 1 Aug 2000 07:55:25 +0200


hi Curtis

Yaaay! It works :)  Thanks a lot!

I wouldn't have found "objectValues" on my own .. where'd
you learn about that? I'm ploughing through docs and wiki's
now, just don't know if they're the right ones. I also need
to read more about Python .. 

Anyway, I messed about with your instructions a bit, and 
tried:

  <dtml-var "text_content('member')"> 

(which renders nothing), and:

  <dtml-var "text_content"> 

which renders:

  <Python Method object at 13bead8>

Dunno how soon I'd've navigated that maze on my own. The 
"text_content" I can understand -- putting it between "" 
means that it should be evaluated, so text_content is 
evaluated without parameters, and dtml-var is being asked
to render the method itself. Doing "text_content('member')",
text_content is replaced by the result of evaluating it
on 'member' .. this works when it's fed the output of 
getElementsByTagName, but since I'm already "in" the members, 
there aren't any member elements to be had inside them -- 
only their text_contents. 

Well, that's as far as I can puzzle it out ..

Now for another question (which I'm throwing to the group
seperately too):

How do I show all groups that a specific member is part
of? In other words, if I have:

<teams>
 <team>
  <name>Ham</name>
  <desc>White papers, brochures, case studies.</desc>
  <member>Eduan</member>
  <member>Jacqui</member>
 </team>

 <team>
  <name>Green eggs</name>
  <desc>Green papers, brochures, case studies.</desc>
  <member>Tracey</member>
  <member>Jacqui</member>
 </team>
</teams>

how do I get 

"Jacqui is member of the Ham and Green eggs teams."

-- 
jean