This class implements the xmldb:// pseudo-protocol and allows to get XML
content from an XML:DB enabled XML database.
| Field Summary |
|---|
| protected String | url | The requested URL |
| protected String | query | The part of URL after # sign |
| protected String | systemId | The System ID |
| protected static final String | URI | Static Strings used for XML Collection representation |
| protected static final String | PREFIX | |
| protected static final String | COLLECTIONS | Root element <collections> |
| protected static final String | QCOLLECTIONS | |
| protected static final String | RESOURCE_COUNT_ATTR | |
| protected static final String | COLLECTION_COUNT_ATTR | |
| protected static final String | COLLECTION | Element <collection> |
| protected static final String | QCOLLECTION | |
| protected static final String | RESOURCE | Element <resource> |
| protected static final String | QRESOURCE | |
| protected static final String | NAME_ATTR | |
| protected static final String | RESULTSET | Root element <results> |
| protected static final String | QRESULTSET | |
| protected static final String | QUERY_ATTR | |
| protected static final String | RESULTS_COUNT_ATTR | |
| protected static final String | RESULT | Element <result> |
| protected static final String | QRESULT | |
| protected static final String | RESULT_DOCID_ATTR | |
| protected static final String | RESULT_ID_ATTR | |
| protected static final String | CDATA | |
| Constructor: |
public XMLDBSource(Environment environment,
ComponentManager manager,
Logger logger,
String url) {
super(environment, manager, logger);
int start;
if ((start = url.indexOf('#")) != -1) {
this.url = url.substring(0, start);
this.query = url.substring(start + 1);
} else {
this.url = url;
}
}
Parameters:
environment - the Cocoon Environment.
url - the URL being queried.
driver - the XML:DB driver class name.
|
| Method from org.apache.cocoon.components.source.XMLDBSource Detail: |
public String getSystemId() {
return url;
}
|
public void recycle() {
this.log = null;
this.manager = null;
this.url = null;
this.query = null;
}
|
public void toSAX(ContentHandler handler) throws SAXException, ProcessingException {
if (url.endsWith("/"))
this.collectionToSAX(handler);
else
this.resourceToSAX(handler);
}
Stream SAX events to a given ContentHandler. If the requested
resource is a collection, build an XML view of it. |