Love U Ruby
2013-Jun-09 13:01 UTC
Nokogiri::XML::AttributeDecl methods output understanding
Hi, Today morning my target is going through the ` Nokogiri::XML::AttributeDecl` methods. So I wrote some simple codes to understand these methods: require ''nokogiri'' doc = Nokogiri::XML::Document.new # => #<Nokogiri::XML::Document:0x44a5070 name="document"> attdcl = Nokogiri::XML::AttributeDecl.new(''bar'',doc) # => #<Nokogiri::XML::AttributeDecl:0x449d0dc "<bar/>"> attdcl.enumeration # => [] attdcl.attribute_type # => 0 attdcl.default # => nil Now my questions are below : (a) why does `attdcl.enumeration` give empty array? What I need to change to get an non-empty array? (b) why does `attdcl.default` give `nil`? What I need to change to get an non-nil value? Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6b38d2f634557011f73bcb488bafc08a%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Eduardo Figarola
2013-Oct-13 03:45 UTC
Re: Nokogiri::XML::AttributeDecl methods output understanding
Hi, I hope the attached code explain all to you. Regards, Eduardo Figarola. Attachments: http://www.ruby-forum.com/attachment/8819/attrdcl.rb -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d7853754902e77a79dac71d7a8ad3ebb%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.