Skip to content
Prev 201608 / 398506 Next

XML package example code?

It's been a long time since i read the tutorials, but 'I think', the
reason you get those notifications is because the html code is
malformed, meaning that some of the opening tags '<dd>' don't have
corresponding end tags </dd> etc.

The XML package seems rather good at working with malformed code, and
therefore I usually just force those notifications into an empty
function.


library(RCurl)
library(XML)
html <- getURL("http://www.omegahat.org/RSXML/index.html")
html.tree <- htmlTreeParse(html, useInternalNodes = TRUE, error =
function(...){})

HTH,
Tony Breyal
On 25 Nov, 16:21, Peng Yu <pengyu... at gmail.com> wrote: