coupa-libxml-ruby 1.1.4

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.
Files changed (280) hide show
  1. data/CHANGES +488 -0
  2. data/LICENSE +22 -0
  3. data/README +161 -0
  4. data/Rakefile +188 -0
  5. data/doc/css/normal.css +182 -0
  6. data/doc/img/raze-tiny.png +0 -0
  7. data/doc/img/red-cube.jpg +0 -0
  8. data/doc/img/xml-ruby.png +0 -0
  9. data/doc/index.xml +43 -0
  10. data/doc/install.xml +77 -0
  11. data/doc/layout.rhtml +38 -0
  12. data/doc/layout.xsl +67 -0
  13. data/doc/license.xml +32 -0
  14. data/doc/log/changelog.xml +1324 -0
  15. data/doc/log/changelog.xsl +42 -0
  16. data/doc/rdoc/classes/LibXML.html +207 -0
  17. data/doc/rdoc/classes/LibXML/XML.html +407 -0
  18. data/doc/rdoc/classes/LibXML/XML/Attr.html +521 -0
  19. data/doc/rdoc/classes/LibXML/XML/AttrDecl.html +360 -0
  20. data/doc/rdoc/classes/LibXML/XML/Attributes.html +149 -0
  21. data/doc/rdoc/classes/LibXML/XML/Document.html +460 -0
  22. data/doc/rdoc/classes/LibXML/XML/Error.html +129 -0
  23. data/doc/rdoc/classes/LibXML/XML/HTMLParser.html +263 -0
  24. data/doc/rdoc/classes/LibXML/XML/Namespace.html +248 -0
  25. data/doc/rdoc/classes/LibXML/XML/Namespaces.html +200 -0
  26. data/doc/rdoc/classes/LibXML/XML/Node.html +1351 -0
  27. data/doc/rdoc/classes/LibXML/XML/Parser.html +328 -0
  28. data/doc/rdoc/classes/LibXML/XML/Reader.html +172 -0
  29. data/doc/rdoc/classes/LibXML/XML/SaxParser.html +232 -0
  30. data/doc/rdoc/classes/LibXML/XML/SaxParser/Callbacks.html +506 -0
  31. data/doc/rdoc/classes/LibXML/XML/SaxParser/VerboseCallbacks.html +555 -0
  32. data/doc/rdoc/classes/LibXML/XML/XPath.html +111 -0
  33. data/doc/rdoc/classes/LibXML/XML/XPath/Object.html +162 -0
  34. data/doc/rdoc/classes/cXMLDtd.html +114 -0
  35. data/doc/rdoc/classes/cXMLNode.html +114 -0
  36. data/doc/rdoc/created.rid +1 -0
  37. data/doc/rdoc/files/CHANGES.html +794 -0
  38. data/doc/rdoc/files/LICENSE.html +131 -0
  39. data/doc/rdoc/files/README.html +343 -0
  40. data/doc/rdoc/files/ext/libxml/libxml_c.html +101 -0
  41. data/doc/rdoc/files/ext/libxml/ruby_xml_attr_c.html +101 -0
  42. data/doc/rdoc/files/ext/libxml/ruby_xml_attr_decl_c.html +101 -0
  43. data/doc/rdoc/files/ext/libxml/ruby_xml_attributes_c.html +101 -0
  44. data/doc/rdoc/files/ext/libxml/ruby_xml_c.html +101 -0
  45. data/doc/rdoc/files/ext/libxml/ruby_xml_cbg_c.html +101 -0
  46. data/doc/rdoc/files/ext/libxml/ruby_xml_document_c.html +101 -0
  47. data/doc/rdoc/files/ext/libxml/ruby_xml_dtd_c.html +101 -0
  48. data/doc/rdoc/files/ext/libxml/ruby_xml_encoding_c.html +101 -0
  49. data/doc/rdoc/files/ext/libxml/ruby_xml_error_c.html +101 -0
  50. data/doc/rdoc/files/ext/libxml/ruby_xml_html_parser_c.html +101 -0
  51. data/doc/rdoc/files/ext/libxml/ruby_xml_html_parser_context_c.html +101 -0
  52. data/doc/rdoc/files/ext/libxml/ruby_xml_html_parser_options_c.html +101 -0
  53. data/doc/rdoc/files/ext/libxml/ruby_xml_input_cbg_c.html +101 -0
  54. data/doc/rdoc/files/ext/libxml/ruby_xml_io_c.html +101 -0
  55. data/doc/rdoc/files/ext/libxml/ruby_xml_namespace_c.html +101 -0
  56. data/doc/rdoc/files/ext/libxml/ruby_xml_namespaces_c.html +101 -0
  57. data/doc/rdoc/files/ext/libxml/ruby_xml_node_c.html +101 -0
  58. data/doc/rdoc/files/ext/libxml/ruby_xml_parser_c.html +101 -0
  59. data/doc/rdoc/files/ext/libxml/ruby_xml_parser_context_c.html +101 -0
  60. data/doc/rdoc/files/ext/libxml/ruby_xml_parser_options_c.html +101 -0
  61. data/doc/rdoc/files/ext/libxml/ruby_xml_reader_c.html +101 -0
  62. data/doc/rdoc/files/ext/libxml/ruby_xml_relaxng_c.html +101 -0
  63. data/doc/rdoc/files/ext/libxml/ruby_xml_sax2_handler_c.html +101 -0
  64. data/doc/rdoc/files/ext/libxml/ruby_xml_sax_parser_c.html +101 -0
  65. data/doc/rdoc/files/ext/libxml/ruby_xml_schema_c.html +101 -0
  66. data/doc/rdoc/files/ext/libxml/ruby_xml_xinclude_c.html +101 -0
  67. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_c.html +101 -0
  68. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_context_c.html +101 -0
  69. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_expression_c.html +101 -0
  70. data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_object_c.html +101 -0
  71. data/doc/rdoc/files/ext/libxml/ruby_xml_xpointer_c.html +101 -0
  72. data/doc/rdoc/files/lib/libxml/attr_decl_rb.html +101 -0
  73. data/doc/rdoc/files/lib/libxml/attr_rb.html +101 -0
  74. data/doc/rdoc/files/lib/libxml/attributes_rb.html +101 -0
  75. data/doc/rdoc/files/lib/libxml/document_rb.html +101 -0
  76. data/doc/rdoc/files/lib/libxml/error_rb.html +101 -0
  77. data/doc/rdoc/files/lib/libxml/hpricot_rb.html +192 -0
  78. data/doc/rdoc/files/lib/libxml/html_parser_rb.html +101 -0
  79. data/doc/rdoc/files/lib/libxml/namespace_rb.html +101 -0
  80. data/doc/rdoc/files/lib/libxml/namespaces_rb.html +101 -0
  81. data/doc/rdoc/files/lib/libxml/node_rb.html +108 -0
  82. data/doc/rdoc/files/lib/libxml/ns_rb.html +101 -0
  83. data/doc/rdoc/files/lib/libxml/parser_rb.html +101 -0
  84. data/doc/rdoc/files/lib/libxml/properties_rb.html +101 -0
  85. data/doc/rdoc/files/lib/libxml/reader_rb.html +101 -0
  86. data/doc/rdoc/files/lib/libxml/sax_callbacks_rb.html +101 -0
  87. data/doc/rdoc/files/lib/libxml/sax_parser_rb.html +101 -0
  88. data/doc/rdoc/files/lib/libxml/tree_rb.html +101 -0
  89. data/doc/rdoc/files/lib/libxml/xpath_object_rb.html +101 -0
  90. data/doc/rdoc/files/lib/libxml_rb.html +133 -0
  91. data/doc/rdoc/files/lib/xml/libxml_rb.html +124 -0
  92. data/doc/rdoc/files/lib/xml_rb.html +134 -0
  93. data/doc/rdoc/fr_class_index.html +46 -0
  94. data/doc/rdoc/fr_file_index.html +84 -0
  95. data/doc/rdoc/fr_method_index.html +155 -0
  96. data/doc/rdoc/index.html +24 -0
  97. data/doc/rdoc/rdoc-style.css +208 -0
  98. data/ext/libxml/Makefile +157 -0
  99. data/ext/libxml/build.log +4 -0
  100. data/ext/libxml/extconf.h +5 -0
  101. data/ext/libxml/extconf.rb +278 -0
  102. data/ext/libxml/libxml.c +77 -0
  103. data/ext/libxml/libxml.o +0 -0
  104. data/ext/libxml/libxml_ruby.bundle +0 -0
  105. data/ext/libxml/mkmf.log +228 -0
  106. data/ext/libxml/ruby_libxml.h +93 -0
  107. data/ext/libxml/ruby_xml.c +893 -0
  108. data/ext/libxml/ruby_xml.h +10 -0
  109. data/ext/libxml/ruby_xml.o +0 -0
  110. data/ext/libxml/ruby_xml_attr.c +352 -0
  111. data/ext/libxml/ruby_xml_attr.h +14 -0
  112. data/ext/libxml/ruby_xml_attr.o +0 -0
  113. data/ext/libxml/ruby_xml_attr_decl.c +171 -0
  114. data/ext/libxml/ruby_xml_attr_decl.h +13 -0
  115. data/ext/libxml/ruby_xml_attr_decl.o +0 -0
  116. data/ext/libxml/ruby_xml_attributes.c +277 -0
  117. data/ext/libxml/ruby_xml_attributes.h +17 -0
  118. data/ext/libxml/ruby_xml_attributes.o +0 -0
  119. data/ext/libxml/ruby_xml_cbg.c +86 -0
  120. data/ext/libxml/ruby_xml_cbg.o +0 -0
  121. data/ext/libxml/ruby_xml_document.c +1006 -0
  122. data/ext/libxml/ruby_xml_document.c.old +936 -0
  123. data/ext/libxml/ruby_xml_document.h +17 -0
  124. data/ext/libxml/ruby_xml_document.o +0 -0
  125. data/ext/libxml/ruby_xml_dtd.c +257 -0
  126. data/ext/libxml/ruby_xml_dtd.h +9 -0
  127. data/ext/libxml/ruby_xml_dtd.o +0 -0
  128. data/ext/libxml/ruby_xml_encoding.c +134 -0
  129. data/ext/libxml/ruby_xml_encoding.h +12 -0
  130. data/ext/libxml/ruby_xml_encoding.o +0 -0
  131. data/ext/libxml/ruby_xml_error.c +1004 -0
  132. data/ext/libxml/ruby_xml_error.h +14 -0
  133. data/ext/libxml/ruby_xml_error.o +0 -0
  134. data/ext/libxml/ruby_xml_html_parser.c +92 -0
  135. data/ext/libxml/ruby_xml_html_parser.h +12 -0
  136. data/ext/libxml/ruby_xml_html_parser.o +0 -0
  137. data/ext/libxml/ruby_xml_html_parser_context.c +308 -0
  138. data/ext/libxml/ruby_xml_html_parser_context.h +12 -0
  139. data/ext/libxml/ruby_xml_html_parser_context.o +0 -0
  140. data/ext/libxml/ruby_xml_html_parser_options.c +40 -0
  141. data/ext/libxml/ruby_xml_html_parser_options.h +12 -0
  142. data/ext/libxml/ruby_xml_html_parser_options.o +0 -0
  143. data/ext/libxml/ruby_xml_input_cbg.c +191 -0
  144. data/ext/libxml/ruby_xml_input_cbg.h +20 -0
  145. data/ext/libxml/ruby_xml_input_cbg.o +0 -0
  146. data/ext/libxml/ruby_xml_io.c +30 -0
  147. data/ext/libxml/ruby_xml_io.h +9 -0
  148. data/ext/libxml/ruby_xml_io.o +0 -0
  149. data/ext/libxml/ruby_xml_namespace.c +170 -0
  150. data/ext/libxml/ruby_xml_namespace.h +12 -0
  151. data/ext/libxml/ruby_xml_namespace.o +0 -0
  152. data/ext/libxml/ruby_xml_namespaces.c +295 -0
  153. data/ext/libxml/ruby_xml_namespaces.h +11 -0
  154. data/ext/libxml/ruby_xml_namespaces.o +0 -0
  155. data/ext/libxml/ruby_xml_node.c +1386 -0
  156. data/ext/libxml/ruby_xml_node.h +13 -0
  157. data/ext/libxml/ruby_xml_node.o +0 -0
  158. data/ext/libxml/ruby_xml_parser.c +94 -0
  159. data/ext/libxml/ruby_xml_parser.h +14 -0
  160. data/ext/libxml/ruby_xml_parser.o +0 -0
  161. data/ext/libxml/ruby_xml_parser_context.c +982 -0
  162. data/ext/libxml/ruby_xml_parser_context.h +12 -0
  163. data/ext/libxml/ruby_xml_parser_context.o +0 -0
  164. data/ext/libxml/ruby_xml_parser_options.c +68 -0
  165. data/ext/libxml/ruby_xml_parser_options.h +14 -0
  166. data/ext/libxml/ruby_xml_parser_options.o +0 -0
  167. data/ext/libxml/ruby_xml_reader.c +1002 -0
  168. data/ext/libxml/ruby_xml_reader.h +14 -0
  169. data/ext/libxml/ruby_xml_reader.o +0 -0
  170. data/ext/libxml/ruby_xml_relaxng.c +111 -0
  171. data/ext/libxml/ruby_xml_relaxng.h +10 -0
  172. data/ext/libxml/ruby_xml_relaxng.o +0 -0
  173. data/ext/libxml/ruby_xml_sax2_handler.c +322 -0
  174. data/ext/libxml/ruby_xml_sax2_handler.h +12 -0
  175. data/ext/libxml/ruby_xml_sax2_handler.o +0 -0
  176. data/ext/libxml/ruby_xml_sax_parser.c +137 -0
  177. data/ext/libxml/ruby_xml_sax_parser.h +12 -0
  178. data/ext/libxml/ruby_xml_sax_parser.o +0 -0
  179. data/ext/libxml/ruby_xml_schema.c +159 -0
  180. data/ext/libxml/ruby_xml_schema.h +11 -0
  181. data/ext/libxml/ruby_xml_schema.o +0 -0
  182. data/ext/libxml/ruby_xml_version.h +9 -0
  183. data/ext/libxml/ruby_xml_xinclude.c +18 -0
  184. data/ext/libxml/ruby_xml_xinclude.h +13 -0
  185. data/ext/libxml/ruby_xml_xinclude.o +0 -0
  186. data/ext/libxml/ruby_xml_xpath.c +107 -0
  187. data/ext/libxml/ruby_xml_xpath.h +12 -0
  188. data/ext/libxml/ruby_xml_xpath.o +0 -0
  189. data/ext/libxml/ruby_xml_xpath_context.c +387 -0
  190. data/ext/libxml/ruby_xml_xpath_context.h +11 -0
  191. data/ext/libxml/ruby_xml_xpath_context.o +0 -0
  192. data/ext/libxml/ruby_xml_xpath_expression.c +83 -0
  193. data/ext/libxml/ruby_xml_xpath_expression.h +12 -0
  194. data/ext/libxml/ruby_xml_xpath_expression.o +0 -0
  195. data/ext/libxml/ruby_xml_xpath_object.c +336 -0
  196. data/ext/libxml/ruby_xml_xpath_object.h +19 -0
  197. data/ext/libxml/ruby_xml_xpath_object.o +0 -0
  198. data/ext/libxml/ruby_xml_xpointer.c +101 -0
  199. data/ext/libxml/ruby_xml_xpointer.h +13 -0
  200. data/ext/libxml/ruby_xml_xpointer.o +0 -0
  201. data/ext/mingw/Rakefile +34 -0
  202. data/ext/mingw/build.rake +41 -0
  203. data/ext/vc/libxml_ruby.sln +26 -0
  204. data/lib/libxml.rb +30 -0
  205. data/lib/libxml/attr.rb +111 -0
  206. data/lib/libxml/attr_decl.rb +78 -0
  207. data/lib/libxml/attributes.rb +12 -0
  208. data/lib/libxml/document.rb +190 -0
  209. data/lib/libxml/error.rb +88 -0
  210. data/lib/libxml/hpricot.rb +76 -0
  211. data/lib/libxml/html_parser.rb +94 -0
  212. data/lib/libxml/namespace.rb +60 -0
  213. data/lib/libxml/namespaces.rb +36 -0
  214. data/lib/libxml/node.rb +385 -0
  215. data/lib/libxml/ns.rb +20 -0
  216. data/lib/libxml/parser.rb +365 -0
  217. data/lib/libxml/properties.rb +21 -0
  218. data/lib/libxml/reader.rb +27 -0
  219. data/lib/libxml/sax_callbacks.rb +178 -0
  220. data/lib/libxml/sax_parser.rb +56 -0
  221. data/lib/libxml/tree.rb +27 -0
  222. data/lib/libxml/xpath_object.rb +14 -0
  223. data/lib/xml.rb +14 -0
  224. data/lib/xml/libxml.rb +8 -0
  225. data/setup.rb +1585 -0
  226. data/test/etc_doc_to_s.rb +19 -0
  227. data/test/ets_doc_file.rb +15 -0
  228. data/test/ets_doc_to_s.rb +21 -0
  229. data/test/ets_gpx.rb +26 -0
  230. data/test/ets_node_gc.rb +21 -0
  231. data/test/ets_test.xml +2 -0
  232. data/test/ets_tsr.rb +9 -0
  233. data/test/model/atom.xml +13 -0
  234. data/test/model/bands.xml +5 -0
  235. data/test/model/books.xml +146 -0
  236. data/test/model/merge_bug_data.xml +58 -0
  237. data/test/model/ruby-lang.html +238 -0
  238. data/test/model/rubynet.xml +79 -0
  239. data/test/model/rubynet_project +1 -0
  240. data/test/model/shiporder.rnc +28 -0
  241. data/test/model/shiporder.rng +86 -0
  242. data/test/model/shiporder.xml +23 -0
  243. data/test/model/shiporder.xsd +31 -0
  244. data/test/model/soap.xml +27 -0
  245. data/test/model/xinclude.xml +5 -0
  246. data/test/tc_attr.rb +170 -0
  247. data/test/tc_attr_decl.rb +131 -0
  248. data/test/tc_attributes.rb +133 -0
  249. data/test/tc_deprecated_require.rb +11 -0
  250. data/test/tc_document.rb +113 -0
  251. data/test/tc_document_write.rb +118 -0
  252. data/test/tc_dtd.rb +123 -0
  253. data/test/tc_error.rb +136 -0
  254. data/test/tc_html_parser.rb +138 -0
  255. data/test/tc_namespace.rb +59 -0
  256. data/test/tc_namespaces.rb +174 -0
  257. data/test/tc_node.rb +181 -0
  258. data/test/tc_node_cdata.rb +49 -0
  259. data/test/tc_node_comment.rb +30 -0
  260. data/test/tc_node_copy.rb +40 -0
  261. data/test/tc_node_edit.rb +158 -0
  262. data/test/tc_node_text.rb +69 -0
  263. data/test/tc_node_write.rb +83 -0
  264. data/test/tc_node_xlink.rb +26 -0
  265. data/test/tc_parser.rb +330 -0
  266. data/test/tc_parser_context.rb +186 -0
  267. data/test/tc_properties.rb +36 -0
  268. data/test/tc_reader.rb +284 -0
  269. data/test/tc_relaxng.rb +51 -0
  270. data/test/tc_sax_parser.rb +274 -0
  271. data/test/tc_schema.rb +51 -0
  272. data/test/tc_traversal.rb +220 -0
  273. data/test/tc_xinclude.rb +19 -0
  274. data/test/tc_xml.rb +224 -0
  275. data/test/tc_xpath.rb +193 -0
  276. data/test/tc_xpath_context.rb +78 -0
  277. data/test/tc_xpath_expression.rb +35 -0
  278. data/test/tc_xpointer.rb +72 -0
  279. data/test/test_suite.rb +33 -0
  280. metadata +376 -0
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2008-2009 Charlie Savage and contributors
2
+ Copyright (c) 2002-2007 Sean Chittenden and contributors
3
+ Copyright (c) 2001 Wai-Sun "Squidster" Chia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README ADDED
@@ -0,0 +1,161 @@
1
+ = LibXML Ruby
2
+
3
+ == Overview
4
+ The libxml gem provides Ruby language bindings for GNOME's Libxml2
5
+ XML toolkit. It is free software, released under the MIT License.
6
+
7
+ We think libxml-ruby is the best XML library for Ruby because:
8
+
9
+ * Speed - Its much faster than REXML and Hpricot
10
+ * Features - It provides an amazing number of featues
11
+ * Conformance - It passes all 1800+ tests from the OASIS XML Tests Suite
12
+
13
+ == Requirements
14
+ libxml-ruby requires Ruby 1.8.4 or higher. It is dependent on
15
+ the following libraries to function properly:
16
+
17
+ * libm (math routines: very standard)
18
+ * libz (zlib)
19
+ * libiconv
20
+ * libxml2
21
+
22
+ If you are running Linux or Unix you'll need a C compiler so the
23
+ extension can be compiled when it is installed. If you are running
24
+ Windows, then install the Windows specific RubyGem which
25
+ includes an already built extension.
26
+
27
+ == INSTALLATION
28
+ The easiest way to install libxml-ruby is via Ruby Gems. To install:
29
+
30
+ <tt>gem install libxml-ruby</tt>
31
+
32
+ If you are running Windows, make sure to install the Win32 RubyGem
33
+ which includes an already built binary file. The binary is built
34
+ against libxml2 version 2.7.2 and iconv version 1.11. Both of these
35
+ are also included as pre-built binaries, and should be put either in
36
+ the libxml/lib directory or on the Windows path. Due to a bug
37
+ in ruby-gems, you cannot install the gem to a path that contains
38
+ spaces (see http://rubyforge.org/tracker/?func=detail&aid=23003&group_id=126&atid=577).
39
+
40
+ The Windows binaries are built with MingW and include libxml-ruby,
41
+ libxml2 and iconv. The gem also includes a Microsoft VC++ 2008
42
+ solution. If you wish to run a debug version of libxml-ruby on
43
+ Windows, then it is highly recommended you use VC++.
44
+
45
+ == Getting Started
46
+ Using libxml is easy. First decide what parser you want to use:
47
+
48
+ * Generally you'll want to use the LibXML::XML::Parser which provides a tree based API.
49
+ * For larger documents that don't fit into memory, or if you prefer an input based API, use the LibXML::XML::Reader.
50
+ * To parse HTML files use LibXML::XML::HTMLParser.
51
+ * If you are masochistic, then use the LibXML::XML::SaxParser, which provides a callback API.
52
+
53
+ Once you have choosen a parser, choose a datasource. Libxml can parse files, strings, URIs
54
+ and IO streams. For each data source you can specify an LibXML::XML::Encoding, a base uri and
55
+ various parser options. For more information, refer the LibXML::XML::Parser.document,
56
+ LibXML::XML::Parser.file, LibXML::XML::Parser.io or LibXML:::XML::Parser.string methods (the
57
+ same methods are defined on all four parser classes).
58
+
59
+ == Advanced Functionality
60
+ Beyond the basics of parsing and processing XML and HTML documents,
61
+ libxml provides a wealth of additional functionality.
62
+
63
+ Most commonly, you'll want to use its LibXML::XML::XPath support, which makes
64
+ it easy to find data inside a XML document. Although not as popular,
65
+ LibXML::XML::XPointer provides another API for finding data inside an XML document.
66
+
67
+ Often times you'll need to validate data before processing it. For example,
68
+ if you accept user generated content submitted over the Web, you'll
69
+ want to verify that it does not contain malicious code such as embedded scripts.
70
+ This can be done using libxml's powerful set of validators:
71
+
72
+ * DTDs (LibXML::XML::Dtd)
73
+ * Relax Schemas (LibXML::XML::RelaxNG)
74
+ * XML Schema (LibXML::XML::Schema)
75
+
76
+ Finally, if you'd like to use XSL Transformations to process data,
77
+ then install the libxslt gem which is available at
78
+ http://rubyforge.org/projects/libxsl/.
79
+
80
+ == Usage
81
+ For in-depth information about using libxml-ruby please refer
82
+ to its online Rdoc documentation.
83
+
84
+ All libxml classes are in the LibXML::XML module. The easiest
85
+ way to use libxml is to require 'xml'. This will mixin
86
+ the LibXML module into the global namespace, allowing you to
87
+ write code like this:
88
+
89
+ require 'xml'
90
+ document = XML::Document.new
91
+
92
+ However, when creating an application or library you plan to
93
+ redistribute, it is best to not add the LibXML module to the global
94
+ namespace, in which case you can either write your code like this:
95
+
96
+ require 'libxml'
97
+ document = LibXML::XML::Document.new
98
+
99
+ Or you can utilize a namespace for you own work and include LibXML into it.
100
+ For example:
101
+
102
+ require 'libxml'
103
+
104
+ mdoule MyApplication
105
+ include LibXML
106
+
107
+ class MyClass
108
+ def some_method
109
+ document = XML::Document.new
110
+ end
111
+ end
112
+ end
113
+
114
+ For simplicity's sake, the documentation uses the xml module in its examples.
115
+
116
+ == Performance
117
+ In addition to being feature rich and conformation, the main reason
118
+ people use libxml-ruby is for performance. Here are the results
119
+ of a couple simple benchmarks recently blogged about on the
120
+ Web (you can find them in the benchmark directory of the
121
+ libxml distribution).
122
+
123
+ From http://depixelate.com/2008/4/23/ruby-xml-parsing-benchmarks
124
+
125
+ user system total real
126
+ libxml 0.032000 0.000000 0.032000 ( 0.031000)
127
+ Hpricot 0.640000 0.031000 0.671000 ( 0.890000)
128
+ REXML 1.813000 0.047000 1.860000 ( 2.031000)
129
+
130
+ From https://svn.concord.org/svn/projects/trunk/common/ruby/xml_benchmarks/
131
+
132
+ user system total real
133
+ libxml 0.641000 0.031000 0.672000 ( 0.672000)
134
+ hpricot 5.359000 0.062000 5.421000 ( 5.516000)
135
+ rexml 22.859000 0.047000 22.906000 ( 23.203000)
136
+
137
+
138
+ == Documentation
139
+ Documentation is provided via rdoc. To generate the documentation,
140
+ run the the command 'rake doc'. libxml-ruby's online documentation
141
+ is generated using Hanna. To use hanna:
142
+
143
+ gem install mislav-hanna
144
+ rake rdoc RDOCOPT="-S -T hanna"
145
+
146
+ Note that older versions of Rdoc, which ship with Ruby 1.8.x, will report
147
+ a number of errors. To avoid them, install Rdoc 2.1 or higher from
148
+ RubyForge (http://rdoc.rubyforge.org/). Once you have installed the gem,
149
+ you'll have to disable the version of Rdoc that Ruby 1.8.x includes. An
150
+ easy way to do that is rename the directory uby/lib/ruby/1.8/rdoc to
151
+ ruby/lib/ruby/1.8/rdoc_old.
152
+
153
+ == Support
154
+
155
+ If you have any questions about using libxml-ruby, please send them to
156
+ libxml-devel@rubyforge.org. If you have found any bugs in libxml-devel,
157
+ or have developed new patches, please submit them to Ruby Forge at
158
+ http://rubyforge.org/tracker/?group_id=494.
159
+
160
+ == License
161
+ See LICENSE for license information.
@@ -0,0 +1,188 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Be sure to set ENV['RUBYFORGE_USERNAME'] to use publish.
4
+
5
+ require 'rubygems'
6
+ require 'rake/gempackagetask'
7
+ require 'rake/rdoctask'
8
+ require 'rake/testtask'
9
+ require 'date'
10
+
11
+
12
+ # ------- Default Package ----------
13
+ FILES = FileList[
14
+ 'Rakefile',
15
+ 'CHANGES',
16
+ 'LICENSE',
17
+ 'README',
18
+ 'setup.rb',
19
+ 'doc/**/*',
20
+ 'ext/libxml/*',
21
+ 'ext/mingw/Rakefile',
22
+ 'ext/mingw/build.rake',
23
+ 'ext/vc/*.sln',
24
+ 'ext/vc/*.vcproj',
25
+ 'lib/**/*',
26
+ 'benchmark/**/*',
27
+ 'test/**/*'
28
+ ]
29
+
30
+ # Default GEM Specification
31
+ default_spec = Gem::Specification.new do |spec|
32
+ spec.name = "coupa-libxml-ruby"
33
+
34
+ spec.homepage = "http://libxml.rubyforge.org/"
35
+ spec.summary = "Fork of libXML with some extra features"
36
+ spec.description = <<-EOF
37
+ Patches have been submitted to the LibXML-Ruby project on rubyforge, but until they get
38
+ merged in we have this fork. Currently adds c14n support.
39
+ EOF
40
+
41
+ # Determine the current version of the software
42
+ spec.version =
43
+ if File.read('ext/libxml/ruby_xml_version.h') =~ /\s*RUBY_LIBXML_VERSION\s*['"](\d.+)['"]/
44
+ CURRENT_VERSION = $1
45
+ else
46
+ CURRENT_VERSION = "0.0.0"
47
+ end
48
+
49
+ spec.author = "Victor Lin"
50
+ spec.email = "devteam@coupa.com"
51
+ spec.platform = Gem::Platform::RUBY
52
+ spec.require_paths = ["lib", "ext/libxml"]
53
+ spec.bindir = "bin"
54
+ spec.extensions = ["ext/libxml/extconf.rb"]
55
+ spec.files = FILES.to_a
56
+ spec.test_files = Dir.glob("test/tc_*.rb")
57
+
58
+ spec.required_ruby_version = '>= 1.8.4'
59
+ spec.date = DateTime.now
60
+ spec.rubyforge_project = 'libxml'
61
+
62
+ spec.has_rdoc = true
63
+ end
64
+
65
+ # Rake task to build the default package
66
+ Rake::GemPackageTask.new(default_spec) do |pkg|
67
+ pkg.package_dir = 'admin/pkg'
68
+ pkg.need_tar = true
69
+ end
70
+
71
+
72
+ # ------- Windows GEM ----------
73
+ if RUBY_PLATFORM.match(/win32/)
74
+ binaries = (FileList['ext/mingw/*.so',
75
+ 'ext/mingw/*.dll*'])
76
+
77
+ # Windows specification
78
+ win_spec = default_spec.clone
79
+ win_spec.extensions = ['ext/mingw/Rakefile']
80
+ win_spec.platform = Gem::Platform::CURRENT
81
+ win_spec.files += binaries.to_a
82
+
83
+ # Rake task to build the windows package
84
+ Rake::GemPackageTask.new(win_spec) do |pkg|
85
+ pkg.package_dir = 'admin/pkg'
86
+ pkg.need_tar = false
87
+ end
88
+ end
89
+
90
+ # --------- RDoc Documentation ---------
91
+ desc "Generate rdoc documentation"
92
+ Rake::RDocTask.new("rdoc") do |rdoc|
93
+ rdoc.rdoc_dir = 'doc/rdoc'
94
+ rdoc.title = "LibXML"
95
+ # Show source inline with line numbers
96
+ rdoc.options << "--line-numbers"
97
+ # Make the readme file the start page for the generated html
98
+ rdoc.options << '--main' << 'README'
99
+ rdoc.rdoc_files.include('doc/*.rdoc',
100
+ 'ext/**/libxml.c',
101
+ 'ext/**/ruby_xml.c',
102
+ 'ext/**/*.c',
103
+ 'lib/**/*.rb',
104
+ 'CHANGES',
105
+ 'README',
106
+ 'LICENSE')
107
+ end
108
+
109
+ Rake::TestTask.new do |t|
110
+ t.libs << "test"
111
+ t.libs << "lib"
112
+ t.libs << "ext/libxml"
113
+ end
114
+
115
+ if not RUBY_PLATFORM.match(/mswin32/i)
116
+ Rake::Task[:test].prerequisites << :extensions
117
+ end
118
+
119
+ task :default => :package
120
+ task :build => :extensions
121
+ task :extension => :build
122
+
123
+ ext = Config::CONFIG["DLEXT"]
124
+ task :extensions => ["ext/libxml/libxml_ruby.#{ext}"]
125
+ file "ext/libxml/libxml_ruby.#{ext}" =>
126
+ ["ext/libxml/Makefile"] + FileList["ext/libxml/*.{c,h}"].to_a do |t|
127
+ Dir.chdir("ext/libxml") { sh "make" }
128
+ end
129
+
130
+ namespace :extensions do
131
+ task :clean do
132
+ Dir.chdir("ext/libxml") do
133
+ sh "rm -f Makefile"
134
+ sh "rm -f *.{o,so,bundle,log}"
135
+ end
136
+ end
137
+ end
138
+
139
+ file "ext/libxml/Makefile" => ["ext/libxml/extconf.rb"] do
140
+ command = ["ruby"] + $:.map{|dir| "-I#{File.expand_path dir}"} + ["extconf.rb"]
141
+ Dir.chdir("ext/libxml") { sh(*command) }
142
+ end
143
+
144
+ # --------- Publish Website to Rubyforge ---------
145
+ desc "publish website (uses rsync)"
146
+ task :publish => [:publish_website, :publish_rdoc]
147
+
148
+ task :publish_website do
149
+ unixname = 'libxml'
150
+ username = ENV['RUBYFORGE_USERNAME']
151
+
152
+ dir = 'admin/web'
153
+ url = "#{username}@rubyforge.org:/var/www/gforge-projects/#{unixname}"
154
+
155
+ dir = dir.chomp('/') + '/'
156
+
157
+ # Using commandline filter options didn't seem to work, so
158
+ # I opted for creating an .rsync_filter file for all cases.
159
+
160
+ protect = %w{usage statcvs statsvn robot.txt wiki}
161
+ exclude = %w{.svn}
162
+
163
+ rsync_file = File.join(dir,'.rsync-filter')
164
+ unless File.file?(rsync_file)
165
+ File.open(rsync_file, 'w') do |f|
166
+ exclude.each{|e| f << "- #{e}\n"}
167
+ protect.each{|e| f << "P #{e}\n"}
168
+ end
169
+ end
170
+
171
+ # maybe -p ?
172
+ cmd = "rsync -rLvz --delete-after --filter='dir-merge #{rsync_file}' #{dir} #{url}"
173
+ sh cmd
174
+ end
175
+
176
+ task :publish_rdoc do
177
+ unixname = 'libxml'
178
+ username = ENV['RUBYFORGE_USERNAME']
179
+
180
+ dir = 'doc/rdoc'
181
+ url = "#{username}@rubyforge.org:/var/www/gforge-projects/#{unixname}/rdoc"
182
+
183
+ dir = dir.chomp('/') + '/'
184
+
185
+ # maybe -p ?
186
+ cmd = "rsync -rLvz --delete-after #{dir} #{url}"
187
+ sh cmd
188
+ end
@@ -0,0 +1,182 @@
1
+ /*
2
+ * Uncopyrighted 2005 Ross Bamford.
3
+ *
4
+ * rosco at roscopeco dot co dot uk
5
+ */
6
+ body {
7
+ background: #ffffff;
8
+ color: #000000;
9
+ font-family: Microsoft sans-serif, sans-serif, arial, helvetica;
10
+ font-size: 12px;
11
+ padding: 0px;
12
+ margin: 0px 0px 0px 0px;
13
+ }
14
+
15
+ .container {
16
+ width: 800px;
17
+ margin: 0 auto;
18
+ }
19
+
20
+ /* ** links ** */
21
+ a {
22
+ color: red;
23
+ text-decoration: none;
24
+ }
25
+
26
+ a:hover {
27
+ color: red;
28
+ text-decoration: underline;
29
+ }
30
+
31
+ a:active {
32
+ color: red;
33
+ text-decoration: underline;
34
+ }
35
+
36
+ .navlinks a {
37
+ color: red;
38
+ text-decoration: none;
39
+ font-weight: bold;
40
+ }
41
+
42
+ .navlinks a:hover {
43
+ color: red;
44
+ text-decoration: underline;
45
+ font-weight: bold;
46
+ }
47
+
48
+ .navlinks {
49
+ padding: 10px;
50
+ background: white;
51
+ white-space: nowrap
52
+ }
53
+
54
+ div.copyright {
55
+ /* Copyright bit on pages */
56
+ color: #909090;
57
+ position: relative;
58
+ top: 5em;
59
+ right: 2%;
60
+ text-align: right;
61
+ font-size: 8pt;
62
+ }
63
+
64
+ /* * page styles *** */
65
+
66
+ h1.title {
67
+ font-size: 48px;
68
+ padding-left: 0;
69
+ }
70
+
71
+ h1 {
72
+ padding: 10px;
73
+ }
74
+
75
+ h2 {
76
+ border-bottom: thin #959595 solid;
77
+ }
78
+
79
+ h3 {
80
+ border-bottom: thin #b8c8c8 solid;
81
+ }
82
+
83
+ h5 {
84
+ border-bottom: thin #c0c0d8 solid;
85
+ }
86
+
87
+ div.note {
88
+ background: #e8e8fa;
89
+ border: thin dashed #3e5972;
90
+ position: relative;
91
+ width: 90%;
92
+ left: 5%;
93
+ right: 5%;
94
+ text-align: right;
95
+ font-size: 10pt;
96
+ padding: 5px;
97
+ margin-bottom: 5px;
98
+ }
99
+
100
+ /* * syntax ******** */
101
+ pre.ruby {
102
+ background: #f5f5f5;
103
+ border: thin dashed #3e5972;
104
+ padding: 10px;
105
+ margin-left: 2em;
106
+ }
107
+
108
+ pre.ruby span.normal {
109
+ color: #000000;
110
+ }
111
+
112
+ pre.ruby span.comment {
113
+ color: #789a86;
114
+ text-decoration: oblique;
115
+ }
116
+
117
+ pre.ruby span.ident {
118
+ color: #0b0202;
119
+ }
120
+
121
+ pre.ruby span.punct {
122
+ color: #8a7070;
123
+ }
124
+
125
+ pre.ruby span.symbol {
126
+ color: #aa1010;
127
+ font-weight: bold;
128
+ }
129
+
130
+ pre.ruby span.keyword {
131
+ color: #903030;
132
+ font-weight: bold;
133
+ }
134
+
135
+ pre.ruby span.constant {
136
+ color: #3e5972;
137
+ font-weight: bold;
138
+ }
139
+
140
+ pre.ruby span.string {
141
+ color: #2020f0;
142
+ }
143
+
144
+ pre.ruby span.char {
145
+ color: #2020f0;
146
+ font-weight: bold;
147
+ }
148
+
149
+ pre.ruby span.number {
150
+ color: #aa1010;
151
+ }
152
+
153
+ pre.ruby span.regex {
154
+ color: #552090;
155
+ }
156
+
157
+ pre.ruby span.expr {
158
+ color: #101080;
159
+ font-weight: bold;
160
+ }
161
+
162
+ pre.ruby span.global {
163
+ color: #557462;
164
+ }
165
+
166
+ pre.ruby span.class {
167
+ color: #3e5972;
168
+ font-weight: bold;
169
+ }
170
+
171
+ pre.ruby span.method {
172
+ color: #aa1010;
173
+ }
174
+
175
+ pre.ruby span.attribute {
176
+ color: #3e5972;
177
+ }
178
+
179
+ pre.ruby span.escape {
180
+ color: #2020f0;
181
+ font-weight: bold;
182
+ }