Skip to content

XMLParserConfiguration forceList initial empty tag should be consistent with default processing #1040

Description

@stleary

See discussion in #1039: #1039 (comment)

When a tag is in forceList, and the first element is empty, the first element is dropped, but the default non-forceList behavior is to insert an initial empty string. ForceList and default processing in this case should have the same result.

Although this breaks existing behavior, it is a corner case of XML parsing, and I believe it should be fixed.
Note that after the fix is made, in the case where there is only one instance of an empty tag, default processing results in an empty string value, but forceList processing will create an array with a single empty string as content. This is acceptable.

Fixing this will break several existing tests in XMLConfigurationTest.java:
testEmptyTagForceList()
testEmptyForceList()

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions