inst/examples/createTree.R

doc <- xmlTree()
doc$addTag("EXAMPLE", close= FALSE, attrs=c("prop1" = "gnome is great", prop2 = "& linux too"))
  doc$addComment("A comment")
  doc$addTag("head", close= FALSE)
   doc$addTag("title", "Welcome to Gnome")
   doc$addTag("chapter", close= FALSE)
     doc$addTag("title", "The Linux Adventure")
     doc$addTag("p")

     doc$addTag("image", attrs=c(href="linux.gif"))
   doc$closeTag()  
  doc$closeTag()  

  doc$addTag("foot")

doc$closeTag()

Try the XML package in your browser

Any scripts or data that you put into this service are public.

XML documentation built on Nov. 3, 2023, 1:14 a.m.