libxml-ruby 0.9.5-x86-mswin32-60 → 0.9.6-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/CHANGES +28 -0
  2. data/README +8 -12
  3. data/ext/libxml/cbg.c +86 -86
  4. data/ext/libxml/libxml.c +875 -899
  5. data/ext/libxml/ruby_libxml.h +91 -65
  6. data/ext/libxml/ruby_xml_attr.c +485 -485
  7. data/ext/libxml/ruby_xml_attr.h +3 -3
  8. data/ext/libxml/ruby_xml_attributes.h +2 -2
  9. data/ext/libxml/ruby_xml_document.c +124 -307
  10. data/ext/libxml/ruby_xml_document.h +3 -3
  11. data/ext/libxml/ruby_xml_dtd.c +119 -119
  12. data/ext/libxml/ruby_xml_dtd.h +2 -2
  13. data/ext/libxml/ruby_xml_error.c +1 -1
  14. data/ext/libxml/ruby_xml_error.h +2 -2
  15. data/ext/libxml/ruby_xml_html_parser.c +119 -119
  16. data/ext/libxml/ruby_xml_html_parser.h +3 -3
  17. data/ext/libxml/ruby_xml_input.c +13 -11
  18. data/ext/libxml/ruby_xml_input.h +3 -3
  19. data/ext/libxml/ruby_xml_input_cbg.c +197 -197
  20. data/ext/libxml/ruby_xml_namespace.c +158 -0
  21. data/ext/libxml/ruby_xml_namespace.h +12 -0
  22. data/ext/libxml/ruby_xml_namespaces.c +303 -0
  23. data/ext/libxml/{ruby_xml_ns.h → ruby_xml_namespaces.h} +4 -5
  24. data/ext/libxml/ruby_xml_node.c +88 -293
  25. data/ext/libxml/ruby_xml_node.h +4 -4
  26. data/ext/libxml/ruby_xml_parser.c +152 -152
  27. data/ext/libxml/ruby_xml_parser.h +3 -3
  28. data/ext/libxml/ruby_xml_parser_context.c +630 -657
  29. data/ext/libxml/ruby_xml_parser_context.h +3 -3
  30. data/ext/libxml/ruby_xml_reader.c +899 -904
  31. data/ext/libxml/ruby_xml_reader.h +2 -2
  32. data/ext/libxml/ruby_xml_relaxng.h +2 -2
  33. data/ext/libxml/ruby_xml_sax_parser.c +175 -175
  34. data/ext/libxml/ruby_xml_sax_parser.h +3 -3
  35. data/ext/libxml/ruby_xml_schema.c +165 -165
  36. data/ext/libxml/ruby_xml_schema.h +2 -2
  37. data/ext/libxml/ruby_xml_state.h +2 -2
  38. data/ext/libxml/ruby_xml_xinclude.c +24 -24
  39. data/ext/libxml/ruby_xml_xinclude.h +3 -3
  40. data/ext/libxml/ruby_xml_xpath.c +108 -108
  41. data/ext/libxml/ruby_xml_xpath.h +3 -3
  42. data/ext/libxml/ruby_xml_xpath_context.c +84 -35
  43. data/ext/libxml/ruby_xml_xpath_context.h +3 -3
  44. data/ext/libxml/ruby_xml_xpath_expression.c +5 -7
  45. data/ext/libxml/ruby_xml_xpath_expression.h +2 -2
  46. data/ext/libxml/ruby_xml_xpath_object.c +7 -7
  47. data/ext/libxml/ruby_xml_xpath_object.h +2 -2
  48. data/ext/libxml/ruby_xml_xpointer.c +107 -107
  49. data/ext/libxml/ruby_xml_xpointer.h +3 -3
  50. data/ext/libxml/version.h +2 -2
  51. data/ext/mingw/libxml_ruby.dll.a +0 -0
  52. data/ext/mingw/libxml_ruby.so +0 -0
  53. data/ext/vc/libxml_ruby.vcproj +13 -5
  54. data/lib/libxml.rb +4 -1
  55. data/lib/libxml/document.rb +40 -6
  56. data/lib/libxml/hpricot.rb +76 -76
  57. data/lib/libxml/namespace.rb +60 -0
  58. data/lib/libxml/namespaces.rb +36 -0
  59. data/lib/libxml/node.rb +90 -26
  60. data/lib/libxml/ns.rb +20 -0
  61. data/test/model/bands.xml +5 -0
  62. data/test/tc_attributes.rb +1 -1
  63. data/test/tc_document.rb +24 -41
  64. data/test/tc_document_write.rb +87 -115
  65. data/test/tc_namespace.rb +59 -0
  66. data/test/tc_namespaces.rb +174 -0
  67. data/test/tc_node.rb +41 -33
  68. data/test/tc_node_copy.rb +1 -1
  69. data/test/tc_node_edit.rb +6 -0
  70. data/test/tc_node_write.rb +76 -0
  71. data/test/tc_xinclude.rb +2 -9
  72. data/test/tc_xpath.rb +38 -11
  73. data/test/test_suite.rb +3 -1
  74. metadata +16 -9
  75. data/ext/libxml/ruby_xml_ns.c +0 -150
  76. data/test/ets_copy_bug.rb +0 -21
  77. data/test/ets_copy_bug3.rb +0 -38
  78. data/test/model/default_validation_bug.rb +0 -0
  79. data/test/tc_ns.rb +0 -18
