On 02/02/2012 07:06 PM, Moshagen Sjur Nørstebø wrote: > > We would like to use XXE to edit a number of terminology collections, > dictionaries and other language resources. One of our goals for this editing > setup is to avoid duplication of information. To achieve this the idea is to > define an entry once, and only use pointers to this entry whenever it is > referenced. Each entry has an ID, which is directly derived from the entry > word(s), to make the ID interpretable and understandable by humans. > > From time to time these ID's will have to change for various reasons. The > question is: > > Is it possible to make XXE automatically update all references to an ID that > is changed? Within the same document?
The only idea which comes to my mind can be described as follows: * Let's suppose the ID of an entry is an attribute. * The author must not use the normal editing tools (that is, the Attributes tool) when she/he wants to change an ID. * Instead, she/he must use a custom command which, at the same time, will change ID1 to ID2 and will update all the references to ID1. > Across documents, if the referencing documents are defined within the source > document? No, I don't see how this could be done from within XXE. > If yes, what do I need to do in my configuration to make this happen? It's quite easy to write a command in Java which would implement the above idea. Otherwise, may be an advanced, interactive (that is, prompting the user for ID2) macro-command can do it. Such macro-command would be quite challenging to write and that's why we cannot recommend following that path. Once the custom command has been written, you must declare it in your XXE configuration file and associate it to a toolbar button, menu item or keystroke. References: * http://www.xmlmind.com/xmleditor/_distrib/doc/commands/concepts.html * http://www.xmlmind.com/xmleditor/_distrib/doc/commands/writing_macros.html * http://www.xmlmind.com/xmleditor/_distrib/doc/configure/config_file.html * http://www.xmlmind.com/xmleditor/_distrib/doc/configure/toolBar.html * http://www.xmlmind.com/xmleditor/_distrib/doc/configure/menu.html * http://www.xmlmind.com/xmleditor/_distrib/doc/configure/binding.html > > I have tried to find an answer to this/these question(s) in the online > documentation and other resources, but haven't been able to find anything. > I'm afraid that XXE has not been designed to accomplish this kind of task. To my knowledge, this kind of task -- automatically maintaining referential integrity -- is out of the scope of XML editors. An external script (e.g. XSLT or XQuery Update) is probably a better choice. -- XMLmind XML Editor Support List [email protected] http://www.xmlmind.com/mailman/listinfo/xmleditor-support

