Home Forums General XMetaL Discussion List of XM processing instructions Reply To: List of XM processing instructions

Derek Read

Reply to: List of XM processing instructions


Our philosophy is to keep the XML produced by our products as clean as possible. Historically we've thought long and hard when and if to use PIs to implement any particular feature.

Types of PIs Recognized by XMetaL Author (and XMAX):

There are only two cases I can think of where XMetaL Author uses PIs: for “replacement text” (essentially an “insert text here” prompt that sits inline in a document) and for the Change Tracking feature built into XMetaL Author (aka: Revision Marking).


The format of replacement text is somewhat configurable. Typically this is done inside the customization's CTM file (ie: when element X is inserted, include replacement text to prompt the user to fill it in properly), or when creating an XML template, but these types of PIs can be inserted at any time (via scripting using APIs for example). To be recognized, the PI's target must be “xm-replace_text” while the PI's data can be anything validly contained within a PI's data ([url=http://www.w3.org/TR/xml/#sec-pi]W3C XML Recommendation – Processing Instructions[/url]). The text contained within the data section is what will be rendered in the document as the text “prompt”. The data section of the PI follows the first whitespace though it may itself contain whitespaces.

The format of the Change Tracking PIs is not configurable.


Replacement Text:

Change Tracking Deletion:
[code]data=”<p>this is a deletion</p>”?>[/code]

Change Tracking Insertion:

this is an insertion


Other Types of PIs:

Author Created:
Document authors are free to insert their own PIs. In this case pretty much anything goes. These will do nothing in XMetaL Author (or XMAX) unless they match one of the formats above or the customization currently loaded contains special code to handle them. The most likely use-case for these would be to insert a PI that is used by other software. For example, a transformation engine might support specific PIs, or a browser you are targeting might support the [url=http://www.w3.org/TR/xml-stylesheet/]W3C xml-stylesheet PI[/url].

Developer Created:
Customization developers may decide their customization warrants the use of PIs. In this case they are free to make up their own target and data values. These PIs will not have any special meaning to XMetaL Author (or XMAX) unless the customization is programmed to recognize them and triggers certain actions using the many events and APIs available in the product.

Note: if you use XMetaL Author together with XMetaL Reviewer that product (Reviewer) uses PIs to track changes, comments, and other things when the two products are communicating. These PIs are typically removed when saving the document to another location (outside of Reviewer) and so other applications will never see them.