Hi, I’ve used the following code to try to follow the example given in the zip file…
TConnectionFactory connectionFactory = TConnectionFactory.getInstance();
TConnection connection= connectionFactory.newConnection(dbconnect);
MessageDefaultHandler messageDefaultHandler = new MessageDefaultHandler();
DocumentDefaultHandler docDefHandler = new DocumentDefaultHandler(messageDefaultHandler);
ElementDefaultHandler elDefHandler = new ElementDefaultHandler(messageDefaultHandler);
TSAXObjectModel saxObjectModel = new TSAXObjectModel(“MessageSAXObjectModel”, Message.class, Message.class, docDefHandler, elDefHandler);
TXMLObjectModel.register(saxObjectModel);
TXMLObjectAccessor accessor = connection.newXMLObjectAccessor(TAccessLocation.newInstance(“cnews”), saxObjectModel);
TResponse resp = accessor.query(TQuery.newInstance(xql));
where cnews is the collection name an xql is the query ‘/NewsML’ for searching the root node of the XML document…
I have XML documents in the database and they are in the following format…
…
…
However, it prompts out the following Exception:
3com.softwareag.tamino.db.API.accessor.TQueryException Response could not be built NestedException:Response could not be built for XML access. NestedException:Interpreting the input stream for JDOM failed! NestedException:Error in building: null
How to solve this, thx
Actually, my aim is to retrive the value of Element A and the attribute values of C … hope I can do it quickly in using SAX
#API-Management#webMethods#webMethods-Tamino-XML-Server-APIs