libxml-ruby 0.7.0-x86-mswin32-60 → 0.8.0-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. data/CHANGES +24 -1
  2. data/README +48 -3
  3. data/benchmark/depixelate.rb +632 -0
  4. data/benchmark/hamlet.xml +9055 -0
  5. data/benchmark/sock_entries.xml +507 -0
  6. data/benchmark/throughput.rb +39 -0
  7. data/benchmark/xml_benchmarks.rb +222 -0
  8. data/doc/classes/LibXML.html +237 -0
  9. data/doc/classes/LibXML/XML.html +178 -0
  10. data/doc/classes/{XML → LibXML/XML}/Attr.html +213 -182
  11. data/doc/classes/{XML → LibXML/XML}/Attributes.html +126 -54
  12. data/doc/classes/{XML → LibXML/XML}/Document.html +299 -297
  13. data/doc/classes/{XML → LibXML/XML}/Dtd.html +10 -10
  14. data/doc/classes/{XML/XInclude → LibXML/XML}/Error.html +4 -4
  15. data/doc/classes/{XML → LibXML/XML}/HTMLParser.html +40 -40
  16. data/doc/classes/{XML → LibXML/XML}/InputCallbacks.html +10 -10
  17. data/doc/classes/{XML → LibXML/XML}/NS.html +46 -46
  18. data/doc/classes/{XML → LibXML/XML}/Node.html +935 -788
  19. data/doc/classes/LibXML/XML/Node/FailedModify.html +111 -0
  20. data/doc/classes/{XML → LibXML/XML}/Node/Set.html +69 -68
  21. data/doc/classes/{XML → LibXML/XML}/Node/SetNamespace.html +4 -4
  22. data/doc/classes/{XML/Node/FailedModify.html → LibXML/XML/Node/UnknownType.html} +4 -4
  23. data/doc/classes/{XML → LibXML/XML}/Parser.html +426 -389
  24. data/doc/classes/{XML → LibXML/XML}/Parser/Context.html +208 -208
  25. data/doc/classes/{XML → LibXML/XML}/Parser/ParseError.html +4 -4
  26. data/doc/classes/{XML → LibXML/XML}/Reader.html +288 -287
  27. data/doc/classes/{XML → LibXML/XML}/SaxParser.html +52 -52
  28. data/doc/classes/{XML/XPath/Context.html → LibXML/XML/Schema.html} +60 -32
  29. data/doc/classes/{XML → LibXML/XML}/State.html +4 -4
  30. data/doc/classes/{XML/Node/UnknownType.html → LibXML/XML/Tree.html} +5 -5
  31. data/doc/classes/{XML → LibXML/XML}/XInclude.html +5 -5
  32. data/doc/classes/{XML → LibXML/XML/XInclude}/Error.html +5 -5
  33. data/doc/classes/{XML → LibXML/XML}/XMLParserOptions.html +5 -5
  34. data/doc/classes/{XML → LibXML/XML}/XPath.html +23 -64
  35. data/doc/classes/LibXML/XML/XPath/Context.html +403 -0
  36. data/doc/classes/{XML/XPointer/Context → LibXML/XML/XPath}/InvalidPath.html +4 -4
  37. data/doc/classes/LibXML/XML/XPath/Object.html +623 -0
  38. data/doc/classes/{XML → LibXML/XML}/XPointer.html +12 -12
  39. data/doc/classes/{XML → LibXML/XML}/XPointer/Context.html +5 -5
  40. data/doc/classes/{XML/XPath → LibXML/XML/XPointer/Context}/InvalidPath.html +5 -5
  41. data/doc/classes/{XML → LibXML/XML}/XPointer/InvalidExpression.html +4 -4
  42. data/doc/classes/XML.html +17 -123
  43. data/doc/created.rid +1 -1
  44. data/doc/files/CHANGES.html +49 -25
  45. data/doc/files/LICENSE.html +1 -1
  46. data/doc/files/README.html +79 -4
  47. data/doc/files/VERSION.html +2 -2
  48. data/doc/files/ext/libxml/cbg_c.html +1 -1
  49. data/doc/files/ext/libxml/libxml_c.html +1 -1
  50. data/doc/files/ext/libxml/ruby_xml_attr_c.html +1 -1
  51. data/doc/files/ext/libxml/ruby_xml_attributes_c.html +1 -1
  52. data/doc/files/ext/libxml/ruby_xml_document_c.html +1 -1
  53. data/doc/files/ext/libxml/ruby_xml_dtd_c.html +1 -1
  54. data/doc/files/ext/libxml/ruby_xml_html_parser_c.html +1 -1
  55. data/doc/files/ext/libxml/ruby_xml_input_cbg_c.html +1 -1
  56. data/doc/files/ext/libxml/ruby_xml_node_c.html +1 -1
  57. data/doc/files/ext/libxml/ruby_xml_node_set_c.html +1 -1
  58. data/doc/files/ext/libxml/ruby_xml_ns_c.html +1 -1
  59. data/doc/files/ext/libxml/ruby_xml_parser_c.html +1 -1
  60. data/doc/files/ext/libxml/ruby_xml_parser_context_c.html +1 -1
  61. data/doc/files/ext/libxml/ruby_xml_reader_c.html +1 -1
  62. data/doc/files/ext/libxml/ruby_xml_sax_parser_c.html +1 -1
  63. data/doc/files/ext/libxml/ruby_xml_schema_c.html +1 -1
  64. data/doc/files/ext/libxml/ruby_xml_state_c.html +1 -1
  65. data/doc/files/ext/libxml/ruby_xml_xinclude_c.html +1 -1
  66. data/doc/files/ext/libxml/ruby_xml_xpath_c.html +1 -1
  67. data/doc/files/ext/libxml/ruby_xml_xpath_context_c.html +1 -1
  68. data/doc/files/ext/libxml/ruby_xml_xpath_object_c.html +1 -1
  69. data/doc/files/ext/libxml/ruby_xml_xpointer_c.html +1 -1
  70. data/doc/files/ext/libxml/ruby_xml_xpointer_context_c.html +1 -1
  71. data/doc/files/lib/libxml/attr_rb.html +108 -0
  72. data/doc/files/lib/libxml/attributes_rb.html +108 -0
  73. data/doc/files/lib/libxml/document_rb.html +108 -0
  74. data/doc/files/lib/libxml/node_rb.html +108 -0
  75. data/doc/files/lib/libxml/node_set_rb.html +108 -0
  76. data/doc/files/lib/libxml/parser_options_rb.html +107 -0
  77. data/doc/files/{ext/libxml/ruby_xml_tree_c.html → lib/libxml/parser_rb.html} +4 -4
  78. data/doc/files/lib/libxml/properties_rb.html +108 -0
  79. data/doc/files/lib/libxml/tree_rb.html +107 -0
  80. data/doc/files/lib/libxml_rb.html +12 -3
  81. data/doc/fr_class_index.html +34 -32
  82. data/doc/fr_file_index.html +9 -1
  83. data/doc/fr_method_index.html +362 -347
  84. data/ext/libxml/cbg.c +76 -76
  85. data/ext/libxml/libxml.c +4 -3
  86. data/ext/libxml/ruby_libxml.h +1 -1
  87. data/ext/libxml/ruby_xml_attr.c +4 -3
  88. data/ext/libxml/ruby_xml_attr.h +16 -16
  89. data/ext/libxml/ruby_xml_attributes.c +267 -266
  90. data/ext/libxml/ruby_xml_attributes.h +17 -17
  91. data/ext/libxml/ruby_xml_document.c +30 -59
  92. data/ext/libxml/ruby_xml_document.h +27 -27
  93. data/ext/libxml/ruby_xml_dtd.c +2 -1
  94. data/ext/libxml/ruby_xml_dtd.h +17 -17
  95. data/ext/libxml/ruby_xml_html_parser.c +3 -2
  96. data/ext/libxml/ruby_xml_html_parser.h +29 -29
  97. data/ext/libxml/ruby_xml_input_cbg.c +2 -1
  98. data/ext/libxml/ruby_xml_input_cbg.h +20 -20
  99. data/ext/libxml/ruby_xml_node.c +127 -470
  100. data/ext/libxml/ruby_xml_node.h +17 -17
  101. data/ext/libxml/ruby_xml_node_set.c +5 -4
  102. data/ext/libxml/ruby_xml_node_set.h +20 -20
  103. data/ext/libxml/ruby_xml_ns.c +3 -2
  104. data/ext/libxml/ruby_xml_ns.h +12 -12
  105. data/ext/libxml/ruby_xml_parser.c +20 -48
  106. data/ext/libxml/ruby_xml_parser.h +31 -31
  107. data/ext/libxml/ruby_xml_parser_context.c +3 -2
  108. data/ext/libxml/ruby_xml_parser_context.h +20 -20
  109. data/ext/libxml/ruby_xml_reader.c +2 -1
  110. data/ext/libxml/ruby_xml_sax_parser.c +3 -2
  111. data/ext/libxml/ruby_xml_sax_parser.h +56 -56
  112. data/ext/libxml/ruby_xml_schema.c +6 -0
  113. data/ext/libxml/ruby_xml_schema.h +16 -16
  114. data/ext/libxml/ruby_xml_state.c +13 -12
  115. data/ext/libxml/ruby_xml_state.h +1 -1
  116. data/ext/libxml/ruby_xml_xinclude.c +3 -2
  117. data/ext/libxml/ruby_xml_xinclude.h +13 -13
  118. data/ext/libxml/ruby_xml_xpath.c +35 -228
  119. data/ext/libxml/ruby_xml_xpath.h +22 -23
  120. data/ext/libxml/ruby_xml_xpath_context.c +223 -62
  121. data/ext/libxml/ruby_xml_xpath_context.h +15 -20
  122. data/ext/libxml/ruby_xml_xpath_object.c +63 -19
  123. data/ext/libxml/ruby_xml_xpointer.c +19 -15
  124. data/ext/libxml/ruby_xml_xpointer.h +27 -27
  125. data/ext/libxml/ruby_xml_xpointer_context.c +3 -2
  126. data/ext/libxml/ruby_xml_xpointer_context.h +18 -18
  127. data/ext/libxml/version.h +9 -9
  128. data/lib/libxml.rb +16 -128
  129. data/lib/libxml/attr.rb +45 -0
  130. data/lib/libxml/attributes.rb +15 -0
  131. data/lib/libxml/document.rb +54 -0
  132. data/lib/libxml/node.rb +132 -0
  133. data/lib/libxml/node_set.rb +27 -0
  134. data/lib/libxml/parser.rb +42 -0
  135. data/lib/libxml/parser_options.rb +25 -0
  136. data/lib/libxml/properties.rb +19 -0
  137. data/lib/libxml/tree.rb +29 -0
  138. data/lib/libxml_ruby.so +0 -0
  139. data/mingw/libxml_ruby.so +0 -0
  140. data/{work/task/setup → setup.rb} +1585 -1616
  141. data/test/gc.log +0 -0
  142. data/test/model/books.xml +147 -0
  143. data/{work/test/runner.rb → test/model/default_validation_bug.rb} +0 -0
  144. data/test/model/merge_bug_data.xml +58 -0
  145. data/test/model/rubynet.xml +78 -0
  146. data/test/model/rubynet_project +1 -0
  147. data/test/model/saxtest.xml +5 -0
  148. data/test/model/shiporder.xml +23 -0
  149. data/test/model/shiporder.xsd +31 -0
  150. data/test/model/simple.xml +7 -0
  151. data/test/model/soap.xml +27 -0
  152. data/test/model/xinclude.xml +5 -0
  153. data/test/tc_deprecated_require.rb +13 -0
  154. data/test/tc_xml_document.rb +57 -16
  155. data/test/tc_xml_document_write.rb +125 -10
  156. data/test/tc_xml_dtd.rb +22 -1
  157. data/test/tc_xml_node.rb +13 -0
  158. data/test/tc_xml_node_edit.rb +1 -1
  159. data/test/tc_xml_node_xlink.rb +1 -1
  160. data/test/tc_xml_parser.rb +64 -7
  161. data/test/tc_xml_properties.rb +42 -0
  162. data/test/tc_xml_reader.rb +4 -4
  163. data/test/tc_xml_sax_parser.rb +50 -50
  164. data/test/tc_xml_schema.rb +2 -2
  165. data/test/tc_xml_traversal.rb +220 -0
  166. data/test/tc_xml_xinclude.rb +12 -15
  167. data/test/tc_xml_xpath.rb +74 -6
  168. data/test/tc_xml_xpath_context.rb +72 -0
  169. data/test/test_suite.rb +6 -4
  170. data/vc/libxml_ruby.vcproj +1 -9
  171. metadata +92 -65
  172. data/doc/classes/XML/SiblingEnum.html +0 -142
  173. data/doc/classes/XML/Tree.html +0 -224
  174. data/doc/classes/XML/XPath/Object.html +0 -439
  175. data/ext/libxml/ruby_xml_tree.c +0 -43
  176. data/ext/libxml/ruby_xml_tree.h +0 -12
  177. data/test/ets_copy_bug2.rb +0 -21
  178. data/test/tc_xml_document_write2.rb +0 -54
  179. data/test/tc_xml_document_write3.rb +0 -96
  180. data/test/tc_xml_sax_parser2.rb +0 -51
  181. data/work/Rakefile +0 -247
  182. data/work/task/make +0 -26
  183. data/work/task/memory +0 -37
  184. data/work/task/rdoc +0 -39
  185. data/work/task/test +0 -29
  186. data/work/test/ets_runner.rb +0 -33
  187. data/work/test/libxml_test.rb +0 -3
  188. data/work/test/runner_ets.rb +0 -33
