Module: RTM::IO::TOXTM2::Occurrence

Defined in:
rtm/lib/rtm/io/to_xtm2.rb

Instance Method Summary

Instance Method Details

- (Object) to_xtm2



121
122
123
124
125
126
127
128
129
130
131
132
# File 'rtm/lib/rtm/io/to_xtm2.rb', line 121

def to_xtm2
  warn("TOXTM2: Warning: outputting invalid Occurrence #{self}") unless valid?
  # occurrence = element occurrence { reifiable,
  #   type, scope?, ( resourceRef | resourceData ) }
  x = REXML::Element.new 'occurrence'
  x.add_attribute('reifier', reifier.xtm2_id) if reifier
  item_identifiers.each { |ii| x << TOXTM2.locator(ii) } # itemIdentity
  x << TOXTM2.type(type) if type
  x << TOXTM2.scope(scope) unless scope.empty?
  x << TOXTM2.value(datatype, value)
  x
end