We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Please describe the bug
Since 35cace6 in 2008, DTD#attributes has returned a Hash<String => AttributeDecl> where the key is the attribute name.
DTD#attributes
Hash<String => AttributeDecl>
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.
DTD
Enumerable
#each
The text was updated successfully, but these errors were encountered:
Also just a note that AttributeDecl does not support declaring multiple attributes, see https://www.w3.org/TR/xml/#attdecls
AttributeDecl
Sorry, something went wrong.
I think the right thing to do here is:
#attribute_list
Array<AttributeDecl>
#attributes
Opinions welcome.
No branches or pull requests
Please describe the bug
Since 35cace6 in 2008,
DTD#attributes
has returned aHash<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:
This should probably just be an array, and not a hash. And in that case,
DTD
should not beEnumerable
and we should remove the#each
method.The text was updated successfully, but these errors were encountered: