phax commented on code in PR #234: URL: https://github.com/apache/santuario-xml-security-java/pull/234#discussion_r1383699188
########## src/main/java/org/apache/xml/security/utils/XMLUtils.java: ########## @@ -706,6 +706,27 @@ public static Element selectXencNode(Node sibling, String nodeName, int number) return null; } + /** + * + * @param sibling + * @param nodeName + * @param number + * @return nodes with the given node name + */ + public static Element selectXenc11Node(Node sibling, String nodeName, int number) { + while (sibling != null) { + if (EncryptionConstants.EncryptionSpec11NS.equals(sibling.getNamespaceURI()) + && sibling.getLocalName().equals(nodeName)) { + if (number == 0){ + return (Element)sibling; Review Comment: Is it always safe to assume that this is an `Element`? `Text` nodes also implement `getNextSibling()` (for multiple `CDATA` I assume) - but they can never have a namespace URI... Just doesn't feel too perfect. Maybe some comment may help :) -- 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: dev-unsubscr...@santuario.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org