modified to preserve the analogy to ginkgo
Change-Id: Ib70a301a7a00a4cac85d0b9987d699cf5cd6d36f
diff --git a/nkjp2korap.xsl b/nkjp2korap.xsl
index 86988ef..738f4af 100644
--- a/nkjp2korap.xsl
+++ b/nkjp2korap.xsl
@@ -271,7 +271,6 @@
<xsl:variable name="my_dir" as="xs:string" select="replace(base-uri(),'/text\.xml','')"/>
<xsl:variable name="my_textID" as="xs:string" select="tokenize($my_dir,'/')[last()]"/>
<xsl:variable name="ann_morphosyntax.uri" select="$my_dir || '/ann_morphosyntax.xml'" as="xs:string"/>
- <!--<xsl:variable name="ann_segmentation.uri" select="$my_dir || '/ann_segmentation.xml'" as="xs:string"/>-->
<xsl:variable name="ann_named.uri" select="$my_dir || '/ann_named.xml'" as="xs:string"/>
<xsl:variable name="ann_groups.uri" select="$my_dir || '/ann_groups.xml'" as="xs:string"/>
<xsl:variable name="ann_words.uri" select="$my_dir || '/ann_words.xml'" as="xs:string"/>
@@ -656,7 +655,7 @@
</xsl:variable>
<xsl:variable name="ptr" select="map:get($rev_lookup,fn:string(@xml:id))" as="element(tei:ptr)*"/>
- <!-- it's an element, because we need to see where it stands in a sequence... -->
+ <!-- it's an element, because we may need to see where it stands in a sequence... -->
<xsl:if test="$ptr">
<xsl:variable name="my_id" select="@xml:id" as="xs:string"/>
@@ -678,28 +677,28 @@
else
' _') || tei:fs/tei:f[@name eq 'orth']/tei:string"/>
</xsl:if>
+
<xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
- <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
- <xsl:attribute name="name" select="'complex-ent'"/>
- <xsl:for-each select="$ptr">
- <xsl:element name="fs" namespace="http://www.tei-c.org/ns/1.0">
- <xsl:attribute name="type" select="'complex-ent'"/>
- <xsl:for-each select="parent::tei:seg/tei:fs[1]/tei:f">
- <xsl:if test="@name eq 'type' or @name eq 'subtype'">
- <xsl:copy-of select="." copy-namespaces="no"/>
- </xsl:if>
- </xsl:for-each>
- <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
- <xsl:attribute name="name" select="'nkjp-named'"/>
- <xsl:copy-of select="parent::tei:seg/tei:fs[1]" copy-namespaces="no"/>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
-
- </xsl:element>
+ <!-- typeless in the Ginkgo example that I used as a template -->
+ <!-- assumption, theoretically falsifiable: NKJP NEs are in these cases identical.
+ Therefore, we process only the first one. -->
+ <xsl:for-each select="$ptr[1]/parent::tei:seg/tei:fs[1]/tei:f">
+ <xsl:if test="@name eq 'type' or @name eq 'subtype'">
+ <xsl:copy-of select="." copy-namespaces="no"/>
+ </xsl:if>
+ </xsl:for-each>
</xsl:element>
</xsl:element>
+
+ <xsl:element name="f" namespace="http://www.tei-c.org/ns/1.0">
+ <xsl:attribute name="name" select="'nkjp'"/>
+ <xsl:value-of select="$ptr[1]/parent::tei:seg/tei:fs[1]/tei:f[@name eq 'type']"/>
+
+ <xsl:for-each select="$ptr">
+ <xsl:copy-of select="parent::tei:seg/tei:fs[1]" copy-namespaces="no"/>
+ </xsl:for-each>
+ </xsl:element>
</xsl:element>
</xsl:element>
</xsl:if>