Nokogiri::XML::AttributeDecl methods output understanding

11 views
Skip to first unread message

Love U Ruby

unread,
Jun 9, 2013, 9:01:22 AM6/9/13
to rubyonra...@googlegroups.com
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/.

Eduardo Figarola

unread,
Oct 12, 2013, 11:45:16 PM10/12/13
to rubyonra...@googlegroups.com
Hi, I hope the attached code explain all to you.

Regards,
Eduardo Figarola.

Attachments:
http://www.ruby-forum.com/attachment/8819/attrdcl.rb
Reply all
Reply to author
Forward
0 new messages