Yes, that's the way to do it (I believe the code snippet you found was Derek's answer to my question). Add a macro to reload the image. In my case the image element name is imagedata:
<MACRO name="Reload Current Image" lang="JScript" desc="Custom macro." hide="false"><![CDATA[// XMetal Author JScript Macro File
if (rng.ContainerName == "imagedata") {
rng = ActiveDocument.Range;
rng.CollapsedContainerTags = true;
//Application.Alert("collapsed");
rng.CollapsedContainerTags = false;
}
]]></MACRO>
And then add an item to the contextual menu:
<MACRO name="On_Context_Menu" lang="JScript" hide="true"><![CDATA[var rng = ActiveDocument.Range;
var curNode = rng.ContainerNode;
if (rng.ContainerName=="imagedata" && rng.ContainerNode.hasAttribute("fileref")) {
Application.AppendMacro("&Reload Current Image","Reload Current Image");
}
]]></MACRO>
Now the user can right-click on the image and select "Reload Current Image".
Adjust for the names of the elements in your dtd.
David