Connecting Tech Pros Worldwide Help | Site Map

problem with xml and xpath in PHP

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 4th, 2008, 02:15 AM
amit
Guest
 
Posts: n/a
Default problem with xml and xpath in PHP


hello group,

I need to extract information from an XML file (http://
wurfl.sourceforge.net/wurfl.xml). Now, using following function I'm
able to read the user_agent's value:

$devices = $xml->xpath('devices/device/@user_agent');

But when I try to read "Capability" element vlaue which is "Audivox" I
don't get anything. or if I try to read "model_name" it will return
nothing!

$capability = $xml->xpath('devices/device/group/capability/
@value');


How should I address value="Audiovox" ?



Thanks.


A block sample of the XML I'm reading.

<devices>
<device user_agent="AUDIOVOX-CDM180" actual_device_root="true"
fall_back="generic" id="audiovox_cdm180_ver1">
<group id="product_info">
<capability name="brand_name" value="Audiovox"/>
<capability name="model_name" value="CDM-180"/>
</group>
</device>
</devices>


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.