Home Forums General XMetaL Discussion Xmetal -Attribute in MiniTemplate Reply To: Xmetal -Attribute in MiniTemplate

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;

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.