Module: RDF::TriX::Reader::LibXML

Defined in:
vendor/bundler/ruby/2.4.0/bundler/gems/rdf-trix-7d61d2cef93b/lib/rdf/trix/reader/libxml.rb

Overview

LibXML-Ruby implementation of the TriX reader.

Constant Summary

OPTIONS =
{'trix' => Format::XMLNS}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.librarySymbol

Returns the name of the underlying XML library.

Returns:



14
15
16
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-trix-7d61d2cef93b/lib/rdf/trix/reader/libxml.rb', line 14

def self.library
  :libxml
end

Instance Method Details

#initialize_xml(options = {})

This method returns an undefined value.

Initializes the underlying XML library.

Parameters:



23
24
25
26
27
28
29
30
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-trix-7d61d2cef93b/lib/rdf/trix/reader/libxml.rb', line 23

def initialize_xml(options = {})
  require 'libxml' unless defined?(::LibXML)
  @xml = case @input
    when File         then ::LibXML::XML::Document.file(@input.path)
    when IO, StringIO then ::LibXML::XML::Document.io(@input)
    else ::LibXML::XML::Document.string(@input.to_s)
  end
end