Pages: 1
Print
Author Topic: Copy and paste into DITA  (Read 1933 times)
gcrews
Member

Posts: 265


« on: February 21, 2013, 12:18:36 PM »

XMetaL(R) Author Enterprise 7.0
Version#: 7.0.0.111

Is it possible to modify copy and pasted code from an HTML webpage? Specifically, I want to be able to “map” an HTML tag to a DITA on a copy and paste operation. For example, change <code> to <codeph> instead of stripping the tag out.  I created the following macro but the DropText only seems to only contain text and no tags or anything.

Code:
<MACRO name="On_Application_Document_Before_DropText" hide="true" lang="JScript" id=""><![CDATA[
function dropTextMod () {
var strDrop = ActiveDocument.DropText;
Application.Alert(strDrop);
}
dropTextMod();
]]></MACRO>
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: February 21, 2013, 01:59:05 PM »

Since there is already HTML conversion in our DITA functionality it would probably be best (though dangerous) to extend the existing code using your own logic. That way there is a greater chance that your code will work. Of course this would be unsupported since this part of the system is considered closed.

Note that the current code is quite messy. The initial design and logic was migrated from another project and then because end users should never see it it was never "made nice". So, there are things in there that do nothing and probably some questionable logic as well. Ultimately I'd like to see it rewritten so that it is possible for people like yourself to inject additional logic, but since it is "good enough" that might be a hard sell.
« Last Edit: February 21, 2013, 02:06:33 PM by Derek Read » Logged
Pages: 1
Print
Jump to:  

email us