diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 08:14:57 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 08:14:57 +0000 |
commit | 0eb20dc9b41da71b51540f75cfe955ed71420915 (patch) | |
tree | 6c16302232c2b655cfd5ea406a9ac202814a8b35 /lib/xsd/xmlparser/parser.rb | |
parent | f54f1ce821930931cf490d6c7ac8f3f12baec3a1 (diff) | |
download | ruby-0eb20dc9b41da71b51540f75cfe955ed71420915.tar.gz ruby-0eb20dc9b41da71b51540f75cfe955ed71420915.tar.xz ruby-0eb20dc9b41da71b51540f75cfe955ed71420915.zip |
Mon Dec 24 17:06:37 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* {lib,test}/{soap,wsdl,xsd}: removed soap4r along to the discussion
at ruby-core and ruby-dev. see [ruby-core:12535], [ruby-dev:31969].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/xsd/xmlparser/parser.rb')
-rw-r--r-- | lib/xsd/xmlparser/parser.rb | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/lib/xsd/xmlparser/parser.rb b/lib/xsd/xmlparser/parser.rb deleted file mode 100644 index ad01d55aa..000000000 --- a/lib/xsd/xmlparser/parser.rb +++ /dev/null @@ -1,96 +0,0 @@ -# XSD4R - XML Instance parser library. -# Copyright (C) 2002, 2003 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; -# either the dual license version in 2003, or any later version. - - -require 'xsd/qname' -require 'xsd/ns' -require 'xsd/charset' - - -module XSD -module XMLParser - - -class Parser - class ParseError < Error; end - class FormatDecodeError < ParseError; end - class UnknownElementError < FormatDecodeError; end - class UnknownAttributeError < FormatDecodeError; end - class UnexpectedElementError < FormatDecodeError; end - class ElementConstraintError < FormatDecodeError; end - - @@parser_factory = nil - - def self.factory - @@parser_factory - end - - def self.create_parser(host, opt = {}) - @@parser_factory.new(host, opt) - end - - def self.add_factory(factory) - if $DEBUG - puts "Set #{ factory } as XML processor." - end - @@parser_factory = factory - end - -public - - attr_accessor :charset - - def initialize(host, opt = {}) - @host = host - @charset = opt[:charset] || nil - end - - def parse(string_or_readable) - @textbuf = '' - prologue - do_parse(string_or_readable) - epilogue - end - -private - - def do_parse(string_or_readable) - raise NotImplementError.new( - 'Method do_parse must be defined in derived class.') - end - - def start_element(name, attrs) - @host.start_element(name, attrs) - end - - def characters(text) - @host.characters(text) - end - - def end_element(name) - @host.end_element(name) - end - - def prologue - end - - def epilogue - end - - def xmldecl_encoding=(charset) - if @charset.nil? - @charset = charset - else - # Definition in a stream (like HTTP) has a priority. - p "encoding definition: #{ charset } is ignored." if $DEBUG - end - end -end - - -end -end |