-
Notifications
You must be signed in to change notification settings - Fork 278
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
Partial support for parsing XML namespaces #3925
base: main
Are you sure you want to change the base?
Conversation
Remove duplicate NonNull; see package-info.java Validate argument not literal Apply formatter
Thanks for getting this started @ammachado ! I've also tagged @knutwannheden for review since we're adding methods in the |
rewrite-xml/src/main/java/org/openrewrite/xml/internal/XmlNamespaceUtils.java
Outdated
Show resolved
Hide resolved
Once merged we can revisit these recipes in rewrite-migrate-java: |
# Conflicts: # rewrite-xml/src/test/java/org/openrewrite/xml/ChangeNamespaceValueTest.java
rewrite-xml/src/main/java/org/openrewrite/xml/ChangeNamespaceValue.java
Outdated
Show resolved
Hide resolved
if (this.root == root) { | ||
return this; | ||
} | ||
Map<String, String> namespaces = XmlNamespaceUtils.extractNamespaces(root.getAttributes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of extracting the namespaces here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we need this back in to later support namespace lookup for particular elements?
For example, using the test file, and wanting to look for the XPath /client/conduitSelector
with the http://cxf.apache.org/jaxws
namespace:
<jaxws:client name="{http://cxf.apache.org/hello_world_soap_http}SoapPort" createdFromAPI="true" xmlns:jaxws="http://cxf.apache.org/jaxws">
<jaxws:conduitSelector>
<bean class="org.apache.cxf.endpoint.DeferredConduitSelector"/>
</jaxws:conduitSelector>
</jaxws:client>
…alue.java Co-authored-by: Knut Wannheden <knut.wannheden@gmail.com>
What's changed?
Partial support for #3919, including namespace parsing and resolution
What's your motivation?
#3919
Anything in particular you'd like reviewers to focus on?
No
Anyone you would like to review specifically?
No
Have you considered any alternatives or workarounds?
No
Any additional context
No
Checklist