Created
May 8, 2013 16:41
-
-
Save jcromartie/5541754 to your computer and use it in GitHub Desktop.
SAX Machine/Nokogiri attribute decoding???
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sax-machine' | |
class Foo | |
include SAXMachine | |
attribute :bar | |
end | |
class FooDoc | |
include SAXMachine | |
elements :foo, :as => :foos, :class => Foo | |
end | |
puts "expecting: bat & baz" | |
puts FooDoc.parse("<doc><foo bar='bat & baz'></foo></doc>").foos.first.bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment