The AuthorExternalObjectInsertionHandler extension can be used to configure how URLs or XHTML fragments from external applications are handled when they are dropped or pasted in Author mode.
You can use a stylesheet to convert the pasted XHTML to your own XML vocabulary by overwriting the following method:
ro.sync.ecss.extensions.api.AuthorExternalObjectInsertionHandler.getImporterStylesheetFileName(AuthorAccess)
and return the file name of the stylesheet that will be applied. The path to the importer stylesheet must also be added in the Classpath tab in the Document Type configuration dialog box for your particular document type.
/**
* @see ro.sync.ecss.extensions.api.ExtensionsBundle#
createExternalObjectInsertionHandler()
*/
@Override
public AuthorExternalObjectInsertionHandler createExternalObjectInsertionHandler() {
return new DITAExternalObjectInsertionHandler();
} /**
* @see ro.sync.ecss.extensions.api.AuthorExternalObjectInsertionHandler#
getImporterStylesheetFileName(ro.sync.ecss.extensions.api.AuthorAccess)
*/
@Override
protected String getImporterStylesheetFileName(AuthorAccess authorAccess) {
return "xhtml2ditaDriver.xsl";
}