XMLNode {XiMpLe} | R Documentation |
Constructor function for XiMpLe_node
objects
Description
Can be used to create XML nodes.
Usage
XMLNode(
tag_name,
...,
attrs,
shine,
namespace,
namespaceDefinitions,
.children = list(...)
)
Arguments
tag_name |
Character string, the tag name. |
... |
Optional children for the tag. Must be either objects of class |
attrs |
An optional named list of attributes. Will be appended to attributes already defined in
the |
shine |
A numeric integer value between 0 and 2,
overwriting the |
namespace |
Currently ignored. |
namespaceDefinitions |
Currently ignored. |
.children |
Alternative way of specifying children,
if you have them already as a list.
This argument completely replaces values defined in the |
Details
To generate a CDATA node, set tag_name="![CDATA["
, to create a comment,
set tag_name="!--"
.
Note that all defined attributes will silently be dropped if a text node, CDATA node or comment is generated.
Value
An object of class XiMpLe_node
.
See Also
Examples
(sample.XML.node <- XMLNode("a",
attrs=list(
href="http://example.com",
target="_blank"
),
.children="klick here!"
))
# This is equivalent
(sample.XML.node2 <- XMLNode("a",
"klick here!",
href="http://example.com",
target="_blank"
))
# As is this
(sample.XML.node3 <- XMLNode("a",
.children=list(
"klick here!",
href="http://example.com",
target="_blank"
)
))