File: modify.rd

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 (140 lines) | stat: -rw-r--r-- 4,397 bytes parent folder | download | duplicates (11)
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
=begin

== BDB::XML::Modify

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. 

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. 

=== Methods

--- append(query, type, name, content, location = -1)

    Appends the provided data to the selected node's child nodes.
    
    : ((|query|)) 
      provides the Query expression used to target the 
      location in the document where the modification is to be performed.
    
    : ((|type|))
      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
    
    : ((|name|))
      the name of the node, attribute, or processing instruction
      to insert
    
    : ((|content|))
      The content to insert.
    
    : ((|location|)) 
      Identifies the position in the child node list
      where the provided content is to be inserted

--- insert_after(query, type, name, content)

    Inserts the provided data into the document after the selected node.
    
    : ((|query|))
      provides the Query expression used to target the 
      location in the document where the modification is to be performed.
    
    : ((|type|))
      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
    
    : ((|name|))
      the name of the node, attribute, or processing instruction
      to insert
    
    : ((|content|))
      The content to insert.
    

--- insert_before(query, type, name, content)

    Inserts the provided data into the document before the selected node.
    
    : ((|query|))
      provides the Query expression used to target the 
      location in the document where the modification is to be performed.
    
    : ((|type|))
      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
    
    : ((|name|))
      the name of the node, attribute, or processing instruction
      to insert
    
    : ((|content|))The content to insert.
    

--- remove(query)

    Removes the node targeted by the selection expression.
    
    : ((|query|))
      provides the Query expression used to target the 
      location in the document where the modification is to be performed.

--- rename(query, name)

    Renames an element node, attribute node, or processing instruction.
    
    : ((|query|))
      provides the Query expression used to target the 
      location in the document where the modification is to be performed.
    
    : ((|name|))
      The new name to give the targeted node.


--- update(query, content)

    Replaces the targeted node's content with text.
    
    : ((|query|)) 
      provides the Query expression used to target the 
      location in the document where the modification is to be performed.
    
    : ((|content|)) 
      The content to use as the targeted node's content.

--- execute(obj, context, update = nil)

    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.
    
    : ((|obj|))
      The object to modify using this collection of
      modification steps.
    
    : ((|context|))
      The XML::Context object to use for this modification.
    
    : ((|update|))
      The XML::Update object to use for this modification.

--- encoding = string

    Specify a new character encoding for the modified documents.
    


=end