0

I'm using the Xpath parser module for my drupalsite, and now I want to pick a result from an XML that has a certain time. The XML parts looks like this

    <time from="2012-12-17T12:00:00" to="2012-12-17T18:00:00" period="2">
      <!-- Valid from 2012-12-17T12:00:00 to 2012-12-17T18:00:00 -->
      <symbol number="4" name="Cloudy" var="04"/>
      <precipitation value="0.6" minvalue="0.3" maxvalue="0.6"/>
      <!-- Valid at 2012-12-17T12:00:00 -->
      <windDirection deg="80.2" code="E" name="East"/>
      <windSpeed mps="3.2" name="Light breeze"/>
      <temperature unit="celsius" value="-2"/>
      <pressure unit="hPa" value="1014.3"/>
    </time>
    <time from="2012-12-17T12:00:00" to="2012-12-17T18:00:00" period="2">
      <!-- Valid from 2012-12-17T12:00:00 to 2012-12-17T18:00:00 -->
      <symbol number="4" name="Cloudy" var="04"/>
      <precipitation value="0.6" minvalue="0.3" maxvalue="0.6"/>
      <!-- Valid at 2012-12-17T12:00:00 -->
      <windDirection deg="80.2" code="E" name="East"/>
      <windSpeed mps="3.2" name="Light breeze"/>
      <temperature unit="celsius" value="-2"/>
      <pressure unit="hPa" value="1014.3"/>
    </time>

And now I want to pick the time with from=....12:00....

How can I accomplish this?

1

Try this:

/time/@from 
/time/@to
/time/@period  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.