DSSXMLUtils { public static void setIDIdentifier(final Element childElement) { final NamedNodeMap attributes = childElement.getAttributes(); for (int jj = 0; jj < attributes.getLength(); jj++) { final Node item = attributes.item(jj); final String localName = item.getLocalName(); final String nodeName = item.getNodeName(); if (localName != null) { if (Utils.areStringsEqualIgnoreCase(XMLDSigAttribute.ID.getAttributeName(), localName)) { childElement.setIdAttribute(nodeName, true); break; } } } } private  DSSXMLUtils(); static boolean registerTransform(final String transformURI); static boolean registerCanonicalizer(final String c14nAlgorithmURI); static Node indentAndReplace(final Document document, Node node); static Node indentAndExtend(final Document document, Node newNode, Node oldNode); static Document getDocWithIndentedSignatures(final Document documentDom, String signatureId, List<String> noIndentObjectIds); static Node getIndentedNode(final Node documentDom, final Node xmlNode); static Node alignChildrenIndents(Node parentNode); static byte[] serializeNode(final Node xmlNode); static boolean canCanonicalize(final String canonicalizationMethod); static byte[] canonicalize(final String canonicalizationMethod, final byte[] toCanonicalizeBytes); static byte[] canonicalizeSubtree(String canonicalizationMethod, final Node node); static String getCanonicalizationMethod(String canonicalizationMethod); static void recursiveIdBrowse(final Element element); static String getIDIdentifier(final Node node); static String getAttribute(final Node node, final String attributeName); static void setIDIdentifier(final Element childElement); static String validateAgainstXSD(XSDAbstractUtils xsdUtils, final Source source); static boolean isOid(String policyId); static String getOidCode(String oid); static boolean isDuplicateIdsDetected(DSSDocument doc); static byte[] getNodeBytes(Node node); static byte[] getReferenceOriginalContentBytes(Reference reference); static Digest getDigestAndValue(Element element); static boolean isSignedProperties(final Reference reference, final XAdESPaths xadesPaths); static boolean isCounterSignature(final Reference reference, final XAdESPaths xadesPaths); static boolean isKeyInfoReference(final Reference reference, final Element signature); static boolean isObjectReferenceType(String referenceType); static boolean isManifestReferenceType(String referenceType); static boolean isCounterSignatureReferenceType(String referenceType); static PublicKey getKeyInfoSigningCertificatePublicKey(final Element signatureElement); static final String DEFAULT_CANONICALIZATION_METHOD; }
@Test public void setIdentifierPrefixed() { FileDocument document = new FileDocument("src/test/resources/ns-prefixes-sample.xml"); Document dom = DomUtils.buildDOM(document); NodeList list = dom.getDocumentElement().getElementsByTagName("czip:initInstantPayment"); DSSXMLUtils.setIDIdentifier((Element) list.item(0)); assertNotNull(dom.getElementById("signedData")); }