Hello, I am try to delete a >(root) document, but get the error XMLObject has no ino:id
First:
1)I setup a TXQuery to select the expected Document
2) Get baxk a XMLObject
3) try to delete by accessor.delete(XMLObject ) to remove the Document
4) Tamino complains : TXMLObject instance does not have an ino:id
Question
What should i do to get the Document deleted (is there a easy way to delete the Document with out changing the Document definition)??
Blease could you also show a example ?tarzisius.reolon@unisys.com" target="_blank" rel="noopener nofollow ugc">Tamino deleting document
Example of the java methode
sb.append(“declare namespace tf = ‘http://namespaces.softwareag.com/tamino/TaminoFunction’ \n”);
sb.append(“declare namespace xf = ‘W3C XQuery 1.0 and XPath 2.0 Functions and Operators’ \n”);
sb.append(“declare namespace xs = ‘XML Schema’ \n”);
sb.append(“for $q in input()/”);
sb.append(docType);
sb.append(“\n”);
sb.append(“let $a := $q/metadata/lastLoadDate \n”);
sb.append(“let $b := $q/metadata/public \n”);
sb.append(“where xf:string($b) = ‘false’ and $a > xs:dateTime('”);
sb.append(df.format(notUsedDate));
sb.append(“') \n”);
sb.append(“return ($q) \n”);
String sQuery = sb.toString();
int count = 0;
TConnection con = null;
TXMLObjectAccessor accessor = null;
TXMLObject xmlDoc = null;
StringWriter w = new StringWriter();
boolean bo = false;
TResponse resp = null;
try {
con = getConnection();
accessor = getStreamAccessor(con);
resp = accessor.xquery(new TXQuery(sb.toString()));
bo = resp.hasFirstXMLObject();
if (bo == false) {
return count;
}
}
catch (TXQueryException ex1) {
ErrorObject eo = new ErrorObject(this.LAYER, this.BEAN, 11,
sQuery,
“\nXQueryException=<” +
ex1.getClass().getName() + “>” +
“\nMessage=” + ex1.getMessage());
log.error(eo);
try {
con.close();
}
catch (TConnectionCloseException ex) {}
throw new FvzException(eo);
}
TNonXMLObjectIterator tnxIt = resp.getNonXMLObjectIterator() ; //TEST 30-03-2004
TXMLObjectIterator txIt = resp.getXMLObjectIterator();
count = txIt.getCount();
while (txIt.hasNext()) {
try {
xmlDoc = (TXMLObject) txIt.next();
accessor.delete(xmlDoc);
}
catch (TIteratorException ex2) {
ErrorObject eo = new ErrorObject(this.LAYER, this.BEAN, 12,
"delUnusedQueryHitsDoc() " + docType +
" ",
“TIteratonException Message=” +
ex2.getMessage());
log.error(eo);
throw new FvzException(eo);
}
catch (TNoSuchXMLObjectException ex2) {
ErrorObject eo = new ErrorObject(this.LAYER, this.BEAN, 13,
"delUnusedQueryHitsDoc() " + docType +
" ",
“TNoSuchXMLObjectException Message=” +
ex2.getMessage());
log.error(eo);
throw new FvzException(eo);
}
catch (TDeleteException ex3) {
ErrorObject eo = new ErrorObject(this.LAYER, this.BEAN, 14,
"delUnusedQueryHitsDoc() " + docType +
" ",
“TDeleteException Message=” +
ex3.getMessage());
log.error(eo);
throw new FvzException(eo);
}
#API-Management#webMethods-Tamino-XML-Server-APIs#webMethods