Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
The intention was to treat the parameter as the actual signature parent, which
is the current behavior. If the document already has a DocumentElement, the
exception is the correct behavior. Note that you may want to have the signature
as the DocumentElement; that's when you should pass the Document as the parent.
There's no limitation in this; it just means that the signature doesn't need
anything else on a document (such as a signature over external resources).
If the signature is meant to be child of an element, that element should be
passed as the parent regardless it being the DocumentElement or not. If the
document's root element was used, we'd loose the possibility of appending the
signature directly to the document, hence becoming the root.
I get your point.. I see 2 options:
1) Update the docs to be more clear and leave the behavior as it is
2) Change the behavior to: if the parent is a Document and:
a) has no root element -> signature becomes the root (appended to document as is)
b) already has a root element -> root element is used as parent (reference node if using different appending strategies)
After writing this, I don't think option 2 is very useful. It's more confusing
and will end up only on saving one call to doc.getDocumentElement().
Did I misunderstand something? If not, I think no changes should be made and
the issue should be closed.
Original comment by luis.fgoncalv
on 26 Dec 2011 at 5:55
[deleted comment]
As an additional note, this is the behavior of the JSR 105 API. At least it was
when the XAdES4j implementation was based on it.
Original comment by luis.fgoncalv
on 26 Dec 2011 at 6:06
Original comment by luis.fgoncalv
on 22 Jan 2012 at 8:19
Original comment by luis.fgoncalv
on 29 Jan 2012 at 11:56
Original issue reported on code.google.com by
clementp...@gmail.com
on 6 Dec 2011 at 4:30