This is a complicated XPath problem I cannot figure out.
Suppose I have an XML Feed that contains many <event> nodes that look like this:
<bestlinesports_line_feed>
<event>
<event_datetimeGMT>2015-07-29 19:10</event_datetimeGMT>
<sporttype>Baseball</sporttype>
<scheduletext>null</scheduletext>
<league>MLB Baseball</league>
<participant>
<participant_name>Washington Nationals</participant_name>
<rotnum>905</rotnum>
<visiting_home_draw>Visiting</visiting_home_draw>
<odds>
<moneyline>-124</moneyline>
</odds>
<pitcher>D. Fister -R</pitcher>
</participant>
<participant>
<participant_name>Miami Marlins</participant_name>
<rotnum>906</rotnum>
<visiting_home_draw>Home</visiting_home_draw>
<odds>
<moneyline>114</moneyline>
</odds>
<pitcher>T. Koehler -R</pitcher>
</participant>
<drawrotnum>0</drawrotnum>
<drawmoneyline>0</drawmoneyline>
<drawTitle/>
<period>
<period_description>Game</period_description>
<periodcutoff_datetimeGMT>2015-07-29 19:20</periodcutoff_datetimeGMT>
<period_status>O</period_status>
<spread>
<spread_visiting>-1.5</spread_visiting>
<spread_adjust_visiting>125</spread_adjust_visiting>
<spread_home>1.5</spread_home>
<spread_adjust_home>-145</spread_adjust_home>
</spread>
<total>
<total_points>7.5</total_points>
<over_adjust>-102</over_adjust>
<under_adjust>-118</under_adjust>
</total>
</period>
</event>
Now, there are 6 of these Washington Nationals event nodes. I'd like to target this specific one based on 4 criteria:
<participant_name>contains 'Nationals' (this narrows it down to 6) (this needs to be contains because they connect with my Rails model that == 'Nationals')<event_datetimeGMT>contains '2015-07-29' (this narrows it down to 5) (needs to be contains as well because of my Rails game_date model)<league>is 'MLB Baseball' (narrows it down to 2)<period_description>is 'Game' (narrows it down to the 1)
This would be a HUGE help. XPath is really hard!
If you're feeling especially gracious, the 3 strings/values I am going to target once I have the parent event node selected are: <moneyline> under the home team, the second participant or Miami Marlins (there are two moneylines), then <total_points> and <spread_home>. This xml is a little wonky so it makes it harder.
Thank you so very much.