Simple answer "yes". Detailed answer follows:
Firstly, there will be an upgraded TopLeaf plugin for XMetaL 7. This will allow custom markers both to have context and to be part of the context of normal elements (eg. when previously scanned material is re-used).
In the meantime there are several methods for tracking context indirectly. Simplest is to have a user defined variable
{Location} (or some such):
- In $document use
<set var="Location" string="topic">
to set the default value. - In frontmatter (or preface if you use that)
<stack var="Location" string="preface">
will temporarily change the value of {Location} to preface. We use stack rather than set so the value reverts when we leave the preface. - Same technique is used for appendix.
We can now use a
switch statement:
<switch>
<case var="Location" target="preface">
... handle preface levels ...
</case>
...
</switch>to take care of any special handling.
To say more I'd need to know more about your markup details. DITA is after all a very broad church and numerous variants are possible.
Let me know if this works for you, as there are alternatives if this doesn't suit.
Geoff