/** * An ID attribute can only be dereferenced if it is declared in the validation context. This behaviour is caused by the fact that the attribute does not have attached type of * information. Another solution is to parse the XML against some DTD or XML schema. This process adds the necessary type of information to each ID attribute. * * @param element */ public static void recursiveIdBrowse(final Element element) { for (int ii = 0; ii < element.getChildNodes().getLength(); ii++) { final Node node = element.getChildNodes().item(ii); if (node.getNodeType() == Node.ELEMENT_NODE) { final Element childElement = (Element) node; setIDIdentifier(childElement); recursiveIdBrowse(childElement); } } }
/** * An ID attribute can only be dereferenced if it is declared in the validation context. This behaviour is caused by the fact that the attribute does not have attached type of * information. Another solution is to parse the XML against some DTD or XML schema. This process adds the necessary type of information to each ID attribute. * This method is useful to carry out tests with different signature provider. * * @param context * @param element */ public static void recursiveIdBrowse(final DOMValidateContext context, final Element element) { for (int ii = 0; ii < element.getChildNodes().getLength(); ii++) { final Node node = element.getChildNodes().item(ii); if (node.getNodeType() == Node.ELEMENT_NODE) { final Element childElement = (Element) node; setIDIdentifier(context, childElement); recursiveIdBrowse(context, childElement); } } }
DSSXMLUtils.recursiveIdBrowse(rootElement); try {
DSSXMLUtils.recursiveIdBrowse(document.getDocumentElement()); final String uri_id = uri.substring(1); nodeToTransform = document.getElementById(uri_id);