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
data/doc/rdoc/index.html
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
5
|
-
|
6
|
-
<!--
|
7
|
-
|
8
|
-
LibXML
|
9
|
-
|
10
|
-
-->
|
11
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
12
|
-
<head>
|
13
|
-
<title>LibXML</title>
|
14
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
15
|
-
</head>
|
16
|
-
<frameset rows="20%, 80%">
|
17
|
-
<frameset cols="25%,35%,45%">
|
18
|
-
<frame src="fr_file_index.html" title="Files" name="Files" />
|
19
|
-
<frame src="fr_class_index.html" name="Classes" />
|
20
|
-
<frame src="fr_method_index.html" name="Methods" />
|
21
|
-
</frameset>
|
22
|
-
<frame src="files/README.html" name="docwin" />
|
23
|
-
</frameset>
|
24
|
-
</html>
|
data/doc/rdoc/rdoc-style.css
DELETED
@@ -1,208 +0,0 @@
|
|
1
|
-
|
2
|
-
body {
|
3
|
-
font-family: Verdana,Arial,Helvetica,sans-serif;
|
4
|
-
font-size: 90%;
|
5
|
-
margin: 0;
|
6
|
-
margin-left: 40px;
|
7
|
-
padding: 0;
|
8
|
-
background: white;
|
9
|
-
}
|
10
|
-
|
11
|
-
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
|
12
|
-
h1 { font-size: 150%; }
|
13
|
-
h2,h3,h4 { margin-top: 1em; }
|
14
|
-
|
15
|
-
a { background: #eef; color: #039; text-decoration: none; }
|
16
|
-
a:hover { background: #039; color: #eef; }
|
17
|
-
|
18
|
-
/* Override the base stylesheet's Anchor inside a table cell */
|
19
|
-
td > a {
|
20
|
-
background: transparent;
|
21
|
-
color: #039;
|
22
|
-
text-decoration: none;
|
23
|
-
}
|
24
|
-
|
25
|
-
/* and inside a section title */
|
26
|
-
.section-title > a {
|
27
|
-
background: transparent;
|
28
|
-
color: #eee;
|
29
|
-
text-decoration: none;
|
30
|
-
}
|
31
|
-
|
32
|
-
/* === Structural elements =================================== */
|
33
|
-
|
34
|
-
div#index {
|
35
|
-
margin: 0;
|
36
|
-
margin-left: -40px;
|
37
|
-
padding: 0;
|
38
|
-
font-size: 90%;
|
39
|
-
}
|
40
|
-
|
41
|
-
|
42
|
-
div#index a {
|
43
|
-
margin-left: 0.7em;
|
44
|
-
}
|
45
|
-
|
46
|
-
div#index .section-bar {
|
47
|
-
margin-left: 0px;
|
48
|
-
padding-left: 0.7em;
|
49
|
-
background: #ccc;
|
50
|
-
font-size: small;
|
51
|
-
}
|
52
|
-
|
53
|
-
|
54
|
-
div#classHeader, div#fileHeader {
|
55
|
-
width: auto;
|
56
|
-
color: white;
|
57
|
-
padding: 0.5em 1.5em 0.5em 1.5em;
|
58
|
-
margin: 0;
|
59
|
-
margin-left: -40px;
|
60
|
-
border-bottom: 3px solid #006;
|
61
|
-
}
|
62
|
-
|
63
|
-
div#classHeader a, div#fileHeader a {
|
64
|
-
background: inherit;
|
65
|
-
color: white;
|
66
|
-
}
|
67
|
-
|
68
|
-
div#classHeader td, div#fileHeader td {
|
69
|
-
background: inherit;
|
70
|
-
color: white;
|
71
|
-
}
|
72
|
-
|
73
|
-
|
74
|
-
div#fileHeader {
|
75
|
-
background: #057;
|
76
|
-
}
|
77
|
-
|
78
|
-
div#classHeader {
|
79
|
-
background: #048;
|
80
|
-
}
|
81
|
-
|
82
|
-
|
83
|
-
.class-name-in-header {
|
84
|
-
font-size: 180%;
|
85
|
-
font-weight: bold;
|
86
|
-
}
|
87
|
-
|
88
|
-
|
89
|
-
div#bodyContent {
|
90
|
-
padding: 0 1.5em 0 1.5em;
|
91
|
-
}
|
92
|
-
|
93
|
-
div#description {
|
94
|
-
padding: 0.5em 1.5em;
|
95
|
-
background: #efefef;
|
96
|
-
border: 1px dotted #999;
|
97
|
-
}
|
98
|
-
|
99
|
-
div#description h1,h2,h3,h4,h5,h6 {
|
100
|
-
color: #125;;
|
101
|
-
background: transparent;
|
102
|
-
}
|
103
|
-
|
104
|
-
div#validator-badges {
|
105
|
-
text-align: center;
|
106
|
-
}
|
107
|
-
div#validator-badges img { border: 0; }
|
108
|
-
|
109
|
-
div#copyright {
|
110
|
-
color: #333;
|
111
|
-
background: #efefef;
|
112
|
-
font: 0.75em sans-serif;
|
113
|
-
margin-top: 5em;
|
114
|
-
margin-bottom: 0;
|
115
|
-
padding: 0.5em 2em;
|
116
|
-
}
|
117
|
-
|
118
|
-
|
119
|
-
/* === Classes =================================== */
|
120
|
-
|
121
|
-
table.header-table {
|
122
|
-
color: white;
|
123
|
-
font-size: small;
|
124
|
-
}
|
125
|
-
|
126
|
-
.type-note {
|
127
|
-
font-size: small;
|
128
|
-
color: #DEDEDE;
|
129
|
-
}
|
130
|
-
|
131
|
-
.xxsection-bar {
|
132
|
-
background: #eee;
|
133
|
-
color: #333;
|
134
|
-
padding: 3px;
|
135
|
-
}
|
136
|
-
|
137
|
-
.section-bar {
|
138
|
-
color: #333;
|
139
|
-
border-bottom: 1px solid #999;
|
140
|
-
margin-left: -20px;
|
141
|
-
}
|
142
|
-
|
143
|
-
|
144
|
-
.section-title {
|
145
|
-
background: #79a;
|
146
|
-
color: #eee;
|
147
|
-
padding: 3px;
|
148
|
-
margin-top: 2em;
|
149
|
-
margin-left: -30px;
|
150
|
-
border: 1px solid #999;
|
151
|
-
}
|
152
|
-
|
153
|
-
.top-aligned-row { vertical-align: top }
|
154
|
-
.bottom-aligned-row { vertical-align: bottom }
|
155
|
-
|
156
|
-
/* --- Context section classes ----------------------- */
|
157
|
-
|
158
|
-
.context-row { }
|
159
|
-
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
|
160
|
-
.context-item-value { font-size: small; color: #448; }
|
161
|
-
.context-item-desc { color: #333; padding-left: 2em; }
|
162
|
-
|
163
|
-
/* --- Method classes -------------------------- */
|
164
|
-
.method-detail {
|
165
|
-
background: #efefef;
|
166
|
-
padding: 0;
|
167
|
-
margin-top: 0.5em;
|
168
|
-
margin-bottom: 1em;
|
169
|
-
border: 1px dotted #ccc;
|
170
|
-
}
|
171
|
-
.method-heading {
|
172
|
-
color: black;
|
173
|
-
background: #ccc;
|
174
|
-
border-bottom: 1px solid #666;
|
175
|
-
padding: 0.2em 0.5em 0 0.5em;
|
176
|
-
}
|
177
|
-
.method-signature { color: black; background: inherit; }
|
178
|
-
.method-name { font-weight: bold; }
|
179
|
-
.method-args { font-style: italic; }
|
180
|
-
.method-description { padding: 0 0.5em 0 0.5em; }
|
181
|
-
|
182
|
-
/* --- Source code sections -------------------- */
|
183
|
-
|
184
|
-
a.source-toggle { font-size: 90%; }
|
185
|
-
div.method-source-code {
|
186
|
-
background: #262626;
|
187
|
-
color: #ffdead;
|
188
|
-
margin: 1em;
|
189
|
-
padding: 0.5em;
|
190
|
-
border: 1px dashed #999;
|
191
|
-
overflow: hidden;
|
192
|
-
}
|
193
|
-
|
194
|
-
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
195
|
-
|
196
|
-
/* --- Ruby keyword styles --------------------- */
|
197
|
-
|
198
|
-
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
|
199
|
-
|
200
|
-
.ruby-constant { color: #7fffd4; background: transparent; }
|
201
|
-
.ruby-keyword { color: #00ffff; background: transparent; }
|
202
|
-
.ruby-ivar { color: #eedd82; background: transparent; }
|
203
|
-
.ruby-operator { color: #00ffee; background: transparent; }
|
204
|
-
.ruby-identifier { color: #ffdead; background: transparent; }
|
205
|
-
.ruby-node { color: #ffa07a; background: transparent; }
|
206
|
-
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
|
207
|
-
.ruby-regexp { color: #ffa07a; background: transparent; }
|
208
|
-
.ruby-value { color: #7fffd4; background: transparent; }
|
@@ -1,172 +0,0 @@
|
|
1
|
-
/* $Id: ruby_xml_node_set.c 461 2008-07-15 21:35:56Z cfis $ */
|
2
|
-
|
3
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
4
|
-
|
5
|
-
#include "ruby_libxml.h"
|
6
|
-
#include "ruby_xml_node_set.h"
|
7
|
-
|
8
|
-
/*
|
9
|
-
* Document-class: LibXML::XML::Node::Set
|
10
|
-
*
|
11
|
-
* Includes Enumerable.
|
12
|
-
*/
|
13
|
-
VALUE cXMLNodeSet;
|
14
|
-
|
15
|
-
// TODO maybe we should support [] on nodeset?
|
16
|
-
// Would also give us on xpath too...
|
17
|
-
|
18
|
-
/*
|
19
|
-
* call-seq:
|
20
|
-
* nodeset.to_a -> [node, ..., node]
|
21
|
-
*
|
22
|
-
* Obtain an array of the nodes in this set.
|
23
|
-
*/
|
24
|
-
VALUE
|
25
|
-
ruby_xml_node_set_to_a(VALUE self) {
|
26
|
-
ruby_xml_node_set *rxnset;
|
27
|
-
VALUE r;
|
28
|
-
|
29
|
-
Data_Get_Struct(self, ruby_xml_node_set, rxnset);
|
30
|
-
r=ruby_xml_xpath_object_to_a(rxnset->rxpop);
|
31
|
-
#ifdef NODE_DEBUG
|
32
|
-
fprintf(stderr,"node_set_to_a %s\n",rb_str2cstr(rb_ary_to_s(r),0));
|
33
|
-
#endif
|
34
|
-
return r;
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
/*
|
39
|
-
* call-seq:
|
40
|
-
* nodeset.each { |node| ... } -> self
|
41
|
-
*
|
42
|
-
* Call the supplied block for each node in this set.
|
43
|
-
*/
|
44
|
-
VALUE
|
45
|
-
ruby_xml_node_set_each(VALUE self) {
|
46
|
-
ruby_xml_node_set *rxnset;
|
47
|
-
|
48
|
-
Data_Get_Struct(self, ruby_xml_node_set, rxnset);
|
49
|
-
return ruby_xml_xpath_object_each(rxnset->rxpop);
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
/*
|
54
|
-
* call-seq:
|
55
|
-
* nodeset.empty? -> (true|false)
|
56
|
-
*
|
57
|
-
* Determine whether this nodeset is empty (contains no nodes).
|
58
|
-
*/
|
59
|
-
VALUE
|
60
|
-
ruby_xml_node_set_empty_q(VALUE self) {
|
61
|
-
ruby_xml_node_set *rxnset;
|
62
|
-
|
63
|
-
Data_Get_Struct(self, ruby_xml_node_set, rxnset);
|
64
|
-
return ruby_xml_xpath_object_empty_q(rxnset->rxpop);
|
65
|
-
}
|
66
|
-
|
67
|
-
|
68
|
-
/*
|
69
|
-
* call-seq:
|
70
|
-
* nodeset.first -> node
|
71
|
-
*
|
72
|
-
* Returns the first node in this node set, or nil if none exist.
|
73
|
-
*/
|
74
|
-
VALUE
|
75
|
-
ruby_xml_node_set_first(VALUE self) {
|
76
|
-
ruby_xml_node_set *rxnset;
|
77
|
-
|
78
|
-
Data_Get_Struct(self, ruby_xml_node_set, rxnset);
|
79
|
-
return ruby_xml_xpath_object_first(rxnset->rxpop);
|
80
|
-
}
|
81
|
-
|
82
|
-
/*
|
83
|
-
* call-seq:
|
84
|
-
* nodeset.length -> num
|
85
|
-
*
|
86
|
-
* Obtain the length of this nodeset.
|
87
|
-
*/
|
88
|
-
VALUE
|
89
|
-
ruby_xml_node_set_length(VALUE self) {
|
90
|
-
ruby_xml_node_set *rxnset;
|
91
|
-
|
92
|
-
Data_Get_Struct(self, ruby_xml_node_set, rxnset);
|
93
|
-
return ruby_xml_xpath_object_length(rxnset->rxpop);
|
94
|
-
}
|
95
|
-
|
96
|
-
|
97
|
-
static void
|
98
|
-
ruby_xml_node_set_mark(ruby_xml_node_set *rxnset) {
|
99
|
-
if (!NIL_P(rxnset->rxpop))
|
100
|
-
rb_gc_mark(rxnset->rxpop);
|
101
|
-
}
|
102
|
-
|
103
|
-
static void
|
104
|
-
ruby_xml_node_set_free(ruby_xml_node_set *rxnset) {
|
105
|
-
ruby_xfree(rxnset);
|
106
|
-
}
|
107
|
-
|
108
|
-
VALUE
|
109
|
-
ruby_xml_node_set_new(VALUE class, VALUE rxpop)
|
110
|
-
{
|
111
|
-
ruby_xml_node_set *rxnset;
|
112
|
-
rxnset = ALLOC(ruby_xml_node_set);
|
113
|
-
rxnset->rxpop=rxpop;
|
114
|
-
return Data_Wrap_Struct(class,
|
115
|
-
ruby_xml_node_set_mark,
|
116
|
-
ruby_xml_node_set_free,
|
117
|
-
rxnset);
|
118
|
-
}
|
119
|
-
|
120
|
-
VALUE
|
121
|
-
ruby_xml_node_set_new2(VALUE rxpop)
|
122
|
-
{
|
123
|
-
return ruby_xml_node_set_new(cXMLNodeSet,rxpop);
|
124
|
-
}
|
125
|
-
|
126
|
-
/*
|
127
|
-
* call-seq:
|
128
|
-
* nodeset.xpath -> xpath
|
129
|
-
*
|
130
|
-
* Obtain the xpath corresponding to this nodeset, if any.
|
131
|
-
*/
|
132
|
-
VALUE
|
133
|
-
ruby_xml_node_set_xpath_get(VALUE self) {
|
134
|
-
rb_raise(rb_eRuntimeError,"xpath retrival is no longer supported");
|
135
|
-
}
|
136
|
-
|
137
|
-
|
138
|
-
/*
|
139
|
-
* call-seq:
|
140
|
-
* nodeset.xpath_ctxt -> context
|
141
|
-
*
|
142
|
-
* Return the xpath context corresponding to this nodeset,
|
143
|
-
* if any.
|
144
|
-
*/
|
145
|
-
VALUE
|
146
|
-
ruby_xml_node_set_xpath_data_get(VALUE self) {
|
147
|
-
rb_raise(rb_eRuntimeError,"xpath data retrival is no longer supported");
|
148
|
-
}
|
149
|
-
|
150
|
-
// Rdoc needs to know
|
151
|
-
#ifdef RDOC_NEVER_DEFINED
|
152
|
-
mLibXML = rb_define_module("LibXML");
|
153
|
-
mXML = rb_define_module_under(mLibXML, "XML");
|
154
|
-
cXMLNode = rb_define_class_under(mXML, "Node", rb_cObject);
|
155
|
-
#endif
|
156
|
-
|
157
|
-
void
|
158
|
-
ruby_init_xml_node_set(void) {
|
159
|
-
cXMLNodeSet = rb_define_class_under(cXMLNode, "Set", rb_cObject);
|
160
|
-
rb_include_module(cXMLNodeSet, rb_mEnumerable);
|
161
|
-
|
162
|
-
rb_define_method(cXMLNodeSet, "each", ruby_xml_node_set_each, 0);
|
163
|
-
rb_define_method(cXMLNodeSet, "empty?", ruby_xml_node_set_empty_q, 0);
|
164
|
-
rb_define_method(cXMLNodeSet, "first", ruby_xml_node_set_first, 0);
|
165
|
-
rb_define_method(cXMLNodeSet, "length", ruby_xml_node_set_length, 0);
|
166
|
-
rb_define_method(cXMLNodeSet, "size", ruby_xml_node_set_length, 0);
|
167
|
-
rb_define_method(cXMLNodeSet, "to_a", ruby_xml_node_set_to_a, 0);
|
168
|
-
rb_define_method(cXMLNodeSet, "xpath", ruby_xml_node_set_xpath_get, 0);
|
169
|
-
rb_define_method(cXMLNodeSet, "xpath_ctxt",
|
170
|
-
ruby_xml_node_set_xpath_data_get, 0);
|
171
|
-
|
172
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
/* $Id: ruby_xml_node_set.h 207 2007-11-14 07:51:46Z danj $ */
|
2
|
-
|
3
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
4
|
-
|
5
|
-
#ifndef __RUBY_XML_NODE_SET__
|
6
|
-
#define __RUBY_XML_NODE_SET__
|
7
|
-
|
8
|
-
extern VALUE cXMLNodeSet;
|
9
|
-
|
10
|
-
typedef struct ruby_xml_node_set {
|
11
|
-
VALUE rxpop;
|
12
|
-
} ruby_xml_node_set;
|
13
|
-
|
14
|
-
void ruby_init_xml_node_set(void);
|
15
|
-
VALUE ruby_xml_node_set_new(VALUE class, VALUE xpop);
|
16
|
-
VALUE ruby_xml_node_set_new2(VALUE xpop);
|
17
|
-
VALUE ruby_xml_node_set_each(VALUE self);
|
18
|
-
VALUE ruby_xml_node_set_first(VALUE self);
|
19
|
-
|
20
|
-
#endif
|
@@ -1,22 +0,0 @@
|
|
1
|
-
/* $Id: ruby_xml_xpointer_context.c 461 2008-07-15 21:35:56Z cfis $ */
|
2
|
-
|
3
|
-
/* Please see the LICENSE file for copyright and distribution information */
|
4
|
-
|
5
|
-
#include "ruby_libxml.h"
|
6
|
-
#include "ruby_xml_xpointer_context.h"
|
7
|
-
|
8
|
-
VALUE cXMLXPointerContext;
|
9
|
-
VALUE eXMLXPointerContextInvalidPath;
|
10
|
-
|
11
|
-
// Rdoc needs to know
|
12
|
-
#ifdef RDOC_NEVER_DEFINED
|
13
|
-
mLibXML = rb_define_module("LibXML");
|
14
|
-
mXML = rb_define_module_under(mLibXML, "XML");
|
15
|
-
cXMLXPointer = rb_define_class_under(mXML, "XPointer", rb_cObject);
|
16
|
-
#endif
|
17
|
-
|
18
|
-
void
|
19
|
-
ruby_init_xml_xpointer_context(void) {
|
20
|
-
cXMLXPointerContext = rb_define_class_under(cXMLXPointer, "Context", cXMLXPathContext);
|
21
|
-
eXMLXPointerContextInvalidPath = rb_define_class_under(cXMLXPointerContext, "InvalidPath", eXMLError);
|
22
|
-
}
|