Closed (fixed)
Project:
Feeds XPath Parser
Version:
7.x-1.0-beta2
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
23 Jul 2011 at 21:39 UTC
Updated:
23 Aug 2011 at 11:51 UTC
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
Comment #1
twistor commentedThere's a lot of documentation on how to perform xpath queries. http://drupal.org/node/919448
Comment #2
twistor commentedYou use the @ symbol to return an attribute value.
Comment #3
TonyAngelo commentedThanks!