libxml-ruby 0.8.3-x86-mswin32-60 → 0.9.0-x86-mswin32-60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/{lib → ext/mingw}/libiconv-2.dll +0 -0
- data/ext/mingw/libxml2-2.dll +0 -0
- data/ext/mingw/libxml_ruby.dll.a +0 -0
- data/ext/mingw/libxml_ruby.so +0 -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 +32 -115
- 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/lib/libxml2-2.dll +0 -0
- data/lib/libxml_ruby.dll.a +0 -0
- data/lib/libxml_ruby.so +0 -0
- data/test/tc_node_set.rb +0 -24
- data/test/tc_node_set2.rb +0 -37
@@ -1,404 +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::XPath::Context</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::XPath::Context</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../../../files/ext/libxml/ruby_xml_xpath_c.html">
|
59
|
-
ext/libxml/ruby_xml_xpath.c
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="Object.html">
|
69
|
-
Object
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
<div id="description">
|
84
|
-
<p>
|
85
|
-
The <a href="Context.html">XML::XPath::Context</a> class is used to
|
86
|
-
evaluate <a href="../XPath.html">XPath</a> expressions. Generally, you
|
87
|
-
should not directly use this class, but instead use the <a
|
88
|
-
href="../Document.html#M000359">XML::Document#find</a> and <a
|
89
|
-
href="../Node.html#M000173">XML::Node#find</a> methods.
|
90
|
-
</p>
|
91
|
-
<pre>
|
92
|
-
doc = XML::Document.string('<header>content</header>')
|
93
|
-
context = XPath::Context.new(doc)
|
94
|
-
context.node = doc.root
|
95
|
-
context.register_namespaces_from_node(doc.root)
|
96
|
-
nodes = context.find('/header')
|
97
|
-
</pre>
|
98
|
-
|
99
|
-
</div>
|
100
|
-
|
101
|
-
|
102
|
-
</div>
|
103
|
-
|
104
|
-
<div id="method-list">
|
105
|
-
<h3 class="section-bar">Methods</h3>
|
106
|
-
|
107
|
-
<div class="name-list">
|
108
|
-
<a href="#M000006">find</a>
|
109
|
-
<a href="#M000001">new</a>
|
110
|
-
<a href="#M000005">node=</a>
|
111
|
-
<a href="#M000004">register_namespace</a>
|
112
|
-
<a href="#M000002">register_namespaces</a>
|
113
|
-
<a href="#M000003">register_namespaces_from_node</a>
|
114
|
-
</div>
|
115
|
-
</div>
|
116
|
-
|
117
|
-
</div>
|
118
|
-
|
119
|
-
|
120
|
-
<!-- if includes -->
|
121
|
-
|
122
|
-
<div id="section">
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
<div id="attribute-list">
|
129
|
-
<h3 class="section-bar">Attributes</h3>
|
130
|
-
|
131
|
-
<div class="name-list">
|
132
|
-
<table>
|
133
|
-
<tr class="top-aligned-row context-row">
|
134
|
-
<td class="context-item-name">doc</td>
|
135
|
-
<td class="context-item-value"> [R] </td>
|
136
|
-
<td class="context-item-desc"></td>
|
137
|
-
</tr>
|
138
|
-
</table>
|
139
|
-
</div>
|
140
|
-
</div>
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
<!-- if method_list -->
|
145
|
-
<div id="methods">
|
146
|
-
<h3 class="section-bar">Public Class methods</h3>
|
147
|
-
|
148
|
-
<div id="method-M000001" class="method-detail">
|
149
|
-
<a name="M000001"></a>
|
150
|
-
|
151
|
-
<div class="method-heading">
|
152
|
-
<a href="#M000001" class="method-signature">
|
153
|
-
<span class="method-name">XPath::Context.new(node) → XPath::Context<br />
|
154
|
-
</span>
|
155
|
-
</a>
|
156
|
-
</div>
|
157
|
-
|
158
|
-
<div class="method-description">
|
159
|
-
<p>
|
160
|
-
Creates a <a href="Context.html#M000001">new</a> <a
|
161
|
-
href="../XPath.html">XPath</a> context for the specified document. The
|
162
|
-
context can then be used to evaluate an <a href="../XPath.html">XPath</a>
|
163
|
-
expression.
|
164
|
-
</p>
|
165
|
-
<pre>
|
166
|
-
doc = XML::Document.string('<header><first>hi</first></header>')
|
167
|
-
context = XPath::Context.new(doc)
|
168
|
-
nodes = XPath::Object.new('//first', context)
|
169
|
-
nodes.length == 1
|
170
|
-
</pre>
|
171
|
-
<p><a class="source-toggle" href="#"
|
172
|
-
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
173
|
-
<div class="method-source-code" id="M000001-source">
|
174
|
-
<pre>
|
175
|
-
/* call-seq:
|
176
|
-
* XPath::Context.new(node) -> XPath::Context
|
177
|
-
*
|
178
|
-
* Creates a new XPath context for the specified document. The
|
179
|
-
* context can then be used to evaluate an XPath expression.
|
180
|
-
*
|
181
|
-
* doc = XML::Document.string('<header><first>hi</first></header>')
|
182
|
-
* context = XPath::Context.new(doc)
|
183
|
-
* nodes = XPath::Object.new('//first', context)
|
184
|
-
* nodes.length == 1
|
185
|
-
*/
|
186
|
-
VALUE
|
187
|
-
ruby_xml_xpath_context_initialize(VALUE self, VALUE node) {
|
188
|
-
|
189
|
-
</pre>
|
190
|
-
</div>
|
191
|
-
</div>
|
192
|
-
</div>
|
193
|
-
|
194
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
195
|
-
|
196
|
-
<div id="method-M000006" class="method-detail">
|
197
|
-
<a name="M000006"></a>
|
198
|
-
|
199
|
-
<div class="method-heading">
|
200
|
-
<a href="#M000006" class="method-signature">
|
201
|
-
<span class="method-name">context.find("xpath") → XML::XPath::Object<br />
|
202
|
-
</span>
|
203
|
-
</a>
|
204
|
-
</div>
|
205
|
-
|
206
|
-
<div class="method-description">
|
207
|
-
<p>
|
208
|
-
Find nodes matching the specified <a href="../XPath.html">XPath</a>
|
209
|
-
expression
|
210
|
-
</p>
|
211
|
-
<p><a class="source-toggle" href="#"
|
212
|
-
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
213
|
-
<div class="method-source-code" id="M000006-source">
|
214
|
-
<pre>
|
215
|
-
/*
|
216
|
-
* call-seq:
|
217
|
-
* context.find("xpath") -> XML::XPath::Object
|
218
|
-
*
|
219
|
-
* Find nodes matching the specified XPath expression
|
220
|
-
*/
|
221
|
-
VALUE
|
222
|
-
ruby_xml_xpath_context_find(VALUE self, VALUE xpath_expr) {
|
223
|
-
|
224
|
-
</pre>
|
225
|
-
</div>
|
226
|
-
</div>
|
227
|
-
</div>
|
228
|
-
|
229
|
-
<div id="method-M000005" class="method-detail">
|
230
|
-
<a name="M000005"></a>
|
231
|
-
|
232
|
-
<div class="method-heading">
|
233
|
-
<a href="#M000005" class="method-signature">
|
234
|
-
<span class="method-name">context.node = node<br />
|
235
|
-
</span>
|
236
|
-
</a>
|
237
|
-
</div>
|
238
|
-
|
239
|
-
<div class="method-description">
|
240
|
-
<p>
|
241
|
-
Set the current node used by the <a href="../XPath.html">XPath</a> engine
|
242
|
-
</p>
|
243
|
-
<pre>
|
244
|
-
doc = XML::Document.string('<header><first>hi</first></header>')
|
245
|
-
context.node = doc.root.first
|
246
|
-
</pre>
|
247
|
-
<p><a class="source-toggle" href="#"
|
248
|
-
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
249
|
-
<div class="method-source-code" id="M000005-source">
|
250
|
-
<pre>
|
251
|
-
/*
|
252
|
-
* call-seq:
|
253
|
-
* context.node = node
|
254
|
-
*
|
255
|
-
* Set the current node used by the XPath engine
|
256
|
-
|
257
|
-
* doc = XML::Document.string('<header><first>hi</first></header>')
|
258
|
-
* context.node = doc.root.first
|
259
|
-
*/
|
260
|
-
VALUE
|
261
|
-
ruby_xml_xpath_context_node_set(VALUE self, VALUE node) {
|
262
|
-
|
263
|
-
</pre>
|
264
|
-
</div>
|
265
|
-
</div>
|
266
|
-
</div>
|
267
|
-
|
268
|
-
<div id="method-M000004" class="method-detail">
|
269
|
-
<a name="M000004"></a>
|
270
|
-
|
271
|
-
<div class="method-heading">
|
272
|
-
<a href="#M000004" class="method-signature">
|
273
|
-
<span class="method-name">context.register_namespace(prefix, uri) → (true|false)<br />
|
274
|
-
</span>
|
275
|
-
</a>
|
276
|
-
</div>
|
277
|
-
|
278
|
-
<div class="method-description">
|
279
|
-
<p>
|
280
|
-
Register the specified namespace URI with the specified prefix in this
|
281
|
-
context.
|
282
|
-
</p>
|
283
|
-
<pre>
|
284
|
-
context.register_namespace('xi', 'http://www.w3.org/2001/XInclude')
|
285
|
-
</pre>
|
286
|
-
<p><a class="source-toggle" href="#"
|
287
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
288
|
-
<div class="method-source-code" id="M000004-source">
|
289
|
-
<pre>
|
290
|
-
/*
|
291
|
-
* call-seq:
|
292
|
-
* context.register_namespace(prefix, uri) -> (true|false)
|
293
|
-
*
|
294
|
-
* Register the specified namespace URI with the specified prefix
|
295
|
-
* in this context.
|
296
|
-
|
297
|
-
* context.register_namespace('xi', 'http://www.w3.org/2001/XInclude')
|
298
|
-
*/
|
299
|
-
VALUE
|
300
|
-
ruby_xml_xpath_context_register_namespace(VALUE self, VALUE prefix, VALUE uri) {
|
301
|
-
|
302
|
-
</pre>
|
303
|
-
</div>
|
304
|
-
</div>
|
305
|
-
</div>
|
306
|
-
|
307
|
-
<div id="method-M000002" class="method-detail">
|
308
|
-
<a name="M000002"></a>
|
309
|
-
|
310
|
-
<div class="method-heading">
|
311
|
-
<a href="#M000002" class="method-signature">
|
312
|
-
<span class="method-name">context.register_namespaces(["prefix:uri"]) → self<br />
|
313
|
-
</span>
|
314
|
-
</a>
|
315
|
-
</div>
|
316
|
-
|
317
|
-
<div class="method-description">
|
318
|
-
<p>
|
319
|
-
Register the specified namespaces in this context.
|
320
|
-
</p>
|
321
|
-
<pre>
|
322
|
-
context.register_namespaces('xi:http://www.w3.org/2001/XInclude')
|
323
|
-
context.register_namespaces(['xlink:http://www.w3.org/1999/xlink',
|
324
|
-
'xi:http://www.w3.org/2001/XInclude')
|
325
|
-
context.register_namespaces('xlink' => 'http://www.w3.org/1999/xlink',
|
326
|
-
'xi' => 'http://www.w3.org/2001/XInclude')
|
327
|
-
</pre>
|
328
|
-
<p><a class="source-toggle" href="#"
|
329
|
-
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
330
|
-
<div class="method-source-code" id="M000002-source">
|
331
|
-
<pre>
|
332
|
-
/*
|
333
|
-
* call-seq:
|
334
|
-
* context.register_namespaces(["prefix:uri"]) -> self
|
335
|
-
*
|
336
|
-
* Register the specified namespaces in this context.
|
337
|
-
*
|
338
|
-
* context.register_namespaces('xi:http://www.w3.org/2001/XInclude')
|
339
|
-
* context.register_namespaces(['xlink:http://www.w3.org/1999/xlink',
|
340
|
-
* 'xi:http://www.w3.org/2001/XInclude')
|
341
|
-
* context.register_namespaces('xlink' => 'http://www.w3.org/1999/xlink',
|
342
|
-
* 'xi' => 'http://www.w3.org/2001/XInclude')
|
343
|
-
*/
|
344
|
-
VALUE
|
345
|
-
ruby_xml_xpath_context_register_namespaces(VALUE self, VALUE nslist) {
|
346
|
-
|
347
|
-
</pre>
|
348
|
-
</div>
|
349
|
-
</div>
|
350
|
-
</div>
|
351
|
-
|
352
|
-
<div id="method-M000003" class="method-detail">
|
353
|
-
<a name="M000003"></a>
|
354
|
-
|
355
|
-
<div class="method-heading">
|
356
|
-
<a href="#M000003" class="method-signature">
|
357
|
-
<span class="method-name">context.register_namespaces_from_node(node) → self<br />
|
358
|
-
</span>
|
359
|
-
</a>
|
360
|
-
</div>
|
361
|
-
|
362
|
-
<div class="method-description">
|
363
|
-
<p>
|
364
|
-
Helper method to read in namespaces defined on a node.
|
365
|
-
</p>
|
366
|
-
<pre>
|
367
|
-
doc = XML::Document.string('<header><first>hi</first></header>')
|
368
|
-
context = XPath::Context.new(doc)
|
369
|
-
context.register_namespaces_from_node(doc.root)
|
370
|
-
</pre>
|
371
|
-
<p><a class="source-toggle" href="#"
|
372
|
-
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
373
|
-
<div class="method-source-code" id="M000003-source">
|
374
|
-
<pre>
|
375
|
-
/* call-seq:
|
376
|
-
* context.register_namespaces_from_node(node) -> self
|
377
|
-
*
|
378
|
-
* Helper method to read in namespaces defined on a node.
|
379
|
-
*
|
380
|
-
* doc = XML::Document.string('<header><first>hi</first></header>')
|
381
|
-
* context = XPath::Context.new(doc)
|
382
|
-
* context.register_namespaces_from_node(doc.root)
|
383
|
-
*/
|
384
|
-
VALUE
|
385
|
-
ruby_xml_xpath_context_register_namespaces_from_node(VALUE self, VALUE node) {
|
386
|
-
|
387
|
-
</pre>
|
388
|
-
</div>
|
389
|
-
</div>
|
390
|
-
</div>
|
391
|
-
|
392
|
-
|
393
|
-
</div>
|
394
|
-
|
395
|
-
|
396
|
-
</div>
|
397
|
-
|
398
|
-
|
399
|
-
<div id="validator-badges">
|
400
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
401
|
-
</div>
|
402
|
-
|
403
|
-
</body>
|
404
|
-
</html>
|
@@ -1,172 +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::XPath::InvalidPath</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::XPath::InvalidPath</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../../../files/ext/libxml/ruby_xml_xpath_c.html">
|
59
|
-
ext/libxml/ruby_xml_xpath.c
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
eXMLError
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
<div id="description">
|
82
|
-
<p>
|
83
|
-
<a href="../Document.html">Document</a>-class: <a
|
84
|
-
href="../XPath.html">LibXML::XML::XPath</a>
|
85
|
-
</p>
|
86
|
-
<p>
|
87
|
-
The <a href="../XPath.html">XML::XPath</a> module is used to query <a
|
88
|
-
href="../../XML.html">XML</a> documents. It is usually accessed via the <a
|
89
|
-
href="../Document.html#M000359">XML::Document#find</a> or <a
|
90
|
-
href="../Node.html#M000173">XML::Node#find</a> methods. For example:
|
91
|
-
</p>
|
92
|
-
<pre>
|
93
|
-
document.find('/foo', namespaces) -> XML::XPath::Object
|
94
|
-
</pre>
|
95
|
-
<p>
|
96
|
-
The optional namespaces parameter can be a string, array or hash table.
|
97
|
-
</p>
|
98
|
-
<pre>
|
99
|
-
document.find('/foo', 'xlink:http://www.w3.org/1999/xlink')
|
100
|
-
document.find('/foo', ['xlink:http://www.w3.org/1999/xlink',
|
101
|
-
'xi:http://www.w3.org/2001/XInclude')
|
102
|
-
document.find('/foo', 'xlink' => 'http://www.w3.org/1999/xlink',
|
103
|
-
'xi' => 'http://www.w3.org/2001/XInclude')
|
104
|
-
</pre>
|
105
|
-
<h3>Working With Namespaces</h3>
|
106
|
-
<p>
|
107
|
-
Finding namespaced elements and attributes can be tricky. Lets work through
|
108
|
-
some examples using the following xml document:
|
109
|
-
</p>
|
110
|
-
<pre>
|
111
|
-
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
112
|
-
<soap:Body>
|
113
|
-
<getManufacturerNamesResponse xmlns="http://services.somewhere.com">
|
114
|
-
<IDAndNameList xmlns="http://services.somewhere.com">
|
115
|
-
<ns1:IdAndName xmlns:ns1="http://domain.somewhere.com"/>
|
116
|
-
</IDAndNameList>
|
117
|
-
</getManufacturerNamesResponse>
|
118
|
-
</soap:Envelope>
|
119
|
-
|
120
|
-
# Since the soap namespace is defined on the root
|
121
|
-
# node we can directly use it.
|
122
|
-
doc.find('/soap:Envelope')
|
123
|
-
|
124
|
-
# Since the ns1 namespace is not defined on the root node
|
125
|
-
# we have to first register it with the xpath engine.
|
126
|
-
doc.find('//ns1:IdAndName',
|
127
|
-
'ns1:http://domain.somewhere.com')
|
128
|
-
|
129
|
-
# Since the getManufacturerNamesResponse element uses a default
|
130
|
-
# namespace we first have to give it a prefix and register
|
131
|
-
# it with the xpath engine.
|
132
|
-
doc.find('//ns:getManufacturerNamesResponse',
|
133
|
-
'ns:http://services.somewhere.com')
|
134
|
-
|
135
|
-
# Here is an example showing a complex namespace aware
|
136
|
-
# xpath expression.
|
137
|
-
doc.find('/soap:Envelope/soap:Body/ns0:getManufacturerNamesResponse/ns0:IDAndNameList/ns1:IdAndName',
|
138
|
-
['ns0:http://services.somewhere.com', 'ns1:http://domain.somewhere.com'])
|
139
|
-
</pre>
|
140
|
-
|
141
|
-
</div>
|
142
|
-
|
143
|
-
|
144
|
-
</div>
|
145
|
-
|
146
|
-
|
147
|
-
</div>
|
148
|
-
|
149
|
-
|
150
|
-
<!-- if includes -->
|
151
|
-
|
152
|
-
<div id="section">
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
<!-- if method_list -->
|
162
|
-
|
163
|
-
|
164
|
-
</div>
|
165
|
-
|
166
|
-
|
167
|
-
<div id="validator-badges">
|
168
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
169
|
-
</div>
|
170
|
-
|
171
|
-
</body>
|
172
|
-
</html>
|