From 2bac61c1f04ea074fe6bff7cfdf470d79c440224 Mon Sep 17 00:00:00 2001
From: Martin Goik <goik@hdm-stuttgart.de>
Date: Tue, 6 Feb 2018 20:20:12 +0100
Subject: [PATCH] HTML table border, option

---
 .../CustomLayer/Klausur/docbook2klausur.xsl   | 32 +++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/ws/Docbook/CustomLayer/Klausur/docbook2klausur.xsl b/ws/Docbook/CustomLayer/Klausur/docbook2klausur.xsl
index af4658390..62dea47f0 100644
--- a/ws/Docbook/CustomLayer/Klausur/docbook2klausur.xsl
+++ b/ws/Docbook/CustomLayer/Klausur/docbook2klausur.xsl
@@ -10,12 +10,17 @@
     xmlns:html="http://www.w3.org/1999/xhtml"
     xmlns:db="http://docbook.org/ns/docbook"
     
+    
     xmlns:s6hl="java:net.sf.xslthl.ConnectorSaxon6"
     xmlns:xslthl="http://xslthl.sf.net"
     extension-element-prefixes="s6hl xslthl"
     exclude-result-prefixes="xs xlink xila xi trans db svg html m"
     version="2.0">
     
+    <!-- 
+    xmlns:fn = "http://www.w3.org/2005/xpath-functions"
+    -->
+    
     
     <xsl:template match="/db:book">
         <xsl:apply-templates select="db:chapter"/>
@@ -79,6 +84,7 @@
         <xsl:attribute name="start">
             <xsl:value-of select="."/>
         </xsl:attribute>
+        
     </xsl:template>
     
     <xsl:template match="db:listitem">
@@ -107,16 +113,19 @@
     
     <xsl:template match="db:xref">
         <span style="font-weight: bold;">
+            <xsl:value-of select="id(@linkend)"/>
+            <!-- 
             <xsl:apply-templates select="id(@linkend)/db:title" mode="xref"/>
+            -->
         </span>
     </xsl:template>
     
     
     <xsl:template match="db:informaltable">
-        <table border="0">
+        <table border="{@border}" style="border-collapse: collapse;">
             <xsl:for-each select="db:tr">
                 <tr>
-                    <xsl:for-each select="db:td">
+                    <xsl:for-each select="db:td|db:th">
                         <td valign="top">
                             <xsl:apply-templates select="text()|*"/>
                         </td>
@@ -129,6 +138,25 @@
         
     </xsl:template>
     
+    <xsl:template match="db:td">
+        <td>
+            <xsl:apply-templates/>
+        </td>
+    </xsl:template>
+    
+    <xsl:template match="db:th">
+        <th>
+            <xsl:apply-templates/>
+        </th>
+    </xsl:template>
+    
+    <xsl:template match="db:option">
+        <span style="font-style: italic;">
+            <xsl:apply-templates/>
+        </span>
+        
+    </xsl:template>
+    
     <xsl:template match="db:link|db:uri">
         <!-- link already present from template mode='link' -->
         <xsl:apply-templates/>
-- 
GitLab