[phpXML] Searching on attributes
Brought to you by:
bs_php,
nigelswinson
From: <lu...@sa...> - 2001-10-08 16:08:41
|
Hello, Sorry guys its time to fire the my_stupid_question_of_the_day() function : In the government example, the search function is pretty simple because the search is done on content if ( !empty($term) ) { // Only select those persons, in whose name or position // the search string is present. $government = $xml->evaluate( "//person/*[contains(., $term)]/.."); } else { // Select all members of the government. $government = $xml->evaluate("//person"); } How would one (one = me) proceed to do the same kind of thing with a search based on attributes especially as attributes aren't accessed directly but through an array In fact I've a file that is an agenda and I'd like to be able to search on the attribute month "name" : <agenda> <month name="January"> <event> <date/> <location> <name/> <address/> <town/> <country/> </location> <phone/> <email/> <web/> <description/> </event> </month> Thanks in advance Luc -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |