Replacing Elements in a XML document with String in Java

kukxxoqmfb

New Member
I am writing an HTTP server where i will receive an XPATH in an HTTP PUT and the data in the request body. I will need to replace the result of the XPATH expression with the data in the HTTP request data in an XML documentFor example the XML document is\[code\]<presence><tuple id="x8eg92n"><note> i am reading email 3 times a day </note></tuple></presence>\[/code\]The HTTP request is for example something like\[code\] PUT /pidf-manipulation/users/sip:[email protected]/index/ ~~/presence/tuple%5b@id='x8eg92n'%5d/note HTTP/1.1 If-Match: "xyz" Host: xcap.example.com Content-Type: application/xcap-el+xml ... <note>I'm reading mails on Tuesdays and Fridays</note>\[/code\]This above should replace the note element in the XML with the one the PUT request. Clients can this way send any XPATH and replace contents of the XML document. Please help in how this can be done in Java Code.
 
Back
Top