Reply to: Trap links in Page Preview?May 16, 2014 at 10:32 pm
Hmmm. Still not exactly clear to me.
Does this mean the user would be clicking on an element inside an XML document in Tags On or Normal view to trigger this action?
If so, you'd probably just use the On_Click event for that. It should be easy enough to include code in On_Click that calls an external application (whatever is doing your transform) and when that app returns the rest of the code in On_Click could open the resulting file in an external copy of IE (or whatever external application you want to display it in).
If you need to have the resulting file render in Page Preview you could switch to that view when On_Click fires (ActiveDocument.ViewType = 3), but I'm not sure how easy it will be to change what is displayed in there. By default XMetaL creates a temp file which is then transformed using auto-generated XSLT (based on your CSS and the DTD itself) and the resulting file is rendered in the copy of IE embedded in Page Preview. I think you would probably need to rewrite the macro file multipleOutput.mcr in the Startup folder to do that. A lot of it may need to be rewritten.
If your users work with DITA files then this becomes more complex because switching to Page Preview in this case includes running the DITA Open Toolkit to perform the transformation.
Are you the creator of the CMS integration that connects XMetaL Author Enterprise to the CMS? If not, you may wish to request that they investigate this functionality.