Home Forums General XMetaL Discussion Insert Entity With XML Markup Reply To: Insert Entity With XML Markup

Derek Read

Reply to: Insert Entity With XML Markup

Another thought… have you considered XInclude? I think that would be a pretty versatile solution for your needs, provided other tools you use support it as well (probably most importantly: anything that does your transformations for you, though we include an API that will write out a combined document with all XIncludes merged into the document they are referenced from).

This would require you to modify your Schema (to define the XInclude elements according to the XInclude spec) plus you would need to do some scripting to enable the feature and expose those actions you want your users to be able to perform.

If you wish to see this in action an example is included with a demo we are shipping for DocBook.
To see this demo:
1. Open the sample here: Help > Samples > Anatomy and Physiology (DocBook)
2.  Locate an (we have styled them in yellow) right click on it and select one of the three options we have exposed on the context menu ('Show/Hide XML Inclusion' and 'Open XML Inclusion Target').

The code for this demo is located here:
  C:Program FilesXMetaL 6.0AuthorRulesDocBook5.0xidocbookxi.mcr
  C:Program FilesXMetaL 6.0AuthorRulesDocBook5.0xidocbookxi.js

Note that although this demo uses the DocBook DTDs the feature itself (the APIs) should function for any DTD or Schema provided it supports the required elements (see here: http://www.w3.org/TR/xinclude/#syntax).

There are quite a few more APIs available than those exposed in the demo. Check the most recent Programmer's Guide and search for “xinclude” to find (probably all) information on them.

We don't attempt to provide a default GUI for working with XInclude for various reasons, but mostly because we felt that to function best this feature needs to be tailored to your authoring environment, workflow, business rules, exact user needs and possibly even tied into 3rd party systems. Implementing something out of the box might just get in the way of anyone that really needs it forcing them to disable some things and override or change others. So, we leave it up to the developer (for either XMetaL Author Essential, or Enterprise, or even XMAX customizations) to decide which XInclude functionality they wish to enable, how to expose it to the end user and exactly how and when it will function. This gives you full control over which to expose, how you want to expose them (via shortcut, menus, toolbars, context menu, or dialog, or perhaps even via the Resource Manager) and build a GUI that matches your user's exact needs.