6. Inline Technical Elements
Due to the nature of this journal, a discussion of technical XML or TEI elements is a common feature in jTEI articles. When elements from an XML vocabulary are discussed, they should be identified in a gi element, with an optional scheme attribute in which the XML vocabulary can be named. The default value for this attribute is TEI for TEI elements; others could be HTML, Schematron, DBK (Docbook), etc. At rendering time, the gi start and end tags are replaced with the < and > characters, respectively. The element name is always presented in this form: <p>
in the output rendering, even if it is an empty element which in actual usage is almost always self-closing, such as lb or <pb>.
Attribute names should be tagged in an att element, which at rendering time will be preceded with a @ character. Attribute values should be tagged in val. At rendering time, the val start and end tags are replaced with straight quotation marks, so there is no need to quote the values yourself.
<p>For example, the extension of credit can be represented in a transactionography
by the transfer of a commodity of indebtedness. We have been using the keyword
<val>iou</val> as the value of <att>commodity</att> of <gi>measure</gi> for this purpose.</p>
When you want to quote an instance of a single start or end tag, you should use the tag element. If you want to specify the XML vocabulary this tag belongs to, this can be done in the scheme attribute (see above). In the type attribute, you can specify the kind of tag: start (start tag), end (end tag), empty (an empty tag), pi (processing instruction), comment (an XML comment), or ms (a CDATA marked section). For all these types of tags, the proper delimiters (starting with the < and ending with the > characters) are inserted when the article is rendered. Note, for full-fledged XML examples, the egXML element should be used (see 4.6. Example Code, XML and non-XML).
<p>A range like <code>#range(left(//lb[@n='3']),left(//lb[@n='4']))</code>, however,
could unambiguously address the sequence of nodes comprising line 3, even if the
<gi>lb</gi> happened to be a child of another element that began in the previous line.</p>
<p>For example, <tagĀ type="empty">rng:ref name="model.pLike"</tag> becomes <tagĀ type="empty">classRef key="model.pLike"</tag>.</p>
If you want to cite a brief inline code fragment from a formal programming language, you can use the
code element. With the
lang attribute, you can identify the language of the code:
<p>Most of the time, pointing from one part of a TEI document to another, it is easy
to use IDs. Simply wrap the thing in an element, give that element an <att>xml:id</att>
attribute (say, <code>xml:id="foo"</code>), and point at the ID using either a
URI with an appended fragment identifier (<val>#foo</val>) or using an attribute
whose type is IDREF.</p>
The
ident element should be used to encode identifiers in a formal language, such as variable, class, and function names in a programming language. When discussing the TEI encoding scheme or customizations, the names of model and attribute classes, datatypes, macros, and TEI customizations should be encoded with
ident:
<p>For example <ident>data.duration.iso</ident>, <ident>data.outputMeasurement</ident>,
<ident>data.pattern</ident>, <ident>data.point</ident>, <ident>data.version</ident>,
and <ident>data.word</ident> all map to the same datatype CDATA in XML DTD, and to
various TEI-defined regular expressions in RELAX NG or W3C Schema.</p>