Sha256: e2f37a42e410882323f9b2da20ee43705e6baeb158425dcd3cafdfa611eafd2e

Contents?: true

Size: 1.89 KB

Versions: 2

Compression:

Stored size: 1.89 KB

Contents

# ISO <<Class>> MD_Identifier
# writer
# output for ISO 19115-2 XML

# History:
# 	Stan Smith 2014-05-16 original script
#   Stan Smith 2014-05-28 revised for json schema 0.5.0
#   Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
#   Stan Smith 2014-12-12 refactored to handle namespacing readers and writers

require 'class_citation'

module ADIWG
    module Mdtranslator
        module Writers
            module Iso

                class MD_Identifier

                    def initialize(xml)
                        @xml = xml
                    end

                    def writeXML(hResID)

                        # the authority for the identifier is a citation block

                        # classes used in MD_Metadata
                        citationClass = $WriterNS::CI_Citation.new(@xml)

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

                            # identifier - authority
                            hCitation = hResID[:identifierCitation]
                            if !hCitation.empty?
                                @xml.tag!('gmd:authority') do
                                    citationClass.writeXML(hCitation)
                                end
                            elsif $showAllTags
                                @xml.tag!('gmd:authority')
                            end

                            # identity - code - required
                            s = hResID[:identifier]
                            if !s.nil?
                                @xml.tag!('gmd:code') do
                                    @xml.tag!('gco:CharacterString', s)
                                end
                            elsif $showAllTags
                                @xml.tag!('gmd:code')
                            end

                        end

                    end

                end

            end
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.12.1 lib/adiwg/mdtranslator/writers/iso/classes/class_identifier.rb
adiwg-mdtranslator-0.12.0 lib/adiwg/mdtranslator/writers/iso/classes/class_identifier.rb