use of org.mycore.common.content.MCRXMLContent in project mycore by MyCoRe-Org.
the class MCRToPrettyXML method transform.
@Override
public MCRContent transform(MCRContent source) throws IOException {
MCRXMLContent content;
try {
content = (source instanceof MCRXMLContent ? (MCRXMLContent) source : new MCRJDOMContent(source.asXML()));
} catch (JDOMException | SAXException e) {
throw new IOException(e);
}
if (content != source) {
content.setName(source.getName());
content.setLastModified(source.lastModified());
}
content.setFormat(Format.getPrettyFormat().setEncoding(getEncoding()));
return content;
}
Aggregations