Class: DS::Source::TeiXML
- Inherits:
-
BaseSource
- Object
- BaseSource
- DS::Source::TeiXML
- Defined in:
- lib/ds/source/tei_xml.rb
Constant Summary collapse
Instance Method Summary collapse
-
#open_source(source_file_path) ⇒ Nokogiri::XML::Document
Opens a TEI XML file at the given path and returns it as a Nokogiri::XML object.
Methods inherited from BaseSource
#load_source, #source_type, #to_s
Methods included from SourceCache
#cache, #find_or_open_source, #max_cache_size, #max_cache_size=
Instance Method Details
#open_source(source_file_path) ⇒ Nokogiri::XML::Document
Opens a TEI XML file at the given path and returns it as a Nokogiri::XML object.
NB: Namespaces are stripped from the document.
15 16 17 18 19 |
# File 'lib/ds/source/tei_xml.rb', line 15 def open_source source_file_path xml = File.open(source_file_path) { |f| Nokogiri::XML f } xml.remove_namespaces! xml end |