@@ -1,150 +0,0 @@
1
- /* $Id: ruby_xml_ns.c 650 2008-11-30 03:40:22Z cfis $ */
2
-
3
- /* Please see the LICENSE file for copyright and distribution information */
4
-
5
- #include "ruby_libxml.h"
6
- #include "ruby_xml_ns.h"
7
-
8
- VALUE cXMLNS;
9
-
10
- /* Document-class: LibXML::XML::NS
11
- *
12
- * The NS class is used to query information about
13
- * xml namespaces associated with particular nodes.
14
- * It can also be used to associate new namespaces
15
- * with an node. */
16
-
17
- static VALUE rxml_ns_alloc(VALUE klass)
18
- {
19
- return Data_Wrap_Struct(klass, NULL, NULL, NULL);
20
- }
21
-
22
- /*
23
- * call-seq:
24
- * initialize(node, "href", "prefix")
25
- *
26
- * Create a new namespace attached to the specified node with the
27
- * give prefix and namespace.
28
- *
29
- * XML::NS.new(node, "xlink", "http://www.w3.org/1999/xlink")
30
- */
31
- static VALUE rxml_ns_initialize(VALUE self, VALUE node, VALUE href,
32
- VALUE prefix)
33
- {
34
- xmlNodePtr xnode;
35
- xmlChar *xmlPrefix;
36
- xmlNsPtr xns;
37
-
38
- Data_Get_Struct(node, xmlNode, xnode);
39
- /* Prefix can be null - that means its the default namespace */
40
- xmlPrefix = NIL_P(prefix) ? NULL : StringValuePtr(prefix);
41
- xns = xmlNewNs(xnode, (xmlChar*) StringValuePtr(href), xmlPrefix);
42
-
43
- DATA_PTR( self) = xns;
44
- return self;
45
- }
46
-
47
- VALUE rxml_ns_wrap(xmlNsPtr xns)
48
- {
49
- return (Data_Wrap_Struct(cXMLNS, NULL, NULL, xns));
50
- }
51
-
52
- /*
53
- * call-seq:
54
- * ns.href -> "href"
55
- *
56
- * Obtain the namespace's href.
57
- */
58
- static VALUE rxml_ns_href_get(VALUE self)
59
- {
60
- xmlNsPtr xns;
61
- Data_Get_Struct(self, xmlNs, xns);
62
- if (xns == NULL || xns->href == NULL)
63
- return (Qnil);
64
- else
65
- return (rb_str_new2((const char*) xns->href));
66
- }
67
-
68
- /*
69
- * call-seq:
70
- * ns.href? -> (true|false)
71
- *
72
- * Determine whether this namespace has an href.
73
- */
74
- static VALUE rxml_ns_href_q(VALUE self)
75
- {
76
- xmlNsPtr xns;
77
- Data_Get_Struct(self, xmlNs, xns);
78
- if (xns == NULL || xns->href == NULL)
79
- return (Qfalse);
80
- else
81
- return (Qtrue);
82
- }
83
-
84
- /*
85
- * call-seq:
86
- * ns.next -> ns
87
- *
88
- * Obtain the next namespace.
89
- */
90
- static VALUE rxml_ns_next(VALUE self)
91
- {
92
- xmlNsPtr xns;
93
- Data_Get_Struct(self, xmlNs, xns);
94
- if (xns == NULL || xns->next == NULL)
95
- return (Qnil);
96
- else
97
- return (rxml_ns_wrap(xns->next));
98
- }
99
-
100
- /*
101
- * call-seq:
102
- * ns.prefix -> "prefix"
103
- * ns.to_s -> "prefix"
104
- *
105
- * Obtain the namespace's prefix.
106
- */
107
- static VALUE rxml_ns_prefix_get(VALUE self)
108
- {
109
- xmlNsPtr xns;
110
- Data_Get_Struct(self, xmlNs, xns);
111
- if (xns == NULL || xns->prefix == NULL)
112
- return (Qnil);
113
- else
114
- return (rb_str_new2((const char*) xns->prefix));
115
- }
116
-
117
- /*
118
- * call-seq:
119
- * ns.prefix? -> (true|false)
120
- *
121
- * Determine whether this namespace has a prefix.
122
- */
123
- static VALUE rxml_ns_prefix_q(VALUE self)
124
- {
125
- xmlNsPtr xns;
126
- Data_Get_Struct(self, xmlNs, xns);
127
- if (xns == NULL || xns->prefix == NULL)
128
- return (Qfalse);
129
- else
130
- return (Qtrue);
131
- }
132
-
133
- // Rdoc needs to know
134
- #ifdef RDOC_NEVER_DEFINED
135
- mLibXML = rb_define_module("LibXML");
136
- mXML = rb_define_module_under(mLibXML, "XML");
137
- #endif
138
-
139
- void ruby_init_xml_ns(void)
140
- {
141
- cXMLNS = rb_define_class_under(mXML, "NS", rb_cObject);
142
- rb_define_alloc_func(cXMLNS, rxml_ns_alloc);
143
- rb_define_method(cXMLNS, "initialize", rxml_ns_initialize, 3);
144
- rb_define_method(cXMLNS, "href", rxml_ns_href_get, 0);
145
- rb_define_method(cXMLNS, "href?", rxml_ns_href_q, 0);
146
- rb_define_method(cXMLNS, "next", rxml_ns_next, 0);
147
- rb_define_method(cXMLNS, "prefix", rxml_ns_prefix_get, 0);
148
- rb_define_method(cXMLNS, "prefix?", rxml_ns_prefix_q, 0);
149
- rb_define_method(cXMLNS, "to_s", rxml_ns_prefix_get, 0);
150
- }
data/test/ets_copy_bug.rb DELETED
@@ -1,21 +0,0 @@
1
- require 'xml'
2
-
3
- def test( doc2 )
4
- doc = XML::Document.new('1.0')
5
- doc.root = XML::Node.new("ccc")
6
- doc.root['aaa'] = 'aaa'
7
- doc.root.child_add(doc2.root.copy(true)) # BUG!
8
- doc.root << doc2.root.copy(true)
9
- return doc
10
- end
11
-
12
- def test2
13
- doc2 = XML::Document.new('1.0')
14
- doc2.root = XML::Node.new("aaa")
15
- test( doc2 )
16
- end
17
-
18
- 1000.times { |i|
19
- print "\r#{i}"; $stdout.flush
20
- test2
21
- }
@@ -1,38 +0,0 @@
1
- require 'xml'
2
-
3
- str = <<-STR
4
- <html>
5
- <body>
6
- <div class="textarea" id="t1"
7
- style="STATIC">werwerwerwerwer </div>
8
- <div class="textarea" id="t2" style="STATIC">
9
- Quisque et diam dapibus nisi bibendum blandit.
10
- </div>
11
- <div class="textarea" id="t3" style="STATIC">
12
- <p>aaaaaaaaa</p>
13
- </div>
14
- </body>
15
- </html>
16
- STR
17
-
18
- XML::Parser.default_keep_blanks = false
19
- xp = XML::Parser.new
20
- xp.string = str
21
- doc = xp.parse
22
-
23
- xpath = "//div[@id='t1']"
24
- div1 = doc.find(xpath).to_a[0]
25
- printf "xxx div1: #{div1}\n"
26
-
27
- xpath = "//div[@id='t2']"
28
- div2 = doc.find(xpath).to_a[0]
29
- printf "xxx div2: #{div2}\n"
30
-
31
-
32
- div2.each do |child|
33
- #c = child.clone
34
- c = child.copy(false)
35
- div1.child_add(c)
36
- end
37
-
38
- printf "xxx root: #{doc.root}\n"
File without changes
data/test/tc_ns.rb DELETED
@@ -1,18 +0,0 @@
1
- require "xml"
2
- require 'test/unit'
3
-
4
- class TestNS < Test::Unit::TestCase
5
- def test_ns
6
- node = XML::Node.new('foo')
7
- ns = XML::NS.new(node, 'http://www.mynamespace.com', 'my_namepace')
8
- assert_equal(ns.prefix, 'my_namepace')
9
- assert_equal(ns.href, 'http://www.mynamespace.com')
10
- end
11
-
12
- def test_default_ns
13
- node = XML::Node.new('foo')
14
- ns = XML::NS.new(node, 'http://www.mynamespace.com', nil)
15
- assert_equal(ns.prefix, nil)
16
- assert_equal(ns.href, 'http://www.mynamespace.com')
17
- end
18
- end