@@ -5,10 +5,10 @@
5
5
 
6
6
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
7
  <head>
8
- <title>Class: XML::XInclude</title>
8
+ <title>Class: LibXML::XML::XInclude</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
12
  <script type="text/javascript">
13
13
  // <![CDATA[
14
14
 
@@ -50,12 +50,12 @@
50
50
  <table class="header-table">
51
51
  <tr class="top-aligned-row">
52
52
  <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">XML::XInclude</td>
53
+ <td class="class-name-in-header">LibXML::XML::XInclude</td>
54
54
  </tr>
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
- <a href="../../files/ext/libxml/libxml_c.html">
58
+ <a href="../../../files/ext/libxml/libxml_c.html">
59
59
  ext/libxml/libxml.c
60
60
  </a>
61
61
  <br />
@@ -93,7 +93,7 @@
93
93
  <div id="class-list">
94
94
  <h3 class="section-bar">Classes and Modules</h3>
95
95
 
96
- Class <a href="XInclude/Error.html" class="link">XML::XInclude::Error</a><br />
96
+ Class <a href="XInclude/Error.html" class="link">LibXML::XML::XInclude::Error</a><br />
97
97
 
98
98
  </div>
99
99
 
@@ -5,10 +5,10 @@
5
5
 
6
6
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
7
  <head>
