diff software/eXist/webapp/mpdl/presentation/pageFragmentHtml.xsl @ 9:1ec29fdd0db8

neue .lex Dateien f?r Normalisierung / externe Objekte update
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 22 Feb 2011 16:03:45 +0100
parents d2a1c14fde31
children d6f528ad5d96
line wrap: on
line diff
--- a/software/eXist/webapp/mpdl/presentation/pageFragmentHtml.xsl	Thu Feb 10 14:02:05 2011 +0100
+++ b/software/eXist/webapp/mpdl/presentation/pageFragmentHtml.xsl	Tue Feb 22 16:03:45 2011 +0100
@@ -43,6 +43,7 @@
     <xsl:variable name="pageHeader" select="header"/>
     <xsl:variable name="pageNumber" select="number(number)"/>
     <xsl:variable name="pageNumberOrig" select="number-orig"/>
+    <xsl:variable name="pageNumberOrigNorm" select="number-orig-norm"/>
     <xsl:variable name="documentValue" select="concat('document=', $documentUri)"/>
     <xsl:variable name="pnValue" select="concat('pn=', $pageNumber)"/>
     <xsl:variable name="modeValue" select="concat('mode=', $mode)"/>
@@ -58,6 +59,10 @@
         <xsl:when test="$pageNumberOrig = ''"></xsl:when>
         <xsl:otherwise><div class="pageNumberOrig"><xsl:value-of select="$pageNumberOrig"/></div></xsl:otherwise>
       </xsl:choose>
+      <xsl:choose>
+        <xsl:when test="$pageNumberOrigNorm = ''"></xsl:when>
+        <xsl:otherwise><div class="pageNumberOrigNorm"><xsl:value-of select="$pageNumberOrigNorm"/></div></xsl:otherwise>
+      </xsl:choose>
       <xsl:if test="$pageHeader != ''">
         <div class="pageHeaderTitle"><xsl:value-of select="$pageHeader"/></div>
       </xsl:if>
@@ -282,6 +287,21 @@
   <p class="bf center"><xsl:apply-templates mode="text"/></p>
 </xsl:template>
 
+<!-- TEI: segmentation   -->
+<xsl:template match="seg" mode="text">
+  <span class="seg">
+    <xsl:if test="not(empty(@xlink:href))">
+      <a>
+        <xsl:attribute name="href"><xsl:value-of select="@xlink:href"/></xsl:attribute>
+        <xsl:apply-templates mode="text"/>
+      </a>
+    </xsl:if>
+    <xsl:if test="empty(@xlink:href)">
+      <xsl:apply-templates mode="text"/>
+    </xsl:if>
+  </span>
+</xsl:template>
+
 <xsl:template match="div" mode="text">
   <xsl:variable name="type" select="@type"/>
   <xsl:variable name="level" select="@level"/>
@@ -401,8 +421,19 @@
   <xsl:if test="$collectionName = 'archimedes'"><xsl:apply-templates mode="text"/></xsl:if>
 </xsl:template>
 
+<!-- TEI: reference    -->
 <xsl:template match="ref" mode="text">
-  <span class="ref"><xsl:apply-templates mode="text"/></span>
+  <span class="ref">
+    <xsl:if test="not(empty(@target))">
+      <a>
+        <xsl:attribute name="href"><xsl:value-of select="@target"/></xsl:attribute>
+        <xsl:apply-templates mode="text"/>
+      </a>
+    </xsl:if>
+    <xsl:if test="empty(@target)">
+      <xsl:apply-templates mode="text"/>
+    </xsl:if>
+  </span>
 </xsl:template>
 
 <xsl:template match="foreign" mode="text">
@@ -510,7 +541,7 @@
         <xsl:value-of select="concat('↓ (', $href, ')')"/>
       </a>
     </xsl:when>
-    <xsl:otherwise><a><xsl:attribute name="href"><xsl:value-of select="@xlink:href"/></xsl:attribute>Anchor of type: <xsl:value-of select="@type"/>, href: <xsl:value-of select="@xlink:href"/></a></xsl:otherwise>
+    <xsl:otherwise><a><xsl:attribute name="href"><xsl:value-of select="@xlink:href"/></xsl:attribute><xsl:apply-templates mode="text"/></a></xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
@@ -661,13 +692,13 @@
     <!-- Show the sentence in color light grey if it is given as sn -->
     <xsl:when test="$sn >= 0 and $sn = $actualSN">
       <span class="s highlight">
-        <xsl:if test="contains($options, 'withXmlNodeId')"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if>
+        <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if>
         <xsl:apply-templates mode="text"/>
       </span>
     </xsl:when>
     <xsl:otherwise>
       <span class="s">
-        <xsl:if test="contains($options, 'withXmlNodeId')"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if>
+        <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if>
         <xsl:apply-templates mode="text"/>
       </span>
     </xsl:otherwise>