Атрибуты в XML

Jenius

Guest
Атрибуты в XML

- <catalog update_id="0" update_to="29692" media_type="game" region="RU">
- <service_groups>
- <service_group id="300" price="3.00">
<service id="23" operator_name="Билайн" phone="1717" real_price="2.99 USD" operator_logo="http://img.playfon.ru/img/operators/beeline.gif" />


Как мне получить аттрибуты ID operator_name....?

Пишу следующее
$sJavagamesContent = $dom->getElementsByTagName('service')->item(0)->getAttributeNode('id');
 

bubblegum

Новичок
случалось делать - через xml_parse_into_struct

плюс ф-я от
gdemartini at bol dot com dot br
11-Dec-2000 03:49 с исправлением из следующего поста
http://halfos.street-tv.net/lib/php/function.xml-parse-into-struct.php.htm

дальше остается только перебирать массив
 

Alexandre

PHPПенсионер
все зависит от версии пхп, вариантов море
- DOM
- SAX
- XMLReader
- SimpleXML
 
Сверху