I'm dealing with an XML feed that uses the attribute value of the node to store it's data, what XPath query do I need to use to return the attribute values?

Here's an example of the feed:

<class id="15" name="Baseball" maxRepDate="2011-07-23" maxRepTime="08:05:35">
<type id="226" name="MLB" url="http://sports.williamhill.com/bet/betting/t/226" lastUpdateDate="2011-03-08" lastUpdateTime="07:10:37">
<market id="19161805" name="STL Cardinals (J Garcia) @ PIT Pirates (K Correia) - Run Line" url="http://sports.williamhill.com/bet/gb/betting/e/2221329/STL%2dCardinals%2d%28J%2dGarcia%29%2d%40%2dPIT%2dPirates%2d%28K%2dCorreia%29" date="2011-07-24" time="00:05:00" betTillDate="2011-07-24" betTillTime="00:05:00" lastUpdateDate="2011-07-23" lastUpdateTime="08:05:32">
<participant name="PIT Pirates (K Correia)" id="86586666" odds="5/7" oddsDecimal="1.71" lastUpdateDate="2011-07-23" lastUpdateTime="08:05:35" handicap="1.5"/>
<participant name="STL Cardinals (J Garcia)" id="86586667" odds="6/5" oddsDecimal="2.20" lastUpdateDate="2011-07-23" lastUpdateTime="08:05:35" handicap="-1.5"/>
</market>

Comments

twistor’s picture

There's a lot of documentation on how to perform xpath queries. http://drupal.org/node/919448

twistor’s picture

Component: Code » Documentation
Assigned: TonyAngelo » twistor
Category: task » support
Status: Active » Fixed

You use the @ symbol to return an attribute value.

TonyAngelo’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.