Module: RTM::IO::TOXTM1::Occurrence

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

Instance Method Summary

Instance Method Details

- (Object) to_xtm1



119
120
121
122
123
124
125
126
127
128
129
130
# File 'rtm/lib/rtm/io/to_xtm1.rb', line 119

def to_xtm1
  warn("TOXTM1: 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.xtm1_id) if reifier
  item_identifiers.each { |ii| x << TOXTM1.ii(ii) } # itemIdentity
  x << TOXTM1.type(type) if type
  x << TOXTM1.scope(scope) unless scope.empty?
  x << TOXTM1.value(datatype, value)
  x
end