
Last chance! 50% off unlimited learning
Sale ends in
xmlOutputBuffer(dtd=NULL, nameSpace=NULL, buf=NULL, nsURI=NULL, header="")
xmlOutputDOM(tag="doc", dtd=NULL, nameSpace=NULL, nsURI=character(0))
parseDTD
and
xmlTreeParse
) which contains specifications about
what elements are valid within other elements and what attributes
arxmlOuputDOM
, this is a named character vector with each
element giving the name space identifier and the
corresponding URI, e.g c(shelp="http://www.omegxmlOutputDOM
: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=F)
con$addTag("office", "2C-259")
con$addTag("street", "Mountain Avenue.")
con$addTag("phone", close=F)
con$addTag("area", "908", attrs=c(state="NJ"))
con$addTag("number", "582-3217")
con$closeTag() # phone
con$closeTag() # address
con$addTag("section", close=F)
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=F)
con$addNode(xmlTextNode("some addtional text "))
con$addTag("a", attrs=c(href="http://www.omegahat.org"), close=F)
con$addNode(xmlTextNode("the content of the link"))
con$closeTag() # a
con$closeTag() # "subsection"
con$closeTag() # section
Run the code above in your browser using DataLab