It seems that create a CacheXPathAPI is a really expensive operation, and it's better to postpone it till if it's ever needed.
Please test it.
Thanks.
Index: XMLSignatureInput.java
===================================================================
RCS file: /home/cvspublic/xml-security/src/org/apache/xml/security/signature/XMLSignatureInput.java,v
retrieving revision 1.24
diff -u -r1.24 XMLSignatureInput.java
--- XMLSignatureInput.java 8 Feb 2004 06:11:19 -0000 1.24
+++ XMLSignatureInput.java 16 Apr 2004 15:52:05 -0000
@@ -88,7 +88,7 @@
System.arraycopy(inputOctets, 0, copy, 0, inputOctets.length);
this._inputOctetStreamProxy = new ByteArrayInputStream(copy); - this._cxpathAPI = new CachedXPathAPI(); + //this._cxpathAPI = new CachedXPathAPI(); }
/**
@@ -182,7 +182,7 @@
* @param inputNodeSet
*/
public XMLSignatureInput(Set inputNodeSet) {
- this(inputNodeSet, new CachedXPathAPI());
+ this(inputNodeSet, null);
} /**
@@ -240,6 +240,9 @@
XMLUtils.circumventBug2650(doc); // select all nodes, also the comments.
+ if (this._cxpathAPI==null) {
+ this._cxpathAPI=new CachedXPathAPI();
+ }
NodeList nodeList =
this._cxpathAPI
.selectNodeList(doc,