Home Forums DITA and XMetaL Discussion Convert <table> to <simpletable> Reply To: Convert <table> to <simpletable>


Reply to: Convert <table> to <simpletable>

I'll write that xslt if you'll write the script. I'm envisioning an XMetaL macro that runs a xslt on the currently selected content and replaces the selection with the result of the xslt. It would also need to obfuscate entity reference before running the xslt on the xml (e.g. change &foo; to @@foo; before running the xslt, then @@foo; back to &foo; after running the xslt…it would be up to the user to understand the limitation that the content of the entity won't be processed). Another possibility would be to run the xslt on the currently selected content and then put the result of the xslt in the clipboard. The the user can either past over the current contents or move it somewhere else (e.g. if you've converted the element into something that is not valid in the current context).

Bonus points if I can make it use Saxon 9 as the xslt processor (and so use xslt 2.0)

Then I could give my users “Convert X to Y” macros powered by simple xslts.