class TopPred::Parser_XML::LibXML

Public Instance Methods

get_root_node_from_io(io, &block) click to toggle source
# File lib/transmembrane/toppred.rb, line 348
def get_root_node_from_io(io, &block)
  # turn off warnings because this doesn't seem to work:
  # XML::Parser.default_load_external_dtd = false
  # (There is a warning about not finding DTD)
  xml_parser_warnings = XML::Parser.default_warnings
  XML::Parser.default_warnings = false
  doc = XML::Parser.io(io).parse
  root = doc.root
  block.call(root)
  # reset the warning level of XML::Parser:
  XML::Parser.default_warnings = xml_parser_warnings
end