Hello Jazz,
I’m afraid that I’m not sure I understand your question entirely.
The exact code required will depend upon the Object Model that you decide to use, but with the Tamino API for Java and the DOM object model you can do something like this:
TConnection connection = TConnectionFactory.getInstance().newConnection(databaseURI);
TXMLObjectAccessor accessor = connection.newXMLObjectAccessor( TAccessLocation.newInstance( collection ), TJDOMObjectModel.getInstance() );
TQuery query = TQuery.newInstance("/Telephone");
TResponse response = accessor.query(query);
TXMLObjectIterator iterator = response.getXMLObjectIterator();
TXMLObject xmlObject = null;
while ( iterator.hasNext() ) {
xmlObject = iterator.next();
xmlObject.writeTo(System.out);
}
connection.close();
The result of the XPath query “/Telephone” is all the Telephone documents, which could be considered a collection of elements and attributes.
If the query were “/Telephone/LoginName” then the results would be the LoginName elements from the Telephone documents. (Which can then be iterated in the same manner.)
Is this of any help?
Cheers,
Trevor.
#webMethods#API-Management#webMethods-Tamino-XML-Server-APIs