8
- <title>Class: XML::Error</title>
8
+ <title>Class: LibXML::XML::XInclude::Error</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
12
12
  <script type="text/javascript">
13
13
  // <![CDATA[
14
14
 
@@ -50,13 +50,13 @@
50
50
  <table class="header-table">
51
51
  <tr class="top-aligned-row">
52
52
  <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">XML::Error</td>
53
+ <td class="class-name-in-header">LibXML::XML::XInclude::Error</td>
54
54
  </tr>
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
- <a href="../../files/ext/libxml/libxml_c.html">
59
- ext/libxml/libxml.c
58
+ <a href="../../../../files/ext/libxml/ruby_xml_xinclude_c.html">
59
+ ext/libxml/ruby_xml_xinclude.c
60
60
  </a>
61
61
  <br />
62
62
  </td>
@@ -5,10 +5,10 @@
5
5
 
6
6
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
7
  <head>
8
- <title>Module: XML::XMLParserOptions</title>
8
+ <title>Module: LibXML::XML::XMLParserOptions</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
12
  <script type="text/javascript">
13
13
  // <![CDATA[
14
14
 
@@ -50,13 +50,13 @@
50
50
  <table class="header-table">
51
51
  <tr class="top-aligned-row">
52
52
  <td><strong>Module</strong></td>
