module EPUB::Parser::XMLDocument::Refinements::REXML

Public Instance Methods

attribute_with_prefix(name, prefix = nil) click to toggle source
# File lib/epub/parser/xml_document/refinements/rexml.rb, line 23
def attribute_with_prefix(name, prefix = nil)
  attribute(name, EPUB::NAMESPACES[prefix])&.value
end
content() click to toggle source
# File lib/epub/parser/xml_document/refinements/rexml.rb, line 29
def content
  each_child.inject("") {|text, node|
    case node.node_type
    when :document, :element
      text << node.content
    when :text
      text << node.value
    end
  }
end
each_element_by_xpath(xpath, namespaces = nil, &block) click to toggle source
# File lib/epub/parser/xml_document/refinements/rexml.rb, line 19
def each_element_by_xpath(xpath, namespaces = nil, &block)
  ::REXML::XPath.each self, xpath, namespaces, &block
end