Home Forums DITA and XMetaL Discussion How to add table caption? Reply To: How to add table caption?

Derek Read

Reply to: How to add table caption?

I can see how even my workaround would be quite annoying for people with requirements to always have the inserted. That, together with the fact that this code <i>seems</i> (note the emphasis) easily modified to support your need, I offer the following…</p> <p>For someone very familiar with scripting (perhaps partners already providing their own form of front line support for our products), that is not afraid to be using an unsupported installation of XMetaL Author Enterprise the script that performs the CALS table insertion is located in the following file (default installation on English Windows XP):</p> <p>C:Program FilesXMetaL 5.1AuthorDITAXACssharedDitaDocHandlerActions_Table.js</p> <p>The prototype function that inserts the table in this case is called “doTable” and could be modified using code similar to the following:</p> <p> if ( strElement == “table”) {<br /> rng.InsertCALSTable(intRows,intCols,strElement,blnHeader);<br /> //add two new lines to insert title element<br /> rng.MoveToElement(“table”,false);<br /> rng.InsertElement(“title”);<br /> rng.Select();<br /> rng = null;<br /> Dlg=null; return;<br /> }</p> <p>This is all offered in good faith. Please don't complain if it doesn't work. I've filed a feature request to officially add something like this (possibly to include a checkbox option) for a future release (we cannot say when, or if, a particular feature will be implemented).</p> <p>Such changes as described above are not unsupported and so I cannot actually officially recommend doing this. The code is there though, so I also cannot stop you from finding it. “Unsupported” basically means that if you make changes to any part of the DITA functionality and they don't work with the rest of the system you should simply back out the changes. This one seems fairly safe but has obviously not undergone any form of testing on our side. Make sure you test any changes you make before deployment to anyone for anything but testing purposes (ie: to production systems). Even then, you really are on your own.</p> <p>And as stated previously, the DITA functionality is a closed system and so we may alter any code in future releases. Our installers may not detect changes to files considered to be “owned” by our installation, so any such changes might be lost (and might need to be reimplemented) if you do an installation Repair, Uninstall then Install, or an upgrade to a newer release, including patches.