twigbranch
twigbranch
In the US. But looks like they banned my IP- not sure why, is running this 2-4 times / day excessive? Monkey patching with this code allows you to choose...
It appears that after numerous requests with the various genre and store IDs which are met with 301 redirects, the IP becomes banned, and instead receives 403 forbidden. I'm wondering...
file at filepath: ``` child1 text ``` ``` parser = Saxerator.parser(File.new(filepath)) do |config| config.adapter = :ox end p=parser.for_tag('parent') p.first => {"child1"=>"child1 text", "child2"=>{}} p.first['child1'].class => Saxerator::Builder::StringElement p.first['child2'].class => Saxerator::Builder::EmptyElement ```
I installed via: ``` gem 'saxerator', :git => 'https://github.com/soulcutter/saxerator.git' gem 'ox' bundle install ``` Here's what I'm reportedly using now: `Using saxerator 0.9.8 from https://github.com/soulcutter/saxerator.git (at master)` I get: ```...
Here's the nokogiri output - both are text nodes: ``` doc = File.open(filepath) { |f| Nokogiri::XML(f) } => # ``` Here's ox output: ``` xml = File.open(filepath).read => "\n child1...
Wouldn't it make more sense to return ``,``, ` ` as text, and `` and `` as hash?
This issue is similar: https://github.com/soulcutter/saxerator/issues/12
Here's how Ruby on Rails ActiveSupport handles it: ``` Hash.from_xml(File.read(filepath)) => {"parent"=>{"child1"=>"child1 text", "child2"=>" "}} ``` and for completely empty elements: ``` Hash.from_xml("\n child1 text\n \n\n") => {"parent"=>{"child1"=>"child1 text", "child2"=>nil}}...
Also, a completely empty element without even white space should be nil like ActiveSupport from_xml, no? (or at least "" text, but not a {})
I tried it with the default rexml and got the same result: (::HashElement, not ::StringElement).