if (exists($n/preceding-sibling::tei:addSpan) and $n/preceding-sibling::tei:addSpan/substring-after(@spanTo, '#') = $n/following-sibling::tei:anchor/@xml:id ) then 'addSpan' else(),
(: TODO: mechanism for pre text from previous line is disabled. :)
then ($n/preceding::text()[not(parent::tei:expan)][not(ancestor::tei:fw)][1][ancestor::tei:zone/substring-after(@next, "#") = $n/ancestor::*[@xml:id]/@xml:id])
then ($n/preceding::text()[not(parent::tei:expan)][not(ancestor::tei:fw)][1][ancestor::tei:*/substring-after(@next, "#") = $n/ancestor::*[@xml:id]/@xml:id])