libxml-ruby 0.8.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. data/CHANGES +18 -0
  2. data/RAKEFILE +15 -39
  3. data/README +48 -47
  4. data/ext/libxml/libxml.c +847 -22
  5. data/ext/libxml/ruby_libxml.h +71 -95
  6. data/ext/libxml/ruby_xml_attr.c +500 -500
  7. data/ext/libxml/ruby_xml_attributes.c +1 -1
  8. data/ext/libxml/ruby_xml_document.c +1144 -1135
  9. data/ext/libxml/ruby_xml_document.h +4 -11
  10. data/ext/libxml/ruby_xml_dtd.c +27 -0
  11. data/ext/libxml/ruby_xml_encoding.c +164 -0
  12. data/ext/libxml/ruby_xml_encoding.h +13 -0
  13. data/ext/libxml/ruby_xml_error.c +941 -0
  14. data/ext/libxml/ruby_xml_error.h +13 -0
  15. data/ext/libxml/ruby_xml_html_parser.c +71 -387
  16. data/ext/libxml/ruby_xml_html_parser.h +1 -17
  17. data/ext/libxml/ruby_xml_input.c +179 -0
  18. data/ext/libxml/ruby_xml_input.h +18 -0
  19. data/ext/libxml/ruby_xml_input_cbg.c +17 -3
  20. data/ext/libxml/ruby_xml_node.c +1566 -1582
  21. data/ext/libxml/ruby_xml_node.h +1 -4
  22. data/ext/libxml/ruby_xml_ns.c +14 -3
  23. data/ext/libxml/ruby_xml_parser.c +164 -1398
  24. data/ext/libxml/ruby_xml_parser.h +5 -17
  25. data/ext/libxml/ruby_xml_parser_context.c +131 -169
  26. data/ext/libxml/ruby_xml_parser_context.h +2 -9
  27. data/ext/libxml/ruby_xml_reader.c +910 -945
  28. data/ext/libxml/ruby_xml_relaxng.c +32 -3
  29. data/ext/libxml/ruby_xml_sax_parser.c +106 -364
  30. data/ext/libxml/ruby_xml_sax_parser.h +1 -37
  31. data/ext/libxml/ruby_xml_schema.c +174 -145
  32. data/ext/libxml/ruby_xml_xinclude.c +9 -5
  33. data/ext/libxml/ruby_xml_xpath.c +25 -6
  34. data/ext/libxml/ruby_xml_xpath.h +1 -2
  35. data/ext/libxml/ruby_xml_xpath_context.c +17 -19
  36. data/ext/libxml/ruby_xml_xpath_object.c +60 -56
  37. data/ext/libxml/ruby_xml_xpointer.c +11 -5
  38. data/ext/libxml/sax_parser_callbacks.inc +42 -37
  39. data/ext/libxml/version.h +3 -3
  40. data/ext/mingw/Rakefile +20 -27
  41. data/ext/mingw/build.rake +41 -0
  42. data/ext/vc/libxml_ruby.vcproj +23 -15
  43. data/lib/libxml.rb +8 -2
  44. data/lib/libxml/document.rb +16 -4
  45. data/lib/libxml/error.rb +84 -0
  46. data/lib/libxml/hpricot.rb +76 -0
  47. data/lib/libxml/html_parser.rb +61 -0
  48. data/lib/libxml/node.rb +36 -25
  49. data/lib/libxml/parser.rb +312 -33
  50. data/lib/libxml/parser_context.rb +17 -0
  51. data/lib/libxml/properties.rb +15 -2
  52. data/lib/libxml/reader.rb +15 -0
  53. data/lib/libxml/sax_callbacks.rb +179 -0
  54. data/lib/libxml/sax_parser.rb +42 -0
  55. data/lib/libxml/tree.rb +1 -2
  56. data/lib/libxml/xpath_object.rb +12 -0
  57. data/test/model/atom.xml +4 -0
  58. data/test/tc_attributes.rb +43 -19
  59. data/test/tc_document.rb +1 -1
  60. data/test/tc_document_write.rb +15 -8
  61. data/test/tc_dtd.rb +36 -20
  62. data/test/tc_encoding.rb +13 -0
  63. data/test/tc_error.rb +136 -0
  64. data/test/tc_node.rb +2 -3
  65. data/test/tc_node_copy.rb +1 -1
  66. data/test/tc_node_edit.rb +6 -0
  67. data/test/tc_ns.rb +18 -0
  68. data/test/tc_parser.rb +113 -228
  69. data/test/tc_parser_context.rb +1 -2
  70. data/test/tc_reader.rb +24 -14
  71. data/test/tc_relaxng.rb +18 -6
  72. data/test/tc_sax_parser.rb +48 -13
  73. data/test/tc_schema.rb +20 -8
  74. data/test/tc_well_formed.rb +2 -1
  75. data/test/tc_xml.rb +212 -0
  76. data/test/tc_xpath.rb +60 -46
  77. data/test/tc_xpointer.rb +7 -11
  78. data/test/test_suite.rb +4 -3
  79. metadata +26 -109
  80. data/doc/rdoc/classes/LibXML.html +0 -241
  81. data/doc/rdoc/classes/LibXML/XML.html +0 -185
  82. data/doc/rdoc/classes/LibXML/XML/Attr.html +0 -1010
  83. data/doc/rdoc/classes/LibXML/XML/Attributes.html +0 -526
  84. data/doc/rdoc/classes/LibXML/XML/Document.html +0 -1489
  85. data/doc/rdoc/classes/LibXML/XML/Dtd.html +0 -213
  86. data/doc/rdoc/classes/LibXML/XML/Error.html +0 -117
  87. data/doc/rdoc/classes/LibXML/XML/HTMLParser.html +0 -348
  88. data/doc/rdoc/classes/LibXML/XML/InputCallbacks.html +0 -160
  89. data/doc/rdoc/classes/LibXML/XML/NS.html +0 -381
  90. data/doc/rdoc/classes/LibXML/XML/Node.html +0 -3396
  91. data/doc/rdoc/classes/LibXML/XML/Node/FailedModify.html +0 -123
  92. data/doc/rdoc/classes/LibXML/XML/Node/Set.html +0 -440
  93. data/doc/rdoc/classes/LibXML/XML/Node/SetNamespace.html +0 -123
  94. data/doc/rdoc/classes/LibXML/XML/Node/UnknownType.html +0 -123
  95. data/doc/rdoc/classes/LibXML/XML/Parser.html +0 -2239
  96. data/doc/rdoc/classes/LibXML/XML/Parser/Context.html +0 -1255
  97. data/doc/rdoc/classes/LibXML/XML/Parser/ParseError.html +0 -123
  98. data/doc/rdoc/classes/LibXML/XML/Reader.html +0 -2264
  99. data/doc/rdoc/classes/LibXML/XML/RelaxNG.html +0 -237
  100. data/doc/rdoc/classes/LibXML/XML/SaxParser.html +0 -415
  101. data/doc/rdoc/classes/LibXML/XML/Schema.html +0 -308
  102. data/doc/rdoc/classes/LibXML/XML/State.html +0 -124
  103. data/doc/rdoc/classes/LibXML/XML/Tree.html +0 -111
  104. data/doc/rdoc/classes/LibXML/XML/XInclude.html +0 -123
  105. data/doc/rdoc/classes/LibXML/XML/XInclude/Error.html +0 -117
  106. data/doc/rdoc/classes/LibXML/XML/XMLParserOptions.html +0 -198
  107. data/doc/rdoc/classes/LibXML/XML/XPath.html +0 -184
  108. data/doc/rdoc/classes/LibXML/XML/XPath/Context.html +0 -404
  109. data/doc/rdoc/classes/LibXML/XML/XPath/InvalidPath.html +0 -172
  110. data/doc/rdoc/classes/LibXML/XML/XPath/Object.html +0 -627
  111. data/doc/rdoc/classes/LibXML/XML/XPointer.html +0 -170
  112. data/doc/rdoc/classes/LibXML/XML/XPointer/Context.html +0 -123
  113. data/doc/rdoc/classes/LibXML/XML/XPointer/Context/InvalidPath.html +0 -117
  114. data/doc/rdoc/classes/LibXML/XML/XPointer/InvalidExpression.html +0 -124
  115. data/doc/rdoc/classes/singleton.html +0 -114
  116. data/doc/rdoc/created.rid +0 -1
  117. data/doc/rdoc/files/CHANGES.html +0 -442
  118. data/doc/rdoc/files/LICENSE.html +0 -133
  119. data/doc/rdoc/files/README.html +0 -388
  120. data/doc/rdoc/files/VERSION.html +0 -107
  121. data/doc/rdoc/files/ext/libxml/cbg_c.html +0 -101
  122. data/doc/rdoc/files/ext/libxml/libxml_c.html +0 -101
  123. data/doc/rdoc/files/ext/libxml/ruby_xml_attr_c.html +0 -101
  124. data/doc/rdoc/files/ext/libxml/ruby_xml_attributes_c.html +0 -101
  125. data/doc/rdoc/files/ext/libxml/ruby_xml_document_c.html +0 -101
  126. data/doc/rdoc/files/ext/libxml/ruby_xml_dtd_c.html +0 -101
  127. data/doc/rdoc/files/ext/libxml/ruby_xml_html_parser_c.html +0 -101
  128. data/doc/rdoc/files/ext/libxml/ruby_xml_input_cbg_c.html +0 -101
  129. data/doc/rdoc/files/ext/libxml/ruby_xml_node_c.html +0 -101
  130. data/doc/rdoc/files/ext/libxml/ruby_xml_node_set_c.html +0 -101
  131. data/doc/rdoc/files/ext/libxml/ruby_xml_ns_c.html +0 -101
  132. data/doc/rdoc/files/ext/libxml/ruby_xml_parser_c.html +0 -101
  133. data/doc/rdoc/files/ext/libxml/ruby_xml_parser_context_c.html +0 -101
  134. data/doc/rdoc/files/ext/libxml/ruby_xml_reader_c.html +0 -101
  135. data/doc/rdoc/files/ext/libxml/ruby_xml_relaxng_c.html +0 -101
  136. data/doc/rdoc/files/ext/libxml/ruby_xml_sax_parser_c.html +0 -101
  137. data/doc/rdoc/files/ext/libxml/ruby_xml_schema_c.html +0 -101
  138. data/doc/rdoc/files/ext/libxml/ruby_xml_state_c.html +0 -101
  139. data/doc/rdoc/files/ext/libxml/ruby_xml_xinclude_c.html +0 -101
  140. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_c.html +0 -101
  141. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_context_c.html +0 -101
  142. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_object_c.html +0 -101
  143. data/doc/rdoc/files/ext/libxml/ruby_xml_xpointer_c.html +0 -101
  144. data/doc/rdoc/files/ext/libxml/ruby_xml_xpointer_context_c.html +0 -101
  145. data/doc/rdoc/files/lib/libxml/attr_rb.html +0 -108
  146. data/doc/rdoc/files/lib/libxml/attributes_rb.html +0 -108
  147. data/doc/rdoc/files/lib/libxml/document_rb.html +0 -108
  148. data/doc/rdoc/files/lib/libxml/node_rb.html +0 -108
  149. data/doc/rdoc/files/lib/libxml/node_set_rb.html +0 -108
  150. data/doc/rdoc/files/lib/libxml/parser_options_rb.html +0 -107
  151. data/doc/rdoc/files/lib/libxml/parser_rb.html +0 -101
  152. data/doc/rdoc/files/lib/libxml/properties_rb.html +0 -108
  153. data/doc/rdoc/files/lib/libxml/tree_rb.html +0 -107
  154. data/doc/rdoc/files/lib/libxml_rb.html +0 -124
  155. data/doc/rdoc/files/lib/xml/libxml_rb.html +0 -124
  156. data/doc/rdoc/files/lib/xml_rb.html +0 -134
  157. data/doc/rdoc/fr_class_index.html +0 -62
  158. data/doc/rdoc/fr_file_index.html +0 -66
  159. data/doc/rdoc/fr_method_index.html +0 -392
  160. data/doc/rdoc/index.html +0 -24
  161. data/doc/rdoc/rdoc-style.css +0 -208
  162. data/ext/libxml/ruby_xml_node_set.c +0 -172
  163. data/ext/libxml/ruby_xml_node_set.h +0 -20
  164. data/ext/libxml/ruby_xml_xpointer_context.c +0 -22
  165. data/ext/libxml/ruby_xml_xpointer_context.h +0 -18
  166. data/lib/libxml/node_set.rb +0 -27
  167. data/test/tc_node_set.rb +0 -24
  168. data/test/tc_node_set2.rb +0 -37
