-
Notifications
You must be signed in to change notification settings - Fork 354
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
Support for XML Namespaces #3919
Comments
Seems reasonable, thanks! Might tie into some of the |
Probably a few of the existing Java EE9/10 recipes could be improved with this, also create new ones, specially new recipes to refactor |
With that PR merged, I think this ticket can now be closed. What fo you guys think, @ammachado and @timtebeek ? |
We had added a disabled tests previously; think we can reevaluate the rewrite/rewrite-xml/src/test/java/org/openrewrite/xml/XPathMatcherTest.java Lines 223 to 226 in 22ac272
|
#3925 does not consider namespaces on |
Also need to finish support for |
I feel this has been handled and then last refined in Let's pick up any remaining work separately as the context has shifted quite a bit since this was opened. Thanks all! |
What problem are you trying to solve?
Change namespaced tags without being required to know the namespace prefix. For example, on the following XML, I want to replace the
schemaLocation
attribute on thebeans
tag.There are situations where the namespace URI remains the same, but the prefix changes. I can try change the attribute
xsi:schemaLocation
, but for that the prefix should match.Describe the solution you'd like
ChangeTagAttribute
(I already have this working, I will contribute a PRAllow regular expressions onChangeTagAttribute
#3920);name
,onnamespace-uri
andlocal-name
XPathMatcher
; Partial support for parsing XML namespaces #3925 and Add XPath support for namespace-uri() condition and attribute elements #4287Add aPartial support for parsing XML namespaces #3925 andnamespaces
field onXml.Document
andXml.Tag
, mapping the declared prefixes and namespaces;Add aPartial support for parsing XML namespaces #3925namespace
or anamespacePrefix
field onXml.Tag
andXml.Attribute
, identifying the namespace of that particular tag/attribute.Have you considered any alternatives or workarounds?
No.
Additional context
Are you interested in contributing this feature to OpenRewrite?
The text was updated successfully, but these errors were encountered: