How to delete all NonXML documents from a collection?

I created a collection (no schema) and added bunch of XML and NonXML documents. The NonXML Documents gets added into ino:nonXML automatically in that collection.

Now how can I delete all the NonXML documents using JAVA API? Any code samples would help.

Thanks.

Hi,

just issue an XQuery statement in the following
form:

declare namespace ino=“http://namespaces.softwareag.com/tamino/response2
update delete input()/ino:nonXML/…

I tried this but get the following error:

Delete NonXML failed with:com.softwareag.tamino.db.API.common.TAccessFailureException( message: Tami
no access failure (8320, INOXIE8320, Error parsing the XQL query, Unexpected token namespace found,
expected was End of query), tag: JavaTaminoAPI_4_2_0_53, java: 1.4.2_06, os: Windows XP 5.1 ):

Any Clues?? Here’s what my code looks like


String qry = “declare namespace ino="http://namespaces.softwareag.com/tamino/response2\”";
qry += “update delete input()/ino:nonXML/…”;

TQuery query = TQuery.newInstance(qry);
try {
// Invoke the query operation.
nxAccessor_.query(query);

} catch (TQueryException queryException) {
System.out.println(“Couldn’t Delete NonXML Articles from Tamino DB.”);

TAccessFailureMessage accessFailure = queryException.getAccessFailureException();
if ( accessFailure != null )
System.out.println(“Delete NonXML failed with:” + accessFailure);
else
System.out.println(“Delete NonXML failed:” + queryException.getMessage());
}

Hi,
Because you are issuing an XQuery, you need to use a TXQuery object, not a TQuery, like this:

TXQuery query = TXQuery.newInstance(qry);
// Invoke the query operation.
TResponse response = accessor.xquery(query);
...
catch...TXQueryException....


HTH