@@ -1,526 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: LibXML::XML::Attributes</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">LibXML::XML::Attributes</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../../files/ext/libxml/libxml_c.html">
59
- ext/libxml/libxml.c
60
- </a>
61
- <br />
62
- <a href="../../../files/lib/libxml/attributes_rb.html">
63
- lib/libxml/attributes.rb
64
- </a>
65
- <br />
66
- </td>
67
- </tr>
68
-
69
- <tr class="top-aligned-row">
70
- <td><strong>Parent:</strong></td>
71
- <td>
72
- Object
73
- </td>
74
- </tr>
75
- </table>
76
- </div>
77
- <!-- banner header -->
78
-
79
- <div id="bodyContent">
80
-
81
-
82
-
83
- <div id="contextContent">
84
-
85
- <div id="description">
86
- <p>
87
- Provides access to an elements attributes (<a
88
- href="Attr.html">XML::Attr</a>).
89
- </p>
90
- <p>
91
- Basic Usage:
92
- </p>
93
- <pre>
94
- require 'xml'
95
-
96
- doc = XML::Document.new(&lt;some_file&gt;)
97
- attributes = doc.root.attributes
98
-
99
- attributes.each do |attribute|
100
- ..
101
- end
102
-
103
- attributes['foo'] = 'bar'
104
- attribute = attributes.get_attribute['foo']
105
- attribute.value == 'foo'
106
- </pre>
107
- <p>
108
- To access a namespaced attribute:
109
- </p>
110
- <pre>
111
- XLINK_URI = 'http://www.w3.org/1999/xlink'
112
-
113
- attribute = attributes.get_attribute_ns(XLINK_URI, 'title')
114
- attribute.value = 'My title'
115
- </pre>
116
-
117
- </div>
118
-
119
-
120
- </div>
121
-
122
- <div id="method-list">
123
- <h3 class="section-bar">Methods</h3>
124
-
125
- <div class="name-list">
126
- <a href="#M000233">[]</a>&nbsp;&nbsp;
127
- <a href="#M000234">[]=</a>&nbsp;&nbsp;
128
- <a href="#M000235">each</a>&nbsp;&nbsp;
129
- <a href="#M000237">first</a>&nbsp;&nbsp;
130
- <a href="#M000231">get_attribute</a>&nbsp;&nbsp;
131
- <a href="#M000232">get_attribute_ns</a>&nbsp;&nbsp;
132
- <a href="#M000236">length</a>&nbsp;&nbsp;
133
- <a href="#M000230">node</a>&nbsp;&nbsp;
134
- <a href="#M000238">to_h</a>&nbsp;&nbsp;
135
- </div>
136
- </div>
137
-
138
- </div>
139
-
140
-
141
- <!-- if includes -->
142
- <div id="includes">
143
- <h3 class="section-bar">Included Modules</h3>
144
-
145
- <div id="includes-list">
146
- <span class="include-name">Enumerable</span>
147
- </div>
148
- </div>
149
-
150
- <div id="section">
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
- <!-- if method_list -->
160
- <div id="methods">
161
- <h3 class="section-bar">Public Instance methods</h3>
162
-
163
- <div id="method-M000233" class="method-detail">
164
- <a name="M000233"></a>
165
-
166
- <div class="method-heading">
167
- <a href="#M000233" class="method-signature">
168
- <span class="method-name">attributes["name"] &rarr; String<br />
169
- </span>
170
- </a>
171
- </div>
172
-
173
- <div class="method-description">
174
- <p>
175
- Fetches an attribute value. If you want to access the underlying Attribute
176
- itself use <a href="Attributes.html#M000231">get_attribute</a>.
177
- </p>
178
- <p>
179
- name: The name of the attribute, not including any namespaces.
180
- </p>
181
- <pre>
182
- doc.root.attributes['att'] -&gt; 'some value'
183
- </pre>
184
- <p><a class="source-toggle" href="#"
185
- onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
186
- <div class="method-source-code" id="M000233-source">
187
- <pre>
188
- /*
189
- * call-seq:
190
- * attributes[&quot;name&quot;] -&gt; String
191
- *
192
- * Fetches an attribute value. If you want to access the underlying
193
- * Attribute itself use get_attribute.
194
- *
195
- * name: The name of the attribute, not including any namespaces.
196
- *
197
- * doc.root.attributes['att'] -&gt; 'some value'
198
- */
199
- VALUE
200
- ruby_xml_attributes_attribute_get(VALUE self, VALUE name) {
201
-
202
- </pre>
203
- </div>
204
- </div>
205
- </div>
206
-
207
- <div id="method-M000234" class="method-detail">
208
- <a name="M000234"></a>
209
-
210
- <div class="method-heading">
211
- <a href="#M000234" class="method-signature">
212
- <span class="method-name">attributes["name"] = "value"<br />
213
- </span>
214
- </a>
215
- </div>
216
-
217
- <div class="method-description">
218
- <p>
219
- Sets an attribute value. If you want to get the Attribute itself, use <a
220
- href="Attributes.html#M000231">get_attribute</a>.
221
- </p>
222
- <p>
223
- name: The name of the attribute, not including any namespaces. value: The
224
- new value of the namespace.
225
- </p>
226
- <pre>
227
- doc.root.attributes['att'] = 'some value'
228
- </pre>
229
- <p><a class="source-toggle" href="#"
230
- onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
231
- <div class="method-source-code" id="M000234-source">
232
- <pre>
233
- /*
234
- * call-seq:
235
- * attributes[&quot;name&quot;] = &quot;value&quot;
236
- *
237
- * Sets an attribute value. If you want to get the Attribute itself,
238
- * use get_attribute.
239
- *
240
- * name: The name of the attribute, not including any namespaces.
241
- * value: The new value of the namespace.
242
- *
243
- * doc.root.attributes['att'] = 'some value'
244
- */
245
- VALUE
246
- ruby_xml_attributes_attribute_set(VALUE self, VALUE name, VALUE value) {
247
-
248
- </pre>
249
- </div>
250
- </div>
251
- </div>
252
-
253
- <div id="method-M000235" class="method-detail">
254
- <a name="M000235"></a>
255
-
256
- <div class="method-heading">
257
- <a href="#M000235" class="method-signature">
258
- <span class="method-name">attributes.each {block} &rarr; XML::Attr<br />
259
- </span>
260
- </a>
261
- </div>
262
-
263
- <div class="method-description">
264
- <p>
265
- Iterates over <a href="Attributes.html#M000235">each</a> attribute.
266
- </p>
267
- <pre>
268
- doc.root.attributes.each {|attribute| puts attribute.name}
269
- </pre>
270
- <p><a class="source-toggle" href="#"
271
- onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
272
- <div class="method-source-code" id="M000235-source">
273
- <pre>
274
- /*
275
- * call-seq:
276
- * attributes.each {block} -&gt; XML::Attr
277
- *
278
- * Iterates over each attribute.
279
- *
280
- * doc.root.attributes.each {|attribute| puts attribute.name}
281
- */
282
- VALUE
283
- ruby_xml_attributes_each(VALUE self) {
284
-
285
- </pre>
286
- </div>
287
- </div>
288
- </div>
289
-
290
- <div id="method-M000237" class="method-detail">
291
- <a name="M000237"></a>
292
-
293
- <div class="method-heading">
294
- <a href="#M000237" class="method-signature">
295
- <span class="method-name">attributes.first &rarr; XML::Attr<br />
296
- </span>
297
- </a>
298
- </div>
299
-
300
- <div class="method-description">
301
- <p>
302
- Returns the <a href="Attributes.html#M000237">first</a> attribute.
303
- </p>
304
- <pre>
305
- doc.root.attributes.first
306
- </pre>
307
- <p><a class="source-toggle" href="#"
308
- onclick="toggleCode('M000237-source');return false;">[Source]</a></p>
309
- <div class="method-source-code" id="M000237-source">
310
- <pre>
311
- /*
312
- * call-seq:
313
- * attributes.first -&gt; XML::Attr
314
- *
315
- * Returns the first attribute.
316
- *
317
- * doc.root.attributes.first
318
- */
319
- VALUE
320
- ruby_xml_attributes_first(VALUE self) {
321
-
322
- </pre>
323
- </div>
324
- </div>
325
- </div>
326
-
327
- <div id="method-M000231" class="method-detail">
328
- <a name="M000231"></a>
329
-
330
- <div class="method-heading">
331
- <a href="#M000231" class="method-signature">
332
- <span class="method-name">attributes.get_attribute("name") &rarr; XML::Attr<br />
333
- </span>
334
- </a>
335
- </div>
336
-
337
- <div class="method-description">
338
- <p>
339
- Returns the specified attribute.
340
- </p>
341
- <p>
342
- name: The name of the attribute, not including a namespace.
343
- </p>
344
- <pre>
345
- doc.root.attributes.get_attribute(&quot;foo&quot;)
346
- </pre>
347
- <p><a class="source-toggle" href="#"
348
- onclick="toggleCode('M000231-source');return false;">[Source]</a></p>
349
- <div class="method-source-code" id="M000231-source">
350
- <pre>
351
- /*
352
- * call-seq:
353
- * attributes.get_attribute(&quot;name&quot;) -&gt; XML::Attr
354
- *
355
- * Returns the specified attribute.
356
- *
357
- * name: The name of the attribute, not including a namespace.
358
- *
359
- * doc.root.attributes.get_attribute(&quot;foo&quot;)
360
- */
361
- VALUE
362
- ruby_xml_attributes_get_attribute(VALUE self, VALUE name) {
363
-
364
- </pre>
365
- </div>
366
- </div>
367
- </div>
368
-
369
- <div id="method-M000232" class="method-detail">
370
- <a name="M000232"></a>
371
-
372
- <div class="method-heading">
373
- <a href="#M000232" class="method-signature">
374
- <span class="method-name">attributes.get_attribute_ns("namespace", "name") &rarr; XML::Attr<br />
375
- </span>
376
- </a>
377
- </div>
378
-
379
- <div class="method-description">
380
- <p>
381
- Returns the specified attribute.
382
- </p>
383
- <p>
384
- namespace: The URI of the attribute&#8216;s namespace. name: The name of
385
- the attribute, not including a namespace.
386
- </p>
387
- <pre>
388
- doc.root.attributes.get_attribute_ns('http://www.w3.org/1999/xlink', 'href')
389
- </pre>
390
- <p><a class="source-toggle" href="#"
391
- onclick="toggleCode('M000232-source');return false;">[Source]</a></p>
392
- <div class="method-source-code" id="M000232-source">
393
- <pre>
394
- /*
395
- * call-seq:
396
- * attributes.get_attribute_ns(&quot;namespace&quot;, &quot;name&quot;) -&gt; XML::Attr
397
- *
398
- * Returns the specified attribute.
399
- *
400
- * namespace: The URI of the attribute's namespace.
401
- * name: The name of the attribute, not including a namespace.
402
- *
403
- * doc.root.attributes.get_attribute_ns('http://www.w3.org/1999/xlink', 'href')
404
- */
405
- VALUE
406
- ruby_xml_attributes_get_attribute_ns(VALUE self, VALUE namespace, VALUE name) {
407
-
408
- </pre>
409
- </div>
410
- </div>
411
- </div>
412
-
413
- <div id="method-M000236" class="method-detail">
414
- <a name="M000236"></a>
415
-
416
- <div class="method-heading">
417
- <a href="#M000236" class="method-signature">
418
- <span class="method-name">attributes.length &rarr; Integer<br />
419
- </span>
420
- </a>
421
- </div>
422
-
423
- <div class="method-description">
424
- <p>
425
- Returns the number of attributes.
426
- </p>
427
- <pre>
428
- doc.root.attributes.length
429
- </pre>
430
- <p><a class="source-toggle" href="#"
431
- onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
432
- <div class="method-source-code" id="M000236-source">
433
- <pre>
434
- /*
435
- * call-seq:
436
- * attributes.length -&gt; Integer
437
- *
438
- * Returns the number of attributes.
439
- *
440
- * doc.root.attributes.length
441
- */
442
- VALUE
443
- ruby_xml_attributes_length(VALUE self) {
444
-
445
- </pre>
446
- </div>
447
- </div>
448
- </div>
449
-
450
- <div id="method-M000230" class="method-detail">
451
- <a name="M000230"></a>
452
-
453
- <div class="method-heading">
454
- <a href="#M000230" class="method-signature">
455
- <span class="method-name">attributes.node &rarr; XML::Node<br />
456
- </span>
457
- </a>
458
- </div>
459
-
460
- <div class="method-description">
461
- <p>
462
- Return the <a href="Attributes.html#M000230">node</a> that owns this
463
- attributes list.
464
- </p>
465
- <pre>
466
- doc.root.attributes.node == doc.root
467
- </pre>
468
- <p><a class="source-toggle" href="#"
469
- onclick="toggleCode('M000230-source');return false;">[Source]</a></p>
470
- <div class="method-source-code" id="M000230-source">
471
- <pre>
472
- /*
473
- * call-seq:
474
- * attributes.node -&gt; XML::Node
475
- *
476
- * Return the node that owns this attributes list.
477
- *
478
- * doc.root.attributes.node == doc.root
479
- */
480
- VALUE
481
- ruby_xml_attributes_node_get(VALUE self) {
482
-
483
- </pre>
484
- </div>
485
- </div>
486
- </div>
487
-
488
- <div id="method-M000238" class="method-detail">
489
- <a name="M000238"></a>
490
-
491
- <div class="method-heading">
492
- <a href="#M000238" class="method-signature">
493
- <span class="method-name">to_h</span><span class="method-args">()</span>
494
- </a>
495
- </div>
496
-
497
- <div class="method-description">
498
- <p><a class="source-toggle" href="#"
499
- onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
500
- <div class="method-source-code" id="M000238-source">
501
- <pre>
502
- <span class="ruby-comment cmt"># File lib/libxml/attributes.rb, line 7</span>
503
- 7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h</span>
504
- 8: <span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hash</span>, <span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
505
- 9: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">attr</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">value</span>
506
- 10: <span class="ruby-identifier">hash</span>
507
- 11: <span class="ruby-keyword kw">end</span>
508
- 12: <span class="ruby-keyword kw">end</span>
509
- </pre>
510
- </div>
511
- </div>
512
- </div>
513
-
514
-
515
- </div>
516
-
517
-
518
- </div>
519
-
520
-
521
- <div id="validator-badges">
522
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
523
- </div>
524
-
525
- </body>
526
- </html>