XMLTree: Constructor function for XiMpLe.doc objects

Description Usage Arguments Value See Also Examples

View source: R/XMLTree.R

Description

Can be used to create full XML trees.

Usage

1
XMLTree(..., xml = NULL, dtd = NULL, .children = list(...))

Arguments

...

Optional children for the XML tree. Must be either objects of class XiMpLe.node or character strings, which are treated as simple text values.

xml

A named list, XML declaration of the XML tree. Currently just pasted, no checking is done.

dtd

A named list, doctype definition of the XML tree. Valid elements are doctype (root element), decl ("PUBLIC" or "SYSTEM"), id (the identifier) and refer (URI to .dtd). Currently just pasted, no checking is done.

.children

Alternative way of specifying children, if you have them already as a list.

Value

An object of class XiMpLe.doc

See Also

XMLNode, pasteXML

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sample.XML.a <- XMLNode("a",
  attrs=list(href="http://example.com", target="_blank"),
  .children="klick here!")
sample.XML.body <- XMLNode("body", .children=list(sample.XML.a))
sample.XML.html <- XMLNode("html", .children=list(XMLNode("head", ""),
  sample.XML.body))
sample.XML.tree <- XMLTree(sample.XML.html,
  xml=list(version="1.0", encoding="UTF-8"),
  dtd=list(doctype="html", decl="PUBLIC",
    id="-//W3C//DTD XHTML 1.0 Transitional//EN",
    refer="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"))

Example output



XiMpLe documentation built on Dec. 13, 2017, 1:04 a.m.