RE: [Zope] How do I control iteration over XML elements?
On Tue, 01 Aug 2000, Jean Jordaan wrote: > Hi Curtis & all > > > yuck > > indeed. > > Just thinking aloud .. > > I got as far as: > > > > !! but now I can't see 'team' anymore :( Erm... I was banking on it still being in the namespace, since all the dtml-in does is push another object onto the namespace. > > is member of > > !! this whole -in never contains anything .. because > !! I'm already -in member (Have I got this right?) > > > > , > !! AFAICT 'name' won't be visible -in 'member' .. > > > > > > > > > I think I need a lot more Python than I know .. I've got this far with almost 0 python knowledge. (o8 But yes, learning some Python can be a very helpful thing. > 1. objectValues returns a list -- this needs to get sorted >& duplicates dropped. sorting is easy with dtml-in removing duplicats is another story... > 2. when -in team and -in member, the name of the team >needs to be accessible. As I said earlier, AIUI name should still be in the namespace. Have a better one, Curtis ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] How do I control iteration over XML elements?
Hi Curtis & all > yuck indeed. Just thinking aloud .. I got as far as: !! but now I can't see 'team' anymore :( is member of !! this whole -in never contains anything .. because !! I'm already -in member (Have I got this right?) , !! AFAICT 'name' won't be visible -in 'member' .. I think I need a lot more Python than I know .. 1. objectValues returns a list -- this needs to get sorted & duplicates dropped. 2. when -in team and -in member, the name of the team needs to be accessible. -- jean ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] How do I control iteration over XML elements?
On Tue, 01 Aug 2000, Jean Jordaan wrote: > 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 .. > The Zope Quick Reference. An indispensible resource, which you can find through the zope.com Documentation section. > Anyway, I messed about with your instructions a bit, and > tried: > > > > (which renders nothing), and: > > > > which renders: > > > > 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. Another option is getChildNodes() > > 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: > > > > Ham > White papers, brochures, case studies. > Eduan > Jacqui > > > > Green eggs > Green papers, brochures, case studies. > Tracey > Jacqui > > > > how do I get > > "Jacqui is member of the Ham and Green eggs teams." yuck is member of , that's my best guess, but you _might_ run into a problem with 'name' Have a better one, Curtis. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] How do I control iteration over XML elements?
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: (which renders nothing), and: which renders: 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: Ham White papers, brochures, case studies. Eduan Jacqui Green eggs Green papers, brochures, case studies. Tracey Jacqui how do I get "Jacqui is member of the Ham and Green eggs teams." -- jean ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How do I control iteration over XML elements?
On Tue, 01 Aug 2000, Jean Jordaan wrote: > Hi all > > If I have (in an XML Document): > > > > Name of team > White papers, brochures, case studies. > Tracey > Eduan > Jacqui > > > > Then: > > > > > > gives me this: > > TraceyEduanJacqui > > I'd like to format the output, putting 's between > all the names, for example. How do I do that? > Simple enough. You just need another dtml-in inside replace: with: Works for me. (o8 > Cheers, Have a better one, Curtis. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )