copy an xml node

<TestCase>

<AuthorizePaymentRq>

<amount>3.1415926535897932384626433832795</amount>

<method>Debit</method>

<parameters>

<PaymentParameter>

<Name>String</Name>

<Value>String</Value>

</PaymentParameter>

</parameters>

</AuthorizePaymentRq>

<LOB>PL</LOB>

<ReferenceNumber>234234553</ReferenceNumber>

<Applicantid>886</Applicantid>

</TestCase>

this is my xml file. i need to parse it and i used dom do it.

i need to copy a node of this xml and put it in to string.

for example my target will be like this

String p= "<AuthorizePaymentRq>

<amount>3.1415926535897932384626433832795</amount><method>Debit</method><parameters> <PaymentParameter><Name>String</Name> <Value>String</Value> </PaymentParameter></parameters>

</AuthorizePaymentRq>".

please give me a quick reply ASAP please..

[1128 byte] By [lagisettya] at [2007-10-2 5:16:20]
# 1

i am posting this question again for help.

my request to a service will go like this

String response = proxy.doAuthorizePayment(lob,RefNumber,appid,XMLInput as a string);

XMLInput should be a string in xml format which i have to copy from the xml that i gave. please solve this..

NodeList LOB = doc.getElementsByTagName("LOB");

NodeList ReferenceNumber = doc.getElementsByTagName("ReferenceNumber");

NodeList Applicantid = doc.getElementsByTagName("Applicantid");

Node node;

node = LOB.item(0);

String lob=node.getChildNodes().item(0).getNodeValue();

System.out.println(lob+"LOB");

node=ReferenceNumber.item(0);

String RefNumber=node.getChildNodes().item(0).getNodeValue();

System.out.println(RefNumber+"RefNumbe Here");

node=Applicantid.item(0);

String appid=node.getChildNodes().item(0).getNodeValue();

System.out.println(appid+"Applicantid Here");

lagisettya at 2007-7-16 1:18:40 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
no reply so far.... please update me..........
lagisettya at 2007-7-16 1:18:40 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...