Learn R Programming

XiMpLe (version 0.03-21)

XMLNode: Constructor function for XiMpLe.node objects

Description

Can be used to create XML nodes.

Usage

XMLNode(name, ..., attrs = NULL, namespace = "",
    namespaceDefinitions = NULL, .children = list(...))

is.XiMpLe.node(x)

Arguments

name
Character string, the tag name.
...
Optional children for the tag. Must be either objects of class XiMpLe.node or character strings, which are treated as simple text values. If this is empty, the tag will be treated as an empty tag. To force a closing tag, supply an empty string, i.
attrs
An optional named list of attributes.
namespace
Currently ignored.
namespaceDefinitions
Currently ignored.
.children
Alternative way of specifying children, if you have them already as a list.
x
An arbitrary R object.

Value

Details

To generate a CDATA node, set name="![CDATA[", to create a comment, set name="!--".

See Also

XMLTree, pasteXML

Examples

Run this code
sample.XML.node <- XMLNode("a",
  attrs=list(href="http://example.com", target="_blank"),
  .children="klick here!")

Run the code above in your browser using DataLab