[phpXML] Re: Searching on attributes
Brought to you by:
bs_php,
nigelswinson
From: <lu...@sa...> - 2001-10-08 16:43:55
|
Daniel, This is much more efficient FM ;-) Thanks a lot by the way fore some reason $sorties =3D $xml->evaluate('//agenda/month[@name=3D"%s"]', $month_name); give an empty array while $sorties =3D $xml->evaluate('//agenda/month[@name=3D'.$month_name.']'); works OK Thanks again Luc At 07:19 07/07/01 +0000, inf...@aj... wrote: >Bonjour luc, > >Le samedi 7 juillet 2001 =E0 09:10:32, vous =E9criviez : > >lsec> '//agenda/month[@name=3D"$month_name"]'); > >It's not phpXml but an error with your PHP coding : >Between single quotes PHP doesn't calculate/evaluate the variables if >you make this test : >$month_name =3D 18; >echo '//agenda/month[@name=3D"$month_name"]'; > >You will obtain this output : //agenda/month[@name=3D"$month_name"] > >To correct you must write : >echo "//agenda/month[@name=3D\"$month_name\"]"; >and you will have : //agenda/month[@name=3D"18"] > >I prefer this : >echo sprintf( '//agenda/month[@name=3D"%s"]', $month_name) ; > >I use echo to demonstrate, you use this in strings.. >(Sorry but my english is poor, I hope I help you) >-- >Cordialement, > Daniel mailto:inf...@aj... >---------- >Support-Assistance PHP/MySql de =ABInternet Pour Tous=BB >http://www.i-p-t.com.fr/ :::XML/XSLT - Sablotron::: -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |