throw new TransformException
("Couldn't find Transform for: " + getAlgorithm(), ex);
}
}
XMLSignatureInput in;
if (data instanceof ApacheData) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "ApacheData = true");
}
in = ((ApacheData) data).getXMLSignatureInput();
} else if (data instanceof NodeSetData) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "isNodeSet() = true");
}
if (data instanceof DOMSubTreeData) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "DOMSubTreeData = true");
}
DOMSubTreeData subTree = (DOMSubTreeData) data;
in = new XMLSignatureInput(subTree.getRoot());
in.setExcludeComments(subTree.excludeComments());
} else {
Set nodeSet =
Utils.toNodeSet(((NodeSetData) data).iterator());
in = new XMLSignatureInput(nodeSet);
}
} else {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "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) {