General XMetaL Discussion
pooh2583 December 4, 2012 at 10:05 am
Xmetal -Attribute in MiniTemplateDecember 4, 2012 at 10:05 amParticipants 2Replies 3Last Activity 10 years, 1 month ago
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;
but when that Macro is run. the element gets inserted with minitempate but attribute value is not getting inserted as per the Minitemplate
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?
RegardsDerek Read December 4, 2012 at 4:18 pm
Reply to: Xmetal -Attribute in MiniTemplateDecember 4, 2012 at 4:18 pm
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)?pooh2583 December 5, 2012 at 4:10 am
Reply to: Xmetal -Attribute in MiniTemplateDecember 5, 2012 at 4:10 am
I am using Xmetal Author Enterprise, Version Xmetal 5.5 .
Thanks and RegardsDerek Read December 13, 2012 at 9:58 pm
Reply to: Xmetal -Attribute in MiniTemplateDecember 13, 2012 at 9:58 pm
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;
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
- You must be logged in to reply to this topic.