Thanks. That works really well. I've set up my macro as shown below. This allows me to press F6 and enter the id from my references file. I've got one final problem to resolve so that this works the way I want. I would like to be able to change the location of the references file when I start XXE. I though I might be able to do this by using a catalog file but this doesn't seem to work. What am I doing wrong, or am I going the wrong way about this?
The catalog I tried was: catalog ----------- <?xml version="1.0" ?> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <uri name="catreferences.xml" uri="file:///D:/My%20Documents/DocBook/references.xml"/> </catalog> includeReference Macro ------------------------------------ <command name="includeReference"> <macro> <sequence> <command name = "prompt " parameter = '"Reference" "Enter ID"' /> <command name = "include" parameter = "into[useXInclude] catreferences.xml#%_" /> <command name = "moveDotTo" parameter = "nextElement" /> </sequence> </macro> </command> <binding> <keyPressed code="F6" /> <command name="includeReference" /> </binding> Hussein Shafie <hussein at pixware. fr> To Steve Butler <sbutler at planer.co.uk> 11/03/05 13:53 cc "xmleditor-support at xmlmind.com" <xmleditor-support at xmlmind.com> Please respond to Subject "xmleditor-suppor Re: [XXE] Setting up a macro t at xmlmind.com" command for xi:include <xmleditor-suppor t at xmlmind.com> Steve Butler wrote: > I have been trying to find a way around the fact that I cannot use > Entities for replacement text. I've read the tutorial with the VAT example > and pasting references and that works fine so I am almost there; it also > seems a well structured way to do this. What I want to do now, is set up > a macro command so that I can easily enter the reference while typing. > What I want to do is to be able to select the text where the caret is and > then convert it into the element id in the xpointer of an xi:include. The > href location would be predefined in the macro. > > So the macro would insert: > > <xi:include href="MyEntities.xml" > xmlns:xi="http://www.w3.org/2001/XInclude" > xpointer="element(SELECTED_TEXT_GOES_HERE)" /> > > The trouble is I don't know how, with the macro commands, to insert the > <xi:include. As the insert command from the menu will not let me insert an > xi:include (unless I'm missing something), I presume the insert macro > command will not either. In XXE, <xi:include> elements only exist at load/save time. Your macro-command must be based on the "include" command. See http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch06s23.html

