Skip to content

Main content

TEI Gap Reason Attribute Label Tool

Escape supplied reason text as a double-quoted TEI gap reason attribute, accepting XML 1.0 characters other than controls without inventing a closed reason vocabulary.

Loading tool…

Description

Escape a supplied reason as one double-quoted XML-style attribute.

Digital editions separate source readings, editorial uncertainty, witness locators, image requests, identifiers and rights statements. XML character/attribute rules differ from display labels, while URI fragments and TEI pointers need their target-document context. An identifier key or formatted token does not authenticate a witness, validate an edition or authorize reuse.

Escape a supplied reason as one double-quoted XML-style attribute.

When to use this tool

Use TEI Gap Reason Attribute Label when you already have suppliedReason and need to escape a supplied reason as one double-quoted XML-style attribute.

How to use the tool and how it works

  1. Enter suppliedReason. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read attributeText. Use the output convention below.

Require nonempty reason text containing only code points U+0020..U+D7FF, U+E000..U+FFFD or U+10000..U+10FFFF. Escape & first, then < and double quote; wrap as reason="value".1

XML permits tab, line feed and carriage return as characters, whereas this helper rejects them. Escaping an accepted value is only one step toward a well-formed and valid document.2

Input fieldMeaning and unitsAccepted input
suppliedReasonSupplied ReasonRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
attributeTextOne escaped double-quoted reason attribute, not a complete XML/TEI element or document.Required. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "suppliedReason": "illegible"
  },
  "output": {
    "attributeText": "reason=\"illegible\""
  }
}

Limitations and assumptions

  • Tabs, newlines and carriage returns are rejected even though XML permits them in other contexts. No complete XML/TEI element, schema, reason vocabulary or target document is validated.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Validate the complete XML/TEI document or IIIF request when technical conformance matters, and inspect the original witness and rights record for editorial use. Preserve uncertain readings, source order and attribution rather than treating local tokens as verified scholarly interpretations.

References

  1. Calculation and input contract: digital-humanities/tei-gap-reason-attribute-label — tool.io

  2. XML 1.0: Characters and attribute values — W3C

Similar or alternative tools