General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Edit Insert Table form

  • 4fingers

    Edit Insert Table form

    Participants 1
    Replies 2
    Last Activity 13 years ago

    Hi,

    I was just wondering if it were possible to edit the “Insert Table” form you see when you go to:
    Table -> Insert Table

    For example I would try and change the default width of the table to 480 and include a new drop down menu for any default values to be used on the TD elements e.g valign=top

    Thanks

    PS I have XMetaL Author Enterprise Edition.

    Reply

    Derek Read

    Reply to: Edit Insert Table form

    For XMetaL Author Enterprise the answer depends on which DTD/Schema is being used:

    Any DTD or Schema other than DITA:
    The Insert Table dialog is coded into the XMetaL Author application and cannot be modified (there are no externally exposed forms, or script). If this functionality is enabled it means your schema defines either CALS or HTML as the table model.

    If you need to display a custom form, or provide some other means for your users to insert tables that varies from what the product displays you could create your own form. This would be either an XFT file or something else like a VB DLL, etc, that would ultimately do the following to insert the table:

    • For CALS tables call the API InsertCALSTable() with appropriate parameters.
    • For HTML tables call the API InsertTable() with appropriate parameters.
    • Call some combination of InsertElement() and the various element and attribute manipulation APIs using Range objects to move around in a loop. This would probably be slow for large tables.
    • Use the DOM APIs we provide to build up a table (probably using DOMDocumentFragment) and then insert it using one of the DOM APIs that let you insert a node such as AppendChild() or InsertBefore().

    The last two would be most useful if the table type supported by your schema is not HTML or CALS, or if you need to build up a table that is not a simple grid (ie: has spanned cells), or that needs to populate some of the table cells with additional markup.

    If you want people to always insert the same type of table (ie: they don't get to pick how many rows or columns or anything else) you could create a far simpler solution by avoiding the form altogether and simply build the table using one of the methods above, or if it is really static you could basically just hard code the whole thing as a string in a script variable and then use the PasteString() API.

    Note: For XMetaL Author Essential the answer above applies even if you are editing DITA documents because that means you must have your own custom DITA editing solution installed and are most likely using the standard Insert Table dialog because XMetaL Author has automatically recognized that your DTD (DITA) defines CALS as the table model.

    DITA:
    We don't support making modifications to this part of the DITA functionality. However, the dialogs that are displayed for DITA are custom XFT forms and JScript so in theory you could hack them if you don't mind running an unsupported installation of the product.

    If there is a particular feature someone would like to see added to the DITA functionality please submit it to XMetaL Support as a feature request so it can be considered for a future release (assuming it makes sense for every user of the product).

    Reply

    4fingers

    Reply to: Edit Insert Table form

    Thanks Derek for your suggestions.

    I see there is a guide on how to create XMetaL Forms Toolkit (XFT) so I might give that a try.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support