Skip to content

scala.xml.parsing.XhtmlParser silently ignores invalid XML #4296

Closed
@scabug

Description

@scabug

=== What steps will reproduce the problem (please be specific and use wikiformatting)? ===

scala.xml.parsing.XhtmlParser(scala.io.Source.fromString("<p/><b/>"))

=== What is the expected behavior? ===

Expected it to throw an exception saying "document must contain exactly one element"

=== What do you see instead? ===

Repl output:

:1:8: document must contain exactly one element ^
List(

, )
res1: scala.xml.NodeSeq = Document()

(Its printing an error to the console???)

=== Additional information ===
(for instance, a link to a relevant mailing list discussion)

=== What versions of the following are you using? ===

  • Scala:
  • Java:
  • Operating system:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions