[R] Package XML: Parse Garmin *.tcx file problems

From: Folkes, Michael <Michael.Folkes_at_dfo-mpo.gc.ca>
Date: Wed, 30 Mar 2011 13:15:43 -0700

I'm struggling with package XML to parse a Garmin file (named *.tcx). I wonder if it's form is incomplete, but appreciably reluctant to paste even a shortened version.
The output below shows I can get nodes, but an attempt at value of a single node comes up empty (even though there is data there.

One question: Has anybody succeeded parsing Garmin .tcx (xml) files? Thanks!

>doc2 = xmlRoot(xmlTreeParse("HR.reduced3.tcx",useInternalNodes = TRUE))
>xpathApply(doc2, "//*", xmlName)

[1] "TrainingCenterDatabase"

[1] "Activities"

[1] "Activity"

[1] "Id"

[1] "Lap"

[1] "TotalTimeSeconds"

> xpathApply(doc2, "//TotalTimeSeconds", xmlValue)

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 30 Mar 2011 - 20:27:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Mar 2011 - 21:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive