public void toSAX(ContentHandler handler) throws QueryException {
throw new NotSupportedException("Not implemented");
}
public DocumentTable toDocumentTable() throws QueryException {
Collection col = rs.getCollection();
TableBuilder tb;
try {
tb = new TableBuilder(col.getSymbols());
}
catch ( DBException e ) {
throw new NotSupportedException(e);
}
tb.addEntry(Constants.OBJ_BEGIN_DOCUMENT);
int rootID = tb.addEntry(Constants.OBJ_BEGIN_ELEMENT, QNAME_RESULTS);
// Namespace
int attrID = tb.addEntry(Constants.OBJ_BEGIN_ATTRIBUTE, QNAME_NSDEF);
tb.addEntry(Constants.OBJ_TEXT, UTF8_URI);
tb.addEntry(Constants.OBJ_END_ATTRIBUTE, attrID);
// Collection
attrID = tb.addEntry(Constants.OBJ_BEGIN_ATTRIBUTE, QNAME_COL);
tb.addEntry(Constants.OBJ_TEXT, UTF8.toUTF8(col.getCanonicalName()));
tb.addEntry(Constants.OBJ_END_ATTRIBUTE, attrID);
int count = rs.getCount();
if ( count != -1 ) {
attrID = tb.addEntry(Constants.OBJ_BEGIN_ATTRIBUTE, QNAME_COUNT);
tb.addEntry(Constants.OBJ_TEXT, UTF8.toUTF8(Integer.toString(count)));
tb.addEntry(Constants.OBJ_END_ATTRIBUTE, attrID);
}
while ( rs.next() ) {
Collection c = rs.getResultCollection();
int resID = tb.addEntry(Constants.OBJ_BEGIN_ELEMENT, QNAME_RESULT);
if ( c != col ) {
// Alternate Collection
attrID = tb.addEntry(Constants.OBJ_BEGIN_ATTRIBUTE, QNAME_COL);
tb.addEntry(Constants.OBJ_TEXT, UTF8.toUTF8(c.getCanonicalName()));
tb.addEntry(Constants.OBJ_END_ATTRIBUTE, attrID);
}
Key key = rs.getResultKey();
if ( key != null && key.getLength() > 0 ) {
// Key