Content

By default, the content of an element or custom marker is processed after the pre content user customisation and before the post content customisation . However, on occasion you may want to vary this behavior. The Mapping Editor Content tab allows element content to be scanned and optionally suppressed. This tab also allows the content to be assigned to a telltale, note or running head. You can also reference the scanned content within a tag customisation using either:

  • <content/> command;

  • {content} variable.

The choice depends on how you want to use the scanned content. Use the command form to pass the whole content, with all its structure, to a custom marker. So a mapping for a <personal-details> element might contain something like:

<if var="@age" test="not-less" target="18">
   <RegisterToVote><content/></RegisterToVote>
</if>

On the other hand, you might want to use the content as a string. For example the document fragment:

<graphic>MonaLisa</graphic>

doesn't have the right structure to drive the Image tab, which requires a filename in an attribute. We can fix this with the following custom markup:

<MyGraphic filename="{content}.jpg"/>

In this case there is no internal structure to worry about, so it's safe to treat the content as a string and assign it to a custom marker attribute. Note that if there had been internal structure, this would have been stripped. Thus the document fragment:

<quote><para>Fools rush in where <emph>angels</emph>
fear to tread.<link idref="q10427"/></para></quote>

would result in a {content} (in the quote mapping) of:

Fools rush in where angels fear to tread.
[Warning] Warning

You may only use <content/> or {content} if you have ticked the Scan element content selector in the Content tab.