I have a XAdES-EPES signature, then I extended the signature to XAdES-T using XAdES-4j. The problem is that in the original signature the QualifyingProperties is:
<xades:QualifyingProperties Id="Signature-b8925056-3e5e-4a39-8e4c-7fc1286b5eb5-QualifyingProperties" Target="#Signature-b8925056-3e5e-4a39-8e4c-7fc1286b5eb5-Signature" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#">
And in the extended signature QualifyingProperties is:
<xades:QualifyingProperties Id="Signature-b8925056-3e5e-4a39-8e4c-7fc1286b5eb5-QualifyingProperties" Target="#Signature-b8925056-3e5e-4a39-8e4c-7fc1286b5eb5-Signature" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#">
How can extend the signature without add xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#" to the QualifyingProperties?
Thanks in advance!
Edited: Until I find a solution, I'm doing:
Element qualifyingProperties = null;
final NodeList nlist = xmlSig.getDocument().getElementsByTagName("xades:QualifyingProperties");
if (nlist.getLength() != 0) {
qualifyingProperties = (Element) nlist.item(0);
qualifyingProperties.removeAttribute("xmlns:xades141");
}
The way xades4j is currently doing the XML serialization always adds that namespace declaration, even if there aren't any elements using it. There's no way to configure that. I'd like to only add it when necessary, but that issue hasn't been tackled yet.