<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -146,7 +146,7 @@ module AMEE
       rescue
         raise AMEE::BadData.new(&quot;Couldn't load ProfileCategory from V2 JSON data. Check that your URL is correct.&quot;)
       end
-
+            
       def self.parse_xml_profile_item(item)
         item_data = {}
         item_data[:values] = {}
@@ -175,6 +175,22 @@ module AMEE
         return item_data
       end
 
+      def self.from_v2_batch_json(json)
+        # Parse JSON
+        doc = JSON.parse(json)
+        data = {}
+        data[:profileItems] = []
+        doc['profileItems'].each do |child|
+          profile_item = {}
+          profile_item[:uri] = child['uri'].to_s
+          profile_item[:uid] = child['uid'].to_s
+          data[:profileItems] &lt;&lt; profile_item
+        end
+        return data
+      rescue
+        raise AMEE::BadData.new(&quot;Couldn't load ProfileCategory batch response from V2 JSON data. Check that your URL is correct.&quot;)
+      end
+      
       def self.parse_xml_profile_category(category)
         category_data = {}
         category_data[:name] = category.elements['DataCategory'].elements['Name'].text
@@ -314,6 +330,22 @@ module AMEE
         raise AMEE::BadData.new(&quot;Couldn't load ProfileCategory from V2 XML data. Check that your URL is correct.&quot;)
       end
 
+      def self.from_v2_batch_xml(xml)
+        # Parse XML
+        doc = REXML::Document.new(xml)
+        data = {}
+        data[:profileItems] = []
+        REXML::XPath.each(doc, '/Resources/ProfileItems/ProfileItem') do |child|
+          profile_item = {}
+          profile_item[:uri] = child.attributes['uri'].to_s
+          profile_item[:uid] = child.attributes['uid'].to_s
+          data[:profileItems] &lt;&lt; profile_item
+        end
+        return data
+      rescue
+        raise AMEE::BadData.new(&quot;Couldn't load ProfileCategory batch response from V2 XML data. Check that your URL is correct.&quot;)
+      end
+      
       def self.from_v2_atom(response)
         # Parse XML
         doc = REXML::Document.new(response)
@@ -413,7 +445,16 @@ module AMEE
         return cat
       end
 
-
+      def self.parse_batch(connection, response)
+        if response.is_v2_json?
+          return Category.from_v2_batch_json(response)
+        elsif response.is_v2_xml?
+          return Category.from_v2_batch_xml(response)
+        else
+          return self.parse(connection, response)
+        end
+      end
+      
       def self.get(connection, path, options = {})
         unless options.is_a?(Hash)
           raise AMEE::ArgumentError.new(&quot;Third argument must be a hash of options!&quot;)</diff>
      <filename>lib/amee/profile_category.rb</filename>
    </modified>
    <modified>
      <diff>@@ -299,7 +299,7 @@ module AMEE
         response = connection.raw_post(category_path, post_data).body
         # Send back a category object containing all the created items
         unless response.empty?
-          return AMEE::Profile::Category.parse(connection, response)
+          return AMEE::Profile::Category.parse_batch(connection, response)
         else
           return true
         end</diff>
      <filename>lib/amee/profile_item.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>065221c22743006a5d27ef582a6b45b245bef3b5</id>
    </parent>
  </parents>
  <author>
    <name>Stephen Matthew</name>
    <email>stephen.matthew@gmail.com</email>
  </author>
  <url>http://github.com/Floppy/amee-ruby/commit/98714ceac069bd05f2b5079d48669e0db34df5f9</url>
  <id>98714ceac069bd05f2b5079d48669e0db34df5f9</id>
  <committed-date>2009-07-03T09:26:53-07:00</committed-date>
  <authored-date>2009-07-03T09:26:53-07:00</authored-date>
  <message>Created new functions for parsing default v2 ProfileCategory batch POST repsonses.</message>
  <tree>ad6518b2e008c9f06c665bba2c5f82d088e113e8</tree>
  <committer>
    <name>Stephen Matthew</name>
    <email>stephen.matthew@gmail.com</email>
  </committer>
</commit>
