lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb in adiwg-mdtranslator-1.1.1 vs lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb in adiwg-mdtranslator-1.2.0
- old
+ new
@@ -4,12 +4,13 @@
# History:
# Stan Smith 2013-09-18 original script
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
# Stan Smith 2014-08-21 removed keyword thesaurus link; use citation onlineResource
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
+# Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method
-require 'code_keywordType'
+require 'class_codelist'
require 'class_citation'
module ADIWG
module Mdtranslator
module Writers
@@ -22,12 +23,12 @@
end
def writeXML(hDKeyword)
# classes used
+ codelistClass = $IsoNS::MD_Codelist.new(@xml)
citationClass = $IsoNS::CI_Citation.new(@xml)
- keywordCode = $IsoNS::MD_KeywordTypeCode.new(@xml)
@xml.tag!('gmd:MD_Keywords') do
# keywords - keyword - required
aKeywords = hDKeyword[:keyword]
@@ -43,10 +44,10 @@
# keywords - type - MD_KeywordTypeCode
s = hDKeyword[:keywordType]
if !s.nil?
@xml.tag!('gmd:type') do
- keywordCode.writeXML(s)
+ codelistClass.writeXML('iso_keywordType',s)
end
elsif $showAllTags
@xml.tag!('gmd:type')
end