README Oracc Home SEARCH DOCUMENTATION

Creative Commons License

ORACC Home


Introduction


Processing

Schema


xtr.rnc


Resources

XTR: XML Translations

(http://oracc.org/ns/xtr/1.0)

Steve Tinney
Version of 2017-08-10

Introduction

This document provides the RNG schema used by the XML version of translations and explains implementation details useful for programmers; if you are typing translations in ATF you don't need to read this page.

The XML Translations subsystem handles translations of texts. These may be input as interlinear, within the ATF files, or extralinear either within ATF files or separately. Interlinear translations are automatically aligned with the translated material at the line-level; extralinear translations may be aligned either at the level of labels (including label ranges like [o i 14 - o ii 3]) or at the level of units (units are normally sentences). We do not expect that XTR will be generated manually, though it could be; the normal practice will be to prepare translations in a simple format which is an extension to ATF.

Processing

The ATF processor transparently handles the relationship between the different surface forms of translations and the single internal data structure and serialized XML form. Linkage between the transliterations and their corresponding translations is also handled automatically.

A multi-pass approach is used to achieve this:

Schema

XTR translations are defined as a tiny subset of XHTML so that rendering them is little more than a matter of inserting appropriate linking conventions to support user-navigation between the IDREFs in xtf:ref attributes and the IDs in either the transliteration or the translation.

Each translation unit is expressed as an xhtml:p.

The values of the @label, @unit and @span commands are preserved in XTR attributes with corresponding names.

xtr.rnc

namespace xtr = "http://oracc.org/ns/xtr/1.0"
namespace xh  = "http://www.w3.org/1999/xhtml"

translation =
  element xtr:translation {
    id,
    attribute ref      { xsd:NMTOKEN },
    attribute n        { text },
    attribute project  { text },
    attribute xml:lang { xsd:NMTOKEN },
    attribute xtr:code { xsd:NMTOKEN },
    attribute xtr:type { 
      "interlinear" | "parallel" | "labeled" | "unitary" 
    },
    attribute xtr:cols { xsd:nonNegativeInteger }?,
    (trans-unit | trans-note | trans-dollar | trans-comment | h)*,
    map?
  }

id  = attribute xml:id { xsd:ID }
cid = attribute xtr:cid { xsd:IDREF }
ctr = attribute class { "tr" }

trans-comment =
  element xh:p {
    attribute class { "tr-comment" },
    htext*
  }

trans-dollar =
  element xh:p {
    attribute class { "dollar" },
    silent?,
    (standalone
     | (ref | refs | (unit,refs?))),
    new-labels? ,
    htext* ,
    innerp*
  }

trans-note = 
  element xh:div {
    attribute class { "note" },
    id,
    noteauto?,
    element xh:p { ctr , xtr-notemark , htext } ,
    (element xh:p { ctr , htext } 
     | trans-comment)*
  }

trans-unit = 
  element xh:p {
    id,
    cid?,
    ctr,
    xtr-label, se-label,
    (ref | refs | (unit,refs?)),
    new-labels? ,
    overlap? ,
    spanall? ,
    (innerp+ | htext)
  }

h = h1 | h2 | h3
h1 = element xh:h1 { h-model }
h2 = element xh:h2 { h-model }
h3 = element xh:h3 { h-model }

h-model = (id? , ctr , ( ref | hdr-ref)? , new-labels? , htext)

innerp = element xh:innerp { htext | (comment, text) }
htext = (text | trword | trcell | foreign | literal | xtr-notelink 
         | supplied | uncertain | rspan | bspan | ispan | sign
	 | bispan | smaller | sc | gdlspan | sup | lab | cun 
	 | xtr-notelink | xtr-notemark)*

trword    = element xh:span { attribute class      { "w" },  
			      attribute xtr:lem    { text }?,
			      attribute xtr:disamb { text }?,
			      attribute xtr:form   { text }?,
			      id,
			      (text | rspan | bspan | ispan | bispan | smaller | sc | sup | lab)* }

trcell	  = element xh:span { attribute class { "cell" },  
			      attribute xtr:span { xsd:nonNegativeInteger }?,
			      htext }
comment   = attribute class { "tr-comment" }
foreign   = element xh:span { attribute class { "foreign" },  htext }
literal   = element xh:span { attribute class { "literal" },  htext }
supplied  = element xh:span { attribute class { "supplied" }, htext }
uncertain = element xh:span { attribute class { "uncertain" },htext }
rspan     = element xh:span { attribute class { "r" },        htext }
bspan     = element xh:span { attribute class { "b" },        htext }
ispan     = element xh:span { attribute class { "i" },        htext }
bispan    = element xh:span { attribute class { "bi" },       htext }
gdlspan   = element xh:span { attribute class { "gdl" },      l.inner }
lab       = element xh:span { attribute class { "lab" },      htext }
sc        = element xh:span { attribute class { "sc" },       htext }
sign      = element xh:span { attribute class { "sign" },     htext }
smaller   = element xh:span { attribute class { "smaller" },  htext }
sup       = element xh:span { attribute class { "sup" | "up" },      htext }
cun       = element xh:span { attribute class { "cun" },      htext }

xtr-notelink = 
  element xh:span {
    attribute class { "notelink" },
    noteref,
    noteauto?,
    text
  }

xtr-notemark = 
  element xh:span {
    attribute class { "notemark" },
    text
  }

ref       = attribute xtr:ref     { xsd:IDREF }
hdr-ref   = attribute xtr:hdr-ref { xsd:IDREF }
refs      = start-ref , end-ref , all-refs? , new-labels? , rows
start-ref = attribute xtr:sref    { xsd:IDREF  }
end-ref   = attribute xtr:eref    { xsd:IDREF  }
all-refs  = attribute xtr:refs    { xsd:IDREFS }
uref      = attribute xtr:uref    { xsd:IDREF  }
nrefs     = attribute xtr:nrefs   { xsd:IDREFS }
rows 	  = attribute xtr:rows    { xsd:integer }
overlap   = attribute xtr:overlap { xsd:boolean }
silent    = attribute xtr:silent  { "1" }
spanall   = attribute xtr:spanall { "1" }
standalone= attribute xtr:standalone { "1" }
xtr-label = (attribute xtr:label { text },
             attribute xtr:rend-label { text }?)
se-label = attribute xtr:se_label { text }
unit  = attribute xtr:unit  { text }

new-labels = 
	(attribute xtr:lab-start-lnum  { text },
	 attribute xtr:lab-end-lnum    { text } ?,
	 attribute xtr:lab-start-label { text },
	 attribute xtr:lab-end-label   { text } ?
	)

map =
  element xtr:map {
    element xtr:l2t {
      attribute lid { xsd:IDREF },
      attribute tid { xsd:IDREF }
    }*
  }

Resources


Questions about this document may be directed to the Oracc Steering Committee (osc at oracc dot org).