File: modify.rb

package info (click to toggle)
libdb-ruby 0.6.5-6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,612 kB
  • ctags: 3,979
  • sloc: ansic: 13,984; cpp: 8,739; ruby: 7,864; sh: 47; makefile: 8
file content (112 lines) | stat: -rw-r--r-- 4,450 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
# 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. 
class BDB::XML::Modify
   # Appends the provided data to the selected node's child nodes.
   #
   # * <em>query</em> provides the Query expression used to target the 
   #   location in the document where the modification is to be performed.
   #
   # * <em>type</em>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
   #
   # * <em>name</em>the name of the node, attribute, or processing instruction
   #   to insert
   #
   # * <em>content</em>The content to insert.
   #
   # * <em>location</em> Identifies the position in the child node list
   #   where the provided content is to be inserted
   def append(query, type, name, content, location = -1)
   end

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

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

   # Removes the node targeted by the selection expression.
   #
   # * <em>query</em> provides the Query expression used to target the 
   #   location in the document where the modification is to be performed.
   def remove(query)
   end

   # Renames an element node, attribute node, or processing instruction.
   #
   # * <em>query</em> provides the Query expression used to target the 
   #   location in the document where the modification is to be performed.
   #
   # * <em>name</em> The new name to give the targeted node.
   def rename(query, name)
   end


   # Replaces the targeted node's content with text.
   #
   # * <em>query</em> provides the Query expression used to target the 
   #   location in the document where the modification is to be performed.
   #
   # * <em>content</em> The content to use as the targeted node's content.
   def update(query, content)
   end

   # 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.
   #
   # * <em>obj</em>The object to modify using this collection of
   #   modification steps.
   #
   # * <em>context</em>The XML::Context object to use for this modification.
   #
   # * <em>update</em>The XML::Update object to use for this modification.
   def execute(obj, context, update = nil)
   end

   # Specify a new character encoding for the modified documents.
   #
   def  encoding=(string)
   end
end