<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,7 @@
+== 0.1.3 2009-06-22
+* 1 minor patch
+  * Parsing a text node with attributes stores them in the attributes method (tamalw)
+
 == 0.1.2 2009-04-21
 * 2 minor patches
   * Correct unnormalization of attribute values (der-flo)</diff>
      <filename>History</filename>
    </modified>
    <modified>
      <diff>@@ -81,7 +81,13 @@ class REXMLUtilityNode #:nodoc:
     end
 
     if @text
-      return { name =&gt; typecast_value( unnormalize_xml_entities( inner_html ) ) }
+      t = typecast_value( unnormalize_xml_entities( inner_html ) )
+      unless t.respond_to? :attributes
+        # Some types don't work with singleton methods, so modifying the class instead
+        t.class.send :attr_accessor, :attributes
+      end
+      t.attributes = attributes
+      return { name =&gt; t }
     else
       #change repeating groups into an array
       groups = @children.inject({}) { |s,e| (s[e.name] ||= []) &lt;&lt; e; s }</diff>
      <filename>lib/crack/xml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,6 +68,31 @@ class XmlTest &lt; Test::Unit::TestCase
 
     Crack::XML.parse(xml).should == hash
   end
+  
+  should &quot;should include attributes hash if present&quot; do
+    xml =&lt;&lt;-XML
+      &lt;opt&gt;
+        &lt;user login=&quot;grep&quot;&gt;Gary R Epstein&lt;/user&gt;
+        &lt;user&gt;Simon T Tyson&lt;/user&gt;
+      &lt;/opt&gt;
+    XML
+
+    Crack::XML.parse(xml)['opt']['user'].class.should == Array
+
+    hash = {
+      'opt' =&gt; {
+        'user' =&gt; [
+          'Gary R Epstein',
+          'Simon T Tyson'
+        ]
+      }
+    }
+
+    Crack::XML.parse(xml).should == hash
+    
+    Crack::XML.parse(xml)['opt']['user'][0].attributes.should == { 'login' =&gt; 'grep' }
+    Crack::XML.parse(xml)['opt']['user'][1].attributes.should == {}
+  end
 
   should &quot;should typecast an integer&quot; do
     xml = &quot;&lt;tag type='integer'&gt;10&lt;/tag&gt;&quot;</diff>
      <filename>test/xml_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9e5b6557600e259d27c6eedcc2eb48a4cc0b550d</id>
    </parent>
  </parents>
  <author>
    <name>Tamal White</name>
    <email>twhite@apple.com</email>
  </author>
  <url>http://github.com/jnunemaker/crack/commit/66a2a2b860765a4c6577eb064dc0faf49b68a0f0</url>
  <id>66a2a2b860765a4c6577eb064dc0faf49b68a0f0</id>
  <committed-date>2009-06-30T20:04:54-07:00</committed-date>
  <authored-date>2009-06-22T15:27:39-07:00</authored-date>
  <message>Backwards compatibility with attributes method

Signed-off-by: John Nunemaker &lt;nunemaker@gmail.com&gt;</message>
  <tree>e9618ecff3c86eac2f4ee1becbd98796f39e9e7a</tree>
  <committer>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </committer>
</commit>
