// handler, you can't set call marshaller.setDocType(String, String)
// See Also:
// https://issues.apache.org/jira/browse/PLUTO-312
// http://castor.org/javadoc/org/exolab/castor/xml/Marshaller.html#setDoctype(java.lang.String,%20java.lang.String)
Marshaller marshaller = new Marshaller(writer);
marshaller.setMapping(getCastorMapping());
// Use JAXP if we are instructed to do so.
LocalConfiguration castorConfig = LocalConfiguration.getInstance();
if (USING_JAXP) {
// empty string means "use JAXP" for Castor
castorConfig.getProperties().setProperty("org.exolab.castor.parser", "" );
castorConfig.getProperties().setProperty("org.exolab.castor.xml.serializer.factory",
"org.exolab.castor.xml.XercesJDK5XMLSerializerFactory" );
}
if (LOG.isDebugEnabled()) {
LOG.debug("Pluto descriptor service implementation using JAXP: [" + USING_JAXP + "]");
}
castorConfig.getProperties().setProperty("org.exolab.castor.indent", "true");
setCastorMarshallerOptions(marshaller, object);
marshaller.marshal(object);
} catch (IOException e) {
LOG.error(e.getMessage(), e);
throw e;
} catch (Exception e) {
LOG.error(e.getMessage(), e);