libxml-ruby 2.0.0-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/HISTORY +516 -0
- data/LICENSE +23 -0
- data/MANIFEST +165 -0
- data/README.rdoc +161 -0
- data/Rakefile +82 -0
- data/ext/libxml/extconf.rb +122 -0
- data/ext/libxml/libxml.c +93 -0
- data/ext/libxml/ruby_libxml.h +101 -0
- data/ext/libxml/ruby_xml.c +893 -0
- data/ext/libxml/ruby_xml.h +10 -0
- data/ext/libxml/ruby_xml_attr.c +352 -0
- data/ext/libxml/ruby_xml_attr.h +14 -0
- data/ext/libxml/ruby_xml_attr_decl.c +171 -0
- data/ext/libxml/ruby_xml_attr_decl.h +13 -0
- data/ext/libxml/ruby_xml_attributes.c +277 -0
- data/ext/libxml/ruby_xml_attributes.h +17 -0
- data/ext/libxml/ruby_xml_cbg.c +85 -0
- data/ext/libxml/ruby_xml_document.c +958 -0
- data/ext/libxml/ruby_xml_document.h +17 -0
- data/ext/libxml/ruby_xml_dtd.c +257 -0
- data/ext/libxml/ruby_xml_dtd.h +9 -0
- data/ext/libxml/ruby_xml_encoding.c +221 -0
- data/ext/libxml/ruby_xml_encoding.h +16 -0
- data/ext/libxml/ruby_xml_error.c +1004 -0
- data/ext/libxml/ruby_xml_error.h +14 -0
- data/ext/libxml/ruby_xml_html_parser.c +92 -0
- data/ext/libxml/ruby_xml_html_parser.h +12 -0
- data/ext/libxml/ruby_xml_html_parser_context.c +308 -0
- data/ext/libxml/ruby_xml_html_parser_context.h +12 -0
- data/ext/libxml/ruby_xml_html_parser_options.c +40 -0
- data/ext/libxml/ruby_xml_html_parser_options.h +12 -0
- data/ext/libxml/ruby_xml_input_cbg.c +191 -0
- data/ext/libxml/ruby_xml_input_cbg.h +20 -0
- data/ext/libxml/ruby_xml_io.c +30 -0
- data/ext/libxml/ruby_xml_io.h +9 -0
- data/ext/libxml/ruby_xml_namespace.c +170 -0
- data/ext/libxml/ruby_xml_namespace.h +12 -0
- data/ext/libxml/ruby_xml_namespaces.c +295 -0
- data/ext/libxml/ruby_xml_namespaces.h +11 -0
- data/ext/libxml/ruby_xml_node.c +1386 -0
- data/ext/libxml/ruby_xml_node.h +13 -0
- data/ext/libxml/ruby_xml_parser.c +94 -0
- data/ext/libxml/ruby_xml_parser.h +14 -0
- data/ext/libxml/ruby_xml_parser_context.c +982 -0
- data/ext/libxml/ruby_xml_parser_context.h +12 -0
- data/ext/libxml/ruby_xml_parser_options.c +68 -0
- data/ext/libxml/ruby_xml_parser_options.h +14 -0
- data/ext/libxml/ruby_xml_reader.c +1057 -0
- data/ext/libxml/ruby_xml_reader.h +14 -0
- data/ext/libxml/ruby_xml_relaxng.c +111 -0
- data/ext/libxml/ruby_xml_relaxng.h +10 -0
- data/ext/libxml/ruby_xml_sax2_handler.c +334 -0
- data/ext/libxml/ruby_xml_sax2_handler.h +12 -0
- data/ext/libxml/ruby_xml_sax_parser.c +136 -0
- data/ext/libxml/ruby_xml_sax_parser.h +12 -0
- data/ext/libxml/ruby_xml_schema.c +159 -0
- data/ext/libxml/ruby_xml_schema.h +11 -0
- data/ext/libxml/ruby_xml_version.h +9 -0
- data/ext/libxml/ruby_xml_xinclude.c +18 -0
- data/ext/libxml/ruby_xml_xinclude.h +13 -0
- data/ext/libxml/ruby_xml_xpath.c +107 -0
- data/ext/libxml/ruby_xml_xpath.h +12 -0
- data/ext/libxml/ruby_xml_xpath_context.c +390 -0
- data/ext/libxml/ruby_xml_xpath_context.h +11 -0
- data/ext/libxml/ruby_xml_xpath_expression.c +83 -0
- data/ext/libxml/ruby_xml_xpath_expression.h +12 -0
- data/ext/libxml/ruby_xml_xpath_object.c +336 -0
- data/ext/libxml/ruby_xml_xpath_object.h +19 -0
- data/ext/libxml/ruby_xml_xpointer.c +101 -0
- data/ext/libxml/ruby_xml_xpointer.h +13 -0
- data/ext/mingw/Rakefile +34 -0
- data/ext/mingw/build.rake +41 -0
- data/ext/vc/libxml_ruby.sln +26 -0
- data/lib/1.8/libxml_ruby.so +0 -0
- data/lib/1.9/libxml_ruby.so +0 -0
- data/lib/libxml.rb +30 -0
- data/lib/libxml/attr.rb +113 -0
- data/lib/libxml/attr_decl.rb +80 -0
- data/lib/libxml/attributes.rb +14 -0
- data/lib/libxml/document.rb +192 -0
- data/lib/libxml/error.rb +90 -0
- data/lib/libxml/hpricot.rb +78 -0
- data/lib/libxml/html_parser.rb +96 -0
- data/lib/libxml/namespace.rb +62 -0
- data/lib/libxml/namespaces.rb +38 -0
- data/lib/libxml/node.rb +399 -0
- data/lib/libxml/ns.rb +22 -0
- data/lib/libxml/parser.rb +367 -0
- data/lib/libxml/properties.rb +23 -0
- data/lib/libxml/reader.rb +29 -0
- data/lib/libxml/sax_callbacks.rb +180 -0
- data/lib/libxml/sax_parser.rb +58 -0
- data/lib/libxml/tree.rb +29 -0
- data/lib/libxml/xpath_object.rb +16 -0
- data/lib/xml.rb +16 -0
- data/lib/xml/libxml.rb +10 -0
- data/libxml-ruby.gemspec +50 -0
- data/script/benchmark/depixelate +634 -0
- data/script/benchmark/hamlet.xml +9055 -0
- data/script/benchmark/parsecount +170 -0
- data/script/benchmark/sock_entries.xml +507 -0
- data/script/benchmark/throughput +41 -0
- data/script/test +6 -0
- data/setup.rb +1585 -0
- data/test/etc_doc_to_s.rb +21 -0
- data/test/ets_doc_file.rb +17 -0
- data/test/ets_doc_to_s.rb +23 -0
- data/test/ets_gpx.rb +28 -0
- data/test/ets_node_gc.rb +23 -0
- data/test/ets_test.xml +2 -0
- data/test/ets_tsr.rb +11 -0
- data/test/model/atom.xml +13 -0
- data/test/model/bands.iso-8859-1.xml +5 -0
- data/test/model/bands.utf-8.xml +5 -0
- data/test/model/bands.xml +5 -0
- data/test/model/books.xml +146 -0
- data/test/model/merge_bug_data.xml +58 -0
- data/test/model/ruby-lang.html +238 -0
- data/test/model/rubynet.xml +79 -0
- data/test/model/rubynet_project +1 -0
- data/test/model/shiporder.rnc +28 -0
- data/test/model/shiporder.rng +86 -0
- data/test/model/shiporder.xml +23 -0
- data/test/model/shiporder.xsd +31 -0
- data/test/model/soap.xml +27 -0
- data/test/model/xinclude.xml +5 -0
- data/test/rb-magic-comment.rb +33 -0
- data/test/tc_attr.rb +181 -0
- data/test/tc_attr_decl.rb +133 -0
- data/test/tc_attributes.rb +135 -0
- data/test/tc_deprecated_require.rb +13 -0
- data/test/tc_document.rb +119 -0
- data/test/tc_document_write.rb +187 -0
- data/test/tc_dtd.rb +125 -0
- data/test/tc_error.rb +138 -0
- data/test/tc_html_parser.rb +140 -0
- data/test/tc_namespace.rb +62 -0
- data/test/tc_namespaces.rb +177 -0
- data/test/tc_node.rb +258 -0
- data/test/tc_node_cdata.rb +51 -0
- data/test/tc_node_comment.rb +33 -0
- data/test/tc_node_copy.rb +42 -0
- data/test/tc_node_edit.rb +160 -0
- data/test/tc_node_text.rb +71 -0
- data/test/tc_node_write.rb +108 -0
- data/test/tc_node_xlink.rb +29 -0
- data/test/tc_parser.rb +336 -0
- data/test/tc_parser_context.rb +189 -0
- data/test/tc_properties.rb +39 -0
- data/test/tc_reader.rb +298 -0
- data/test/tc_relaxng.rb +54 -0
- data/test/tc_sax_parser.rb +276 -0
- data/test/tc_schema.rb +53 -0
- data/test/tc_traversal.rb +222 -0
- data/test/tc_xinclude.rb +21 -0
- data/test/tc_xml.rb +226 -0
- data/test/tc_xpath.rb +195 -0
- data/test/tc_xpath_context.rb +80 -0
- data/test/tc_xpath_expression.rb +38 -0
- data/test/tc_xpointer.rb +74 -0
- data/test/test_helper.rb +14 -0
- data/test/test_suite.rb +39 -0
- metadata +254 -0
data/lib/libxml/ns.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module LibXML
|
4
|
+
module XML
|
5
|
+
class NS < Namespace # :nodoc:
|
6
|
+
def initialize(node, prefix, href)
|
7
|
+
warn('The XML::NS class is deprecated. Use XML::Namespace instead.')
|
8
|
+
super(node, href, prefix)
|
9
|
+
end
|
10
|
+
|
11
|
+
def href?
|
12
|
+
warn('XML::NS#href? is deprecated. Use !XML::NS#href.nil? instead.')
|
13
|
+
not self.href.nil?
|
14
|
+
end
|
15
|
+
|
16
|
+
def prefix?
|
17
|
+
warn('XML::NS#prefix? is deprecated. Use !XML::NS#prefix?.nil? instead.')
|
18
|
+
not self.previx.nil?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,367 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module LibXML
|
4
|
+
module XML
|
5
|
+
class Parser
|
6
|
+
# call-seq:
|
7
|
+
# XML::Parser.document(document) -> XML::Parser
|
8
|
+
#
|
9
|
+
# Creates a new parser for the specified document.
|
10
|
+
#
|
11
|
+
# Parameters:
|
12
|
+
#
|
13
|
+
# document - A preparsed document.
|
14
|
+
def self.document(doc)
|
15
|
+
context = XML::Parser::Context.document(doc)
|
16
|
+
self.new(context)
|
17
|
+
end
|
18
|
+
|
19
|
+
# call-seq:
|
20
|
+
# XML::Parser.file(path) -> XML::Parser
|
21
|
+
# XML::Parser.file(path, :encoding => XML::Encoding::UTF_8,
|
22
|
+
# :options => XML::Parser::Options::NOENT) -> XML::Parser
|
23
|
+
#
|
24
|
+
# Creates a new parser for the specified file or uri.
|
25
|
+
#
|
26
|
+
# You may provide an optional hash table to control how the
|
27
|
+
# parsing is performed. Valid options are:
|
28
|
+
#
|
29
|
+
# encoding - The document encoding, defaults to nil. Valid values
|
30
|
+
# are the encoding constants defined on XML::Encoding.
|
31
|
+
# options - Parser options. Valid values are the constants defined on
|
32
|
+
# XML::Parser::Options. Mutliple options can be combined
|
33
|
+
# by using Bitwise OR (|).
|
34
|
+
def self.file(path, options = {})
|
35
|
+
context = XML::Parser::Context.file(path)
|
36
|
+
context.encoding = options[:encoding] if options[:encoding]
|
37
|
+
context.options = options[:options] if options[:options]
|
38
|
+
self.new(context)
|
39
|
+
end
|
40
|
+
|
41
|
+
# call-seq:
|
42
|
+
# XML::Parser.io(io) -> XML::Parser
|
43
|
+
# XML::Parser.io(io, :encoding => XML::Encoding::UTF_8,
|
44
|
+
# :options => XML::Parser::Options::NOENT
|
45
|
+
# :base_uri="http://libxml.org") -> XML::Parser
|
46
|
+
#
|
47
|
+
# Creates a new parser for the specified io object.
|
48
|
+
#
|
49
|
+
# Parameters:
|
50
|
+
#
|
51
|
+
# io - io object that contains the xml to parser
|
52
|
+
# base_uri - The base url for the parsed document.
|
53
|
+
# encoding - The document encoding, defaults to nil. Valid values
|
54
|
+
# are the encoding constants defined on XML::Encoding.
|
55
|
+
# options - Parser options. Valid values are the constants defined on
|
56
|
+
# XML::Parser::Options. Mutliple options can be combined
|
57
|
+
# by using Bitwise OR (|).
|
58
|
+
def self.io(io, options = {})
|
59
|
+
context = XML::Parser::Context.io(io)
|
60
|
+
context.base_uri = options[:base_uri] if options[:base_uri]
|
61
|
+
context.encoding = options[:encoding] if options[:encoding]
|
62
|
+
context.options = options[:options] if options[:options]
|
63
|
+
self.new(context)
|
64
|
+
end
|
65
|
+
|
66
|
+
# call-seq:
|
67
|
+
# XML::Parser.string(string)
|
68
|
+
# XML::Parser.string(string, :encoding => XML::Encoding::UTF_8,
|
69
|
+
# :options => XML::Parser::Options::NOENT
|
70
|
+
# :base_uri="http://libxml.org") -> XML::Parser
|
71
|
+
#
|
72
|
+
# Creates a new parser by parsing the specified string.
|
73
|
+
#
|
74
|
+
# You may provide an optional hash table to control how the
|
75
|
+
# parsing is performed. Valid options are:
|
76
|
+
#
|
77
|
+
# base_uri - The base url for the parsed document.
|
78
|
+
# encoding - The document encoding, defaults to nil. Valid values
|
79
|
+
# are the encoding constants defined on XML::Encoding.
|
80
|
+
# options - Parser options. Valid values are the constants defined on
|
81
|
+
# XML::Parser::Options. Mutliple options can be combined
|
82
|
+
# by using Bitwise OR (|).
|
83
|
+
def self.string(string, options = {})
|
84
|
+
context = XML::Parser::Context.string(string)
|
85
|
+
context.base_uri = options[:base_uri] if options[:base_uri]
|
86
|
+
context.encoding = options[:encoding] if options[:encoding]
|
87
|
+
context.options = options[:options] if options[:options]
|
88
|
+
self.new(context)
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.register_error_handler(proc)
|
92
|
+
warn('Parser.register_error_handler is deprecated. Use Error.set_handler instead')
|
93
|
+
if proc.nil?
|
94
|
+
Error.reset_handler
|
95
|
+
else
|
96
|
+
Error.set_handler(&proc)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# :enddoc:
|
101
|
+
|
102
|
+
# Bunch of deprecated methods that have moved to the XML module
|
103
|
+
VERSION = XML::VERSION
|
104
|
+
VERNUM = XML::VERNUM
|
105
|
+
|
106
|
+
def document=(value)
|
107
|
+
warn("XML::Parser#document= is deprecated. Use XML::Parser.document= instead")
|
108
|
+
@context = XML::Parser::Context.document(value)
|
109
|
+
end
|
110
|
+
|
111
|
+
def file=(value)
|
112
|
+
warn("XML::Parser#file is deprecated. Use XML::Parser.file instead")
|
113
|
+
@context = XML::Parser::Context.file(value)
|
114
|
+
end
|
115
|
+
|
116
|
+
def filename=(value)
|
117
|
+
warn("XML::Parser#filename is deprecated. Use XML::Parser.file instead")
|
118
|
+
self.file = value
|
119
|
+
end
|
120
|
+
|
121
|
+
def io=(value)
|
122
|
+
warn("XML::Parser#io is deprecated. Use XML::Parser.io instead")
|
123
|
+
@context = XML::Parser::Context.io(value)
|
124
|
+
end
|
125
|
+
|
126
|
+
def string=(value)
|
127
|
+
warn("XML::Parser#string is deprecated. Use XML::Parser.string instead")
|
128
|
+
@context = XML::Parser::Context.string(value)
|
129
|
+
end
|
130
|
+
|
131
|
+
def self.enabled_automata?
|
132
|
+
warn("XML::Parser.enabled_automata? has been deprecated. Use XML.enabled_automata? instead")
|
133
|
+
XML.enabled_automata?
|
134
|
+
end
|
135
|
+
|
136
|
+
def self.enabled_c14n?
|
137
|
+
warn("XML::Parser.enabled_c14n? has been deprecated. Use XML.enabled_c14n? instead")
|
138
|
+
XML.enabled_c14n?
|
139
|
+
end
|
140
|
+
|
141
|
+
def self.enabled_catalog?
|
142
|
+
warn("XML::Parser.enabled_catalog? has been deprecated. Use XML.enabled_catalog? instead")
|
143
|
+
XML.enabled_catalog?
|
144
|
+
end
|
145
|
+
|
146
|
+
def self.enabled_debug?
|
147
|
+
warn("XML::Parser.enabled_debug? has been deprecated. Use XML.enabled_debug? instead")
|
148
|
+
XML.enabled_debug?
|
149
|
+
end
|
150
|
+
|
151
|
+
def self.enabled_docbook?
|
152
|
+
warn("XML::Parser.enabled_docbook? has been deprecated. Use XML.enabled_docbook? instead")
|
153
|
+
XML.enabled_docbook?
|
154
|
+
end
|
155
|
+
|
156
|
+
def self.enabled_ftp?
|
157
|
+
warn("XML::Parser.enabled_ftp? has been deprecated. Use XML.enabled_ftp? instead")
|
158
|
+
XML.enabled_ftp?
|
159
|
+
end
|
160
|
+
|
161
|
+
def self.enabled_http?
|
162
|
+
warn("XML::Parser.enabled_http? has been deprecated. Use XML.enabled_http? instead")
|
163
|
+
XML.enabled_http?
|
164
|
+
end
|
165
|
+
|
166
|
+
def self.enabled_html?
|
167
|
+
warn("XML::Parser.enabled_html? has been deprecated. Use XML.enabled_html? instead")
|
168
|
+
XML.enabled_html?
|
169
|
+
end
|
170
|
+
|
171
|
+
def self.enabled_iconv?
|
172
|
+
warn("XML::Parser.enabled_iconv? has been deprecated. Use XML.enabled_iconv? instead")
|
173
|
+
XML.enabled_iconv?
|
174
|
+
end
|
175
|
+
|
176
|
+
def self.enabled_memory_debug?
|
177
|
+
warn("XML::Parser.enabled_memory_debug_location? has been deprecated. Use XML.enabled_memory_debug_location? instead")
|
178
|
+
XML.enabled_memory_debug_location?
|
179
|
+
end
|
180
|
+
|
181
|
+
def self.enabled_regexp?
|
182
|
+
warn("XML::Parser.enabled_regexp? has been deprecated. Use XML.enabled_regexp? instead")
|
183
|
+
XML.enabled_regexp?
|
184
|
+
end
|
185
|
+
|
186
|
+
def self.enabled_schemas?
|
187
|
+
warn("XML::Parser.enabled_schemas? has been deprecated. Use XML.enabled_schemas? instead")
|
188
|
+
XML.enabled_schemas?
|
189
|
+
end
|
190
|
+
|
191
|
+
def self.enabled_thread?
|
192
|
+
warn("XML::Parser.enabled_thread? has been deprecated. Use XML.enabled_thread? instead")
|
193
|
+
XML.enabled_thread?
|
194
|
+
end
|
195
|
+
|
196
|
+
def self.enabled_unicode?
|
197
|
+
warn("XML::Parser.enabled_unicode? has been deprecated. Use XML.enabled_unicode? instead")
|
198
|
+
XML.enabled_unicode?
|
199
|
+
end
|
200
|
+
|
201
|
+
def self.enabled_xinclude?
|
202
|
+
warn("XML::Parser.enabled_xinclude? has been deprecated. Use XML.enabled_xinclude? instead")
|
203
|
+
XML.enabled_xinclude?
|
204
|
+
end
|
205
|
+
|
206
|
+
def self.enabled_xpath?
|
207
|
+
warn("XML::Parser.enabled_xpath? has been deprecated. Use XML.enabled_xpath? instead")
|
208
|
+
XML.enabled_xpath?
|
209
|
+
end
|
210
|
+
|
211
|
+
def self.enabled_xpointer?
|
212
|
+
warn("XML::Parser.enabled_xpointer? has been deprecated. Use XML.enabled_xpointer? instead")
|
213
|
+
XML.enabled_xpointer?
|
214
|
+
end
|
215
|
+
|
216
|
+
def self.enabled_zlib?
|
217
|
+
warn("XML::Parser.enabled_zlib? has been deprecated. Use XML.enabled_zlib? instead")
|
218
|
+
XML.enabled_zlib?
|
219
|
+
end
|
220
|
+
|
221
|
+
def self.catalog_dump
|
222
|
+
warn("XML::Parser.catalog_dump has been deprecated. Use XML.catalog_dump instead")
|
223
|
+
XML.catalog_dump
|
224
|
+
end
|
225
|
+
|
226
|
+
def self.catalog_remove
|
227
|
+
warn("XML::Parser.catalog_remove has been deprecated. Use XML.catalog_remove instead")
|
228
|
+
XML.catalog_remove
|
229
|
+
end
|
230
|
+
|
231
|
+
def self.check_lib_versions
|
232
|
+
warn("XML::Parser.check_lib_versions has been deprecated. Use XML.check_lib_versions instead")
|
233
|
+
XML.check_lib_versions
|
234
|
+
end
|
235
|
+
|
236
|
+
def self.debug_entities
|
237
|
+
warn("XML::Parser.debug_entities has been deprecated. Use XML.debug_entities instead")
|
238
|
+
XML.debug_entities
|
239
|
+
end
|
240
|
+
|
241
|
+
def self.debug_entities=(value)
|
242
|
+
warn("XML::Parser.debug_entities_set has been deprecated. Use XML.debug_entities= value instead")
|
243
|
+
XML.debug_entities= value
|
244
|
+
end
|
245
|
+
|
246
|
+
def self.default_compression
|
247
|
+
warn("XML::Parser.default_compression has been deprecated. Use XML.default_compression instead")
|
248
|
+
XML.default_compression
|
249
|
+
end
|
250
|
+
|
251
|
+
def self.default_compression=(value)
|
252
|
+
warn("XML::Parser.default_compression= value has been deprecated. Use XML.default_compression= value instead")
|
253
|
+
XML.default_compression= value
|
254
|
+
end
|
255
|
+
|
256
|
+
def self.default_keep_blanks
|
257
|
+
warn("XML::Parser.default_keep_blanks has been deprecated. Use XML.default_keep_blanks instead")
|
258
|
+
XML.default_keep_blanks
|
259
|
+
end
|
260
|
+
|
261
|
+
def self.default_keep_blanks=(value)
|
262
|
+
warn("XML::Parser.default_keep_blanks= value has been deprecated. Use XML.default_keep_blanks= value instead")
|
263
|
+
XML.default_keep_blanks= value
|
264
|
+
end
|
265
|
+
|
266
|
+
def self.default_load_external_dtd
|
267
|
+
warn("XML::Parser.default_load_external_dtd has been deprecated. Use XML.default_load_external_dtd instead")
|
268
|
+
XML.default_load_external_dtd
|
269
|
+
end
|
270
|
+
|
271
|
+
def self.default_load_external_dtd=(value)
|
272
|
+
warn("XML::Parser.default_load_external_dtd= value has been deprecated. Use XML.default_load_external_dtd= value instead")
|
273
|
+
XML.default_load_external_dtd= value
|
274
|
+
end
|
275
|
+
|
276
|
+
def self.default_line_numbers
|
277
|
+
warn("XML::Parser.default_line_numbers has been deprecated. Use XML.default_line_numbers instead")
|
278
|
+
XML.default_line_numbers
|
279
|
+
end
|
280
|
+
|
281
|
+
def self.default_line_numbers=(value)
|
282
|
+
warn("XML::Parser.default_line_numbers= value has been deprecated. Use XML.default_line_numbers= value instead")
|
283
|
+
XML.default_line_numbers= value
|
284
|
+
end
|
285
|
+
|
286
|
+
def self.default_pedantic_parser
|
287
|
+
warn("XML::Parser.default_pedantic_parser has been deprecated. Use XML.default_pedantic_parser instead")
|
288
|
+
XML.default_pedantic_parser
|
289
|
+
end
|
290
|
+
|
291
|
+
def self.default_pedantic_parser=(value)
|
292
|
+
warn("XML::Parser.default_pedantic_parser= value has been deprecated. Use XML.default_pedantic_parser= value instead")
|
293
|
+
XML.default_pedantic_parser= value
|
294
|
+
end
|
295
|
+
|
296
|
+
def self.default_substitute_entities
|
297
|
+
warn("XML::Parser.default_substitute_entities has been deprecated. Use XML.default_substitute_entities instead")
|
298
|
+
XML.default_substitute_entities
|
299
|
+
end
|
300
|
+
|
301
|
+
def self.default_substitute_entities=(value)
|
302
|
+
warn("XML::Parser.default_substitute_entities= value has been deprecated. Use XML.default_substitute_entities= value instead")
|
303
|
+
XML.default_substitute_entities= value
|
304
|
+
end
|
305
|
+
|
306
|
+
def self.default_tree_indent_string
|
307
|
+
warn("XML::Parser.default_tree_indent_string has been deprecated. Use XML.default_tree_indent_string instead")
|
308
|
+
XML.default_tree_indent_string
|
309
|
+
end
|
310
|
+
|
311
|
+
def self.default_tree_indent_string=(value)
|
312
|
+
warn("XML::Parser.default_tree_indent_string= value has been deprecated. Use XML.default_tree_indent_string= value instead")
|
313
|
+
XML.default_tree_indent_string= value
|
314
|
+
end
|
315
|
+
|
316
|
+
def self.default_validity_checking
|
317
|
+
warn("XML::Parser.default_validity_checking has been deprecated. Use XML.default_validity_checking instead")
|
318
|
+
XML.default_validity_checking
|
319
|
+
end
|
320
|
+
|
321
|
+
def self.default_validity_checking=(value)
|
322
|
+
warn("XML::Parser.default_validity_checking= value has been deprecated. Use XML.default_validity_checking= value instead")
|
323
|
+
XML.default_validity_checking= value
|
324
|
+
end
|
325
|
+
|
326
|
+
def self.default_warnings
|
327
|
+
warn("XML::Parser.default_warnings has been deprecated. Use XML.default_warnings instead")
|
328
|
+
XML.default_warnings
|
329
|
+
end
|
330
|
+
|
331
|
+
def self.default_warnings=(value)
|
332
|
+
warn("XML::Parser.default_warnings= value has been deprecated. Use XML.default_warnings= value instead")
|
333
|
+
XML.default_warnings= value
|
334
|
+
end
|
335
|
+
|
336
|
+
def self.features
|
337
|
+
warn("XML::Parser.features has been deprecated. Use XML.features instead")
|
338
|
+
XML.features
|
339
|
+
end
|
340
|
+
|
341
|
+
def self.indent_tree_output
|
342
|
+
warn("XML::Parser.indent_tree_output has been deprecated. Use XML.indent_tree_output instead")
|
343
|
+
XML.indent_tree_output
|
344
|
+
end
|
345
|
+
|
346
|
+
def self.indent_tree_output=(value)
|
347
|
+
warn("XML::Parser.indent_tree_output= value has been deprecated. Use XML.indent_tree_output= value instead")
|
348
|
+
XML.indent_tree_output= value
|
349
|
+
end
|
350
|
+
|
351
|
+
def self.filename(value)
|
352
|
+
warn("Parser.filename is deprecated. Use Parser.file instead")
|
353
|
+
self.file(value)
|
354
|
+
end
|
355
|
+
|
356
|
+
def self.memory_dump
|
357
|
+
warn("XML::Parser.memory_dump has been deprecated. Use XML.memory_dump instead")
|
358
|
+
XML.memory_dump
|
359
|
+
end
|
360
|
+
|
361
|
+
def self.memory_used
|
362
|
+
warn("XML::Parser.memory_used has been deprecated. Use XML.memory_used instead")
|
363
|
+
XML.memory_used
|
364
|
+
end
|
365
|
+
end
|
366
|
+
end
|
367
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module LibXML
|
4
|
+
module XML
|
5
|
+
class Node
|
6
|
+
def property(name)
|
7
|
+
warn('Node#properties is deprecated. Use Node#[] instead.')
|
8
|
+
self[name]
|
9
|
+
end
|
10
|
+
|
11
|
+
def properties
|
12
|
+
warn('Node#properties is deprecated. Use Node#attributes instead.')
|
13
|
+
self.attributes
|
14
|
+
end
|
15
|
+
|
16
|
+
def properties?
|
17
|
+
warn('Node#properties? is deprecated. Use Node#attributes? instead.')
|
18
|
+
self.attributes?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module LibXML
|
4
|
+
module XML
|
5
|
+
class Reader
|
6
|
+
def reset_error_handler
|
7
|
+
warn('reset_error_handler is deprecated. Use Error.reset_handler instead')
|
8
|
+
Error.reset_handler
|
9
|
+
end
|
10
|
+
|
11
|
+
def set_error_handler(&block)
|
12
|
+
warn('set_error_handler is deprecated. Use Error.set_handler instead')
|
13
|
+
Error.set_handler(&block)
|
14
|
+
end
|
15
|
+
|
16
|
+
# :enddoc:
|
17
|
+
|
18
|
+
def self.walker(doc)
|
19
|
+
warn("XML::Reader.walker is deprecated. Use XML::Reader.document instead")
|
20
|
+
self.document(doc)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.data(string, options = nil)
|
24
|
+
warn("XML::Reader.data is deprecated. Use XML::Reader.string instead")
|
25
|
+
self.string(string, options)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,180 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module LibXML
|
4
|
+
module XML
|
5
|
+
class SaxParser
|
6
|
+
module Callbacks
|
7
|
+
# Called for a CDATA block event.
|
8
|
+
def on_cdata_block(cdata)
|
9
|
+
end
|
10
|
+
|
11
|
+
# Called for a characters event.
|
12
|
+
def on_characters(chars)
|
13
|
+
end
|
14
|
+
|
15
|
+
# Called for a comment event.
|
16
|
+
def on_comment(msg)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Called for a end document event.
|
20
|
+
def on_end_document
|
21
|
+
end
|
22
|
+
|
23
|
+
# Called for a end element event.
|
24
|
+
def on_end_element_ns(name, prefix, uri)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Called for parser errors.
|
28
|
+
def on_error(msg)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Called for an external subset event.
|
32
|
+
def on_external_subset(name, external_id, system_id)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Called for an external subset notification event.
|
36
|
+
def on_has_external_subset
|
37
|
+
end
|
38
|
+
|
39
|
+
# Called for an internal subset notification event.
|
40
|
+
def on_has_internal_subset
|
41
|
+
end
|
42
|
+
|
43
|
+
# Called for an internal subset event.
|
44
|
+
def on_internal_subset(name, external_id, system_id)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Called for 'is standalone' event.
|
48
|
+
def on_is_standalone
|
49
|
+
end
|
50
|
+
|
51
|
+
# Called for an processing instruction event.
|
52
|
+
def on_processing_instruction(target, data)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Called for a reference event.
|
56
|
+
def on_reference(name)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Called for a start document event.
|
60
|
+
def on_start_document
|
61
|
+
end
|
62
|
+
|
63
|
+
# Called for a start element event.
|
64
|
+
def on_start_element_ns(name, attributes, prefix, uri, namespaces)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
module VerboseCallbacks
|
69
|
+
# Called for a CDATA block event.
|
70
|
+
def on_cdata_block(cdata)
|
71
|
+
STDOUT << "on_cdata_block" << "\n" <<
|
72
|
+
" cdata " << cdata << "\n"
|
73
|
+
STDOUT.flush
|
74
|
+
end
|
75
|
+
|
76
|
+
# Called for a characters event.
|
77
|
+
def on_characters(chars)
|
78
|
+
STDOUT << "on_characters" << "\n" <<
|
79
|
+
" chars " << chars << "\n"
|
80
|
+
STDOUT.flush
|
81
|
+
end
|
82
|
+
|
83
|
+
# Called for a comment event.
|
84
|
+
def on_comment(comment)
|
85
|
+
STDOUT << "on_comment" << "\n" <<
|
86
|
+
" comment: " << comment << "\n"
|
87
|
+
STDOUT.flush
|
88
|
+
end
|
89
|
+
|
90
|
+
# Called for a end document event.
|
91
|
+
def on_end_document
|
92
|
+
STDOUT << "on_end_document\n"
|
93
|
+
STDOUT.flush
|
94
|
+
end
|
95
|
+
|
96
|
+
# Called for a end element event.
|
97
|
+
def on_end_element_ns(name, prefix, uri)
|
98
|
+
STDOUT << "on_end_element_ns" << "\n" <<
|
99
|
+
" name: " << name << "\n" <<
|
100
|
+
" prefix: " << prefix << "\n" <<
|
101
|
+
" uri: " << uri << "\n"
|
102
|
+
STDOUT.flush
|
103
|
+
end
|
104
|
+
|
105
|
+
# Called for parser errors.
|
106
|
+
def on_error(error)
|
107
|
+
STDOUT << "on_error" << "\n"
|
108
|
+
" error " << error << "\n"
|
109
|
+
STDOUT.flush
|
110
|
+
end
|
111
|
+
|
112
|
+
# Called for an external subset event.
|
113
|
+
def on_external_subset(name, external_id, system_id)
|
114
|
+
STDOUT << "on_external_subset" << "\n"
|
115
|
+
" external_id " << external_id << "\n" <<
|
116
|
+
" system_id " << system_id << "\n"
|
117
|
+
STDOUT.flush
|
118
|
+
end
|
119
|
+
|
120
|
+
# Called for an external subset notification event.
|
121
|
+
def on_has_external_subset
|
122
|
+
STDOUT << "on_has_internal_subset\n"
|
123
|
+
STDOUT.flush
|
124
|
+
end
|
125
|
+
|
126
|
+
# Called for an internal subset notification event.
|
127
|
+
def on_has_internal_subset
|
128
|
+
STDOUT << "on_has_internal_subset\n"
|
129
|
+
STDOUT.flush
|
130
|
+
end
|
131
|
+
|
132
|
+
# Called for an internal subset event.
|
133
|
+
def on_internal_subset(name, external_id, system_id)
|
134
|
+
STDOUT << "on_internal_subset" << "\n"
|
135
|
+
" external_id " << external_id << "\n" <<
|
136
|
+
" system_id " << system_id << "\n"
|
137
|
+
STDOUT.flush
|
138
|
+
end
|
139
|
+
|
140
|
+
# Called for 'is standalone' event.
|
141
|
+
def on_is_standalone
|
142
|
+
STDOUT << "on_is_standalone\n"
|
143
|
+
STDOUT.flush
|
144
|
+
end
|
145
|
+
|
146
|
+
# Called for an processing instruction event.
|
147
|
+
def on_processing_instruction(target, data)
|
148
|
+
STDOUT << "on_characters" << "\n"
|
149
|
+
" target: " << target << "\n" <<
|
150
|
+
" data: " << data << "\n"
|
151
|
+
STDOUT.flush
|
152
|
+
end
|
153
|
+
|
154
|
+
# Called for a reference event.
|
155
|
+
def on_reference(name)
|
156
|
+
STDOUT << "on_reference:" << "\n" <<
|
157
|
+
" name:" << name << "\n"
|
158
|
+
STDOUT.flush
|
159
|
+
end
|
160
|
+
|
161
|
+
# Called for a start document event.
|
162
|
+
def on_start_document
|
163
|
+
STDOUT << "on_start_document\n"
|
164
|
+
STDOUT.flush
|
165
|
+
end
|
166
|
+
|
167
|
+
# Called for a start element event.
|
168
|
+
def on_start_element_ns(name, attributes, prefix, uri, namespaces)
|
169
|
+
STDOUT << "on_start_element_ns" << "\n" <<
|
170
|
+
" name: " << name << "\n" <<
|
171
|
+
" attr: " << (attributes || Hash.new).inspect << "\n" <<
|
172
|
+
" prefix: " << prefix << "\n" <<
|
173
|
+
" uri: " << uri << "\n" <<
|
174
|
+
" ns_defs: " << (namespaces || Hash.new).inspect << "\n"
|
175
|
+
STDOUT.flush
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|