File: namespaces.S

package info (click to toggle)
r-cran-xml 3.99-0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,688 kB
  • sloc: ansic: 6,659; xml: 2,890; asm: 486; sh: 12; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 709 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

library(XML)

gg <- xmlTree("abc", dtd = "ggobi.dtd", namespaces = list(ggobi="http://www.ggobi.org",
                                                          r = "http://www.r-project.org"))

gg$addTag("ggobidata", attrs = c(count=1), namespace = "ggobi", close = FALSE)
gg$addTag("data", attrs = c(name="cube6"), close = FALSE)
gg$addTag("description", "A simple dataset")
gg$addTag("variables", attrs = c(count="2"), close = FALSE)
gg$addTag("realvariable", attrs = c(name="D1"), namespace = "r")
gg$addTag("realvariable", attrs = c(name="D2"), namespace = "r")
gg$closeTag() # variables
gg$closeTag() # data
gg$closeTag() # ggobidata

# or gg$closeTag(3)
# or gg$closeTag("ggobidata")

cat(saveXML(gg))