Skip to content

Serialization of ATTLIST is incorrect #233

Description

@OlofKalufs

When parsing and then serializing an XML document with a DTD internal subset containing an ATTLIST, the "<!ATTLIST" part is missing. See this example:

require 'rexml'

xml_string = %{
<!DOCTYPE elem [
   <!ELEMENT elem EMPTY>
   <!ATTLIST elem attr CDATA #REQUIRED>
]>
<elem attr="value"/>
}

xml_document = REXML::Document.new(xml_string)

puts xml_document.to_s
# Outputs:
# <!DOCTYPE elem [
# <!ELEMENT elem EMPTY>
#  elem attr CDATA #REQUIRED>
# ]><elem attr='value'/>

Tried with REXML 3.4.0 on Ruby 3.3.6

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions