XMLGetters-methods: Getter/setter methods for S4 objects of XiMpLe XML classes

Description Usage Arguments Details See Also Examples

Description

Used to get/set certain slots from objects of class XiMpLe.doc and XiMpLe.node.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
XMLName(obj)

## S4 method for signature 'XiMpLe.node'
XMLName(obj)

XMLName(obj) <- value

## S4 replacement method for signature 'XiMpLe.node'
XMLName(obj) <- value

XMLAttrs(obj)

## S4 method for signature 'XiMpLe.node'
XMLAttrs(obj)

XMLAttrs(obj) <- value

## S4 replacement method for signature 'XiMpLe.node'
XMLAttrs(obj) <- value

XMLChildren(obj)

## S4 method for signature 'XiMpLe.node'
XMLChildren(obj)

## S4 method for signature 'XiMpLe.doc'
XMLChildren(obj)

XMLChildren(obj) <- value

## S4 replacement method for signature 'XiMpLe.node'
XMLChildren(obj) <- value

## S4 replacement method for signature 'XiMpLe.doc'
XMLChildren(obj) <- value

XMLValue(obj)

## S4 method for signature 'XiMpLe.node'
XMLValue(obj)

XMLValue(obj) <- value

## S4 replacement method for signature 'XiMpLe.node'
XMLValue(obj) <- value

XMLFile(obj)

## S4 method for signature 'XiMpLe.doc'
XMLFile(obj)

XMLFile(obj) <- value

## S4 replacement method for signature 'XiMpLe.doc'
XMLFile(obj) <- value

XMLDecl(obj)

## S4 method for signature 'XiMpLe.doc'
XMLDecl(obj)

XMLDecl(obj) <- value

## S4 replacement method for signature 'XiMpLe.doc'
XMLDecl(obj) <- value

XMLDTD(obj)

## S4 method for signature 'XiMpLe.doc'
XMLDTD(obj)

XMLDTD(obj) <- value

## S4 replacement method for signature 'XiMpLe.doc'
XMLDTD(obj) <- value

XMLScan(obj, name, as.list = FALSE)

## S4 method for signature 'XiMpLe.node'
XMLScan(obj, name, as.list = FALSE)

## S4 method for signature 'XiMpLe.doc'
XMLScan(obj, name, as.list = FALSE)

XMLScan(obj, name) <- value

## S4 replacement method for signature 'XiMpLe.node'
XMLScan(obj, name) <- value

## S4 replacement method for signature 'XiMpLe.doc'
XMLScan(obj, name) <- value

XMLScanDeep(obj, find = NULL, search = "attributes")

## S4 method for signature 'XiMpLe.node'
XMLScanDeep(obj, find = NULL, search = "attributes")

## S4 method for signature 'XiMpLe.doc'
XMLScanDeep(obj, find = NULL, search = "attributes")

Arguments

obj

An object of class XiMpLe.node or XiMpLe.doc

value

The new value to set.

name

Character, name of nodes to scan for.

as.list

Logical, if TRUE allways returns a list (or NULL), otherwise if exactly one result is found, it will be returned as as single XiMpLe.node.

find

Character, name of element to scan for.

search

Character, name of the slot to scan, one of "attributes", "name", or "value" for nodes.

Details

These are convenience methods to get or set slots from XML objects without using the @ operator.

Another special method can scan a node/document tree object for appearances of nodes with a particular name:

Finally, there is a method to scan for certain values in XiMpLe objects and just list them. For instance, it can be used to list all instances of a certain attribute type in a document tree:

See Also

node, XiMpLe.doc, XiMpLe.node

Examples

1
2
3
4
5
6
7
8
9
xmlTestNode <- XMLNode("foo", XMLNode("testchild"))
XMLName(xmlTestNode) # returns "foo"
XMLName(xmlTestNode) <- "bar"
XMLName(xmlTestNode) # now returns "bar"

# search for a child node
XMLScan(xmlTestNode, "testchild")
# remove nodes of that name
XMLScan(xmlTestNode, "testchild") <- NULL

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