53
- <td class="class-name-in-header">XML::XMLParserOptions</td>
53
+ <td class="class-name-in-header">LibXML::XML::XMLParserOptions</td>
54
54
  </tr>
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
- <a href="../../files/lib/libxml_rb.html">
59
- lib/libxml.rb
58
+ <a href="../../../files/lib/libxml/parser_options_rb.html">
59
+ lib/libxml/parser_options.rb
60
60
  </a>
61
61
  <br />
62
62
  </td>
@@ -5,10 +5,10 @@
5
5
 
6
6
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
7
  <head>
8
- <title>Class: XML::XPath</title>
8
+ <title>Module: LibXML::XML::XPath</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
12
  <script type="text/javascript">
13
13
  // <![CDATA[
14
14
 
@@ -49,25 +49,19 @@
49
49
  <div id="classHeader">
50
50
  <table class="header-table">
51
51
  <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">XML::XPath</td>
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">LibXML::XML::XPath</td>
54
54
  </tr>
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
- <a href="../../files/ext/libxml/libxml_c.html">
58
+ <a href="../../../files/ext/libxml/libxml_c.html">
59
59
  ext/libxml/libxml.c
60
60
  </a>
61
61
  <br />
62
62
  </td>
63
63
  </tr>
64
64
 
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Object
69
- </td>
70
- </tr>
71
65
  </table>
