pauldix-sax-machine 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/sax-machine.rb CHANGED
@@ -7,5 +7,5 @@ require "sax-machine/sax_handler"
7
7
  require "sax-machine/sax_config"
8
8
 
9
9
  module SAXMachine
10
- VERSION = "0.0.10"
10
+ VERSION = "0.0.11"
11
11
  end
@@ -30,6 +30,7 @@ module SAXMachine
30
30
 
31
31
  elsif @collection_config = sax_config.collection_config(@name)
32
32
  @collection_handler = @collection_config.handler
33
+ @collection_handler.start_element(@name, @attrs)
33
34
 
34
35
  elsif @element_config = sax_config.element_config_for_attribute(@name, @attrs)
35
36
  parse_element_attribute
@@ -280,6 +280,16 @@ describe "SAXMachine" do
280
280
  document.entries.size.should == 1
281
281
  document.entries.first.title.should == "correct title"
282
282
  end
283
+
284
+ it "should parse out an attribute value from the tag that starts the collection" do
285
+ class Foo
286
+ element :entry, :value => :href, :as => :url
287
+ end
288
+ document = @klass.parse("<xml><entry href='http://pauldix.net'><title>paul</title></entry></xml>")
289
+ document.entries.size.should == 1
290
+ document.entries.first.title.should == "paul"
291
+ document.entries.first.url.should == "http://pauldix.net"
292
+ end
283
293
  end
284
294
  end
285
295
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pauldix-sax-machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Dix