coupa-libxml-ruby 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +488 -0
- data/LICENSE +22 -0
- data/README +161 -0
- data/Rakefile +188 -0
- data/doc/css/normal.css +182 -0
- data/doc/img/raze-tiny.png +0 -0
- data/doc/img/red-cube.jpg +0 -0
- data/doc/img/xml-ruby.png +0 -0
- data/doc/index.xml +43 -0
- data/doc/install.xml +77 -0
- data/doc/layout.rhtml +38 -0
- data/doc/layout.xsl +67 -0
- data/doc/license.xml +32 -0
- data/doc/log/changelog.xml +1324 -0
- data/doc/log/changelog.xsl +42 -0
- data/doc/rdoc/classes/LibXML.html +207 -0
- data/doc/rdoc/classes/LibXML/XML.html +407 -0
- data/doc/rdoc/classes/LibXML/XML/Attr.html +521 -0
- data/doc/rdoc/classes/LibXML/XML/AttrDecl.html +360 -0
- data/doc/rdoc/classes/LibXML/XML/Attributes.html +149 -0
- data/doc/rdoc/classes/LibXML/XML/Document.html +460 -0
- data/doc/rdoc/classes/LibXML/XML/Error.html +129 -0
- data/doc/rdoc/classes/LibXML/XML/HTMLParser.html +263 -0
- data/doc/rdoc/classes/LibXML/XML/Namespace.html +248 -0
- data/doc/rdoc/classes/LibXML/XML/Namespaces.html +200 -0
- data/doc/rdoc/classes/LibXML/XML/Node.html +1351 -0
- data/doc/rdoc/classes/LibXML/XML/Parser.html +328 -0
- data/doc/rdoc/classes/LibXML/XML/Reader.html +172 -0
- data/doc/rdoc/classes/LibXML/XML/SaxParser.html +232 -0
- data/doc/rdoc/classes/LibXML/XML/SaxParser/Callbacks.html +506 -0
- data/doc/rdoc/classes/LibXML/XML/SaxParser/VerboseCallbacks.html +555 -0
- data/doc/rdoc/classes/LibXML/XML/XPath.html +111 -0
- data/doc/rdoc/classes/LibXML/XML/XPath/Object.html +162 -0
- data/doc/rdoc/classes/cXMLDtd.html +114 -0
- data/doc/rdoc/classes/cXMLNode.html +114 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/CHANGES.html +794 -0
- data/doc/rdoc/files/LICENSE.html +131 -0
- data/doc/rdoc/files/README.html +343 -0
- data/doc/rdoc/files/ext/libxml/libxml_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_attr_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_attr_decl_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_attributes_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_cbg_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_document_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_dtd_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_encoding_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_error_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_html_parser_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_html_parser_context_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_html_parser_options_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_input_cbg_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_io_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_namespace_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_namespaces_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_node_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_parser_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_parser_context_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_parser_options_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_reader_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_relaxng_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_sax2_handler_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_sax_parser_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_schema_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_xinclude_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_context_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_expression_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpath_object_c.html +101 -0
- data/doc/rdoc/files/ext/libxml/ruby_xml_xpointer_c.html +101 -0
- data/doc/rdoc/files/lib/libxml/attr_decl_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/attr_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/attributes_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/document_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/error_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/hpricot_rb.html +192 -0
- data/doc/rdoc/files/lib/libxml/html_parser_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/namespace_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/namespaces_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/node_rb.html +108 -0
- data/doc/rdoc/files/lib/libxml/ns_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/parser_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/properties_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/reader_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/sax_callbacks_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/sax_parser_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/tree_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml/xpath_object_rb.html +101 -0
- data/doc/rdoc/files/lib/libxml_rb.html +133 -0
- data/doc/rdoc/files/lib/xml/libxml_rb.html +124 -0
- data/doc/rdoc/files/lib/xml_rb.html +134 -0
- data/doc/rdoc/fr_class_index.html +46 -0
- data/doc/rdoc/fr_file_index.html +84 -0
- data/doc/rdoc/fr_method_index.html +155 -0
- data/doc/rdoc/index.html +24 -0
- data/doc/rdoc/rdoc-style.css +208 -0
- data/ext/libxml/Makefile +157 -0
- data/ext/libxml/build.log +4 -0
- data/ext/libxml/extconf.h +5 -0
- data/ext/libxml/extconf.rb +278 -0
- data/ext/libxml/libxml.c +77 -0
- data/ext/libxml/libxml.o +0 -0
- data/ext/libxml/libxml_ruby.bundle +0 -0
- data/ext/libxml/mkmf.log +228 -0
- data/ext/libxml/ruby_libxml.h +93 -0
- data/ext/libxml/ruby_xml.c +893 -0
- data/ext/libxml/ruby_xml.h +10 -0
- data/ext/libxml/ruby_xml.o +0 -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.o +0 -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_attr_decl.o +0 -0
- data/ext/libxml/ruby_xml_attributes.c +277 -0
- data/ext/libxml/ruby_xml_attributes.h +17 -0
- data/ext/libxml/ruby_xml_attributes.o +0 -0
- data/ext/libxml/ruby_xml_cbg.c +86 -0
- data/ext/libxml/ruby_xml_cbg.o +0 -0
- data/ext/libxml/ruby_xml_document.c +1006 -0
- data/ext/libxml/ruby_xml_document.c.old +936 -0
- data/ext/libxml/ruby_xml_document.h +17 -0
- data/ext/libxml/ruby_xml_document.o +0 -0
- data/ext/libxml/ruby_xml_dtd.c +257 -0
- data/ext/libxml/ruby_xml_dtd.h +9 -0
- data/ext/libxml/ruby_xml_dtd.o +0 -0
- data/ext/libxml/ruby_xml_encoding.c +134 -0
- data/ext/libxml/ruby_xml_encoding.h +12 -0
- data/ext/libxml/ruby_xml_encoding.o +0 -0
- data/ext/libxml/ruby_xml_error.c +1004 -0
- data/ext/libxml/ruby_xml_error.h +14 -0
- data/ext/libxml/ruby_xml_error.o +0 -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.o +0 -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_context.o +0 -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_html_parser_options.o +0 -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_input_cbg.o +0 -0
- data/ext/libxml/ruby_xml_io.c +30 -0
- data/ext/libxml/ruby_xml_io.h +9 -0
- data/ext/libxml/ruby_xml_io.o +0 -0
- data/ext/libxml/ruby_xml_namespace.c +170 -0
- data/ext/libxml/ruby_xml_namespace.h +12 -0
- data/ext/libxml/ruby_xml_namespace.o +0 -0
- data/ext/libxml/ruby_xml_namespaces.c +295 -0
- data/ext/libxml/ruby_xml_namespaces.h +11 -0
- data/ext/libxml/ruby_xml_namespaces.o +0 -0
- data/ext/libxml/ruby_xml_node.c +1386 -0
- data/ext/libxml/ruby_xml_node.h +13 -0
- data/ext/libxml/ruby_xml_node.o +0 -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.o +0 -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_context.o +0 -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_parser_options.o +0 -0
- data/ext/libxml/ruby_xml_reader.c +1002 -0
- data/ext/libxml/ruby_xml_reader.h +14 -0
- data/ext/libxml/ruby_xml_reader.o +0 -0
- data/ext/libxml/ruby_xml_relaxng.c +111 -0
- data/ext/libxml/ruby_xml_relaxng.h +10 -0
- data/ext/libxml/ruby_xml_relaxng.o +0 -0
- data/ext/libxml/ruby_xml_sax2_handler.c +322 -0
- data/ext/libxml/ruby_xml_sax2_handler.h +12 -0
- data/ext/libxml/ruby_xml_sax2_handler.o +0 -0
- data/ext/libxml/ruby_xml_sax_parser.c +137 -0
- data/ext/libxml/ruby_xml_sax_parser.h +12 -0
- data/ext/libxml/ruby_xml_sax_parser.o +0 -0
- data/ext/libxml/ruby_xml_schema.c +159 -0
- data/ext/libxml/ruby_xml_schema.h +11 -0
- data/ext/libxml/ruby_xml_schema.o +0 -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_xinclude.o +0 -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.o +0 -0
- data/ext/libxml/ruby_xml_xpath_context.c +387 -0
- data/ext/libxml/ruby_xml_xpath_context.h +11 -0
- data/ext/libxml/ruby_xml_xpath_context.o +0 -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_expression.o +0 -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_xpath_object.o +0 -0
- data/ext/libxml/ruby_xml_xpointer.c +101 -0
- data/ext/libxml/ruby_xml_xpointer.h +13 -0
- data/ext/libxml/ruby_xml_xpointer.o +0 -0
- data/ext/mingw/Rakefile +34 -0
- data/ext/mingw/build.rake +41 -0
- data/ext/vc/libxml_ruby.sln +26 -0
- data/lib/libxml.rb +30 -0
- data/lib/libxml/attr.rb +111 -0
- data/lib/libxml/attr_decl.rb +78 -0
- data/lib/libxml/attributes.rb +12 -0
- data/lib/libxml/document.rb +190 -0
- data/lib/libxml/error.rb +88 -0
- data/lib/libxml/hpricot.rb +76 -0
- data/lib/libxml/html_parser.rb +94 -0
- data/lib/libxml/namespace.rb +60 -0
- data/lib/libxml/namespaces.rb +36 -0
- data/lib/libxml/node.rb +385 -0
- data/lib/libxml/ns.rb +20 -0
- data/lib/libxml/parser.rb +365 -0
- data/lib/libxml/properties.rb +21 -0
- data/lib/libxml/reader.rb +27 -0
- data/lib/libxml/sax_callbacks.rb +178 -0
- data/lib/libxml/sax_parser.rb +56 -0
- data/lib/libxml/tree.rb +27 -0
- data/lib/libxml/xpath_object.rb +14 -0
- data/lib/xml.rb +14 -0
- data/lib/xml/libxml.rb +8 -0
- data/setup.rb +1585 -0
- data/test/etc_doc_to_s.rb +19 -0
- data/test/ets_doc_file.rb +15 -0
- data/test/ets_doc_to_s.rb +21 -0
- data/test/ets_gpx.rb +26 -0
- data/test/ets_node_gc.rb +21 -0
- data/test/ets_test.xml +2 -0
- data/test/ets_tsr.rb +9 -0
- data/test/model/atom.xml +13 -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/tc_attr.rb +170 -0
- data/test/tc_attr_decl.rb +131 -0
- data/test/tc_attributes.rb +133 -0
- data/test/tc_deprecated_require.rb +11 -0
- data/test/tc_document.rb +113 -0
- data/test/tc_document_write.rb +118 -0
- data/test/tc_dtd.rb +123 -0
- data/test/tc_error.rb +136 -0
- data/test/tc_html_parser.rb +138 -0
- data/test/tc_namespace.rb +59 -0
- data/test/tc_namespaces.rb +174 -0
- data/test/tc_node.rb +181 -0
- data/test/tc_node_cdata.rb +49 -0
- data/test/tc_node_comment.rb +30 -0
- data/test/tc_node_copy.rb +40 -0
- data/test/tc_node_edit.rb +158 -0
- data/test/tc_node_text.rb +69 -0
- data/test/tc_node_write.rb +83 -0
- data/test/tc_node_xlink.rb +26 -0
- data/test/tc_parser.rb +330 -0
- data/test/tc_parser_context.rb +186 -0
- data/test/tc_properties.rb +36 -0
- data/test/tc_reader.rb +284 -0
- data/test/tc_relaxng.rb +51 -0
- data/test/tc_sax_parser.rb +274 -0
- data/test/tc_schema.rb +51 -0
- data/test/tc_traversal.rb +220 -0
- data/test/tc_xinclude.rb +19 -0
- data/test/tc_xml.rb +224 -0
- data/test/tc_xpath.rb +193 -0
- data/test/tc_xpath_context.rb +78 -0
- data/test/tc_xpath_expression.rb +35 -0
- data/test/tc_xpointer.rb +72 -0
- data/test/test_suite.rb +33 -0
- metadata +376 -0
data/lib/libxml/ns.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module LibXML
|
2
|
+
module XML
|
3
|
+
class NS < Namespace # :nodoc:
|
4
|
+
def initialize(node, prefix, href)
|
5
|
+
warn('The XML::NS class is deprecated. Use XML::Namespace instead.')
|
6
|
+
super(node, href, prefix)
|
7
|
+
end
|
8
|
+
|
9
|
+
def href?
|
10
|
+
warn('XML::NS#href? is deprecated. Use !XML::NS#href.nil? instead.')
|
11
|
+
not self.href.nil?
|
12
|
+
end
|
13
|
+
|
14
|
+
def prefix?
|
15
|
+
warn('XML::NS#prefix? is deprecated. Use !XML::NS#prefix?.nil? instead.')
|
16
|
+
not self.previx.nil?
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,365 @@
|
|
1
|
+
module LibXML
|
2
|
+
module XML
|
3
|
+
class Parser
|
4
|
+
# call-seq:
|
5
|
+
# XML::Parser.document(document) -> XML::Parser
|
6
|
+
#
|
7
|
+
# Creates a new parser for the specified document.
|
8
|
+
#
|
9
|
+
# Parameters:
|
10
|
+
#
|
11
|
+
# document - A preparsed document.
|
12
|
+
def self.document(doc)
|
13
|
+
context = XML::Parser::Context.document(doc)
|
14
|
+
self.new(context)
|
15
|
+
end
|
16
|
+
|
17
|
+
# call-seq:
|
18
|
+
# XML::Parser.file(path) -> XML::Parser
|
19
|
+
# XML::Parser.file(path, :encoding => XML::Encoding::UTF_8,
|
20
|
+
# :options => XML::Parser::Options::NOENT) -> XML::Parser
|
21
|
+
#
|
22
|
+
# Creates a new parser for the specified file or uri.
|
23
|
+
#
|
24
|
+
# You may provide an optional hash table to control how the
|
25
|
+
# parsing is performed. Valid options are:
|
26
|
+
#
|
27
|
+
# encoding - The document encoding, defaults to nil. Valid values
|
28
|
+
# are the encoding constants defined on XML::Encoding.
|
29
|
+
# options - Parser options. Valid values are the constants defined on
|
30
|
+
# XML::Parser::Options. Mutliple options can be combined
|
31
|
+
# by using Bitwise OR (|).
|
32
|
+
def self.file(path, options = {})
|
33
|
+
context = XML::Parser::Context.file(path)
|
34
|
+
context.encoding = options[:encoding] if options[:encoding]
|
35
|
+
context.options = options[:options] if options[:options]
|
36
|
+
self.new(context)
|
37
|
+
end
|
38
|
+
|
39
|
+
# call-seq:
|
40
|
+
# XML::Parser.io(io) -> XML::Parser
|
41
|
+
# XML::Parser.io(io, :encoding => XML::Encoding::UTF_8,
|
42
|
+
# :options => XML::Parser::Options::NOENT
|
43
|
+
# :base_uri="http://libxml.org") -> XML::Parser
|
44
|
+
#
|
45
|
+
# Creates a new parser for the specified io object.
|
46
|
+
#
|
47
|
+
# Parameters:
|
48
|
+
#
|
49
|
+
# io - io object that contains the xml to parser
|
50
|
+
# base_uri - The base url for the parsed document.
|
51
|
+
# encoding - The document encoding, defaults to nil. Valid values
|
52
|
+
# are the encoding constants defined on XML::Encoding.
|
53
|
+
# options - Parser options. Valid values are the constants defined on
|
54
|
+
# XML::Parser::Options. Mutliple options can be combined
|
55
|
+
# by using Bitwise OR (|).
|
56
|
+
def self.io(io, options = {})
|
57
|
+
context = XML::Parser::Context.io(io)
|
58
|
+
context.base_uri = options[:base_uri] if options[:base_uri]
|
59
|
+
context.encoding = options[:encoding] if options[:encoding]
|
60
|
+
context.options = options[:options] if options[:options]
|
61
|
+
self.new(context)
|
62
|
+
end
|
63
|
+
|
64
|
+
# call-seq:
|
65
|
+
# XML::Parser.string(string)
|
66
|
+
# XML::Parser.string(string, :encoding => XML::Encoding::UTF_8,
|
67
|
+
# :options => XML::Parser::Options::NOENT
|
68
|
+
# :base_uri="http://libxml.org") -> XML::Parser
|
69
|
+
#
|
70
|
+
# Creates a new parser by parsing the specified string.
|
71
|
+
#
|
72
|
+
# You may provide an optional hash table to control how the
|
73
|
+
# parsing is performed. Valid options are:
|
74
|
+
#
|
75
|
+
# base_uri - The base url for the parsed document.
|
76
|
+
# encoding - The document encoding, defaults to nil. Valid values
|
77
|
+
# are the encoding constants defined on XML::Encoding.
|
78
|
+
# options - Parser options. Valid values are the constants defined on
|
79
|
+
# XML::Parser::Options. Mutliple options can be combined
|
80
|
+
# by using Bitwise OR (|).
|
81
|
+
def self.string(string, options = {})
|
82
|
+
context = XML::Parser::Context.string(string)
|
83
|
+
context.base_uri = options[:base_uri] if options[:base_uri]
|
84
|
+
context.encoding = options[:encoding] if options[:encoding]
|
85
|
+
context.options = options[:options] if options[:options]
|
86
|
+
self.new(context)
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.register_error_handler(proc)
|
90
|
+
warn('Parser.register_error_handler is deprecated. Use Error.set_handler instead')
|
91
|
+
if proc.nil?
|
92
|
+
Error.reset_handler
|
93
|
+
else
|
94
|
+
Error.set_handler(&proc)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# :enddoc:
|
99
|
+
|
100
|
+
# Bunch of deprecated methods that have moved to the XML module
|
101
|
+
VERSION = XML::VERSION
|
102
|
+
VERNUM = XML::VERNUM
|
103
|
+
|
104
|
+
def document=(value)
|
105
|
+
warn("XML::Parser#document= is deprecated. Use XML::Parser.document= instead")
|
106
|
+
@context = XML::Parser::Context.document(value)
|
107
|
+
end
|
108
|
+
|
109
|
+
def file=(value)
|
110
|
+
warn("XML::Parser#file is deprecated. Use XML::Parser.file instead")
|
111
|
+
@context = XML::Parser::Context.file(value)
|
112
|
+
end
|
113
|
+
|
114
|
+
def filename=(value)
|
115
|
+
warn("XML::Parser#filename is deprecated. Use XML::Parser.file instead")
|
116
|
+
self.file = value
|
117
|
+
end
|
118
|
+
|
119
|
+
def io=(value)
|
120
|
+
warn("XML::Parser#io is deprecated. Use XML::Parser.io instead")
|
121
|
+
@context = XML::Parser::Context.io(value)
|
122
|
+
end
|
123
|
+
|
124
|
+
def string=(value)
|
125
|
+
warn("XML::Parser#string is deprecated. Use XML::Parser.string instead")
|
126
|
+
@context = XML::Parser::Context.string(value)
|
127
|
+
end
|
128
|
+
|
129
|
+
def self.enabled_automata?
|
130
|
+
warn("XML::Parser.enabled_automata? has been deprecated. Use XML.enabled_automata? instead")
|
131
|
+
XML.enabled_automata?
|
132
|
+
end
|
133
|
+
|
134
|
+
def self.enabled_c14n?
|
135
|
+
warn("XML::Parser.enabled_c14n? has been deprecated. Use XML.enabled_c14n? instead")
|
136
|
+
XML.enabled_c14n?
|
137
|
+
end
|
138
|
+
|
139
|
+
def self.enabled_catalog?
|
140
|
+
warn("XML::Parser.enabled_catalog? has been deprecated. Use XML.enabled_catalog? instead")
|
141
|
+
XML.enabled_catalog?
|
142
|
+
end
|
143
|
+
|
144
|
+
def self.enabled_debug?
|
145
|
+
warn("XML::Parser.enabled_debug? has been deprecated. Use XML.enabled_debug? instead")
|
146
|
+
XML.enabled_debug?
|
147
|
+
end
|
148
|
+
|
149
|
+
def self.enabled_docbook?
|
150
|
+
warn("XML::Parser.enabled_docbook? has been deprecated. Use XML.enabled_docbook? instead")
|
151
|
+
XML.enabled_docbook?
|
152
|
+
end
|
153
|
+
|
154
|
+
def self.enabled_ftp?
|
155
|
+
warn("XML::Parser.enabled_ftp? has been deprecated. Use XML.enabled_ftp? instead")
|
156
|
+
XML.enabled_ftp?
|
157
|
+
end
|
158
|
+
|
159
|
+
def self.enabled_http?
|
160
|
+
warn("XML::Parser.enabled_http? has been deprecated. Use XML.enabled_http? instead")
|
161
|
+
XML.enabled_http?
|
162
|
+
end
|
163
|
+
|
164
|
+
def self.enabled_html?
|
165
|
+
warn("XML::Parser.enabled_html? has been deprecated. Use XML.enabled_html? instead")
|
166
|
+
XML.enabled_html?
|
167
|
+
end
|
168
|
+
|
169
|
+
def self.enabled_iconv?
|
170
|
+
warn("XML::Parser.enabled_iconv? has been deprecated. Use XML.enabled_iconv? instead")
|
171
|
+
XML.enabled_iconv?
|
172
|
+
end
|
173
|
+
|
174
|
+
def self.enabled_memory_debug?
|
175
|
+
warn("XML::Parser.enabled_memory_debug_location? has been deprecated. Use XML.enabled_memory_debug_location? instead")
|
176
|
+
XML.enabled_memory_debug_location?
|
177
|
+
end
|
178
|
+
|
179
|
+
def self.enabled_regexp?
|
180
|
+
warn("XML::Parser.enabled_regexp? has been deprecated. Use XML.enabled_regexp? instead")
|
181
|
+
XML.enabled_regexp?
|
182
|
+
end
|
183
|
+
|
184
|
+
def self.enabled_schemas?
|
185
|
+
warn("XML::Parser.enabled_schemas? has been deprecated. Use XML.enabled_schemas? instead")
|
186
|
+
XML.enabled_schemas?
|
187
|
+
end
|
188
|
+
|
189
|
+
def self.enabled_thread?
|
190
|
+
warn("XML::Parser.enabled_thread? has been deprecated. Use XML.enabled_thread? instead")
|
191
|
+
XML.enabled_thread?
|
192
|
+
end
|
193
|
+
|
194
|
+
def self.enabled_unicode?
|
195
|
+
warn("XML::Parser.enabled_unicode? has been deprecated. Use XML.enabled_unicode? instead")
|
196
|
+
XML.enabled_unicode?
|
197
|
+
end
|
198
|
+
|
199
|
+
def self.enabled_xinclude?
|
200
|
+
warn("XML::Parser.enabled_xinclude? has been deprecated. Use XML.enabled_xinclude? instead")
|
201
|
+
XML.enabled_xinclude?
|
202
|
+
end
|
203
|
+
|
204
|
+
def self.enabled_xpath?
|
205
|
+
warn("XML::Parser.enabled_xpath? has been deprecated. Use XML.enabled_xpath? instead")
|
206
|
+
XML.enabled_xpath?
|
207
|
+
end
|
208
|
+
|
209
|
+
def self.enabled_xpointer?
|
210
|
+
warn("XML::Parser.enabled_xpointer? has been deprecated. Use XML.enabled_xpointer? instead")
|
211
|
+
XML.enabled_xpointer?
|
212
|
+
end
|
213
|
+
|
214
|
+
def self.enabled_zlib?
|
215
|
+
warn("XML::Parser.enabled_zlib? has been deprecated. Use XML.enabled_zlib? instead")
|
216
|
+
XML.enabled_zlib?
|
217
|
+
end
|
218
|
+
|
219
|
+
def self.catalog_dump
|
220
|
+
warn("XML::Parser.catalog_dump has been deprecated. Use XML.catalog_dump instead")
|
221
|
+
XML.catalog_dump
|
222
|
+
end
|
223
|
+
|
224
|
+
def self.catalog_remove
|
225
|
+
warn("XML::Parser.catalog_remove has been deprecated. Use XML.catalog_remove instead")
|
226
|
+
XML.catalog_remove
|
227
|
+
end
|
228
|
+
|
229
|
+
def self.check_lib_versions
|
230
|
+
warn("XML::Parser.check_lib_versions has been deprecated. Use XML.check_lib_versions instead")
|
231
|
+
XML.check_lib_versions
|
232
|
+
end
|
233
|
+
|
234
|
+
def self.debug_entities
|
235
|
+
warn("XML::Parser.debug_entities has been deprecated. Use XML.debug_entities instead")
|
236
|
+
XML.debug_entities
|
237
|
+
end
|
238
|
+
|
239
|
+
def self.debug_entities=(value)
|
240
|
+
warn("XML::Parser.debug_entities_set has been deprecated. Use XML.debug_entities= value instead")
|
241
|
+
XML.debug_entities= value
|
242
|
+
end
|
243
|
+
|
244
|
+
def self.default_compression
|
245
|
+
warn("XML::Parser.default_compression has been deprecated. Use XML.default_compression instead")
|
246
|
+
XML.default_compression
|
247
|
+
end
|
248
|
+
|
249
|
+
def self.default_compression=(value)
|
250
|
+
warn("XML::Parser.default_compression= value has been deprecated. Use XML.default_compression= value instead")
|
251
|
+
XML.default_compression= value
|
252
|
+
end
|
253
|
+
|
254
|
+
def self.default_keep_blanks
|
255
|
+
warn("XML::Parser.default_keep_blanks has been deprecated. Use XML.default_keep_blanks instead")
|
256
|
+
XML.default_keep_blanks
|
257
|
+
end
|
258
|
+
|
259
|
+
def self.default_keep_blanks=(value)
|
260
|
+
warn("XML::Parser.default_keep_blanks= value has been deprecated. Use XML.default_keep_blanks= value instead")
|
261
|
+
XML.default_keep_blanks= value
|
262
|
+
end
|
263
|
+
|
264
|
+
def self.default_load_external_dtd
|
265
|
+
warn("XML::Parser.default_load_external_dtd has been deprecated. Use XML.default_load_external_dtd instead")
|
266
|
+
XML.default_load_external_dtd
|
267
|
+
end
|
268
|
+
|
269
|
+
def self.default_load_external_dtd=(value)
|
270
|
+
warn("XML::Parser.default_load_external_dtd= value has been deprecated. Use XML.default_load_external_dtd= value instead")
|
271
|
+
XML.default_load_external_dtd= value
|
272
|
+
end
|
273
|
+
|
274
|
+
def self.default_line_numbers
|
275
|
+
warn("XML::Parser.default_line_numbers has been deprecated. Use XML.default_line_numbers instead")
|
276
|
+
XML.default_line_numbers
|
277
|
+
end
|
278
|
+
|
279
|
+
def self.default_line_numbers=(value)
|
280
|
+
warn("XML::Parser.default_line_numbers= value has been deprecated. Use XML.default_line_numbers= value instead")
|
281
|
+
XML.default_line_numbers= value
|
282
|
+
end
|
283
|
+
|
284
|
+
def self.default_pedantic_parser
|
285
|
+
warn("XML::Parser.default_pedantic_parser has been deprecated. Use XML.default_pedantic_parser instead")
|
286
|
+
XML.default_pedantic_parser
|
287
|
+
end
|
288
|
+
|
289
|
+
def self.default_pedantic_parser=(value)
|
290
|
+
warn("XML::Parser.default_pedantic_parser= value has been deprecated. Use XML.default_pedantic_parser= value instead")
|
291
|
+
XML.default_pedantic_parser= value
|
292
|
+
end
|
293
|
+
|
294
|
+
def self.default_substitute_entities
|
295
|
+
warn("XML::Parser.default_substitute_entities has been deprecated. Use XML.default_substitute_entities instead")
|
296
|
+
XML.default_substitute_entities
|
297
|
+
end
|
298
|
+
|
299
|
+
def self.default_substitute_entities=(value)
|
300
|
+
warn("XML::Parser.default_substitute_entities= value has been deprecated. Use XML.default_substitute_entities= value instead")
|
301
|
+
XML.default_substitute_entities= value
|
302
|
+
end
|
303
|
+
|
304
|
+
def self.default_tree_indent_string
|
305
|
+
warn("XML::Parser.default_tree_indent_string has been deprecated. Use XML.default_tree_indent_string instead")
|
306
|
+
XML.default_tree_indent_string
|
307
|
+
end
|
308
|
+
|
309
|
+
def self.default_tree_indent_string=(value)
|
310
|
+
warn("XML::Parser.default_tree_indent_string= value has been deprecated. Use XML.default_tree_indent_string= value instead")
|
311
|
+
XML.default_tree_indent_string= value
|
312
|
+
end
|
313
|
+
|
314
|
+
def self.default_validity_checking
|
315
|
+
warn("XML::Parser.default_validity_checking has been deprecated. Use XML.default_validity_checking instead")
|
316
|
+
XML.default_validity_checking
|
317
|
+
end
|
318
|
+
|
319
|
+
def self.default_validity_checking=(value)
|
320
|
+
warn("XML::Parser.default_validity_checking= value has been deprecated. Use XML.default_validity_checking= value instead")
|
321
|
+
XML.default_validity_checking= value
|
322
|
+
end
|
323
|
+
|
324
|
+
def self.default_warnings
|
325
|
+
warn("XML::Parser.default_warnings has been deprecated. Use XML.default_warnings instead")
|
326
|
+
XML.default_warnings
|
327
|
+
end
|
328
|
+
|
329
|
+
def self.default_warnings=(value)
|
330
|
+
warn("XML::Parser.default_warnings= value has been deprecated. Use XML.default_warnings= value instead")
|
331
|
+
XML.default_warnings= value
|
332
|
+
end
|
333
|
+
|
334
|
+
def self.features
|
335
|
+
warn("XML::Parser.features has been deprecated. Use XML.features instead")
|
336
|
+
XML.features
|
337
|
+
end
|
338
|
+
|
339
|
+
def self.indent_tree_output
|
340
|
+
warn("XML::Parser.indent_tree_output has been deprecated. Use XML.indent_tree_output instead")
|
341
|
+
XML.indent_tree_output
|
342
|
+
end
|
343
|
+
|
344
|
+
def self.indent_tree_output=(value)
|
345
|
+
warn("XML::Parser.indent_tree_output= value has been deprecated. Use XML.indent_tree_output= value instead")
|
346
|
+
XML.indent_tree_output= value
|
347
|
+
end
|
348
|
+
|
349
|
+
def self.filename(value)
|
350
|
+
warn("Parser.filename is deprecated. Use Parser.file instead")
|
351
|
+
self.file(value)
|
352
|
+
end
|
353
|
+
|
354
|
+
def self.memory_dump
|
355
|
+
warn("XML::Parser.memory_dump has been deprecated. Use XML.memory_dump instead")
|
356
|
+
XML.memory_dump
|
357
|
+
end
|
358
|
+
|
359
|
+
def self.memory_used
|
360
|
+
warn("XML::Parser.memory_used has been deprecated. Use XML.memory_used instead")
|
361
|
+
XML.memory_used
|
362
|
+
end
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module LibXML
|
2
|
+
module XML
|
3
|
+
class Node
|
4
|
+
def property(name)
|
5
|
+
warn('Node#properties is deprecated. Use Node#[] instead.')
|
6
|
+
self[name]
|
7
|
+
end
|
8
|
+
|
9
|
+
def properties
|
10
|
+
warn('Node#properties is deprecated. Use Node#attributes instead.')
|
11
|
+
self.attributes
|
12
|
+
end
|
13
|
+
|
14
|
+
def properties?
|
15
|
+
warn('Node#properties? is deprecated. Use Node#attributes? instead.')
|
16
|
+
self.attributes?
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module LibXML
|
2
|
+
module XML
|
3
|
+
class Reader
|
4
|
+
def reset_error_handler
|
5
|
+
warn('reset_error_handler is deprecated. Use Error.reset_handler instead')
|
6
|
+
Error.reset_handler
|
7
|
+
end
|
8
|
+
|
9
|
+
def set_error_handler(&block)
|
10
|
+
warn('set_error_handler is deprecated. Use Error.set_handler instead')
|
11
|
+
Error.set_handler(&block)
|
12
|
+
end
|
13
|
+
|
14
|
+
# :enddoc:
|
15
|
+
|
16
|
+
def self.walker(doc)
|
17
|
+
warn("XML::Reader.walker is deprecated. Use XML::Reader.document instead")
|
18
|
+
self.document(doc)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.data(string, options = nil)
|
22
|
+
warn("XML::Reader.data is deprecated. Use XML::Reader.string instead")
|
23
|
+
self.string(string, options)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,178 @@
|
|
1
|
+
module LibXML
|
2
|
+
module XML
|
3
|
+
class SaxParser
|
4
|
+
module Callbacks
|
5
|
+
# Called for a CDATA block event.
|
6
|
+
def on_cdata_block(cdata)
|
7
|
+
end
|
8
|
+
|
9
|
+
# Called for a characters event.
|
10
|
+
def on_characters(chars)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Called for a comment event.
|
14
|
+
def on_comment(msg)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Called for a end document event.
|
18
|
+
def on_end_document
|
19
|
+
end
|
20
|
+
|
21
|
+
# Called for a end element event.
|
22
|
+
def on_end_element_ns(name, prefix, uri)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Called for parser errors.
|
26
|
+
def on_error(msg)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Called for an external subset event.
|
30
|
+
def on_external_subset(name, external_id, system_id)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Called for an external subset notification event.
|
34
|
+
def on_has_external_subset
|
35
|
+
end
|
36
|
+
|
37
|
+
# Called for an internal subset notification event.
|
38
|
+
def on_has_internal_subset
|
39
|
+
end
|
40
|
+
|
41
|
+
# Called for an internal subset event.
|
42
|
+
def on_internal_subset(name, external_id, system_id)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Called for 'is standalone' event.
|
46
|
+
def on_is_standalone
|
47
|
+
end
|
48
|
+
|
49
|
+
# Called for an processing instruction event.
|
50
|
+
def on_processing_instruction(target, data)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Called for a reference event.
|
54
|
+
def on_reference(name)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Called for a start document event.
|
58
|
+
def on_start_document
|
59
|
+
end
|
60
|
+
|
61
|
+
# Called for a start element event.
|
62
|
+
def on_start_element_ns(name, attributes, prefix, uri, namespaces)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
module VerboseCallbacks
|
67
|
+
# Called for a CDATA block event.
|
68
|
+
def on_cdata_block(cdata)
|
69
|
+
STDOUT << "on_cdata_block" << "\n" <<
|
70
|
+
" cdata " << cdata << "\n"
|
71
|
+
STDOUT.flush
|
72
|
+
end
|
73
|
+
|
74
|
+
# Called for a characters event.
|
75
|
+
def on_characters(chars)
|
76
|
+
STDOUT << "on_characters" << "\n" <<
|
77
|
+
" chars " << chars << "\n"
|
78
|
+
STDOUT.flush
|
79
|
+
end
|
80
|
+
|
81
|
+
# Called for a comment event.
|
82
|
+
def on_comment(comment)
|
83
|
+
STDOUT << "on_comment" << "\n" <<
|
84
|
+
" comment: " << comment << "\n"
|
85
|
+
STDOUT.flush
|
86
|
+
end
|
87
|
+
|
88
|
+
# Called for a end document event.
|
89
|
+
def on_end_document
|
90
|
+
STDOUT << "on_end_document\n"
|
91
|
+
STDOUT.flush
|
92
|
+
end
|
93
|
+
|
94
|
+
# Called for a end element event.
|
95
|
+
def on_end_element_ns(name, prefix, uri)
|
96
|
+
STDOUT << "on_end_element_ns" << "\n" <<
|
97
|
+
" name: " << name << "\n" <<
|
98
|
+
" prefix: " << prefix << "\n" <<
|
99
|
+
" uri: " << uri << "\n"
|
100
|
+
STDOUT.flush
|
101
|
+
end
|
102
|
+
|
103
|
+
# Called for parser errors.
|
104
|
+
def on_error(error)
|
105
|
+
STDOUT << "on_error" << "\n"
|
106
|
+
" error " << error << "\n"
|
107
|
+
STDOUT.flush
|
108
|
+
end
|
109
|
+
|
110
|
+
# Called for an external subset event.
|
111
|
+
def on_external_subset(name, external_id, system_id)
|
112
|
+
STDOUT << "on_external_subset" << "\n"
|
113
|
+
" external_id " << external_id << "\n" <<
|
114
|
+
" system_id " << system_id << "\n"
|
115
|
+
STDOUT.flush
|
116
|
+
end
|
117
|
+
|
118
|
+
# Called for an external subset notification event.
|
119
|
+
def on_has_external_subset
|
120
|
+
STDOUT << "on_has_internal_subset\n"
|
121
|
+
STDOUT.flush
|
122
|
+
end
|
123
|
+
|
124
|
+
# Called for an internal subset notification event.
|
125
|
+
def on_has_internal_subset
|
126
|
+
STDOUT << "on_has_internal_subset\n"
|
127
|
+
STDOUT.flush
|
128
|
+
end
|
129
|
+
|
130
|
+
# Called for an internal subset event.
|
131
|
+
def on_internal_subset(name, external_id, system_id)
|
132
|
+
STDOUT << "on_internal_subset" << "\n"
|
133
|
+
" external_id " << external_id << "\n" <<
|
134
|
+
" system_id " << system_id << "\n"
|
135
|
+
STDOUT.flush
|
136
|
+
end
|
137
|
+
|
138
|
+
# Called for 'is standalone' event.
|
139
|
+
def on_is_standalone
|
140
|
+
STDOUT << "on_is_standalone\n"
|
141
|
+
STDOUT.flush
|
142
|
+
end
|
143
|
+
|
144
|
+
# Called for an processing instruction event.
|
145
|
+
def on_processing_instruction(target, data)
|
146
|
+
STDOUT << "on_characters" << "\n"
|
147
|
+
" target: " << target << "\n" <<
|
148
|
+
" data: " << data << "\n"
|
149
|
+
STDOUT.flush
|
150
|
+
end
|
151
|
+
|
152
|
+
# Called for a reference event.
|
153
|
+
def on_reference(name)
|
154
|
+
STDOUT << "on_reference:" << "\n" <<
|
155
|
+
" name:" << name << "\n"
|
156
|
+
STDOUT.flush
|
157
|
+
end
|
158
|
+
|
159
|
+
# Called for a start document event.
|
160
|
+
def on_start_document
|
161
|
+
STDOUT << "on_start_document\n"
|
162
|
+
STDOUT.flush
|
163
|
+
end
|
164
|
+
|
165
|
+
# Called for a start element event.
|
166
|
+
def on_start_element_ns(name, attributes, prefix, uri, namespaces)
|
167
|
+
STDOUT << "on_start_element_ns" << "\n" <<
|
168
|
+
" name: " << name << "\n" <<
|
169
|
+
" attr: " << (attributes || Hash.new).inspect << "\n" <<
|
170
|
+
" prefix: " << prefix << "\n" <<
|
171
|
+
" uri: " << uri << "\n" <<
|
172
|
+
" ns_defs: " << (namespaces || Hash.new).inspect << "\n"
|
173
|
+
STDOUT.flush
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|