Sha256: 526379dde56dd89fed7b5dfaba1499dd68e31c0edc0bc4783f54424dd7e42097

Contents?: true

Size: 1.2 KB

Versions: 30

Compression:

Stored size: 1.2 KB

Contents

# encoding: UTF-8

module LibXML
  module XML
    class SaxParser
      # call-seq:
      #    XML::SaxParser.file(path) -> XML::SaxParser
      #
      # Creates a new parser by parsing the specified file or uri.
      def self.file(path)
        context = XML::Parser::Context.file(path)
        self.new(context)
      end

      # call-seq:
      #    XML::SaxParser.io(io) -> XML::SaxParser
      #    XML::SaxParser.io(io, :encoding => XML::Encoding::UTF_8) -> XML::SaxParser
      #
      # Creates a new reader by parsing the specified io object.
      #
      # Parameters:
      #
      #  encoding - The document encoding, defaults to nil. Valid values
      #             are the encoding constants defined on XML::Encoding.
      def self.io(io, options = {})
        context = XML::Parser::Context.io(io)
        context.encoding = options[:encoding] if options[:encoding]
        self.new(context)
      end

      # call-seq:
      #    XML::SaxParser.string(string)
      #
      # Creates a new parser by parsing the specified string.
      def self.string(string)
        context = XML::Parser::Context.string(string)
        self.new(context)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
libxml-ruby-5.0.3-x64-mingw-ucrt lib/libxml/sax_parser.rb
libxml-ruby-5.0.3 lib/libxml/sax_parser.rb
libxml-ruby-5.0.2-x64-mingw-ucrt lib/libxml/sax_parser.rb
libxml-ruby-5.0.2 lib/libxml/sax_parser.rb
libxml-ruby-5.0.1-x64-mingw-ucrt lib/libxml/sax_parser.rb
libxml-ruby-5.0.1 lib/libxml/sax_parser.rb
libxml-ruby-5.0.0-x64-mingw-ucrt lib/libxml/sax_parser.rb
libxml-ruby-5.0.0 lib/libxml/sax_parser.rb
libxml-ruby-4.1.2-x64-mingw-ucrt lib/libxml/sax_parser.rb
libxml-ruby-4.1.2 lib/libxml/sax_parser.rb
libxml-ruby-4.1.1-x64-mingw-ucrt lib/libxml/sax_parser.rb
libxml-ruby-4.1.1 lib/libxml/sax_parser.rb
libxml-ruby-4.1.0 lib/libxml/sax_parser.rb
libxml-ruby-4.0.0-x64-mingw-ucrt lib/libxml/sax_parser.rb
libxml-ruby-4.0.0 lib/libxml/sax_parser.rb
libxml-ruby-3.2.4-x64-mingw-ucrt lib/libxml/sax_parser.rb
libxml-ruby-3.2.4 lib/libxml/sax_parser.rb
libxml-ruby-3.2.3-x64-mingw-ucrt lib/libxml/sax_parser.rb
libxml-ruby-3.2.3 lib/libxml/sax_parser.rb
libxml-ruby-3.2.2-x64-mingw32 lib/libxml/sax_parser.rb