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.
- data/CHANGES +18 -0
- data/RAKEFILE +15 -39
- data/README +48 -47
- data/ext/libxml/libxml.c +847 -22
- data/ext/libxml/ruby_libxml.h +71 -95
- data/ext/libxml/ruby_xml_attr.c +500 -500
- data/ext/libxml/ruby_xml_attributes.c +1 -1
- data/ext/libxml/ruby_xml_document.c +1144 -1135
- data/ext/libxml/ruby_xml_document.h +4 -11
- data/ext/libxml/ruby_xml_dtd.c +27 -0
- data/ext/libxml/ruby_xml_encoding.c +164 -0
- data/ext/libxml/ruby_xml_encoding.h +13 -0
- data/ext/libxml/ruby_xml_error.c +941 -0
- data/ext/libxml/ruby_xml_error.h +13 -0
- data/ext/libxml/ruby_xml_html_parser.c +71 -387
- data/ext/libxml/ruby_xml_html_parser.h +1 -17
- data/ext/libxml/ruby_xml_input.c +179 -0
- data/ext/libxml/ruby_xml_input.h +18 -0
- data/ext/libxml/ruby_xml_input_cbg.c +17 -3
- data/ext/libxml/ruby_xml_node.c +1566 -1582
- data/ext/libxml/ruby_xml_node.h +1 -4
- data/ext/libxml/ruby_xml_ns.c +14 -3
- data/ext/libxml/ruby_xml_parser.c +164 -1398
- data/ext/libxml/ruby_xml_parser.h +5 -17
- data/ext/libxml/ruby_xml_parser_context.c +131 -169
- data/ext/libxml/ruby_xml_parser_context.h +2 -9
- data/ext/libxml/ruby_xml_reader.c +910 -945
- data/ext/libxml/ruby_xml_relaxng.c +32 -3
- data/ext/libxml/ruby_xml_sax_parser.c +106 -364
- data/ext/libxml/ruby_xml_sax_parser.h +1 -37
- data/ext/libxml/ruby_xml_schema.c +174 -145
- data/ext/libxml/ruby_xml_xinclude.c +9 -5
- data/ext/libxml/ruby_xml_xpath.c +25 -6
- data/ext/libxml/ruby_xml_xpath.h +1 -2
- data/ext/libxml/ruby_xml_xpath_context.c +17 -19
- data/ext/libxml/ruby_xml_xpath_object.c +60 -56
- data/ext/libxml/ruby_xml_xpointer.c +11 -5
- data/ext/libxml/sax_parser_callbacks.inc +42 -37
- data/ext/libxml/version.h +3 -3
- data/ext/mingw/Rakefile +20 -27
- data/ext/mingw/build.rake +41 -0
- data/ext/vc/libxml_ruby.vcproj +23 -15
- data/lib/libxml.rb +8 -2
- data/lib/libxml/document.rb +16 -4
- data/lib/libxml/error.rb +84 -0
- data/lib/libxml/hpricot.rb +76 -0
- data/lib/libxml/html_parser.rb +61 -0
- data/lib/libxml/node.rb +36 -25
- data/lib/libxml/parser.rb +312 -33
- data/lib/libxml/parser_context.rb +17 -0
- data/lib/libxml/properties.rb +15 -2
- data/lib/libxml/reader.rb +15 -0
- data/lib/libxml/sax_callbacks.rb +179 -0
- data/lib/libxml/sax_parser.rb +42 -0
- data/lib/libxml/tree.rb +1 -2
- data/lib/libxml/xpath_object.rb +12 -0
- data/test/model/atom.xml +4 -0
- data/test/tc_attributes.rb +43 -19
- data/test/tc_document.rb +1 -1
- data/test/tc_document_write.rb +15 -8
- data/test/tc_dtd.rb +36 -20
- data/test/tc_encoding.rb +13 -0
- data/test/tc_error.rb +136 -0
- data/test/tc_node.rb +2 -3
- data/test/tc_node_copy.rb +1 -1
- data/test/tc_node_edit.rb +6 -0
- data/test/tc_ns.rb +18 -0
- data/test/tc_parser.rb +113 -228
- data/test/tc_parser_context.rb +1 -2
- data/test/tc_reader.rb +24 -14
- data/test/tc_relaxng.rb +18 -6
- data/test/tc_sax_parser.rb +48 -13
- data/test/tc_schema.rb +20 -8
- data/test/tc_well_formed.rb +2 -1
- data/test/tc_xml.rb +212 -0
- data/test/tc_xpath.rb +60 -46
- data/test/tc_xpointer.rb +7 -11
- data/test/test_suite.rb +4 -3
- metadata +26 -109
- data/doc/rdoc/classes/LibXML.html +0 -241
- data/doc/rdoc/classes/LibXML/XML.html +0 -185
- data/doc/rdoc/classes/LibXML/XML/Attr.html +0 -1010
- data/doc/rdoc/classes/LibXML/XML/Attributes.html +0 -526
- data/doc/rdoc/classes/LibXML/XML/Document.html +0 -1489
- data/doc/rdoc/classes/LibXML/XML/Dtd.html +0 -213
- data/doc/rdoc/classes/LibXML/XML/Error.html +0 -117
- data/doc/rdoc/classes/LibXML/XML/HTMLParser.html +0 -348
- data/doc/rdoc/classes/LibXML/XML/InputCallbacks.html +0 -160
- data/doc/rdoc/classes/LibXML/XML/NS.html +0 -381
- data/doc/rdoc/classes/LibXML/XML/Node.html +0 -3396
- data/doc/rdoc/classes/LibXML/XML/Node/FailedModify.html +0 -123
- data/doc/rdoc/classes/LibXML/XML/Node/Set.html +0 -440
- data/doc/rdoc/classes/LibXML/XML/Node/SetNamespace.html +0 -123
- data/doc/rdoc/classes/LibXML/XML/Node/UnknownType.html +0 -123
- data/doc/rdoc/classes/LibXML/XML/Parser.html +0 -2239
- data/doc/rdoc/classes/LibXML/XML/Parser/Context.html +0 -1255
- data/doc/rdoc/classes/LibXML/XML/Parser/ParseError.html +0 -123
- data/doc/rdoc/classes/LibXML/XML/Reader.html +0 -2264
- data/doc/rdoc/classes/LibXML/XML/RelaxNG.html +0 -237
- data/doc/rdoc/classes/LibXML/XML/SaxParser.html +0 -415
- data/doc/rdoc/classes/LibXML/XML/Schema.html +0 -308
- data/doc/rdoc/classes/LibXML/XML/State.html +0 -124
- data/doc/rdoc/classes/LibXML/XML/Tree.html +0 -111
- data/doc/rdoc/classes/LibXML/XML/XInclude.html +0 -123
- data/doc/rdoc/classes/LibXML/XML/XInclude/Error.html +0 -117
- data/doc/rdoc/classes/LibXML/XML/XMLParserOptions.html +0 -198
- data/doc/rdoc/classes/LibXML/XML/XPath.html +0 -184
- data/doc/rdoc/classes/LibXML/XML/XPath/Context.html +0 -404
- data/doc/rdoc/classes/LibXML/XML/XPath/InvalidPath.html +0 -172
- data/doc/rdoc/classes/LibXML/XML/XPath/Object.html +0 -627
- data/doc/rdoc/classes/LibXML/XML/XPointer.html +0 -170
- data/doc/rdoc/classes/LibXML/XML/XPointer/Context.html +0 -123
- data/doc/rdoc/classes/LibXML/XML/XPointer/Context/InvalidPath.html +0 -117
- data/doc/rdoc/classes/LibXML/XML/XPointer/InvalidExpression.html +0 -124
- data/doc/rdoc/classes/singleton.html +0 -114
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/CHANGES.html +0 -442
- data/doc/rdoc/files/LICENSE.html +0 -133
- data/doc/rdoc/files/README.html +0 -388
- data/doc/rdoc/files/VERSION.html +0 -107
- data/doc/rdoc/files/ext/libxml/cbg_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/libxml_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_attr_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_attributes_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_document_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_dtd_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_html_parser_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_input_cbg_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_node_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_node_set_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_ns_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_parser_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_parser_context_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_reader_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_relaxng_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_sax_parser_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_schema_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_state_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_xinclude_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_context_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_object_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpointer_c.html +0 -101
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpointer_context_c.html +0 -101
- data/doc/rdoc/files/lib/libxml/attr_rb.html +0 -108
- data/doc/rdoc/files/lib/libxml/attributes_rb.html +0 -108
- data/doc/rdoc/files/lib/libxml/document_rb.html +0 -108
- data/doc/rdoc/files/lib/libxml/node_rb.html +0 -108
- data/doc/rdoc/files/lib/libxml/node_set_rb.html +0 -108
- data/doc/rdoc/files/lib/libxml/parser_options_rb.html +0 -107
- data/doc/rdoc/files/lib/libxml/parser_rb.html +0 -101
- data/doc/rdoc/files/lib/libxml/properties_rb.html +0 -108
- data/doc/rdoc/files/lib/libxml/tree_rb.html +0 -107
- data/doc/rdoc/files/lib/libxml_rb.html +0 -124
- data/doc/rdoc/files/lib/xml/libxml_rb.html +0 -124
- data/doc/rdoc/files/lib/xml_rb.html +0 -134
- data/doc/rdoc/fr_class_index.html +0 -62
- data/doc/rdoc/fr_file_index.html +0 -66
- data/doc/rdoc/fr_method_index.html +0 -392
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
- data/ext/libxml/ruby_xml_node_set.c +0 -172
- data/ext/libxml/ruby_xml_node_set.h +0 -20
- data/ext/libxml/ruby_xml_xpointer_context.c +0 -22
- data/ext/libxml/ruby_xml_xpointer_context.h +0 -18
- data/lib/libxml/node_set.rb +0 -27
- data/test/tc_node_set.rb +0 -24
- 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(<some_file>)
|
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>
|
127
|
-
<a href="#M000234">[]=</a>
|
128
|
-
<a href="#M000235">each</a>
|
129
|
-
<a href="#M000237">first</a>
|
130
|
-
<a href="#M000231">get_attribute</a>
|
131
|
-
<a href="#M000232">get_attribute_ns</a>
|
132
|
-
<a href="#M000236">length</a>
|
133
|
-
<a href="#M000230">node</a>
|
134
|
-
<a href="#M000238">to_h</a>
|
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"] → 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'] -> '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["name"] -> 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'] -> '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["name"] = "value"
|
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} → 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} -> 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 → 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 -> 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") → 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("foo")
|
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("name") -> 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("foo")
|
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") → 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‘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("namespace", "name") -> 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 → 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 -> 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 → 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 -> 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>
|