coupa-libxml-ruby 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,79 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <rubynet xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <pkg version="1.0">
4
+ <meta>
5
+ <pkgname>REXML</pkgname>
6
+ <authors>
7
+ <author>
8
+ <name>Aaron Malone</name>
9
+ <email>aaron@munge.net</email>
10
+ <irc_network>irc.opentprojects.org</irc_network>
11
+ <irc_channel>#ruby-lang</irc_channel>
12
+ <irc_handle>AAmalone</irc_handle>
13
+ </author>
14
+ </authors>
15
+ <maintainers>
16
+ <maintainer>
17
+ <name>Tools Team</name>
18
+ <email>tools@gentoo.org</email>
19
+ <irc_network>irc.opentprojects.org</irc_network>
20
+ <irc_channel>#ruby-lang</irc_channel>
21
+ <irc_handle>TinyT</irc_handle>
22
+ </maintainer>
23
+ </maintainers>
24
+ <categories>
25
+
26
+ <!-- For pieces of data that are repeated constnatly, could we
27
+ use XLink to centralize some of these definitions? If we move
28
+ stuff around on rubynet.org, we don't want to have to do a
29
+ search/replace: just update the entity, IMHO. -->
30
+
31
+ <major_category xlink:type="simple" xlink:href="http://www.rubynet.org/category/xml/">XML</major_category>
32
+ <minor_category xlink:type="simple" xlink:href="http://www.rubynet.org/category/text%20processing/">Text Processing</minor_category>
33
+ <minor_category xlink:type="simple" xlink:href="http://www.rubynet.org/category/storage/">Storage</minor_category>
34
+ </categories>
35
+ <version>
36
+ <major_version>1</major_version>
37
+ <minor_version>2</minor_version>
38
+ <micro_version>3</micro_version>
39
+ </version>
40
+ <copyright>1999-2002 Gentoo Technologies,Inc.</copyright>
41
+ <license>Ruby</license>
42
+ <status>Stable</status>
43
+ <full_name>Ruby Electric XML</full_name>
44
+ <description>Pure Ruby parser, blah blah. Based of Electrice XML</description>
45
+ <homepage xlink:type="simple" xlink:href="http://www.germane-software.com/~ser/Software/rexml/">REXML Home</homepage>
46
+ <download xlink:type="simple" xlink:href="http://www.germane-software.com/~ser/Software/rexml/rexml-1.2.3.bz2/">REXML Download</download>
47
+ </meta>
48
+ <dependencies>
49
+ <dependency name="ruby" uri="http://www.rubynet.org/packages/ruby/">
50
+ <required_version restriction="no-lower-than">
51
+ <version>
52
+ <major_version>1</major_version>
53
+ <minor_version>6</minor_version>
54
+ <micro_version>0</micro_version>
55
+ </version>
56
+ </required_version>
57
+ </dependency>
58
+ </dependencies>
59
+ <files>
60
+ <file>
61
+ <filename>uga.rb</filename>
62
+ <mode>0444</mode>
63
+ <content encoding="xml">... the file here</content>
64
+ </file>
65
+ <file>
66
+ <filename>booga.h</filename>
67
+ <mode>0444</mode>
68
+ <content encoding="xml">... the file here</content>
69
+ </file>
70
+ <file>
71
+ <filename>foo.so</filename>
72
+ <mode>0555</mode>
73
+ <!-- Encode routine: str.to_a.pack('m')
74
+ Decode routine: str.unpack('m') -->
75
+ <content encoding="mime64">Li4uIHRoZSBmaWxlIGhlcmU=\n</content>
76
+ </file>
77
+ </files>
78
+ </pkg>
79
+ </rubynet>
@@ -0,0 +1 @@
1
+ This is some text to include in an xml file via XInclude.
@@ -0,0 +1,28 @@
1
+ #
2
+ # relax ng schema in compact syntax; this cannot be used within libxml but
3
+ # was used to write the schema as compact syntax makes it easier to handle.
4
+ # relax ng schema in xml syntax was created using trang.
5
+ #
6
+ namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"
7
+
8
+ start = shiporder
9
+
10
+ shiporder = element shiporder { attribute orderid { text },
11
+ attribute xsi:noNamespaceSchemaLocation { text },
12
+ orderperson, shipto, item* }
13
+
14
+ orderperson = element orderperson { text }
15
+
16
+ shipto = element shipto { name, address, city, country }
17
+
18
+ name = element name { text }
19
+ address = element address { text }
20
+ city = element city { text }
21
+ country = element country { text }
22
+
23
+ item = element item { title, note?, quantity, price }
24
+
25
+ title = element title { text }
26
+ note = element note { text }
27
+ quantity = element quantity { text }
28
+ price = element price { text }
@@ -0,0 +1,86 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+
4
+ relax ng schema in compact syntax; this cannot be used within libxml but
5
+ was used to write the schema as it's easier to understand
6
+
7
+ -->
8
+ <grammar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://relaxng.org/ns/structure/1.0">
9
+ <start>
10
+ <ref name="shiporder"/>
11
+ </start>
12
+ <define name="shiporder">
13
+ <element name="shiporder">
14
+ <attribute name="orderid"/>
15
+ <attribute name="xsi:noNamespaceSchemaLocation"/>
16
+ <ref name="orderperson"/>
17
+ <ref name="shipto"/>
18
+ <zeroOrMore>
19
+ <ref name="item"/>
20
+ </zeroOrMore>
21
+ </element>
22
+ </define>
23
+ <define name="orderperson">
24
+ <element name="orderperson">
25
+ <text/>
26
+ </element>
27
+ </define>
28
+ <define name="shipto">
29
+ <element name="shipto">
30
+ <ref name="name"/>
31
+ <ref name="address"/>
32
+ <ref name="city"/>
33
+ <ref name="country"/>
34
+ </element>
35
+ </define>
36
+ <define name="name">
37
+ <element name="name">
38
+ <text/>
39
+ </element>
40
+ </define>
41
+ <define name="address">
42
+ <element name="address">
43
+ <text/>
44
+ </element>
45
+ </define>
46
+ <define name="city">
47
+ <element name="city">
48
+ <text/>
49
+ </element>
50
+ </define>
51
+ <define name="country">
52
+ <element name="country">
53
+ <text/>
54
+ </element>
55
+ </define>
56
+ <define name="item">
57
+ <element name="item">
58
+ <ref name="title"/>
59
+ <optional>
60
+ <ref name="note"/>
61
+ </optional>
62
+ <ref name="quantity"/>
63
+ <ref name="price"/>
64
+ </element>
65
+ </define>
66
+ <define name="title">
67
+ <element name="title">
68
+ <text/>
69
+ </element>
70
+ </define>
71
+ <define name="note">
72
+ <element name="note">
73
+ <text/>
74
+ </element>
75
+ </define>
76
+ <define name="quantity">
77
+ <element name="quantity">
78
+ <text/>
79
+ </element>
80
+ </define>
81
+ <define name="price">
82
+ <element name="price">
83
+ <text/>
84
+ </element>
85
+ </define>
86
+ </grammar>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shiporder orderid="889923"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:noNamespaceSchemaLocation="shiporder.xsd">
5
+ <orderperson>John Smith</orderperson>
6
+ <shipto>
7
+ <name>Ola Nordmann</name>
8
+ <address>Langgt 23</address>
9
+ <city>4000 Stavanger</city>
10
+ <country>Norway</country>
11
+ </shipto>
12
+ <item>
13
+ <title>Empire Burlesque</title>
14
+ <note>Special Edition</note>
15
+ <quantity>1</quantity>
16
+ <price>10.90</price>
17
+ </item>
18
+ <item>
19
+ <title>Hide your heart</title>
20
+ <quantity>1</quantity>
21
+ <price>9.90</price>
22
+ </item>
23
+ </shiporder>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1" ?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
3
+ <xs:element name="shiporder">
4
+ <xs:complexType>
5
+ <xs:sequence>
6
+ <xs:element name="orderperson" type="xs:string"/>
7
+ <xs:element name="shipto">
8
+ <xs:complexType>
9
+ <xs:sequence>
10
+ <xs:element name="name" type="xs:string"/>
11
+ <xs:element name="address" type="xs:string"/>
12
+ <xs:element name="city" type="xs:string"/>
13
+ <xs:element name="country" type="xs:string"/>
14
+ </xs:sequence>
15
+ </xs:complexType>
16
+ </xs:element>
17
+ <xs:element name="item" maxOccurs="unbounded">
18
+ <xs:complexType>
19
+ <xs:sequence>
20
+ <xs:element name="title" type="xs:string"/>
21
+ <xs:element name="note" type="xs:string" minOccurs="0"/>
22
+ <xs:element name="quantity" type="xs:positiveInteger"/>
23
+ <xs:element name="price" type="xs:decimal"/>
24
+ </xs:sequence>
25
+ </xs:complexType>
26
+ </xs:element>
27
+ </xs:sequence>
28
+ <xs:attribute name="orderid" type="xs:string" use="required"/>
29
+ </xs:complexType>
30
+ </xs:element>
31
+ </xs:schema>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap:Envelope
3
+ xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
4
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
5
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
+ soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
7
+ <soap:Body>
8
+ <getManufacturerNamesResponse name="widgestRus" xmlns="http://services.somewhere.com">
9
+ <IDAndNameList xmlns="http://services.somewhere.com">
10
+ <ns1:IdAndName xmlns:ns1="http://domain.somewhere.com">
11
+ <id xmlns="http://domain.somewhere.com">1</id>
12
+ <name xmlns="http://domain.somewhere.com">man1</name>
13
+
14
+ </ns1:IdAndName>
15
+ <ns1:IdAndName xmlns:ns1="http://domain.somewhere.com">
16
+ <id xmlns="http://domain.somewhere.com">2</id>
17
+ <name xmlns="http://domain.somewhere.com">man2</name>
18
+
19
+ </ns1:IdAndName>
20
+ <ns1:IdAndName xmlns:ns1="http://domain.somewhere.com">
21
+ <id xmlns="http://domain.somewhere.com">3</id>
22
+ <name xmlns="http://domain.somewhere.com">man3</name>
23
+ </ns1:IdAndName>
24
+ </IDAndNameList>
25
+ </getManufacturerNamesResponse>
26
+ </soap:Body>
27
+ </soap:Envelope>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0"?>
2
+ <document xmlns:xi="http://www.w3.org/2001/XInclude">
3
+ <p>This libxml2 binding has the following project information:
4
+ <code><xi:include href="rubynet_project" parse="text"/></code></p>
5
+ </document>
@@ -0,0 +1,170 @@
1
+ require 'xml'
2
+ require 'test/unit'
3
+
4
+ class AttrNodeTest < Test::Unit::TestCase
5
+ def setup()
6
+ xp = XML::Parser.string(<<-EOS)
7
+ <CityModel
8
+ xmlns="http://www.opengis.net/examples"
9
+ xmlns:city="http://www.opengis.net/examples"
10
+ xmlns:gml="http://www.opengis.net/gml"
11
+ xmlns:xlink="http://www.w3.org/1999/xlink"
12
+ xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
13
+ xsi:schemaLocation="http://www.opengis.net/examples city.xsd">
14
+ <type>City</type>
15
+ <cityMember name="Cambridge"
16
+ xlink:type="simple"
17
+ xlink:title="Trinity Lane"
18
+ xlink:href="http://www.foo.net/cgi-bin/wfs?FeatureID=C10239"
19
+ gml:remoteSchema="city.xsd#xpointer(//complexType[@name='RoadType'])"/>
20
+ </CityModel>
21
+ EOS
22
+
23
+ @doc = xp.parse
24
+ end
25
+
26
+ def teardown()
27
+ @doc = nil
28
+ end
29
+
30
+ def city_member
31
+ @doc.find('/city:CityModel/city:cityMember').first
32
+ end
33
+
34
+ def test_types
35
+ attribute = city_member.attributes.get_attribute('name')
36
+ assert_instance_of(XML::Attr, attribute)
37
+ assert_equal('attribute', attribute.node_type_name)
38
+ end
39
+
40
+ def test_name
41
+ attribute = city_member.attributes.get_attribute('name')
42
+ assert_equal('name', attribute.name)
43
+
44
+ attribute = city_member.attributes.get_attribute('href')
45
+ assert_equal('href', attribute.name)
46
+ assert_equal('xlink', attribute.ns.prefix)
47
+ assert_equal('http://www.w3.org/1999/xlink', attribute.ns.href)
48
+
49
+ attribute = city_member.attributes.get_attribute_ns('http://www.w3.org/1999/xlink', 'href')
50
+ assert_equal('href', attribute.name)
51
+ assert_equal('xlink', attribute.ns.prefix)
52
+ assert_equal('http://www.w3.org/1999/xlink', attribute.ns.href)
53
+ end
54
+
55
+ def test_value
56
+ attribute = city_member.attributes.get_attribute('name')
57
+ assert_equal('Cambridge', attribute.value)
58
+
59
+ attribute = city_member.attributes.get_attribute('href')
60
+ assert_equal('http://www.foo.net/cgi-bin/wfs?FeatureID=C10239', attribute.value)
61
+ end
62
+
63
+ def test_set_value
64
+ attribute = city_member.attributes.get_attribute('name')
65
+ attribute.value = 'London'
66
+ assert_equal('London', attribute.value)
67
+
68
+ attribute = city_member.attributes.get_attribute('href')
69
+ attribute.value = 'http://i.have.changed'
70
+ assert_equal('http://i.have.changed', attribute.value)
71
+ end
72
+
73
+ def test_set_nil
74
+ attribute = city_member.attributes.get_attribute('name')
75
+ assert_raise(TypeError) do
76
+ attribute.value = nil
77
+ end
78
+ end
79
+
80
+ def test_create
81
+ attributes = city_member.attributes
82
+ assert_equal(5, attributes.length)
83
+
84
+ attr = XML::Attr.new(city_member, 'size', '50,000')
85
+ assert_instance_of(XML::Attr, attr)
86
+
87
+ attributes = city_member.attributes
88
+ assert_equal(6, attributes.length)
89
+
90
+ assert_equal(attributes['size'], '50,000')
91
+ end
92
+
93
+ def test_create_on_node
94
+ attributes = city_member.attributes
95
+ assert_equal(5, attributes.length)
96
+
97
+ attributes['country'] = 'England'
98
+
99
+ attributes = city_member.attributes
100
+ assert_equal(6, attributes.length)
101
+
102
+ assert_equal(attributes['country'], 'England')
103
+ end
104
+
105
+ def test_create_ns
106
+ assert_equal(5, city_member.attributes.length)
107
+
108
+ ns = XML::NS.new(city_member, 'my_namepace', 'http://www.mynamespace.com')
109
+ attr = XML::Attr.new(city_member, 'rating', 'rocks', ns)
110
+ assert_instance_of(XML::Attr, attr)
111
+ assert_equal('rating', attr.name)
112
+ assert_equal('rocks', attr.value)
113
+
114
+ attributes = city_member.attributes
115
+ assert_equal(6, attributes.length)
116
+
117
+ assert_equal('rocks', city_member['rating'])
118
+ end
119
+
120
+ def test_remove
121
+ attributes = city_member.attributes
122
+ assert_equal(5, attributes.length)
123
+
124
+ attribute = attributes.get_attribute('name')
125
+ assert_not_nil(attribute.parent)
126
+ assert(attribute.parent?)
127
+
128
+ attribute.remove!
129
+ assert_equal(4, attributes.length)
130
+ assert_nil(attribute.parent)
131
+ assert(!attribute.parent?)
132
+ end
133
+
134
+ def test_first
135
+ attribute = city_member.attributes.first
136
+ assert_instance_of(XML::Attr, attribute)
137
+ assert_equal('name', attribute.name)
138
+ assert_equal('Cambridge', attribute.value)
139
+
140
+ attribute = attribute.next
141
+ assert_instance_of(XML::Attr, attribute)
142
+ assert_equal('type', attribute.name)
143
+ assert_equal('simple', attribute.value)
144
+
145
+ attribute = attribute.next
146
+ assert_instance_of(XML::Attr, attribute)
147
+ assert_equal('title', attribute.name)
148
+ assert_equal('Trinity Lane', attribute.value)
149
+
150
+ attribute = attribute.next
151
+ assert_instance_of(XML::Attr, attribute)
152
+ assert_equal('href', attribute.name)
153
+ assert_equal('http://www.foo.net/cgi-bin/wfs?FeatureID=C10239', attribute.value)
154
+
155
+ attribute = attribute.next
156
+ assert_instance_of(XML::Attr, attribute)
157
+ assert_equal('remoteSchema', attribute.name)
158
+ assert_equal("city.xsd#xpointer(//complexType[@name='RoadType'])", attribute.value)
159
+
160
+ attribute = attribute.next
161
+ assert_nil(attribute)
162
+ end
163
+
164
+ def test_no_attributes
165
+ element = @doc.find('/city:CityModel/city:type').first
166
+
167
+ assert_not_nil(element.attributes)
168
+ assert_equal(0, element.attributes.length)
169
+ end
170
+ end