lib/xmldsig/transforms/enveloped_signature.rb in xmldsig-0.2.7 vs lib/xmldsig/transforms/enveloped_signature.rb in xmldsig-0.2.8
- old
+ new
@@ -1,9 +1,12 @@
module Xmldsig
class Transforms < Array
class EnvelopedSignature < Transform
def transform
- node.xpath("descendant::ds:Signature", Xmldsig::NAMESPACES).first.remove
+ signatures = node.xpath("descendant::ds:Signature", Xmldsig::NAMESPACES).
+ sort { |left, right| left.ancestors.size <=> right.ancestors.size }
+
+ signatures.first.remove
node
end
end
end
end