private void addSchemas(XMLReader reader) throws SAXNotRecognizedException,
SAXNotSupportedException {
StringBuffer namespaceResources = new StringBuffer();
Iterator schemas = this.schemas.iterator();
while (schemas.hasNext()) {
SchemaDefinition schema = (SchemaDefinition)
schemas.next();
// The namespace.
namespaceResources.append(schema.getNamespaceURL());
namespaceResources.append(" ");
// And the resource it maps to.
// TODO: schema resource names should be absolute already.
URL url = getClass().getResource("/" + schema.getResourceName());
if (url == null) {
throw new IllegalStateException("Resource not available:" +
schema.getResourceName());
}
namespaceResources.append(url.toExternalForm());
namespaceResources.append(" ");
}