f = system.file("exampleData", "mtcars.xml", package="XML")
# Same as xmlParse()
xmlParseDoc(f)
txt =
'<top xmlns:r="http://www.r-project.org">
<b xmlns:r="http://www.r-project.org">
<c xmlns:omg="http:/www.omegahat.net"/>
</b>
</top>'
xmlParseDoc(txt, NSCLEAN, asText = TRUE)
txt =
'<top xmlns:r="http://www.r-project.org" xmlns:r="http://www.r-project.org">
<b xmlns:r="http://www.r-project.org">
<c xmlns:omg="http:/www.omegahat.net"/>
</b>
</top>'
xmlParseDoc(txt, c(NSCLEAN, NOERROR), asText = TRUE)
Run the code above in your browser using DataLab