"Transform " + algorithm + " is forbidden when secure validation is enabled"
);
}
}
XMLSignatureInput in;
if (data instanceof ApacheData) {
if (log.isDebugEnabled()) {
log.debug("ApacheData = true");
}
in = ((ApacheData)data).getXMLSignatureInput();
} else if (data instanceof NodeSetData) {
if (log.isDebugEnabled()) {
log.debug("isNodeSet() = true");
}
if (data instanceof DOMSubTreeData) {
if (log.isDebugEnabled()) {
log.debug("DOMSubTreeData = true");
}
DOMSubTreeData subTree = (DOMSubTreeData)data;
in = new XMLSignatureInput(subTree.getRoot());
in.setExcludeComments(subTree.excludeComments());
} else {
@SuppressWarnings("unchecked")
Set<Node> nodeSet =
Utils.toNodeSet(((NodeSetData)data).iterator());
in = new XMLSignatureInput(nodeSet);
}
} else {
if (log.isDebugEnabled()) {
log.debug("isNodeSet() = false");
}
try {
in = new XMLSignatureInput
(((OctetStreamData)data).getOctetStream());
} catch (Exception ex) {
throw new TransformException(ex);
}
}
try {
if (os != null) {
in = apacheTransform.performTransform(in, os);
if (!in.isNodeSet() && !in.isElement()) {
return null;
}
} else {
in = apacheTransform.performTransform(in);
}
if (in.isOctetStream()) {
return new ApacheOctetStreamData(in);
} else {
return new ApacheNodeSetData(in);
}
} catch (Exception ex) {