Module: Metacrunch::Marcxml

Defined in:
lib/metacrunch/marcxml.rb,
lib/metacrunch/marcxml/parser.rb,
lib/metacrunch/marcxml/version.rb,
lib/metacrunch/marcxml/document.rb,
lib/metacrunch/marcxml/document/subfield.rb,
lib/metacrunch/marcxml/document/datafield.rb,
lib/metacrunch/marcxml/document/controlfield.rb,
lib/metacrunch/marcxml/document/subfield_set.rb,
lib/metacrunch/marcxml/document/datafield_set.rb

Defined Under Namespace

Classes: Document, Parser

Constant Summary collapse

VERSION =
"3.1.0"

Class Method Summary collapse

Class Method Details

.[](xml) ⇒ Object

Convenience method for Metacrunch::Marcxml.parse(xml, collection_mode: false)

See Also:

  • #parse


43
44
45
# File 'lib/metacrunch/marcxml.rb', line 43

def [](xml)
  self.parse(xml, collection_mode: false)
end

.parse(xml, collection_mode: false) ⇒ Metacrunch::Marcxml::Document, ...

Parses a MARCXML string into a Document.

Parameters:

  • xml (String)

    the MARCXML document as a string

  • collection_mode (true, false) (defaults to: false)

    set to true if the MARCXML contains more than one record. Default is false.

Returns:



34
35
36
# File 'lib/metacrunch/marcxml.rb', line 34

def parse(xml, collection_mode: false)
  Parser.new.parse(xml, collection_mode: collection_mode)
end