ubsicap / usx

Unified Scripture XML
30 stars 6 forks source link

Support word-level descriptive attributes for <char> #18

Closed klassenjm closed 6 years ago

klassenjm commented 8 years ago

Proposal

This is the USX companion to USFM 3.0 proposal "Syntax for assigning word-level descriptive attributes". See: ubsicap/usfm#24 for detail.

General Syntax

Attributes are added to <char> elements using standard XML syntax.

<char style="w" lemma="grace">

Default Attribute In the case of the USFM specification, a single default attribute may be defined for a given character marker, and does not require the attribute name to be written within the text. To be valid, the XML expression in USX must always contain the attribute name and its value.

In the preceding example, <char @style="w"> accepts an additional attribute lemma, which is the default attribute found in the USFM expression for the same text.

User Defined Attributes

Attributes may be added to <char> elements within a text beyond the defined set for the latest USX version (3.0 or later). These will not be considered strictly USX compliant, and there is no assurance that they will be supported by compliant software tools or processes. Future versions of USX may formally define additional attributes.

Any user defined attributes must begin with the prefix x-.

<char style="w" x-myattr="metadata">gracious</char>
<char style="w" lemma="grace" x-myattr="metadata">gracious</char>

User defined attributes can be added to any USX <char> element, even if it is not within the list of @style tagged <char> elements officially providing descriptive attributes for the current version of the USX specification.

3.0 Elements Officially Providing Descriptive Attributes