Skip to content

verifyXml() escaping behaviour #466

@JCook21

Description

@JCook21

I'm working with Jackson to generate some XML that I'd like to then approve with the verifyXml() method. Jackson takes care of escaping special characters in the XML but doesn't pretty print it. I'm finding some inconsistencies with how Approvals then formats the XML:

  • Single quotes in the DTD are being converted to double quotes. This isn't a major issue but is a difference between what Jackson outputs and how Approvals then formats it.
  • Emoji characters, which Jackson doesn't escape, are being escaped by Approvals. For example, "😼" is being output as 😼
  • XML special characters, which Jackson has already escaped, are being escaped again. For example, Jackson outputs & but Approvals then changes this to &amp.

Do you have any comments on this? Is it possible to just apply formatting to the XML string that adds line breaks and indents but without further formatting the content?

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