KEMBAR78
`REXML::Document.new` accepts no root input · Issue #289 · ruby/rexml · GitHub
Skip to content

REXML::Document.new accepts no root input #289

@kou

Description

@kou
require "rexml"
REXML::Document.new("") # no error
REXML::Document.new("<?xml version='1.0'?>") # no error

https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-well-formed

[Definition: A textual object is a well-formed XML document if:]

  • Taken as a whole, it matches the production labeled document.
  • It meets all the well-formedness constraints given in this specification.
  • Each of the parsed entities
    which is referenced directly or indirectly within the document is well-formed.

Document

[1] document ::= ( prolog element Misc* ) - ( Char* RestrictedChar Char* )

Should we report an error for no root input?

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