Skip to content

Fix equalToXml matching with NamespaceAwareness.NONE - #3511

Open
DragonFSKY wants to merge 1 commit into
wiremock:masterfrom
DragonFSKY:fix/xml-namespace-awareness-none
Open

DragonFSKY wants to merge 1 commit into
wiremock:masterfrom
DragonFSKY:fix/xml-namespace-awareness-none

Conversation

@DragonFSKY

@DragonFSKY DragonFSKY commented Jul 22, 2026

Copy link
Copy Markdown

Description

With NamespaceAwareness.NONE, DOM nodes have no local name. The order-invariant matcher sorted sibling elements by Node#getLocalName(), which caused comparison to fail as soon as two siblings were sorted.

Use the full node name only when the local name is unavailable. This preserves the existing namespace-aware behavior and gives namespace-unaware elements the name used by their comparison mode.

Fixes #3508

Verification

  • The two focused regression cases fail on current master and pass with this change.
  • Full ./gradlew test
  • spotlessJavaCheck

@DragonFSKY
DragonFSKY force-pushed the fix/xml-namespace-awareness-none branch from f3000cd to 2dfe38e Compare July 22, 2026 04:00
@DragonFSKY
DragonFSKY marked this pull request as ready for review July 22, 2026 04:33
@DragonFSKY
DragonFSKY requested a review from a team as a code owner July 22, 2026 04:33
Use the full DOM node name when localName is unavailable so the
order-invariant matcher can sort namespace-unaware elements.

Add regression coverage for both comparator branches under
NamespaceAwareness.NONE.
@DragonFSKY
DragonFSKY force-pushed the fix/xml-namespace-awareness-none branch from 2dfe38e to f3b5f5b Compare August 25, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant