Skip to content

Conversation

@timtebeek
Copy link
Member

@timtebeek timtebeek commented Nov 20, 2025

Summary

Test plan

  • Run XPathMatcherTest.matchTextFunctionCondition() - verifies text() predicate matching
  • Run RemoveXmlTagTest.removeOnlyElementMatchingTextPredicate() - verifies only elements with matching text are removed
  • Run RemoveXmlTagTest.removeOnlyElementMatchingLocalNameAndTextPredicate() - verifies combined predicates work
  • Run full XPathMatcherTest and RemoveXmlTagTest suites to ensure no regressions

🤖 Generated with Claude Code

The CONDITION_CONJUNCTION_PATTERN regex was missing support for text()
function, causing RemoveXmlTag to ignore text predicates and remove all
matching elements instead of only those with specific text content.

Fixes #6314

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@timtebeek timtebeek added xml enhancement New feature or request labels Nov 20, 2025
@timtebeek timtebeek marked this pull request as ready for review November 20, 2025 11:24
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Nov 20, 2025
@timtebeek timtebeek changed the title Fix XPathMatcher to support text() predicate in XPath expressions Fix XPathMatcher to support text() predicate in XPath expressions Nov 25, 2025
@timtebeek timtebeek merged commit 10aeced into main Nov 25, 2025
2 checks passed
@timtebeek timtebeek deleted the fix/xpath-text-predicate-6314 branch November 25, 2025 10:55
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request xml

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

RemoveXmlTag does not correctly evaluate XPath Remove XML tag if it matches the content given in the xPath

2 participants