Sorry, I could not update my former message, so here is some more information:
I try to do the following:
String database = “nameOfDB”;
String user = “userId”;
String passwd = “verySecret”;
String coll = “nameOfCollection”;
TConnection c = TConnectionFactory.getInstance().newConnection(database, user, passwd);
TAccessLocation accessLoc = TAccessLocation.newInstance(coll);
TXMLObjectAccessor objAcc = c.newXMLObjectAccessor(accessLoc,TDOMObjectModel.getInstance());
TQuery q = TQuery.newInstance(“aSpecificQuery”);
TResponse r = objAcc.query(q);
TXMLObjectIterator it = r.getXMLObjetcIterator();
…
TXMLObject o = it.next();
Element elem = (Element)o.getElement();
…
c.close(); // close Connection
…
// do sth with the DOM elem
elem.setAttribute(“newAttribute”,“newAttributeValue”);
…
c = TConnectionFactory.getInstance().newConnection(database, user, passwd);
accessLoc = TAccessLocation.newInstance(coll);
objAcc = c.newXMLObjectAccessor(accessLoc,TDOMObjectModel.getInstance());
// to perform the update, instantiate a
// TXMLObject from the DOM-Element
o = TXMLObject.newInstance(elem);
objAcc.update(xmlObj);
c.close();
Problem:
The TXMLObject has no ino:id after the call to
newInstance(elem), though there is an ino:id attribute in the elem.
If I try o.setId(knownInoId), there is still no in:id in the TXMLObject.
The effect is, that the call to update() does not work as intended.
The attributes docname, doctype and collection are not set also.
Where ist the id (other attributes) after the call to newInstance(elem)?
Why does a call to xmlObj.setId() not work ?
I need the id to update the document, docname is not sufficient.
Any help is very much appreciated !
#webMethods#webMethods-Tamino-XML-Server-APIs#API-Management