General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Xmetal -Attribute in MiniTemplate
-
pooh2583 December 4, 2012 at 10:05 am
Xmetal -Attribute in MiniTemplate
December 4, 2012 at 10:05 amParticipants 2Replies 3Last Activity 10 years, 1 month agoHello,
I am making use of MiniTempate in my Xmetal aplication. for that I have written following code in .ctm file
Abstract
]]>
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.eAs 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 replyRegards
Derek Read December 4, 2012 at 4:18 pm
Reply to: Xmetal -Attribute in MiniTemplate
December 4, 2012 at 4:18 pmI 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)?pooh2583 December 5, 2012 at 4:10 am
Reply to: Xmetal -Attribute in MiniTemplate
December 5, 2012 at 4:10 amDerek Read December 13, 2012 at 9:58 pm
Reply to: Xmetal -Attribute in MiniTemplate
December 13, 2012 at 9:58 pmSorry, 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:
Para
]]>
2) Create a new file from the Journalist template in File > New.
3) Using the Element List insert aelement. 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. -
AuthorPosts
- You must be logged in to reply to this topic.