
Last chance! 50% off unlimited learning
Sale ends in
xmlOutputBuffer(dtd=NULL, nameSpace="", buf=NULL,
nsURI=NULL, header="")xmlOutputDOM(tag="doc", attrs = NULL, dtd=NULL,
nameSpace=NULL, nsURI=character(0))
parseDTD
and
xmlTreeParse
) which contains specifications about
what elements are valid within other elements and what attributes
axmlOuputDOM
, this is a named character vector with each
element giving the name space identifier and the
corresponding URI, \
e.g c(shelp = "h
xmlOutputDOM
:XMLNode
object
into the currently active (i.e. open) node.xmlNode
,
xmlTextNode
,
append.xmlNode
con <- xmlOutputDOM()
con$addTag("author", "Duncan Temple Lang")
con$addTag("address", close=FALSE)
con$addTag("office", "2C-259")
con$addTag("street", "Mountain Avenue.")
con$addTag("phone", close=FALSE)
con$addTag("area", "908", attrs=c(state="NJ"))
con$addTag("number", "582-3217")
con$closeTag() # phone
con$closeTag() # address
con$addTag("section", close=FALSE)
con$addNode(xmlTextNode("This is some text "))
con$addTag("a","and a link", attrs=c(href="http://www.omegahat.org"))
con$addNode(xmlTextNode("and some follow up text"))
con$addTag("subsection", close=FALSE)
con$addNode(xmlTextNode("some addtional text "))
con$addTag("a", attrs=c(href="http://www.omegahat.org"), close=FALSE)
con$addNode(xmlTextNode("the content of the link"))
con$closeTag() # a
con$closeTag() # "subsection"
con$closeTag() # section
d <- xmlOutputDOM()
d$addPI("S", "plot(1:10)")
d$addCData('x <- list(1, a="&");<nx>[[2]]')
d$addComment("A comment")
print(d$value())
print(d$value(), indent = FALSE, tagSeparator = "")</nx>
<keyword>file</keyword>
<keyword>IO</keyword>
Run the code above in your browser using DataLab