-
-
Notifications
You must be signed in to change notification settings - Fork 918
Open
Description
Please describe the bug
Since 35cace6 in 2008, DTD#attributes
has returned a Hash<String => AttributeDecl>
where the key is the attribute name.
This doesn't make any sense, since the attribute name does not need to be unique, for example:
doc = Nokogiri::XML::Document.parse(<<~XML)
<?xml version="1.0"?>
<!DOCTYPE staff SYSTEM "foo.dtd" [
<!ATTLIST br width CDATA "0">
<!ATTLIST a width CDATA "0">
]>
<root />
XML
doc.internal_subset.attributes
# => {"width"=>#(AttributeDecl:0x43f8 { "<!ATTLIST br width CDATA \"0\">\n" })}
This should probably just be an array, and not a hash. And in that case, DTD
should not be Enumerable
and we should remove the #each
method.