<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>oXygen XML Editor Blog</title>
</head>
<body>
<style type="text/css">

                        h1 a:hover {background-color:#888;color:#fff ! important;}

                        div#emailbody table#itemcontentlist tr td div ul {
                                        list-style-type:square;
                                        padding-left:1em;
                        }
        
                        div#emailbody table#itemcontentlist tr td div blockquote {
                                padding-left:6px;
                                border-left: 6px solid #dadada;
                                margin-left:1em;
                        }
        
                        div#emailbody table#itemcontentlist tr td div li {
                                margin-bottom:1em;
                                margin-left:1em;
                        }


                        table#itemcontentlist tr td a:link, table#itemcontentlist tr td a:visited, table#itemcontentlist tr td a:active, ul#summarylist li a {
                                color:#000099;
                                font-weight:bold;
                                text-decoration:none;
                        }       

                        img {border:none;}


                </style>
<div xmlns="http://www.w3.org/1999/xhtml" id="emailbody" style="margin:0 2em;font-family:Georgia,Helvetica,Arial,Sans-Serif;line-height:140%;font-size:13px;color:#000000;">
<table style="border:0;padding:0;margin:0;width:100%">
<tr>
<td style="vertical-align:top" width="99%">
<h1 style="margin:0;padding-bottom:6px;">
<a style="color:#888;font-size:22px;font-family:Arial, Helvetica, sans-serif;font-weight:normal;text-decoration:none;" href="http://blog.oxygenxml.com/" title="(http://blog.oxygenxml.com/)">[oXygen XML Editor Blog] - How Special Paste works in Oxygen</a>
</h1>
</td>
<td width="1%" />
</tr>
</table>
<hr style="border:1px solid #ccc;padding:0;margin:0" />
<table id="itemcontentlist">
<tr xmlns="">
<td style="margin-bottom:0;line-height:1.4em;">
<p style="margin:1em 0 3px 0;">
<a name="1" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;" href="http://feedproxy.google.com/~r/AboutOxygenXmlEditor/~3/8aMRl4DpDek/how-special-paste-works-in-oxygen.html?utm_source=feedburner&amp;utm_medium=email">How Special Paste works in Oxygen</a>
</p>
<p style="font-size:13px;color:#555;margin:9px 0 3px 0;font-family:Georgia,Helvetica,Arial,Sans-Serif;line-height:140%;font-size:13px;">
<span>Posted:</span> 28 Oct 2015 04:48 AM PDT</p>
<div style="margin:0;font-family:Georgia,Helvetica,Arial,Sans-Serif;line-height:140%;font-size:13px;color:#000000;"><div class="body">    <p class="p">If you've worked with one of the <strong class="ph b">XML</strong> vocabularies for which Oxygen has out of the box       support like <strong class="ph b">DITA</strong>, <strong class="ph b">Docbook</strong>, <strong class="ph b">TEI</strong>, <strong class="ph b">XHTML</strong> you've probably already       used the support Oxygen has for converting content pasted in the application from external       applications like <strong class="ph b">Microsoft Word</strong>, <strong class="ph b">Excel</strong> or from any <strong class="ph b">web browser</strong>. This is       a very useful feature for converting various types of content to XML because it preserves and       converts styling, links, lists, tables and image references. </p>     <p class="p">The feature relies on the fact that when copying content in the applications mentioned above,       they set in the clipboard the HTML equivalent of the copied content. So all Oxygen has to do       is clean up that HTML, make it wellformed XHTML and apply conversion XSLT stylesheets over       it.</p>     <p class="p">This support is not hardcoded and anybody who is developing an <a class="xref" href="http://blog.oxygenxml.com/2014/08/the-oxygen-sdk-part-2-frameworks.html" target="_blank">Oxygen framework customization</a> for a certain XML vocabulary can       provide conversion stylesheets for external pasted HTML content.</p>     <div class="p">I will describe how this works for the <strong class="ph b">DITA</strong> framework and you can do the same for       yours. You can also use this information to modify the way in which smart paste works for the       bundled framework configurations.<ol class="ol" id="topic_c3q_lqd_vt__ol_hpf_cc2_vt">        <li class="li">In the <span class="ph uicontrol">Preferences-&gt;Document Type Association</span> page you can choose           to edit (or extend) the <strong class="ph b">DITA</strong> document type association.</li>         <li class="li">In the <strong class="ph b">Extensions</strong> tab the <strong class="ph b">Extensions bundle</strong> implementation is set to             <strong class="ph b">DITAExtensionsBundle</strong> which resides in the <strong class="ph b">DITA</strong> Java extensions archive             <strong class="ph b">dita.jar</strong>.</li>         <li class="li">The <strong class="ph b">DITAExtensionsBundle</strong> is an extension of the <a class="xref" href="https://www.oxygenxml.com/doc/versions/17.0/ug-editor/index.html#tasks/dg-extensions-bundle.html" target="_blank"><strong class="ph b">ExtensionsBundle</strong></a> API and it provides its           own external object extension           handler:<pre class="pre codeblock language-java">  <span class="hl-tag" style="color: #3f5fbf">/**<br />   * @see ro.sync.ecss.extensions.api.ExtensionsBundle#createExternalObjectInsertionHandler()<br />   */</span><br />  <em><span class="hl-annotation" style="color: gray">@Override</span></em><br />  <strong class="hl-keyword" style="color:#7f0055">public</strong> AuthorExternalObjectInsertionHandler createExternalObjectInsertionHandler() {<br />    <strong class="hl-keyword" style="color:#7f0055">return</strong> <strong class="hl-keyword" style="color:#7f0055">new</strong> DITAExternalObjectInsertionHandler();<br />  }</pre></li>         <li class="li">The <strong class="ph b">DITAExternalObjectInsertionHandler</strong> extends the base class <a class="xref" href="https://www.oxygenxml.com/InstData/Editor/SDK/javadoc/ro/sync/ecss/extensions/api/AuthorExternalObjectInsertionHandler.html" target="_blank"><strong class="ph b">AuthorExternalObjectInsertionHandler</strong></a> and           provides a reference to its specific conversion             stylesheet:<pre class="pre codeblock language-java">  <span class="hl-tag" style="color: #3f5fbf">/**<br />   * @see ro.sync.ecss.extensions.api.AuthorExternalObjectInsertionHandler#getImporterStylesheetFileName(ro.sync.ecss.extensions.api.AuthorAccess)<br />   */</span><br />  <em><span class="hl-annotation" style="color: gray">@Override</span></em><br />  <strong class="hl-keyword" style="color:#7f0055">protected</strong> String getImporterStylesheetFileName(AuthorAccess authorAccess) {<br />    <strong class="hl-keyword" style="color:#7f0055">return</strong> <span class="hl-string" style="color:#2a00ff">"xhtml2ditaDriver.xsl"</span>;<br />  }</pre><div class="note note"><span class="notetitle">Note:</span> The               <strong class="ph b">Extensions</strong> tab also allows you to specify the external object insertion handler             as a separate extension.</div></li>         <li class="li">In the same <strong class="ph b">Document Type</strong> edit dialog in the <strong class="ph b">Classpath</strong> tab you will see           that there is a reference to a framework-specific resources folder             like:<span class="ph filepath">${framework}/resources/</span></li>         <li class="li">If you look on disk in the DITA framework <strong class="ph b">resources</strong> folder:             <span class="ph filepath">"OXYGEN_INSTALL_DIR\frameworks\dita\resources"</span> you will find the             <strong class="ph b">xhtml2ditaDriver.xsl</strong> stylesheet there. The stylesheet imports various other           stylesheets which you could probably fully reuse and which apply various cleanups on HTML           produced with MS Word. It also handles the conversion between the pasted HTML content and           DITA so it is a good starting point, you can copy the entire set of XSLT stylesheets to           your framework and use those as a starting point.</li>       </ol></div>   </div><img src="http://feeds.feedburner.com/~r/AboutOxygenXmlEditor/~4/8aMRl4DpDek?utm_source=feedburner&utm_medium=email" height="1" width="1" alt=""/></div>
</td>
</tr>
</table>
<table style="border-top:1px solid #999;padding-top:4px;margin-top:1.5em;width:100%" id="footer">
<tr>
<td style="text-align:left;font-family:Helvetica,Arial,Sans-Serif;font-size:11px;margin:0 6px 1.2em 0;color:#333;">You are subscribed to email updates from <a href="http://blog.oxygenxml.com/">oXygen XML Editor Blog</a>.<br />To stop receiving these emails, you may <a href="https://feedburner.google.com/fb/a/mailunsubscribe?k=y_tRXtumvTurKTedh51JnlYsGXw">unsubscribe now</a>.</td>
<td style="font-family:Helvetica,Arial,Sans-Serif;font-size:11px;margin:0 6px 1.2em 0;color:#333;text-align:right;vertical-align:top">Email delivery powered by Google</td>
</tr>
<tr>
<td colspan="2" style="text-align:left;font-family:Helvetica,Arial,Sans-Serif;font-size:11px;margin:0 6px 1.2em 0;color:#333;">Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States</td>
</tr>
</table>
</div>
</body>
</html>