General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Way to essentially #include .ctm and other customization files?

  • schwamkrug

    Way to essentially #include .ctm and other customization files?

    Participants 0
    Replies 1
    Last Activity 10 years ago

    I'm working on adding support for some in-house topic specializations. 90% of the .ctm files are the same, but there are a few differences between them. Is there a way I can essentially include a .ctm  file in another? What about the other customization files?

    Reply

    Derek Read

    Reply to: Way to essentially #include .ctm and other customization files?

    As of the 7.0 versions of XMetaL (XMetaL Author Enterprise, XMetaL Author Essential, XMAX)…

    CTM:
    There is no mechanism for importing portions of a CTM file into another CTM file. The one exception to this is if your CTM file contains script you may be able to use the same “eval()” method described below under MCR to read a string and use it in the script.

    CSS:
    The @import statement is supported for CSS files.

    MCR:
    If your scripts are written using JScript then you may use eval() to evaluate chunks of script (arbitrary strings that you build or read in from somewhere). You might use that in conjunction with the Application.FileToString() method or anything else that will allow you to create a string for use with eval(). VBScript has similar functionality (this would be useful to read http://blogs.msdn.com/b/ericlippert/archive/2003/09/20/53058.aspx). If you are using another scripting engine then you should check that language's documentation for similar functionality.

    A JScript example is included with the DocBook sample customization. The following file:
      C:Program FilesXMetaL 7.0AuthorRulesDocBook5.0xidocbookxi.mcr
    …reads the content of the following file has the JScript engine “evaluate” it:
      C:Program FilesXMetaL 7.0AuthorRulesDocBook5.0xidocbookxi.js

    XMetaL 7.0 supports a new mechanism for importing scripts into MCR files with an additional parameter but this is currently being tested and used internally and not yet documented in the XMetaL Developer help. This essentially results in a similar thing to the eval() though it is hoped that it will make debugging with some script debuggers function better.

    DTD:
    Standard DTD file referencing can be used (see W3C recommendations). Catalogs are supported for XMetaL Author (you would need to build catalog support into any XMAX container application yourself).

    XSD:
    Standard XSD file referencing can be used (see W3C recommendations).

    Reply

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

Lost Your Password?

Products
Downloads
Support