Ask a Question

copy xml node from one XmlHolder to another

thestraw
Occasional Contributor

copy xml node from one XmlHolder to another

 

How do I work with setNodeValue()?

 

I've tried the following without success(no replacement takes place):

 

request.setNodeValue("/", "none" )

And I need to end up with something like this, where I copy a signature tag from one holder to the other:

 


request.setNodeValue("signature xpath", soapExpandedMessageXMLHolder.getNodeValue("signature xpath"))

 

6 REPLIES 6
TanyaYatskovska
SmartBear Alumni (Retired)

Hi Thestraw,

 

As far as I remember, the setNodeValue method has the following parameters:

  1. the XPath expression to the target node
  2. the new value
setNodeValue (<Your_XPath>,<Your_Value>)
---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



thestraw
Occasional Contributor

and didn't I use it like that?

nmrao
Community Hero

May be you want to show the input and desired ouput xml which might help?


Regards,
Rao.
thestraw
Occasional Contributor

I want to copy a tag called "signature" from one XmlHolder object to another.

Since I couldn't make it to work, I've tried something basic like:

 

request.setNodeValue("/", "none" )

 

It didn't update the root node with anything. 

Sorry, that did not help. May be some more context is needed to understand.


Regards,
Rao.
thestraw
Occasional Contributor

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<note>
<Signature>.....</Signature>
</note>

 

I want to copy the 

<Signature>.....</Signature>

 and from one xmlHolder to another. 

cancel
Showing results for 
Search instead for 
Did you mean: