robrichards / xmlseclibs

A PHP library for XML Security
BSD 3-Clause "New" or "Revised" License
387 stars 181 forks source link

Insert signature at a given node #116

Closed jcaguilar40 closed 7 years ago

jcaguilar40 commented 7 years ago

Dear, I have the following xml:

`<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>

1001 148.5 1000 CIENTO SETENTA Y CINCO CON 2/100 01 ` the question is How do I get the result of the signature to be inserted into the node ?. (The second tag). Thanks for your valuable contribution
Overtonesinger commented 7 years ago

Please, @jcaguilar40 , insert the XML again, but using the "<>" button ... to insert and let it display as the raw code. Thanx. :-)

cpjeanpaul commented 7 years ago
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<root>
   <child>hello</child>
   <otherchild>
      <ds:Signature>...</ds:Signature>
   <otherchild>
</root>

Something like this?

cpjeanpaul commented 7 years ago

$objDSig->appendSignature($doc->getElementsByTagName("otherchild")->item(0));

langaro commented 5 years ago

@cpjeanpaul thank you so much. 👍 💯