throws SAXException,
SourceException,
ProcessingException,
IOException {
Source source = (Source) this.cachedsources.get(uri);
if (source==null) {
return;
}
try {
AttributesImpl attributes = new AttributesImpl();
attributes.addAttribute("", URI_ATTR_NAME, URI_ATTR_NAME,
"CDATA", source.getURI());
String name = source.getURI();
if (name.endsWith("://")) {
attributes.addAttribute("", NAME_ATTR_NAME,
NAME_ATTR_NAME, "CDATA", "");
} else if (name.endsWith("/")) {
name = name.substring(1, name.length()-1);
attributes.addAttribute("", NAME_ATTR_NAME,
NAME_ATTR_NAME, "CDATA",
name.substring(name.lastIndexOf("/")+
1, name.length()));
} else {
attributes.addAttribute("", NAME_ATTR_NAME,
NAME_ATTR_NAME, "CDATA",
name.substring(name.lastIndexOf("/")+
1, name.length()));
}
if ((source.getMimeType()!=null) &&
(source.getMimeType().length()>0)) {
attributes.addAttribute("", MIMETYPE_ATTR_NAME,
MIMETYPE_ATTR_NAME, "CDATA",
source.getMimeType());
}
if (source.getContentLength()>=0) {
attributes.addAttribute("", CONTENTLENGTH_ATTR_NAME,
CONTENTLENGTH_ATTR_NAME, "CDATA",
String.valueOf(source.getContentLength()));
}
if (source.getLastModified()>0) {
attributes.addAttribute("", LASTMODIFIED_ATTR_NAME,
LASTMODIFIED_ATTR_NAME, "CDATA",
String.valueOf(source.getLastModified()));
}
if (this.version && (source instanceof VersionableSource)) {
VersionableSource versionablesource = (VersionableSource) source;