lib/xsd/xmlparser.rb in soap4r-sgonyea-1.5.9 vs lib/xsd/xmlparser.rb in soap4r-sgonyea-1.6.0
- old
+ new
@@ -1,6 +1,5 @@
-# encoding: ASCII-8BIT
# XSD4R - XML Instance parser library.
# Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
# redistribute it and/or modify it under the same terms of Ruby's license;
@@ -18,11 +17,11 @@
XSD::XMLParser::Parser.create_parser(host, opt)
end
module_function :create_parser
# $1 is necessary.
- NSParseRegexp = Regexp.new('^xmlns:?(.*)$', nil, 'n')
+ NSParseRegexp = Regexp.new('^xmlns:?(.*)$', nil, 'NONE')
def filter_ns(ns, attrs)
ns_updated = false
if attrs.nil? or attrs.empty?
return [ns, attrs]
@@ -52,19 +51,19 @@
# Try to load XML processor.
loaded = false
[
- 'nokogiri',
-# 'libxmlparser',
-# 'xmlparser',
-# 'xmlscanner',
- 'rexmlparser',
-].each do |name|
+ 'xsd/xmlparser/libxmlparser',
+ 'xsd/xmlparser/xmlparser',
+ 'xsd/xmlparser/xmlscanner',
+ 'xsd/xmlparser/rexmlparser',
+].each do |lib|
begin
- require "xsd/xmlparser/#{name}"
+ require lib
# XXX: for a workaround of rubygems' require inconsistency
# XXX: MUST BE REMOVED IN THE FUTURE
+ name = lib.sub(/^.*\//, '')
raise LoadError unless XSD::XMLParser.constants.find { |c|
c.to_s.downcase == name
}
loaded = true
break