54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
# File 'lib/slaw/grammars/schedules_nodes.rb', line 54
def to_xml(b, idprefix=nil, i=1)
if num
n = num
component = "schedule#{n}"
else
n = i
component = self.alias.downcase().strip().gsub(/[^a-z0-9]/i, '').gsub(/ +/, '')
end
id = "#{idprefix}#{component}"
b.component(id: "component-#{id}") { |b|
b.doc_(name: component) { |b|
b.meta { |b|
b.identification(source: "#slaw") { |b|
b.FRBRWork { |b|
b.FRBRthis(value: "#{WORK_URI}/#{component}")
b.FRBRuri(value: WORK_URI)
b.FRBRalias(value: self.alias)
b.FRBRdate(date: '1980-01-01', name: 'Generation')
b.FRBRauthor(href: '#council')
b.FRBRcountry(value: 'za')
}
b.FRBRExpression { |b|
b.FRBRthis(value: "#{EXPRESSION_URI}/#{component}")
b.FRBRuri(value: EXPRESSION_URI)
b.FRBRdate(date: '1980-01-01', name: 'Generation')
b.FRBRauthor(href: '#council')
b.FRBRlanguage(language: 'eng')
}
b.FRBRManifestation { |b|
b.FRBRthis(value: "#{MANIFESTATION_URI}/#{component}")
b.FRBRuri(value: MANIFESTATION_URI)
b.FRBRdate(date: Time.now.strftime('%Y-%m-%d'), name: 'Generation')
b.FRBRauthor(href: '#slaw')
}
}
}
b.mainBody { |b|
idprefix = "#{id}."
b.hcontainer(id: id, name: "schedule") { |b|
if title and title.elements
b.heading { |b| title.to_xml(b, idprefix) }
else
b.heading(self.alias)
end
b.subheading { |b| subheading.to_xml(b, idprefix) } if subheading
body.children.elements.each_with_index { |e| e.to_xml(b, idprefix, i) } if body.is_a? Body
}
}
}
}
end
|