Class: MD_CharacterSetCode
- Inherits:
-
Object
- Object
- MD_CharacterSetCode
- Defined in:
- lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_characterSet.rb
Overview
from www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml History: Stan Smith 2013-08-09 original script
Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
Instance Method Summary collapse
-
#initialize(xml) ⇒ MD_CharacterSetCode
constructor
A new instance of MD_CharacterSetCode.
- #writeXML(codeName) ⇒ Object
Constructor Details
#initialize(xml) ⇒ MD_CharacterSetCode
Returns a new instance of MD_CharacterSetCode.
9 10 11 |
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_characterSet.rb', line 9 def initialize(xml) @xml = xml end |
Instance Method Details
#writeXML(codeName) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 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 |
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_characterSet.rb', line 13 def writeXML(codeName) case(codeName) when 'ucs2' then codeID = '001' when 'ucs4' then codeID = '002' when 'utf7' then codeID = '003' when 'utf8' then codeID = '004' when 'utf16' then codeID = '005' when '8859part1' then codeID = '006' when '8859part2' then codeID = '007' when '8859part3' then codeID = '008' when '8895part4' then codeID = '009' when '8859part5' then codeID = '010' when '8859part6' then codeID = '011' when '8859part7' then codeID = '012' when '8859part8' then codeID = '013' when '8859part9' then codeID = '014' when '8859part10' then codeID = '015' when '8859part11' then codeID = '016' when '8859part13' then codeID = '018' when '8859part14' then codeID = '019' when '8859part15' then codeID = '020' when '8859part16' then codeID = '021' when 'jis' then codeID = '022' when 'shiftJIS' then codeID = '023' when 'eusJP' then codeID = '024' when 'usAscii' then codeID = '025' when 'ebcdic' then codeID = '026' when 'ecuKR' then codeID = '027' when 'big5' then codeID = '028' when 'GB2312' then codeID = '029' else codeID = 'non-ISO codeName' end # write xml @xml.tag!('gmd:MD_CharacterSetCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode', :codeListValue=>"#{codeName}", :codeSpace=>"#{codeID}"}) end |