etobella / python-xades

Xades Signature for Python
GNU Lesser General Public License v3.0
32 stars 27 forks source link

incomplete assumptions about location of signature in tree #7

Closed blaggacao closed 5 years ago

blaggacao commented 5 years ago
>>> root.remove(signature)
ValueError: ValueError('Element is not a child of this node.')

The signature element not necessarily is a child of the root element, however it is a "decendent". For example in UBL, <ds:Signature/> is located at ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/ds:Signature

This needs be fixed to comply with the standard.

etobella commented 5 years ago

well, the remove function is not defined here, it is defined by lxml, if you want to remove signature you should do: signature.getparent().remove(signature)

blaggacao commented 5 years ago

If not already merged, I have something in my work dir. Thanks for the great collaboration!