| XiMpLe_node,-class {XiMpLe} | R Documentation |
Classes XiMpLe_node and XiMpLe.node (old)
Description
These classes are used to create DOM trees of XML documents,
like objects that are returned
by parseXMLTree.
Usage
is.XiMpLe.node(x)
is.XiMpLe_node(x)
as_XiMpLe_node(obj, extra = list(), version = 2)
## S4 method for signature 'XiMpLe.node'
as_XiMpLe_node(obj, extra = list(), version = 2)
Arguments
x |
An arbitrary |
obj |
An object of old class |
extra |
A list of values to set the |
version |
Integer numeric,
to set the |
Details
Class XiMpLe.node is the older one,
XiMpLe_node was introduced with XiMpLe 0.11-1. It has two new slots
(extra and version) that would have made it impossible to load old objects without issues. XiMpLe_node
inherits from XiMpLe.node. You can convert old objects into valid new ones using the as_XiMpLe_node method and
are also advised to do so,
as the XiMpLe.node class might become deprecated in future releases.
There are certain special values predefined for the name slot to easily create special XML elements:
name=""If the name is an empty character string, a pseudo node is created,
pasteXMLNodewill paste itsvalueas plain text.name="!--"Creates a comment tag, i.e., this will comment out all its
children.name="![CDATA["Creates a CDATA section and places all its
childrenin it.name="*![CDATA["Creates a CDATA section and places all its
childrenin it, where the CDATA markers are commented out by/* */, as is used for JavaScript in XHTML.
A contructor function XiMpLe_node(...) is available to be used instead of new("XiMpLe_node",
...).
There's also XiMpLe_node_old(...) to be used instead of new("XiMpLe.node",
...), but you should not use that any longer.
Slots
nameName of the node (i.e., the XML tag identifier). For special names see details.
attributesA list of named character values, representing the attributes of this node. Use
character()as value for empty attributes.childrenA list of further objects of class XiMpLe.node, representing child nodes of this node.
valuePlain text to be used as the enclosed value of this node. Set to
value=""if you want a childless node to be forced into an non-empty pair of start and end tags bypasteXMLNode.extraA named list that can be used to store additional information on a node (
XiMpLe_nodeonly). The only value with a noticeable effect as of now (version 2) is:shine:A numeric integer value between 0 and 2, overwriting the
shinevalue of, e.g.,pasteXMLfor this particular node.
versionA numeric integer, currently defaults to 2 (
XiMpLe_nodeonly). This is a version number that can be used in the future in combination with the addedextraslot. Should that get more supported values likeshinethat are interpreted by package methods, the version number will be increased and the differences documented here. You shouldn't set it manually.