Class: Meteor::Ml::Xml::ParserImpl

Inherits:
Core::Kernel show all
Defined in:
lib/meteor.rb

Overview

XML parser (XMLパーサ)

Constant Summary collapse

PATTERN_UNESCAPE =
'&(amp|quot|apos|gt|lt);'.freeze
TABLE_FOR_ESCAPE_ =
{
    '&' => '&'.freeze,
    '"' => '"'.freeze,
    '\'' => '''.freeze,
    '<' => '&lt;'.freeze,
    '>' => '&gt;'.freeze,
}
PATTERN_ESCAPE =
'[&\"\'<>]'.freeze
@@pattern_unescape =
Regexp.new(PATTERN_UNESCAPE)
@@pattern_escape =
Regexp.new(PATTERN_ESCAPE)

Constants inherited from Core::Kernel

Core::Kernel::AND_1, Core::Kernel::AND_2, Core::Kernel::AND_3, Core::Kernel::AP_1, Core::Kernel::AP_2, Core::Kernel::AP_3, Core::Kernel::ATTR_EQ, Core::Kernel::CLEAN_1, Core::Kernel::CLEAN_2, Core::Kernel::CSS_CLASS, Core::Kernel::CSS_ID, Core::Kernel::DOUBLE_QUATATION, Core::Kernel::EMPTY, Core::Kernel::EN_1, Core::Kernel::ERASE_ATTR_1, Core::Kernel::ESCAPE_ENTITY_REF, Core::Kernel::GET_ATTRS_MAP, Core::Kernel::GET_ATTR_1, Core::Kernel::GT_1, Core::Kernel::GT_2, Core::Kernel::GT_3, Core::Kernel::LT_1, Core::Kernel::LT_2, Core::Kernel::LT_3, Core::Kernel::MODE_AF, Core::Kernel::MODE_BF, Core::Kernel::MODE_UTF8, Core::Kernel::PATTERN_FIND_1, Core::Kernel::PATTERN_FIND_2_1, Core::Kernel::PATTERN_FIND_2_2, Core::Kernel::PATTERN_FIND_2_3, Core::Kernel::PATTERN_FIND_3_1, Core::Kernel::PATTERN_FIND_3_2, Core::Kernel::PATTERN_FIND_3_3, Core::Kernel::PATTERN_FIND_4, Core::Kernel::PATTERN_FIND_5, Core::Kernel::QO_2, Core::Kernel::QO_3, Core::Kernel::SEARCH_CX_1, Core::Kernel::SEARCH_CX_2, Core::Kernel::SEARCH_CX_3, Core::Kernel::SEARCH_CX_4, Core::Kernel::SEARCH_CX_5, Core::Kernel::SEARCH_CX_6, Core::Kernel::SET_ATTR_1, Core::Kernel::SET_CX_1, Core::Kernel::SET_CX_2, Core::Kernel::SET_CX_3, Core::Kernel::SET_CX_4, Core::Kernel::SET_MONO_1, Core::Kernel::SPACE, Core::Kernel::TAG_CLOSE, Core::Kernel::TAG_CLOSE3, Core::Kernel::TAG_OPEN, Core::Kernel::TAG_OPEN3, Core::Kernel::TAG_SEARCH_1_1, Core::Kernel::TAG_SEARCH_1_2, Core::Kernel::TAG_SEARCH_1_3, Core::Kernel::TAG_SEARCH_1_4, Core::Kernel::TAG_SEARCH_1_4_2, Core::Kernel::TAG_SEARCH_2_1, Core::Kernel::TAG_SEARCH_2_1_2, Core::Kernel::TAG_SEARCH_2_2, Core::Kernel::TAG_SEARCH_2_2_2, Core::Kernel::TAG_SEARCH_2_3, Core::Kernel::TAG_SEARCH_2_3_2, Core::Kernel::TAG_SEARCH_2_3_2_2, Core::Kernel::TAG_SEARCH_2_4, Core::Kernel::TAG_SEARCH_2_4_2, Core::Kernel::TAG_SEARCH_2_4_2_2, Core::Kernel::TAG_SEARCH_2_4_2_3, Core::Kernel::TAG_SEARCH_2_4_3, Core::Kernel::TAG_SEARCH_2_4_3_2, Core::Kernel::TAG_SEARCH_2_4_4, Core::Kernel::TAG_SEARCH_2_6, Core::Kernel::TAG_SEARCH_2_7, Core::Kernel::TAG_SEARCH_3_1, Core::Kernel::TAG_SEARCH_3_1_2, Core::Kernel::TAG_SEARCH_3_1_2_2, Core::Kernel::TAG_SEARCH_3_2, Core::Kernel::TAG_SEARCH_3_2_2, Core::Kernel::TAG_SEARCH_3_2_2_2, Core::Kernel::TAG_SEARCH_4_1, Core::Kernel::TAG_SEARCH_4_2, Core::Kernel::TAG_SEARCH_4_3, Core::Kernel::TAG_SEARCH_4_4, Core::Kernel::TAG_SEARCH_4_5, Core::Kernel::TAG_SEARCH_4_6, Core::Kernel::TAG_SEARCH_4_7, Core::Kernel::TAG_SEARCH_4_7_2, Core::Kernel::TAG_SEARCH_NC_1_1, Core::Kernel::TAG_SEARCH_NC_1_2, Core::Kernel::TAG_SEARCH_NC_1_3, Core::Kernel::TAG_SEARCH_NC_1_4, Core::Kernel::TAG_SEARCH_NC_1_4_2, Core::Kernel::TAG_SEARCH_NC_2_1, Core::Kernel::TAG_SEARCH_NC_2_1_2, Core::Kernel::TAG_SEARCH_NC_2_2, Core::Kernel::TAG_SEARCH_NC_2_2_2, Core::Kernel::TAG_SEARCH_NC_2_3, Core::Kernel::TAG_SEARCH_NC_2_3_2, Core::Kernel::TAG_SEARCH_NC_2_3_2_2, Core::Kernel::TAG_SEARCH_NC_2_4, Core::Kernel::TAG_SEARCH_NC_2_4_2, Core::Kernel::TAG_SEARCH_NC_2_4_2_2, Core::Kernel::TAG_SEARCH_NC_2_4_2_3, Core::Kernel::TAG_SEARCH_NC_2_4_3, Core::Kernel::TAG_SEARCH_NC_2_4_3_2, Core::Kernel::TAG_SEARCH_NC_2_4_4, Core::Kernel::TAG_SEARCH_NC_2_6, Core::Kernel::TAG_SEARCH_NC_2_7, Core::Kernel::TAG_SEARCH_NC_3_1, Core::Kernel::TAG_SEARCH_NC_3_1_2, Core::Kernel::TAG_SEARCH_NC_3_1_2_2, Core::Kernel::TAG_SEARCH_NC_3_2, Core::Kernel::TAG_SEARCH_NC_3_2_2, Core::Kernel::TAG_SEARCH_NC_3_2_2_2

Constants inherited from Parser

Parser::HTML, Parser::HTML5, Parser::XHTML, Parser::XHTML5, Parser::XML

Instance Attribute Summary

Attributes inherited from Core::Kernel

#doc_type, #document_hook, #element_cache, #element_hook

Instance Method Summary collapse

Methods inherited from Core::Kernel

#attr, #attr_map, #attrs, #character_encoding, #character_encoding=, #content, #cxtag, #document, #document=, #element, #elements, #elements_, #find, #flush, #parse, #read, #remove_element, #root_element, #shadow

Constructor Details

#initializeParserImpl #initialize(ps) ⇒ ParserImpl

initializer (イニシャライザ)

Overloads:


5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
# File 'lib/meteor.rb', line 5396

def initialize(*args)
  super()
  @doc_type = Parser::XML
  case args.length
    when ZERO
      #initialize_0
    when ONE
      initialize_1(args[0])
    else
      raise ArgumentError
  end
end

Instance Method Details

#content_typeStreing

get content type (コンテントタイプを取得する)

Returns:

  • (Streing)

    content type (コンテントタイプ)


5433
5434
5435
# File 'lib/meteor.rb', line 5433

def content_type
  @root.content_type
end