1 22 23 28 29 package org.xquark.xquery.xdbc; 30 31 import org.xml.sax.SAXException ; 32 import org.xml.sax.helpers.AttributesImpl ; 33 import org.xquark.xml.xdbc.XMLDBCException; 34 import org.xquark.xml.xdbc.XMLResultSet; 35 36 public class XMLDocumentImpl extends AbstractXMLDocument 37 { 38 private static final String RCSRevision = "$Revision: 1.1 $"; 39 private static final String RCSName = "$Name: $"; 40 41 private XMLResultSet xmlResultSet = null; 42 private String namespace = null; 43 private String localName = null; 44 private String qName = null; 45 46 47 public XMLDocumentImpl(XMLResultSet xmlResultSet, String namespace, String localName, String qName) 48 { 49 super(true); 50 this.xmlResultSet = xmlResultSet; 51 this.namespace = namespace; 52 this.localName = localName; 53 this.qName = qName; 54 } 55 56 64 public void getAsSAX() throws XMLDBCException, SAXException 65 { 66 if (contentHandler != null) 67 xmlResultSet.setContentHandler(contentHandler); 68 if (errorHandler != null) 69 xmlResultSet.setErrorHandler(errorHandler); 70 if (lexicalHandler != null) 71 xmlResultSet.setLexicalHandler(lexicalHandler); 72 contentHandler.startDocument(); 73 contentHandler.startElement(namespace, localName, qName, new AttributesImpl ()); 74 while (xmlResultSet.hasNext()) 75 xmlResultSet.nextAsSAX(); 76 contentHandler.endElement(namespace, localName, qName); 77 contentHandler.endDocument(); 78 } 79 80 } 81 | Popular Tags |