Skip to content
Snippets Groups Projects
Commit e28d5696 authored by Max-Ferdinand Zeterberg's avatar Max-Ferdinand Zeterberg
Browse files

feat(g,w,translation): implement @cert in HTML serialization

parent a30eb942
No related branches found
No related tags found
1 merge request!32Resolve "uncertainty für g/w/translation"
......@@ -118,18 +118,27 @@
</xsl:template>
<!-- LINE-PARTS -->
<xsl:template match="g[not(@cert)]">
<span class="g" id="{if(@xml:id) then (@xml:id) else ('part_'||generate-id(.))}">
<xsl:apply-templates/>
</span>
<xsl:template match="g">
<xsl:element name="span">
<xsl:attribute name="class">g</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="if(@xml:id) then (@xml:id) else ('part_'||generate-id(.))"/>
</xsl:attribute>
<xsl:if test=".[@cert]">
<xsl:attribute name="data-cert">
<xsl:value-of select="./@cert"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!--
<xsl:template match="g[@cert]">
<span class="g" data-cert="{@cert}"
id="{if(@xml:id) then (@xml:id) else ('part_'||generate-id(.))}">
<xsl:apply-templates/>
</span>
</xsl:template>
</xsl:template>-->
<xsl:template match="metamark[contains(@rend, 'Line') or contains(@rend, 'line')]">
<xsl:variable name="rend" select="@rend"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:uuid="java:java.util.UUID"
xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xs" version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:uuid="java:java.util.UUID" xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xs" version="2.0"
xpath-default-namespace="http://sub.uni-goettingen.de/edxml#">
<xsl:template match="@xml:lang">
......@@ -121,9 +122,15 @@
<xsl:template match="philology//translation">
<div class="translation section-tab">
<xsl:element name="div">
<xsl:attribute name="class">translation section-tab</xsl:attribute>
<xsl:if test=".[@cert]">
<xsl:attribute name="data-cert">
<xsl:value-of select="./@cert"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@* | node()"/>
</div>
</xsl:element>
</xsl:template>
<xsl:template match="philology//translation" mode="table">
......@@ -183,33 +190,41 @@
(tokenize(@corresp, ' '))
else
(false())"/>
<span class="w item" tabindex="1" id="{$id}">
<span class="body">
<xsl:apply-templates/>
</span>
<span class="annotation">
<span class="ana">
<xsl:choose>
<xsl:when test="@ana">
<xsl:value-of select="@ana"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="span">
<xsl:attribute name="class">w item</xsl:attribute>
<xsl:attribute name="tabindex">1</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
<xsl:if test=".[@cert]">
<xsl:attribute name="data-cert">
<xsl:value-of select="./@cert"/>
</xsl:attribute>
</xsl:if>
<span class="body">
<xsl:apply-templates/>
</span>
<span class="lemma">
<xsl:choose>
<xsl:when test="@lemma">
<xsl:value-of select="@lemma"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
<span class="annotation">
<span class="ana">
<xsl:choose>
<xsl:when test="@ana">
<xsl:value-of select="@ana"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</span>
<span class="lemma">
<xsl:choose>
<xsl:when test="@lemma">
<xsl:value-of select="@lemma"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</span>
</span>
</span>
</span>
</xsl:element>
</xsl:template>
<xsl:template match="philology//notes">
......@@ -224,14 +239,13 @@
<label for="{$noteListId}">
<xsl:variable name="targetIds" select="tokenize($targetUnique, ' ')"/>
<xsl:for-each select="$targetIds">
<xsl:variable name="targetId" select="substring(., 2)"/>
<xsl:apply-templates select="root($thisNotes)//*[@xml:id = $targetId]"/>
<xsl:variable name="targetId" select="substring(., 2)"/>
<xsl:apply-templates select="root($thisNotes)//*[@xml:id = $targetId]"/>
</xsl:for-each>
</label>
<input id="{$noteListId}" type="checkbox"/>
<ul>
<xsl:apply-templates
select="$thisNotes//note[@target = $targetUnique]"/>
<xsl:apply-templates select="$thisNotes//note[@target = $targetUnique]"/>
</ul>
</li>
</xsl:for-each>
......@@ -248,7 +262,7 @@
<span>
<xsl:apply-templates/>
</span>
</li>
</xsl:template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment