Where isolated foreign words appear in a text otherwise in a single language, or when a text has significant parts in two or more languages (bilinguals, glosses, etc.).
The <foreign> element identifies a word or phrase as belonging to a language other than that of the surrounding text. It is usually useful to apply the attribute xml:lang with a language code (see Languages and Scripts) to identify the language of the embedded word.
Transformation using the example EpiDoc P5 stylesheets:
Where significantly sized and meaningfully divided passages of the text and in different languages, it is advisable to use <div type="textpart"> with an xml:lang on each, perhaps rather than declaring a single default language on the <div type="edition">.
Where significant, multiline blocks of text are in each of two or more languages, but these blocks are not considered otherwise meaningful or part of the citation scheme of the document, it is enough to tag each block with an <ab>, to which the xml:lang may be added.
A text that is made up of words or phrases in one language, and glosses or translations in one or more others, may be tagged with a series of <term> and <gloss> elements, inline, and each bearing the xml:lang specifying the language of the short phrase. Alternatively, if the specific and rich semantics of <term> and <gloss> are to be avoided, <seg> may be used to mark arbitrary spans of text as being in one language or another.
In this example, from the Corpus of Pyu Inscriptions project, xml:id and corresp attributes are used to link the Pyu <gloss>es with the Sanskrit <term>s of which each is a translation or equivalent.
Other pages describing <div>:
Other pages describing <foreign>:
Other pages describing <gloss>:
Other pages describing <seg>:
Other pages describing <term>: