Permalink
Browse files

Updated readme with example of pulling attributes and inner value wit…

…hin an element
  • Loading branch information...
1 parent 8b7892c commit 24163da21fba1744bef25f6791c05ce11eaa22fd @krobertson krobertson committed Jul 21, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 README.textile
View
@@ -13,6 +13,15 @@ h2. Usage
<pre>
require 'sax-machine'
+# Class for information associated with content parts in a feed.
+# Ex: <content type="text">sample</content>
+# instance.type will be "text", instance.text will be "sample"
+class AtomContent
+ include SAXMachine
+ attribute :type
+ value :text
+end
+
# Class for parsing an atom entry out of a feedburner atom feed
class AtomEntry
include SAXMachine
@@ -21,7 +30,7 @@ class AtomEntry
element :name, :as => :author
element "feedburner:origLink", :as => :url
element :summary
- element :content
+ element :content, :class => AtomContent
element :published
parent :parent
end

0 comments on commit 24163da

Please sign in to comment.