General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Xmetal -Attribute in MiniTemplate

  • pooh2583

    Xmetal -Attribute in MiniTemplate

    Participants 2
    Replies 3
    Last Activity 9 years, 10 months ago

    Hello,

    I am making use of MiniTempate in my Xmetal aplication. for that I have written following code in .ctm file

    also I have witten a JScipt, which inserts the following element with Minitempalte,i.e
    Var rng =ActiveDocument.Range;
    rng.InsertWithTemplate(“Abstract”);

    but when that Macro is run. the  element gets inserted with minitempate but attribute value is not getting inserted as per the Minitemplate
    i.e

    As shown above empty   element is created,but it doesnt have those attribute values in item element ,I want those default attribute value to be seen with the MiniTempalte, Like this

    Even My DTD allows the attribute Values

    How to achieve that?
    Please reply

    Regards

    Reply

    Derek Read

    Reply to: Xmetal -Attribute in MiniTemplate

    I don't see anything obviously wrong with this code.
    Which product do you have (XMetaL Author Enterprise, XMetaL Author Essential, XMAX) and which version (full version number)?

    Reply

    pooh2583

    Reply to: Xmetal -Attribute in MiniTemplate

    Hi,

    I am using Xmetal Author Enterprise, Version Xmetal 5.5 .

    Please reply

    Thanks and Regards

    Reply

    Derek Read

    Reply to: Xmetal -Attribute in MiniTemplate

    Sorry, took me a while to test this since 5.5 is an unsupported release (a reason to upgrade).

    I can't reproduce this issue with 5.5 or 6.0 (the earliest supported release). My test:

    1) Modify the Journalist.ctm file by changing the so that it contains the following:
       
    2) Create a new file from the Journalist template in File > New.
    3) Using the Element List insert a element. The following is inserted:

    4) Run a macro similar to yours:
    var rng =ActiveDocument.Range;
    rng.InsertWithTemplate("Para");

    Again, the same XML is inserted, including the @Id and value.

    I could not test with your scenario exactly as the Journalist DTD doesn't support the element you mention, called . I've substituted one of the children for that are defined instead. That seems like a very similar test, not requiring a change to the DTD.

    Check to see that what your mini template is inserting is in fact valid. That is really the only thing I can think of. However, in that case the child element will not be inserted at all and the fallback in that case (when InsertWithTemplate fails) is for XMetaL to insert the element using InsertElement() instead, so that you would end up with only.

    Reply

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

Lost Your Password?

Products
Downloads
Support