Skip to content

[Bug]: XML with DOCTYPE results in "invalid xml" warning #1809

@martina-oefelein

Description

@martina-oefelein

Description

XML documents with a <!DOCTYPE declaration cause a warning "Appeared to be invalid xml so was not formatted."

This did not happen in CSharpier 1.1.1

Steps to Reproduce

Example file staff.xml (copied from CSharpier's own test suite):

<?xml version="1.0"?>
<!DOCTYPE staff SYSTEM "staff.dtd"[
    <!ENTITY ent1 "es">
]>
<staff></staff>
$ dotnet csharpier --version
1.2.5
$ dotnet csharpier check staff.xml
Warning ./staff.xml - Appeared to be invalid xml so was not formatted.
Checked 1 files in 79ms.

Expected Behavior

CSharpier should be able to check and format these documents, like in previous versions

Actual Behavior

Warning ./staff.xml - Appeared to be invalid xml so was not formatted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions