You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by bl...@apache.org on 2004/10/02 04:18:04 UTC
cvs commit: xml-security/src/org/apache/xml/security/utils XMLUtils.java
blautenb 2004/10/01 19:18:04
Modified: src/org/apache/xml/security/utils XMLUtils.java
Log:
Implement a find utility for Xenc nodes
Revision Changes Path
1.45 +22 -0 xml-security/src/org/apache/xml/security/utils/XMLUtils.java
Index: XMLUtils.java
===================================================================
RCS file: /home/cvs/xml-security/src/org/apache/xml/security/utils/XMLUtils.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- XMLUtils.java 25 Sep 2004 19:42:23 -0000 1.44
+++ XMLUtils.java 2 Oct 2004 02:18:04 -0000 1.45
@@ -789,6 +789,28 @@
* @param number
* @return
*/
+
+ public static Element selectXencNode(Node sibling, String nodeName, int number) {
+ while (sibling!=null) {
+ if (nodeName.equals(sibling.getLocalName())
+ && EncryptionConstants.EncryptionSpecNS.equals(sibling.getNamespaceURI())) {
+ if (number==0){
+ return (Element)sibling;
+ }
+ number--;
+ }
+ sibling=sibling.getNextSibling();
+ }
+ return null;
+ }
+
+
+ /**
+ * @param sibling
+ * @param nodeName
+ * @param number
+ * @return
+ */
public static Text selectDsNodeText(Node sibling, String nodeName, int number) {
Node n=selectDsNode(sibling,nodeName,number);
if (n==null) {