View Single Post
Old 09-21-2012, 12:06 AM   #1
lembi2001
 
Join Date: Sep 2012
Posts: 1
Default Noob needing help with spry filtering

Hi all

This is my first ever attempt at inserting a spry dataset into a page.

I'm using the following xml dataset to supply the data for my table:

PHP Code:
<prices>
 <
pricelist currency="usd">
  <
price timestamp="1348175700" per="ozt" commodity="gold">1768.20</price>
  <
price timestamp="1348175460" per="ozt" commodity="palladium">662.50</price>
  <
price timestamp="1348174500" per="ozt" commodity="platinum">1627.00</price>
  <
price timestamp="1348175640" per="ozt" commodity="silver">34.65</price>
 </
pricelist>
 <
pricelist currency="eur">
  <
price timestamp="1348175700" per="ozt" commodity="gold">1363.64</price>
  <
price timestamp="1348175460" per="ozt" commodity="palladium">510.92</price>
  <
price timestamp="1348174500" per="ozt" commodity="platinum">1254.74</price>
  <
price timestamp="1348175640" per="ozt" commodity="silver">26.72</price>
 </
pricelist>
 <
pricelist currency="chf">
  <
price timestamp="1348175700" per="ozt" commodity="gold">1650.08</price>
  <
price timestamp="1348175460" per="ozt" commodity="palladium">618.25</price>
  <
price timestamp="1348174500" per="ozt" commodity="platinum">1518.32</price>
  <
price timestamp="1348175640" per="ozt" commodity="silver">32.34</price>
 </
pricelist>
</
prices
This works fine, however i want to filter it on the xpath for @currency=usd. This is a dynamically generated xml file and as such i cannot just delete the rows i don't need.

Anyone able to help me?

To clarify (as i tend to over explain things) i just want this section:
PHP Code:
<prices>
 <
pricelist currency="usd">
  <
price timestamp="1348175700" per="ozt" commodity="gold">1768.20</price>
  <
price timestamp="1348175460" per="ozt" commodity="palladium">662.50</price>
  <
price timestamp="1348174500" per="ozt" commodity="platinum">1627.00</price>
  <
price timestamp="1348175640" per="ozt" commodity="silver">34.65</price>
 </
pricelist>
</
prices
Thanks very much for taking the time to read this
lembi2001 is offline   Reply With Quote