Scott Daley wrote: > > Best to illustrate my question via an example. > > Lets say I have one XML document that contains a list of dog breeds and > associated information for each breed (analagous to a data dictionary). > > I would like to constrain another document (say a vetinarian > registration card) so that along with other information, the breed > entered must be contained in the first XML document of dog breeds. Best > situation would be that I could intereact with XMLmind via the GUI to > open & select the desired breed from the list of breeds. The result > would be a link in the registration card document displaying the breed > name. Ideally, this would act as a URL & the user can press it to see > the full details of the breed in the breed list. > > Is this achievable in XMLmind via it's support of XInclude and > appropriate configuration (ie configuration files and a schema)? Or > would some sort of plug-in need to be written?
Thi problem cannot be solved by XInclude. XInclude is used to include part or all an external document inside another document. I don't think you want to include the list of dog breeds in the veterinarian registration card. You need to: * Write a DTD or XML schema which models the veterinarian registration card. * Write a CSS style sheet which styles the veterinarian registration card. * Write a XXE configuration file which associates the DTD/XML Schema and the CSS style sheet to veterinarian registration cards. * Write a command (insertBreed) which allows to open & select the desired breed from the list of breeds. * Write another command (viewBreed) which allows to follow the breed link inserted by command insertBreed. * The configuration file can be used to bind commands insertBreed and viewBreed to custom keyboard shortcuts, custom menu items or custom toolbar items. In your case, it is probably more convenient to directly embed a button trigerring command viewBreed inside the document view. Commands are written in Java (see http://www.xmlmind.com/xmleditor/_distrib/docs/dev/index.html). The code of this commands is dynamically loaded when needed to (that's why you may call these commands ``plug-ins'' but in our doc. the term plug-in is used for other types of dynamically loaded code: format plug-ins and XSL-FO processor plug-ins). We have at least a customer who had a very similar problem and who has solved it without programming in Java, just by writing a mix of process commands and macro commands (see http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/index.html). What follows is a macro-command which is close to insertBreed: =========================================== * I have added this to my customize.xxe. --- <cfg:command name="loadData"> <cfg:process> <cfg:read file="/home/hussein/tmp/list.dat" /> </cfg:process> </cfg:command> <cfg:command name="insertData"> <cfg:macro> <cfg:sequence> <cfg:command name="loadData"/> <cfg:command name="pick" parameter="Select true %_"/> <cfg:command name="paste" parameter="after[implicitElement] %_"/> </cfg:sequence> </cfg:macro> </cfg:command> <binding> <keyPressed code="F1" /> <command name="insertData" /> </binding> --- * my list.dat file is: --- "foo" "<?xml version='1.0'?><para>foo<xref linkend='foo'/></para>" "bar" "<?xml version='1.0'?><para>bar<xref linkend='bar'/></para>" "gee" "<?xml version='1.0'?><para>gee<xref linkend='gee'/></para>" --- ============================================== Something like list.dat could be generated on the fly from an XML file (example: the list of dog breeds) using a process command more complex than the above "loadData".

