### Home Classes Methods

### In Files

- lib/xsd/xmlparser/nokogiri.rb

### Parent

XSD::XMLParser::Parser

### Methods

- ::new
- #cdata_block
- #do_parse
- #end_element
- #end_element_namespace
- #error
- #start_element
- #start_element_namespace
- #warning

### Files

- CHANGELOG.ja.rdoc
- CHANGELOG.rdoc
- C_CODING_STYLE.rdoc
- Manifest.txt
- README.ja.rdoc
- README.rdoc

### Class/Module Index

Quicksearch

- Nokogiri
- Nokogiri::CSS
- Nokogiri::CSS::Node
- Nokogiri::CSS::Parser
- Nokogiri::CSS::SyntaxError
- Nokogiri::CSS::Tokenizer
- Nokogiri::CSS::Tokenizer::ScanError
- Nokogiri::Decorators
- Nokogiri::Decorators::Slop
- Nokogiri::EncodingHandler
- Nokogiri::HTML
- Nokogiri::HTML::Builder
- Nokogiri::HTML::Document
- Nokogiri::HTML::Document::EncodingReader
- Nokogiri::HTML::Document::EncodingReader::JumpSAXHandler
- Nokogiri::HTML::DocumentFragment
- Nokogiri::HTML::ElementDescription
- Nokogiri::HTML::EntityDescription
- Nokogiri::HTML::EntityLookup
- Nokogiri::HTML::SAX
- Nokogiri::HTML::SAX::Parser
- Nokogiri::HTML::SAX::ParserContext
- Nokogiri::HTML::SAX::PushParser
- Nokogiri::SyntaxError
- Nokogiri::XML
- Nokogiri::XML::Attr
- Nokogiri::XML::AttributeDecl
- Nokogiri::XML::Builder
- Nokogiri::XML::CDATA
- Nokogiri::XML::CharacterData
- Nokogiri::XML::Comment
- Nokogiri::XML::DTD
- Nokogiri::XML::Document
- Nokogiri::XML::DocumentFragment
- Nokogiri::XML::Element
- Nokogiri::XML::ElementContent
- Nokogiri::XML::ElementDecl
- Nokogiri::XML::EntityDecl
- Nokogiri::XML::EntityReference
- Nokogiri::XML::Namespace
- Nokogiri::XML::Node
- Nokogiri::XML::Node::SaveOptions
- Nokogiri::XML::NodeSet
- Nokogiri::XML::Notation
- Nokogiri::XML::PP
- Nokogiri::XML::PP::CharacterData
- Nokogiri::XML::PP::Node
- Nokogiri::XML::ParseOptions
- Nokogiri::XML::ProcessingInstruction
- Nokogiri::XML::Reader
- Nokogiri::XML::RelaxNG
- Nokogiri::XML::SAX
- Nokogiri::XML::SAX::Document
- Nokogiri::XML::SAX::Parser
- Nokogiri::XML::SAX::Parser::Attribute
- Nokogiri::XML::SAX::ParserContext
- Nokogiri::XML::SAX::PushParser
- Nokogiri::XML::Schema
- Nokogiri::XML::SyntaxError
- Nokogiri::XML::Text
- Nokogiri::XML::XPath
- Nokogiri::XML::XPath::SyntaxError
- Nokogiri::XML::XPathContext
- Nokogiri::XSLT
- Nokogiri::XSLT::Stylesheet
- XSD
- XSD::XMLParser
- XSD::XMLParser::Nokogiri
- Object

No matching classes.

# XSD::XMLParser::Nokogiri

Nokogiri XML parser for soap4r.

Nokogiri may be used as the XML parser in soap4r. Simply require 'xsd/xmlparser/nokogiri' in your soap4r applications, and soap4r will use Nokogiri as it's XML parser. No other changes should be required to use Nokogiri as the XML parser.

Example (using UW ITS Web Services):

    require 'rubygems'
    require 'nokogiri'
    gem 'soap4r'
    require 'defaultDriver'
    require 'xsd/xmlparser/nokogiri'

    obj = AvlPortType.new
    obj.getLatestByRoute(obj.getAgencies.first, 8).each do |bus|
      p "#{bus.routeID}, #{bus.longitude}, #{bus.latitude}"
    end

### Public Class Methods

new(host, opt = {}) click to toggle source

Create a new XSD parser with `host` and `opt`

    # File lib/xsd/xmlparser/nokogiri.rb, line 29
    def initialize host, opt = {}
      super
      @parser = ::Nokogiri::XML::SAX::Parser.new(self, @charset || 'UTF-8')
    end

### Public Instance Methods

cdata_block(string) click to toggle source

Handle cdata_blocks containing `string`

    # File lib/xsd/xmlparser/nokogiri.rb, line 61
    def cdata_block string
      characters string
    end

do_parse(string_or_readable) click to toggle source

Start parsing `string_or_readable`

    # File lib/xsd/xmlparser/nokogiri.rb, line 36
    def do_parse string_or_readable
      @parser.parse(string_or_readable)
    end

end_element(name) click to toggle source

Handle the end_element event with `name`

    # File lib/xsd/xmlparser/nokogiri.rb, line 48
    def end_element name
      super
    end

end_element_namespace(name, prefix = nil, uri = nil) click to toggle source

Called at the end of an element `name` is the element's name `prefix` is the namespace prefix associated with the element `uri` is the associated namespace URI

    # File lib/xsd/xmlparser/nokogiri.rb, line 89
    def end_element_namespace name, prefix = nil, uri = nil
      ###
      # Deal with SAX v1 interface
      end_element [prefix, name].compact.join(':')
    end

error(msg) click to toggle source

Handle errors with message `msg`

    # File lib/xsd/xmlparser/nokogiri.rb, line 54
    def error msg
      raise ParseError.new(msg)
    end

Also aliased as: warning
start_element(name, attrs = []) click to toggle source

Handle the start_element event with `name` and `attrs`

    # File lib/xsd/xmlparser/nokogiri.rb, line 42
    def start_element name, attrs = []
      super(name, Hash[*attrs.flatten])
    end

start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) click to toggle source

Called at the beginning of an element `name` is the element name `attrs` is a list of attributes `prefix` is the namespace prefix for the element `uri` is the associated namespace URI `ns` is a hash of namespace prefix:urls associated with the element

    # File lib/xsd/xmlparser/nokogiri.rb, line 72
    def start_element_namespace name, attrs = [], prefix = nil, uri = nil, ns = []
      ###
      # Deal with SAX v1 interface
      name = [prefix, name].compact.join(':')
      attributes = ns.map { |ns_prefix,ns_uri|
        [['xmlns', ns_prefix].compact.join(':'), ns_uri]
      } + attrs.map { |attr|
        [[attr.prefix, attr.localname].compact.join(':'), attr.value]
      }.flatten
      start_element name, attributes
    end

warning(msg) click to toggle source
Alias for: error

[Validate]

Generated with the Darkfish Rdoc Generator 2.