File: modify.html

package info (click to toggle)
libdb-ruby 0.6.5-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,596 kB
  • ctags: 3,978
  • sloc: ansic: 13,984; cpp: 8,739; ruby: 7,864; sh: 47; makefile: 6
file content (167 lines) | stat: -rw-r--r-- 7,199 bytes parent folder | download | duplicates (10)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?xml version="1.0" ?>
<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>docs/modify.rd</title>
</head>
<body>
<h2><a name="label-0" id="label-0">BDB::XML::Modify</a></h2><!-- RDLabel: "BDB::XML::Modify" -->
<p>The XML::Modify class encapsulates the context within which a set of one
or more documents specified by an XML::Query query can be modified in
place. The modification is performed using an XML::Modify object, and a
series of methods off that object that identify how the document is to
be modified. Using these methods, the modification steps are
identified. When the object is executed, these steps are performed in
the order that they were specified. </p>
<p>The modification steps are executed against one or more documents
using XML::Modify::execute. This method can operate on a single document
stored in an XML::Value, or against multiple documents stored in an
XML::Results set that was created as the result of a container or
document query. </p>
<h3><a name="label-1" id="label-1">Methods</a></h3><!-- RDLabel: "Methods" -->
<dl>
<dt><a name="label-2" id="label-2"><code>append(<var>query</var>, <var>type</var>, <var>name</var>, <var>content</var>, <var>location</var> = -<var>1</var>)</code></a></dt><!-- RDLabel: "append" -->
<dd>
Appends the provided data to the selected node's child nodes.
<dl>
<dt><a name="label-3" id="label-3"><var>query</var></a></dt><!-- RDLabel: "query" -->
<dd>
provides the Query expression used to target the 
location in the document where the modification is to be performed.
</dd>
<dt><a name="label-4" id="label-4"><var>type</var></a></dt><!-- RDLabel: "type" -->
<dd>
Identifies the type of information to be inserted.
It can have the value XML::Modify::Element, XML::Modify::Attribute,
XML::Modify::Text, XML::Modify::Comment, orXML::Modify::PI
</dd>
<dt><a name="label-5" id="label-5"><var>name</var></a></dt><!-- RDLabel: "name" -->
<dd>
the name of the node, attribute, or processing instruction
to insert
</dd>
<dt><a name="label-6" id="label-6"><var>content</var></a></dt><!-- RDLabel: "content" -->
<dd>
The content to insert.
</dd>
<dt><a name="label-7" id="label-7"><var>location</var></a></dt><!-- RDLabel: "location" -->
<dd>
Identifies the position in the child node list
where the provided content is to be inserted
</dd>
</dl></dd>
<dt><a name="label-8" id="label-8"><code>insert_after(<var>query</var>, <var>type</var>, <var>name</var>, <var>content</var>)</code></a></dt><!-- RDLabel: "insert_after" -->
<dd>
Inserts the provided data into the document after the selected node.
<dl>
<dt><a name="label-9" id="label-9"><var>query</var></a></dt><!-- RDLabel: "query" -->
<dd>
provides the Query expression used to target the 
location in the document where the modification is to be performed.
</dd>
<dt><a name="label-10" id="label-10"><var>type</var></a></dt><!-- RDLabel: "type" -->
<dd>
Identifies the type of information to be inserted.
It can have the value XML::Modify::Element, XML::Modify::Attribute,
XML::Modify::Text, XML::Modify::Comment, orXML::Modify::PI
</dd>
<dt><a name="label-11" id="label-11"><var>name</var></a></dt><!-- RDLabel: "name" -->
<dd>
the name of the node, attribute, or processing instruction
to insert
</dd>
<dt><a name="label-12" id="label-12"><var>content</var></a></dt><!-- RDLabel: "content" -->
<dd>
The content to insert.
</dd>
</dl></dd>
<dt><a name="label-13" id="label-13"><code>insert_before(<var>query</var>, <var>type</var>, <var>name</var>, <var>content</var>)</code></a></dt><!-- RDLabel: "insert_before" -->
<dd>
Inserts the provided data into the document before the selected node.
<dl>
<dt><a name="label-14" id="label-14"><var>query</var></a></dt><!-- RDLabel: "query" -->
<dd>
provides the Query expression used to target the 
location in the document where the modification is to be performed.
</dd>
<dt><a name="label-15" id="label-15"><var>type</var></a></dt><!-- RDLabel: "type" -->
<dd>
Identifies the type of information to be inserted.
It can have the value XML::Modify::Element, XML::Modify::Attribute,
XML::Modify::Text, XML::Modify::Comment, orXML::Modify::PI
</dd>
<dt><a name="label-16" id="label-16"><var>name</var></a></dt><!-- RDLabel: "name" -->
<dd>
the name of the node, attribute, or processing instruction
to insert
</dd>
<dt><a name="label-17" id="label-17"><var>content</var>The content to insert.</a></dt><!-- RDLabel: "contentThe content to insert." -->
</dl></dd>
<dt><a name="label-18" id="label-18"><code>remove(<var>query</var>)</code></a></dt><!-- RDLabel: "remove" -->
<dd>
Removes the node targeted by the selection expression.
<dl>
<dt><a name="label-19" id="label-19"><var>query</var></a></dt><!-- RDLabel: "query" -->
<dd>
provides the Query expression used to target the 
location in the document where the modification is to be performed.
</dd>
</dl></dd>
<dt><a name="label-20" id="label-20"><code>rename(<var>query</var>, <var>name</var>)</code></a></dt><!-- RDLabel: "rename" -->
<dd>
Renames an element node, attribute node, or processing instruction.
<dl>
<dt><a name="label-21" id="label-21"><var>query</var></a></dt><!-- RDLabel: "query" -->
<dd>
provides the Query expression used to target the 
location in the document where the modification is to be performed.
</dd>
<dt><a name="label-22" id="label-22"><var>name</var></a></dt><!-- RDLabel: "name" -->
<dd>
The new name to give the targeted node.
</dd>
</dl></dd>
<dt><a name="label-23" id="label-23"><code>update(<var>query</var>, <var>content</var>)</code></a></dt><!-- RDLabel: "update" -->
<dd>
Replaces the targeted node's content with text.
<dl>
<dt><a name="label-24" id="label-24"><var>query</var></a></dt><!-- RDLabel: "query" -->
<dd>
provides the Query expression used to target the 
location in the document where the modification is to be performed.
</dd>
<dt><a name="label-25" id="label-25"><var>content</var></a></dt><!-- RDLabel: "content" -->
<dd>
The content to use as the targeted node's content.
</dd>
</dl></dd>
<dt><a name="label-26" id="label-26"><code>execute(<var>obj</var>, <var>context</var>, <var>update</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "execute" -->
<dd>
Executes one or more document modification operations (or steps) against
an XML::Results or XML::Value object. Upon completing the modification,
the modified document is automatically updated in the backing
XML::Container for you.
<dl>
<dt><a name="label-27" id="label-27"><var>obj</var></a></dt><!-- RDLabel: "obj" -->
<dd>
The object to modify using this collection of
modification steps.
</dd>
<dt><a name="label-28" id="label-28"><var>context</var></a></dt><!-- RDLabel: "context" -->
<dd>
The XML::Context object to use for this modification.
</dd>
<dt><a name="label-29" id="label-29"><var>update</var></a></dt><!-- RDLabel: "update" -->
<dd>
The XML::Update object to use for this modification.
</dd>
</dl></dd>
<dt><a name="label-30" id="label-30"><code>encoding = <var>string</var></code></a></dt><!-- RDLabel: "encoding = string" -->
<dd>
Specify a new character encoding for the modified documents.</dd>
</dl>

</body>
</html>