following a short discussion in this list from the year 1995, I
discovered that I could use the element <eg> in combination with a CDATA
section for the purpose of encoding a chunk of source code from any
given programming language. (see:
* Once you are done trying to ‘optimize’ this routine,
* and have realized what a terrible mistake that was,
* please increment the following counter as a warning
* to the next guy:
* total_hours_wasted_here = 11
However, if I want to add the name of the programming language I'm a
little lost, since I can't add a @type Attribute to <eg>.
The only solution I came up with so far is to put <eg> within the
<figure> Element and type it accordingly. Another advantage of this
approach is, that I can add a heading and a caption to the source code
<figure type="sourceCode" subtype="php">
However, I'm not sure, if the semantics of <figure> ("... containing
graphic information such as an illustration or figure ... ") allow for
that kind of content.
Another idea that came to my mind is using <exemplum> element instead of
<figure>, but it is not usable within a <p> or <div> element and
according to its semantic, it seems to be only used in order to encode
chunks of TEI-Markup.
Does anyone of you have another solution or idea on that issue or is
<figure><eg>...</eg></figure> already a feasible approach?
Best regards, Matthias