Class: ADIWG::Mdtranslator::Writers::Iso19110::MD_Identifier

Inherits:
Object
  • Object
show all
Defined in:
lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml, hResponseObj) ⇒ MD_Identifier

Returns a new instance of MD_Identifier.



18
19
20
21
22
# File 'lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb', line 18

def initialize(xml, hResponseObj)
   @xml = xml
   @hResponseObj = hResponseObj
   @NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
end

Instance Method Details

#writeXML(hIdentifier) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb', line 24

def writeXML(hIdentifier)

   # classes used in MD_Metadata
   citationClass = CI_Citation.new(@xml, @hResponseObj)

   @xml.tag!('gmd:MD_Identifier') do

      # identifier - authority
      hCitation = hIdentifier[:citation]
      unless hCitation.empty?
         @xml.tag!('gmd:authority') do
            citationClass.writeXML(hCitation)
         end
      end
      if hCitation.empty? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:authority')
      end

      # identifier - code (required)
      s = hIdentifier[:identifier]
      if s.nil?
         @NameSpace.issueWarning(90, 'gmd:code')
      else
         @xml.tag!('gmd:code') do
            @xml.tag!('gco:CharacterString', s)
         end
      end

   end # MD_Identifier tag
end