Reply to: Using variables in XMetal (a.k.a. keywords?)October 16, 2015 at 7:55 pm
Do you have a specific schema you plan to work with?
DITA for example, defines a few things that may give you what you are looking for, and these are supported by XMetaL Author Enterprise and the DITA Open Toolkit. The DITA authoring solution included with XMetaL Author Enterprise has an extensive user interface dedicated to helping you create and manage these.
If you plan to use DITA look up these topics in the Help:
Working with DITA > Content references
Working with DITA > Conditional text
Working with DITA > Key references
You mention “keywords”, which is also part of the DITA specification and supported by XMetaL Author Enterprise. Given the rest of your post, I don't think these are what you are after. I suspect you may have been told about “key references”. As these can be confusing for someone new to DITA you may wish to start with “content references”. You may find that they do not meet your needs and that you need something more powerful, at which point you might decide “key references” are what you need.
Some schemas (like DocBook) support an XML standard called “XML Inclusion” (aka: XInclude). XMetaL Author supports this standard (as well as XPointer, which is related to XInclude) but to use XML inclusions in your XML your schema must define the appropriate elements as defined by the W3C XML Inclusion Recommendation. This means you can use it with any schema provided that schema defines the elements, or provided you can alter the schema to define them.
People will use these in different ways so they may require a specific user interface for helping their users to work with them. For that reason XMetaL Author does not include a predefined interface for this. Instead, several APIs are available for building a UI your users might require. In general you can work with these as you would with any other element and its associated attributes using the Element List and Attribute Inspector however (if you don't require specific functionality). The APIs specific to XInclude are documented in the XMetaL Developer Programmers Guide.
The DocBook sample customization included with XMetaL Author demonstrates one way you might use XInclude. To see that in action open the “Anatomy and Physiology” sample or the “Hello World in MMIX” sample. These are listed in the Help menu under Samples. Right clicking on an
For more information on the standard see http://www.w3.org/TR/xinclude/
XML (in general) defines several types of entities. These can reference text or files. Entities are part of the XML Recommendation and as such are supported in any document without specific requirements needed in the schema. I would strongly recommend not using them with any schema that defines an alternative option (such as those listed above). They are generic in nature (which can be both a good and bad thing) but for any schema that has defined an alternative that alternative will generally have advantages over entities (otherwise the alternative would not have been invented) and the alternative will also be better supported by any tools designed to work specifically with that schema.
See this topic and the topics it links to: Authoring structured content > Working with entities
See also sections 4 through 4.6 in the XML Recommendation: http://www.w3.org/TR/xml/#sec-physical-struct