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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_codeSet.rb', line 18
def self.unpack(axDomains, code, hResponseObj)
intMetadataClass = InternalMetadata.new
aDomains = []
axCodeSets = axDomains.xpath('./codesetd')
unless axCodeSets.empty?
axCodeSets.each do |xCodeSet|
hDomain = intMetadataClass.newDictionaryDomain
hDomain[:domainId] = UUIDTools::UUID.random_create.to_s
hDomain[:domainCode] = code
hDomain[:domainDescription] = 'FGDC codeSet domain'
name = xCodeSet.xpath('./codesetn').text
unless name.empty?
hDomain[:domainName] = name
end
if name.empty?
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: codeset domain name is missing'
end
hCitation = intMetadataClass.newCitation
title = xCodeSet.xpath('./codesets').text
unless title.empty?
hCitation[:title] = title
hDomain[:domainReference] = hCitation
end
if title.empty?
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: codeset domain source is missing'
end
aDomains << hDomain
end
end
return aDomains
end
|