Re: function _handleFunction_contains
Brought to you by:
bs_php,
nigelswinson
From: Peter R. <php...@pe...> - 2004-03-28 12:49:59
|
On Sunday 28 Mar 2004 02:49, ktt wrote: > I have an XML file like > > <orchard> > <flora> > <flower>red</flower> > <stem>green</stem> > </flora> > > <flora> > <flower>red</flower> > <stem>pale</stem> > </flora> > > <flora> > <flower>blue</flower> > <stem>pale</stem> > </flora> > </orchard> > > > The aim is to display all <flora> nodes if subnode of > it > has a value "red". > > I would like to use > function _handleFunction_contains($arguments, > $context) > and use a query "//flora[contains(.,'red')]" . evaluate xpath syntax would be something like //flora//*[contains(.,'red')] i.e. give me descendants of all flora nodes which contain 'red' <name>fred</name> also contains 'red' ;) |