Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add XPath support for namespace-uri() condition and attribute elements #4287

Merged
merged 12 commits into from
Jul 3, 2024

Conversation

evie-lau
Copy link
Contributor

@evie-lau evie-lau commented Jun 25, 2024

What's changed?

Add support for namespace-uri() conditions in XPathMatcher, along with tests
Add attribute match support in XPathMatcher (/@attributeName)
Update XPath splitter to handle URLs

What's your motivation?

Be able to use namespace filters in XPathMatcher

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

@sambsnyd @timtebeek
FYI: @ammachado

Have you considered any alternatives or workarounds?

Any additional context

Unsure about the addition of the new Interface Namespaced (or its naming). Just wanted to be able to run one of my methods on both Xml.Tag and Xml.Attribute objects.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

@timtebeek timtebeek added the enhancement New feature or request label Jun 25, 2024
@evie-lau evie-lau changed the title Add XPath support for namespace-uri() condition Add XPath support for namespace-uri() condition and attribute elements Jun 28, 2024
@timtebeek timtebeek self-requested a review June 28, 2024 21:48
@evie-lau evie-lau requested a review from sambsnyd July 3, 2024 16:02
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions could not be made:

  • rewrite-core/src/main/java/org/openrewrite/internal/lang/NullFields.java
    • lines 36-36

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions could not be made:

  • rewrite-core/src/main/java/org/openrewrite/internal/lang/NullFields.java
    • lines 36-36

@sambsnyd sambsnyd merged commit 28ad1cf into openrewrite:main Jul 3, 2024
2 checks passed
@evie-lau evie-lau deleted the namespace-uri branch July 4, 2024 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants