reta commented on code in PR #3790:
URL: https://github.com/apache/cxf/pull/3790#discussion_r4713164057


##########
core/src/main/java/org/apache/cxf/staxutils/W3CNamespaceContext.java:
##########
@@ -96,11 +96,14 @@ private String getPrefix(Element e, String uri) {
 
                 String val = a.getValue();
                 if (val != null && val.equals(uri)) {
-                    String name = a.getLocalName();
+                    // only namespace declarations bind a prefix
+                    String name = a.getName();
                     if ("xmlns".equals(name)) {
                         return "";
                     }
-                    return name;
+                    if (name.startsWith("xmlns:")) {
+                        return name.substring(6);
+                    }

Review Comment:
   Are we missing return statement (post `if`s)?
   
   ```
   ...
   return name;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to