Update problem!!

who can give me one Update example program code.

this is my XML Document:
<?xml version="1.0" ?>

<order_number>1</order_number>


<com_name>CYUT</com_name>
<com_id>11</com_id>
<com_div>Marketing</com_div>
<com_add>168, GIFeng East Road Wufeng, Taichung County, Taiwan</com_add>
<com_tel local="(04)">23323001</com_tel>
<com_fax local="(05)">23323002</com_fax>



if i want to update element “com_name” vlaue,use dom4j.
my system :apache+tamino

This is an example of how to do updating:
==================================================
/import classes/
import org.w3c.dom.;
import com.softwareag.tamino.api.dom.
;
import com.docuverse.dom.*;



TaminoClient tamino=new TaminoClient(“url of your database”);
tamino.startSession();

TaminoResult tr = tamino.query("Order[order_number=“1”]);

if (!tr.hasMoreElements()){
//do something here if result is not found
}else{
Document doc = tr.getDocument();
Element order = (Element)tr.nextElement();
Element eComName = (Element)order.getElementsByTagName(“com_name”).item(0);

eComName.getChildNodes().item(0).setNodeValue(“new value”);
tamino.update(order);
tamino.commit(true);
tamino.endSession();


==================================================

Hope this helps! :slight_smile: