Preserve Style and Format on Copy and Paste from External Applications

Styled content can be inserted in the Author editor by copying or dragging it from: The styles and general layout of the copied content like: sections with headings, tables, list items, bold, and italic text, hyperlinks, are preserved by the paste operation by transforming them to the equivalent XML markup of the target document type. This is available by default in the following predefined document types: DITA, DocBook 4, DocBook 5, TEI 4, TEI 5, XHTML.

For other document types the default behavior of the paste operation is to keep only the text content without the styling but it can be customized by setting an XSLT stylesheet in that document type. The XSLT stylesheet must accept as input an XHTML flavor of the copied content and transform it to the equivalent XML markup that is appropriate for the target document type of the paste operation. The stylesheet is set up by implementing the getImporterStylesheetFileName method of an instance object of the AuthorExternalObjectInsertionHandler class which is returned by the createExternalObjectInsertionHandler method of the ExtensionsBundle instance of the target document type.