dm-serializer/lib/dm-serializer.rb
def to_xml_document(opts={}) 
      doc = REXML::Document.new
      root = doc.add_element(xml_element_name)
      keys = self.class.key(self.repository.name)
      keys.each do |key|
        value = self.send(key.name)
        root.attributes[key.name.to_s] = value
      end
      
      #TODO old code base was converting single quote to double quote on attribs
    
      self.class.properties(self.repository.name).each do |property|
        if !keys.include?(property)
          value = self.send(property.name)
          node = root.add_element(property.name.to_s)
          node << REXML::Text.new(value.to_s) unless value.nil?
        end          
      end
      doc
    end
# Return a REXML::Document representing this resource
#
Return a REXML::Document representing this resource
Return a REXML :: Document representing this resource
def to_xml_document(opts={}) 
      doc = REXML::Document.new
      root = doc.add_element(xml_element_name)
      keys = self.class.key(self.repository.name)
      keys.each do |key|
        value = self.send(key.name)
        root.attributes[key.name.to_s] = value
      end
      self.class.properties(self.repository.name).each do |property|
        if !keys.include?(property)
          value = self.send(property.name)
          node = root.add_element(property.name.to_s)
          node << REXML::Text.new(value.to_s) unless value.nil?
        end          
      end
      doc
    end
def to_xml_document ( opts = { } ) doc = REXML :: Document . new root = doc . add_element ( xml_element_name ) keys = self . class . key ( self . repository . name ) keys . each do | key | value = self . send ( key . name ) root . attributes [ key . name . to_s ] = value end self . class . properties ( self . repository . name ) . each do | property | if ! keys . include? ( property ) value = self . send ( property . name ) node = root . add_element ( property . name . to_s ) node << REXML :: Text . new ( value . to_s ) unless value . nil? end end doc end
Return a REXML::Document representing this resource
Return a REXML :: Document representing this resource
#TODO old code base was converting single quote to double quote on attribs
opts