- def to_xml
- doc = OSM::API.new.get_xml_doc
- doc.root << to_xml_node()
- return doc
- end
-
- def to_xml_node
- el1 = XML::Node.new 'relation'
- el1['id'] = self.id.to_s
- el1['visible'] = self.visible.to_s
- el1['timestamp'] = self.timestamp.xmlschema
- if self.changeset.user.data_public?
- el1['user'] = self.changeset.user.display_name
- el1['uid'] = self.changeset.user.id.to_s
- end
- el1['version'] = self.version.to_s
- el1['changeset'] = self.changeset_id.to_s
-
- self.old_members.each do |member|
- e = XML::Node.new 'member'
- e['type'] = member.member_type.to_s.downcase
- e['ref'] = member.member_id.to_s # "id" is considered uncool here as it should be unique in XML
- e['role'] = member.member_role.to_s
- el1 << e
- end
-
- self.old_tags.each do |tag|
- e = XML::Node.new 'tag'
- e['k'] = tag.k
- e['v'] = tag.v
- el1 << e
- end
- return el1
- end
-
- # Temporary method to match interface to nodes
- def tags_as_hash
- return self.tags
- end