The following method of the class org.apache.xml.security.transforms.Transform does not test if the contextChild parameter is null: public static final Transform getInstance( Document doc, String algorithmURI, Element contextChild) I propose this modified code to fix this bug: public static final Transform getInstance( Document doc, String algorithmURI, Element contextChild) throws InvalidTransformException { HelperNodeList contextNodes = null; if (contextChild != null) { contextNodes = new HelperNodeList(); XMLUtils.addReturnToElement(doc, contextNodes); contextNodes.appendChild(contextChild); XMLUtils.addReturnToElement(doc, contextNodes); } return Transform.getInstance(doc, algorithmURI, contextNodes); }
Fix applied. Colm.