Customizing Smart Paste Support
The Smart Paste feature preserves certain style and structure information when copying content from some of the most common applications and pasting into document types that support Smart Paste in Oxygen XML Editor. For other document types, the default behavior of the paste operation is to keep only the text content without the styling.
The style of the pasted content can be customized by editing an XSLT stylesheet for a particular document type (framework). The XSLT stylesheet must accept an XHTML flavor of the copied content as input, and transform it to the equivalent XML markup that is appropriate for the target document type of the paste operation.
How to Customize the Smart Paste Mapping
To customize the mapping between the markup of the copied content and the markup of the pasted content for a particular document type, follow these steps:
- Make sure the particular framework contains a folder named
resources
in the following path structure:[OXYGEN_INSTALL_DIR]/frameworks/[Document Type]/resources
- Create an XSLT file named
xhtml2content.xsl
and save it in theresources
folder for the particular framework.For example:
[OXYGEN_INSTALL_DIR]/frameworks/dita/resources/xhtml2content.xsl
- Add your customized styling in the XSLT file.
- You can test modifications done in the stylesheet by pasting content without having to restart Oxygen XML Editor.
Result: When you paste content from external applications (such as a web browser or
and Office document) to a document that is opened in Author mode, and
that matches the particular framework, the styling from the
xhtml2content.xsl
stylesheet will be applied on the clipboard
contents.