revert; the intended lookup from old ID to the new index across the entire tree would require a lot of magic and wouldn't be efficient at all
Change-Id: I8abe11c179833088fcd4fa0c24a2b951a96f60dc
diff --git a/nkjp2korap.xsl b/nkjp2korap.xsl
index 05dec9d..4aae734 100644
--- a/nkjp2korap.xsl
+++ b/nkjp2korap.xsl
@@ -62,12 +62,8 @@
<xsl:mode name="header-text" on-no-match="text-only-copy"/>
<xsl:mode use-accumulators="#all"/>
- <xsl:accumulator name="element-index" as="map(xs:string, xs:integer)" initial-value="map{'':0}">
- <xsl:accumulator-rule match="tei:*[ancestor-or-self::tei:text]" phase="start">
- <xsl:variable name="prev_idx" as="xs:integer"
- select="map:get($value, map:keys($value)[last()])"/>
- <xsl:sequence select="map { string(@xml:id): $prev_idx + 1 }"/>
- </xsl:accumulator-rule>
+ <xsl:accumulator name="element-index" as="xs:integer" initial-value="0">
+ <xsl:accumulator-rule match="tei:*[ancestor-or-self::tei:text]" select="$value + 1" phase="start"/>
</xsl:accumulator>
<xsl:accumulator name="elem-offset-seq" as="map(xs:string, item()+)+" initial-value="(map{'null':(0,0)})">
@@ -437,8 +433,7 @@
</xsl:variable>
<xsl:variable name="my_name" select="local-name()" as="xs:string"/>
- <!--<xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>-->
- <xsl:variable name="my_index" select="map:get(fn:accumulator-before('element-index'),string(@xml:id))" as="xs:integer"/>
+ <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
<xsl:element name="span" namespace="{$KorAP_namespace}">
<xsl:attribute name="id" select="'s' || $my_index"/>
@@ -512,8 +507,7 @@
<xsl:variable name="my_choice-id" select="substring-after($my_disamb//tei:f[@name eq 'choice']/@fVal,'#')" as="xs:string"/>
<xsl:variable name="my_choice-lex" select="$my_morph-seg//tei:f[@name eq 'interps']/tei:fs[@type eq 'lex'][descendant::tei:symbol[@xml:id eq $my_choice-id]]" as="node()"/>
<xsl:variable name="chosen-msd" as="xs:string" select="$my_choice-lex/descendant::tei:symbol[@xml:id eq $my_choice-id]/@value"/>
- <!--<xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>-->
- <xsl:variable name="my_index" select="map:get(fn:accumulator-before('element-index'),string(@xml:id))" as="xs:integer"/>
+ <xsl:variable name="my_index" select="fn:accumulator-before('element-index')" as="xs:integer"/>
<xsl:element name="span" namespace="{$KorAP_namespace}">
<xsl:attribute name="id" select="'m' || $my_index"/>