72
66
  </div>
73
67
  <!-- banner header -->
@@ -80,12 +74,23 @@
80
74
 
81
75
  <div id="description">
82
76
  <p>
83
- The <a href="XPath.html">XML::XPath</a> class is used to query <a
84
- href="../XML.html">XML</a> documents. It is used via the <a
85
- href="Document.html#M000320">XML::Document#find</a> method.
77
+ The <a href="XPath.html">XML::XPath</a> module is used to query <a
78
+ href="../XML.html">XML</a> documents. It is usually accessed via the <a
79
+ href="Document.html#M000355">XML::Document#find</a> or <a
80
+ href="Node.html#M000189">XML::Node#find</a> methods. For example:
86
81
  </p>
87
82
  <pre>
88
- document.find('/foo')
83
+ document.find('/foo', namespaces) -&gt; XML::XPath::Object
84
+ </pre>
85
+ <p>
86
+ The optional namespaces parameter can be a string, array or hash table.
87
+ </p>
88
+ <pre>
89
+ document.find('/foo', 'xlink:http://www.w3.org/1999/xlink')
90
+ document.find('/foo', ['xlink:http://www.w3.org/1999/xlink',
91
+ 'xi:http://www.w3.org/2001/XInclude')
92
+ document.find('/foo', 'xlink' =&gt; 'http://www.w3.org/1999/xlink',
93
+ 'xi' =&gt; 'http://www.w3.org/2001/XInclude')
89
94
  </pre>
90
95
  <h3>Working With Namespaces</h3>
91
96
  <p>
@@ -128,13 +133,6 @@ some examples using the following xml document:
128
133
 
129
134
  </div>
130
135
 
131
- <div id="method-list">
132
- <h3 class="section-bar">Methods</h3>
133
-
134
- <div class="name-list">
135
- <a href="#M000238">debug</a>&nbsp;&nbsp;
136
- </div>
137
- </div>
138
136
 
139
137
  </div>
140
138
 
@@ -146,9 +144,9 @@ some examples using the following xml document:
146
144
  <div id="class-list">
147
145
  <h3 class="section-bar">Classes and Modules</h3>
148
146
 
149
- Class <a href="XPath/Context.html" class="link">XML::XPath::Context</a><br />
150
- Class <a href="XPath/InvalidPath.html" class="link">XML::XPath::InvalidPath</a><br />
151
- Class <a href="XPath/Object.html" class="link">XML::XPath::Object</a><br />
147
+ Class <a href="XPath/Context.html" class="link">LibXML::XML::XPath::Context</a><br />
148
+ Class <a href="XPath/InvalidPath.html" class="link">LibXML::XML::XPath::InvalidPath</a><br />
149
+ Class <a href="XPath/Object.html" class="link">LibXML::XML::XPath::Object</a><br />
152
150
 
153
151
  </div>
154
152
 
@@ -217,45 +215,6 @@ Class <a href="XPath/Object.html" class="link">XML::XPath::Object</a><br />
217
215
 
218
216
 
219
217
  <!-- if method_list -->
220
- <div id="methods">
221
- <h3 class="section-bar">Public Instance methods</h3>
222
-
223
- <div id="method-M000238" class="method-detail">
224
- <a name="M000238"></a>
225
-
226
- <div class="method-heading">
227
- <a href="#M000238" class="method-signature">
228
- <span class="method-name">xpath.debug &rarr; (true|false)<br />
229
- </span>
230
- </a>
231
- </div>
232
-
233
- <div class="method-description">
234
- <p>
235
- Dump libxml debugging information to stdout. Requires Libxml be compiled
236
- with debugging enabled.
237
- </p>
238
- <p><a class="source-toggle" href="#"
239
- onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
240
- <div class="method-source-code" id="M000238-source">
241
- <pre>
242
- /*
243
- * call-seq:
244
- * xpath.debug -&gt; (true|false)
245
- *
246
- * Dump libxml debugging information to stdout.
247
- * Requires Libxml be compiled with debugging enabled.
248
- */
249
- VALUE
250
- ruby_xml_xpath_debug(VALUE self) {
251
-
252
- </pre>
253
- </div>
254
- </div>
255
- </div>
256
-
257
-
258
- </div>
259
218
 
260
219
 
261
220
  </div>
@@ -0,0 +1,403 @@
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#M000355">XML::Document#find</a> and <a
89
+ href="../Node.html#M000189">XML::Node#find</a> methods.
90
+ </p>
91
+ <pre>
92
+ doc = XML::Document.string('&lt;header&gt;content&lt;/header&gt;')
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>&nbsp;&nbsp;
109
+ <a href="#M000001">new</a>&nbsp;&nbsp;
110
+ <a href="#M000005">node=</a>&nbsp;&nbsp;
111
+ <a href="#M000004">register_namespace</a>&nbsp;&nbsp;
112
+ <a href="#M000002">register_namespaces</a>&nbsp;&nbsp;
113
+ <a href="#M000003">register_namespaces_from_node</a>&nbsp;&nbsp;
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">&nbsp;[R]&nbsp;</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) &rarr; XPath::Context<br />
154
+ </span>
155
+ </a>
156
+ </div>
157
+
158
+ <div class="method-description">
159
+ <p>
160
+ Creates a new <a href="../XPath.html">XPath</a> context for the specified
161
+ document. The context can then be used to evaluate an <a
162
+ href="../XPath.html">XPath</a> expression.
163
+ </p>
164
+ <pre>
165
+ doc = XML::Document.string('&lt;header&gt;&lt;first&gt;hi&lt;/first&gt;&lt;/header&gt;')
166
+ context = XPath::Context.new(doc)
167
+ nodes = XPath::Object.new('//first', context)
168
+ nodes.length == 1
169
+ </pre>
170
+ <p><a class="source-toggle" href="#"
171
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
172
+ <div class="method-source-code" id="M000001-source">
173
+ <pre>
174
+ /* call-seq:
175
+ * XPath::Context.new(node) -&gt; XPath::Context
176
+ *
177
+ * Creates a new XPath context for the specified document. The
178
+ * context can then be used to evaluate an XPath expression.
179
+ *
180
+ * doc = XML::Document.string('&lt;header&gt;&lt;first&gt;hi&lt;/first&gt;&lt;/header&gt;')
181
+ * context = XPath::Context.new(doc)
182
+ * nodes = XPath::Object.new('//first', context)
183
+ * nodes.length == 1
184
+ */
185
+ VALUE
186
+ ruby_xml_xpath_context_initialize(VALUE self, VALUE node) {
187
+
188
+ </pre>
189
+ </div>
190
+ </div>
191
+ </div>
192
+
193
+ <h3 class="section-bar">Public Instance methods</h3>
194
+
195
+ <div id="method-M000006" class="method-detail">
196
+ <a name="M000006"></a>
197
+
198
+ <div class="method-heading">
199
+ <a href="#M000006" class="method-signature">
200
+ <span class="method-name">context.find("xpath") &rarr; XML::XPath::Object<br />
201
+ </span>
202
+ </a>
203
+ </div>
204
+
205
+ <div class="method-description">
206
+ <p>
207
+ Find nodes matching the specified <a href="../XPath.html">XPath</a>
208
+ expression
209
+ </p>
210
+ <p><a class="source-toggle" href="#"
211
+ onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
212
+ <div class="method-source-code" id="M000006-source">
213
+ <pre>
214
+ /*
215
+ * call-seq:
216
+ * context.find(&quot;xpath&quot;) -&gt; XML::XPath::Object
217
+ *
218
+ * Find nodes matching the specified XPath expression
219
+ */
220
+ VALUE
221
+ ruby_xml_xpath_context_find(VALUE self, VALUE xpath_expr) {
222
+
223
+ </pre>
224
+ </div>
225
+ </div>
226
+ </div>
227
+
228
+ <div id="method-M000005" class="method-detail">
229
+ <a name="M000005"></a>
230
+
231
+ <div class="method-heading">
232
+ <a href="#M000005" class="method-signature">
233
+ <span class="method-name">context.node = node<br />
234
+ </span>
235
+ </a>
236
+ </div>
237
+
238
+ <div class="method-description">
239
+ <p>
240
+ Set the current node used by the <a href="../XPath.html">XPath</a> engine
241
+ </p>
242
+ <pre>
243
+ doc = XML::Document.string('&lt;header&gt;&lt;first&gt;hi&lt;/first&gt;&lt;/header&gt;')
244
+ context.node = doc.root.first
245
+ </pre>
246
+ <p><a class="source-toggle" href="#"
247
+ onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
248
+ <div class="method-source-code" id="M000005-source">
249
+ <pre>
250
+ /*
251
+ * call-seq:
252
+ * context.node = node
253
+ *
254
+ * Set the current node used by the XPath engine
255
+
256
+ * doc = XML::Document.string('&lt;header&gt;&lt;first&gt;hi&lt;/first&gt;&lt;/header&gt;')
257
+ * context.node = doc.root.first
258
+ */
259
+ VALUE
260
+ ruby_xml_xpath_context_node_set(VALUE self, VALUE node) {
261
+
262
+ </pre>
263
+ </div>
264
+ </div>
265
+ </div>
266
+
267
+ <div id="method-M000004" class="method-detail">
268
+ <a name="M000004"></a>
269
+
270
+ <div class="method-heading">
271
+ <a href="#M000004" class="method-signature">
272
+ <span class="method-name">context.register_namespace(prefix, uri) &rarr; (true|false)<br />
273
+ </span>
274
+ </a>
275
+ </div>
276
+
277
+ <div class="method-description">
278
+ <p>
279
+ Register the specified namespace URI with the specified prefix in this
280
+ context.
281
+ </p>
282
+ <pre>
283
+ context.register_namespace('xi', 'http://www.w3.org/2001/XInclude')
284
+ </pre>
285
+ <p><a class="source-toggle" href="#"
286
+ onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
287
+ <div class="method-source-code" id="M000004-source">
288
+ <pre>
289
+ /*
290
+ * call-seq:
291
+ * context.register_namespace(prefix, uri) -&gt; (true|false)
292
+ *
293
+ * Register the specified namespace URI with the specified prefix
294
+ * in this context.
295
+
296
+ * context.register_namespace('xi', 'http://www.w3.org/2001/XInclude')
297
+ */
298
+ VALUE
299
+ ruby_xml_xpath_context_register_namespace(VALUE self, VALUE prefix, VALUE uri) {
300
+
301
+ </pre>
302
+ </div>
303
+ </div>
304
+ </div>
305
+
306
+ <div id="method-M000002" class="method-detail">
307
+ <a name="M000002"></a>
308
+
309
+ <div class="method-heading">
310
+ <a href="#M000002" class="method-signature">
311
+ <span class="method-name">context.register_namespaces(["prefix:uri"]) &rarr; self<br />
312
+ </span>
313
+ </a>
314
+ </div>
315
+
316
+ <div class="method-description">
317
+ <p>
318
+ Register the specified namespaces in this context.
319
+ </p>
320
+ <pre>
321
+ context.register_namespaces('xi:http://www.w3.org/2001/XInclude')
322
+ context.register_namespaces(['xlink:http://www.w3.org/1999/xlink',
323
+ 'xi:http://www.w3.org/2001/XInclude')
324
+ context.register_namespaces('xlink' =&gt; 'http://www.w3.org/1999/xlink',
325
+ 'xi' =&gt; 'http://www.w3.org/2001/XInclude')
326
+ </pre>
327
+ <p><a class="source-toggle" href="#"
328
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
329
+ <div class="method-source-code" id="M000002-source">
330
+ <pre>
331
+ /*
332
+ * call-seq:
333
+ * context.register_namespaces([&quot;prefix:uri&quot;]) -&gt; self
334
+ *
335
+ * Register the specified namespaces in this context.
336
+ *
337
+ * context.register_namespaces('xi:http://www.w3.org/2001/XInclude')
338
+ * context.register_namespaces(['xlink:http://www.w3.org/1999/xlink',
339
+ * 'xi:http://www.w3.org/2001/XInclude')
340
+ * context.register_namespaces('xlink' =&gt; 'http://www.w3.org/1999/xlink',
341
+ * 'xi' =&gt; 'http://www.w3.org/2001/XInclude')
342
+ */
343
+ VALUE
344
+ ruby_xml_xpath_context_register_namespaces(VALUE self, VALUE nslist) {
345
+
346
+ </pre>
347
+ </div>
348
+ </div>
349
+ </div>
350
+
351
+ <div id="method-M000003" class="method-detail">
352
+ <a name="M000003"></a>
353
+
354
+ <div class="method-heading">
355
+ <a href="#M000003" class="method-signature">
356
+ <span class="method-name">context.register_namespaces_from_node(node) &rarr; self<br />
357
+ </span>
358
+ </a>
359
+ </div>
360
+
361
+ <div class="method-description">
362
+ <p>
363
+ Helper method to read in namespaces defined on a node.
364
+ </p>
365
+ <pre>
366
+ doc = XML::Document.string('&lt;header&gt;&lt;first&gt;hi&lt;/first&gt;&lt;/header&gt;')
367
+ context = XPath::Context.new(doc)
368
+ context.register_namespaces_from_node(doc.root)
369
+ </pre>
370
+ <p><a class="source-toggle" href="#"
371
+ onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
372
+ <div class="method-source-code" id="M000003-source">
373
+ <pre>
374
+ /* call-seq:
375
+ * context.register_namespaces_from_node(node) -&gt; self
376
+ *
377
+ * Helper method to read in namespaces defined on a node.
378
+ *
379
+ * doc = XML::Document.string('&lt;header&gt;&lt;first&gt;hi&lt;/first&gt;&lt;/header&gt;')
380
+ * context = XPath::Context.new(doc)
381
+ * context.register_namespaces_from_node(doc.root)
382
+ */
383
+ VALUE
384
+ ruby_xml_xpath_context_register_namespaces_from_node(VALUE self, VALUE node) {
385
+
386
+ </pre>
387
+ </div>
388
+ </div>
389
+ </div>
390
+
391
+
392
+ </div>
393
+
394
+
395
+ </div>
396
+
397
+
398
+ <div id="validator-badges">
399
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
400
+ </div>
401
+
402
+ </body>
403
+ </html>