sample.XML.a <- XMLNode("a",
attrs=list(href="http://example.com", target="_blank"),
.children="klick here!")
sample.XML.body <- XMLNode("body", .children=list(sample.XML.a))
sample.XML.html <- XMLNode("html", .children=list(XMLNode("head", ""),
sample.XML.body))
sample.XML.tree <- XMLTree(sample.XML.html,
xml=list(version="1.0", encoding="UTF-8"),
dtd=list(doctype="html", decl="PUBLIC",
id="-//W3C//DTD XHTML 1.0 Transitional//EN",
refer="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"))
Run the code above in your browser using DataLab