[R] extracting a value from XML

Glenn Schultz glennmschultz at me.com
Mon Sep 21 20:01:36 CEST 2015

Hi All,

I have been trying to extract a value from XML.  I have been at it for several days off and on and I can't seem to get my head around the problem.   I basically understand the examples in R help but I cannot replicate success with the below 

I tried to use xmlValue(doc, "//[[value]]") but no success.  All I need is the 0.46 value.  Any suggestions to help me along are greatly appreciated.


<?xml version="1.0" encoding="utf-8"?>
<observations realtime_start="2015-09-21" realtime_end="2015-09-21" observation_start="2015-09-01" observation_end="2015-09-01" units="lin" output_type="1" file_type="xml" order_by="observation_date" sort_order="asc" count="1" offset="0" limit="100000">
  <observation realtime_start="2015-09-21" realtime_end="2015-09-21" date="2015-09-01" value="0.46"/>

More information about the R-help mailing list