RK060918 Bugfix: tags inside the Explanaitions were ignored -> i used copy-of instead of value-of
authorrkoenig
Mon, 18 Sep 2006 21:59:56 +0200
changeset 3662ca3fbaab6b8a
parent 3661 7d03278151c4
child 3663 96baa6c2c262
RK060918 Bugfix: tags inside the Explanaitions were ignored -> i used copy-of instead of value-of
src/java/isac/util/genhtml/templates/thy_node_content.xsl
src/java/isac/util/genhtml/templates/thy_node_content_author.xsl
src/java/isac/util/genhtml/templates/thy_node_content_nomodel.xsl
     1.1 --- a/src/java/isac/util/genhtml/templates/thy_node_content.xsl	Sun Sep 17 20:32:33 2006 +0200
     1.2 +++ b/src/java/isac/util/genhtml/templates/thy_node_content.xsl	Mon Sep 18 21:59:56 2006 +0200
     1.3 @@ -3,7 +3,6 @@
     1.4                  version="1.0">
     1.5  
     1.6  
     1.7 -
     1.8  <!--
     1.9    Call the template below to insert the content of a tag with
    1.10    replacement of newlines by <br> as following: 
    1.11 @@ -151,7 +150,7 @@
    1.12  
    1.13  <hr></hr>
    1.14  <xsl:for-each select="EXPLANATIONS">
    1.15 -<xsl:value-of select="."/>
    1.16 +<xsl:copy-of select="."/>
    1.17  </xsl:for-each>
    1.18  
    1.19  <hr></hr>
    1.20 @@ -165,12 +164,9 @@
    1.21  </xsl:for-each>
    1.22  </xsl:for-each> 
    1.23  
    1.24 -
    1.25 -
    1.26 -
    1.27  <xsl:for-each select="HTMLDATA">
    1.28  <xsl:for-each select="EXPLANATIONS">
    1.29 -<xsl:value-of select="."/>
    1.30 +<xsl:copy-of select="."/>
    1.31  </xsl:for-each>
    1.32  <hr></hr>
    1.33  <xsl:for-each select="MATHAUTHORS">
    1.34 @@ -231,7 +227,7 @@
    1.35  <hr></hr>
    1.36  
    1.37  <xsl:for-each select="EXPLANATIONS">
    1.38 -<xsl:value-of select="."/>
    1.39 +<xsl:copy-of select="."/>
    1.40  </xsl:for-each>
    1.41  <hr></hr>
    1.42  
     2.1 --- a/src/java/isac/util/genhtml/templates/thy_node_content_author.xsl	Sun Sep 17 20:32:33 2006 +0200
     2.2 +++ b/src/java/isac/util/genhtml/templates/thy_node_content_author.xsl	Mon Sep 18 21:59:56 2006 +0200
     2.3 @@ -4,6 +4,19 @@
     2.4  
     2.5  
     2.6  <!--
     2.7 +  This is a template which inserts unknown tags (such as html
     2.8 +  tags inside the EXPLANATIONS field) by simply writing:
     2.9 + <xsl:apply-templates/>
    2.10 +  If no other template matches better, this one is taken
    2.11 +-->
    2.12 +<xsl:template match="*">
    2.13 + <xsl:copy>
    2.14 +  <xsl:copy-of select="@*"/>
    2.15 + <xsl:apply-templates/>
    2.16 +</xsl:copy>
    2.17 +</xsl:template>
    2.18 +
    2.19 +<!--
    2.20    Call the template below to insert the content of a tag with
    2.21    replacement of newlines by <br> as following: 
    2.22    <xsl:call-template name="insert_with_line_breaks">
    2.23 @@ -14,8 +27,17 @@
    2.24    <xsl:param name="text" select="."/>
    2.25    <xsl:choose>
    2.26    <xsl:when test="contains($text, '&#xa;')">
    2.27 +  
    2.28 +  
    2.29 +    <xsl:variable name="token-before" select="substring-before($text,'&#xa;')"/>
    2.30 +    <xsl:choose>
    2.31 +  	<xsl:when test="string-length($token-before) > 0">
    2.32 +  
    2.33    	<xsl:value-of select="substring-before($text,'&#xa;')"/>
    2.34 -  	<br/>
    2.35 +
    2.36 +  	<br/> <xsl:text>&#xa;</xsl:text>
    2.37 +  	</xsl:when>   
    2.38 +	</xsl:choose>
    2.39    	<xsl:call-template name="insert_with_line_breaks">
    2.40    		<xsl:with-param name="text" select="substring-after($text,'&#xa;')"/>
    2.41    	</xsl:call-template>
    2.42 @@ -26,33 +48,70 @@
    2.43    </xsl:choose>
    2.44  </xsl:template>
    2.45  
    2.46 +<!--
    2.47 +  Call the template below to insert a link. The template expects
    2.48 +  that there is a <STRING> tag and a <GUH> tag inside of the 
    2.49 +  selected element. The content of the <STRING> tag is used as
    2.50 +  test of the link, the link is created out of the content 
    2.51 +  of the <GUH> tag. Call the template as following:
    2.52 +  <xsl:call-template name="insert_link">
    2.53 +    <xsl:with-param name="text" select="TAG_TO_SELECT"/>
    2.54 +  </xsl:call-template>
    2.55 +-->
    2.56 +<xsl:template name="insert_link">
    2.57 +  <xsl:param name="text" select="."/>
    2.58 +  <xsl:variable name="guh" select="normalize-space(GUH)"/>
    2.59 +	<xsl:element name="a">
    2.60 +		<xsl:attribute name="href">
    2.61 +			<xsl:text>../</xsl:text>
    2.62 +			<xsl:text><xsl:value-of select="substring-before($guh, '_')"/></xsl:text>
    2.63 +			<xsl:text>/</xsl:text>
    2.64 +			<xsl:text><xsl:value-of select="normalize-space(GUH)"/></xsl:text>
    2.65 +			<xsl:text>.html</xsl:text>
    2.66 +		</xsl:attribute>
    2.67 +		<xsl:value-of select="STRING"/>
    2.68 +	</xsl:element>
    2.69 +</xsl:template>
    2.70 +
    2.71 +
    2.72  <xsl:template match="/">
    2.73  <html>
    2.74  
    2.75  <body>
    2.76  
    2.77 +<xsl:for-each select="RULESETDATA">
    2.78  
    2.79 +<table style="text-align: left; width: 100%;" border="0" cellspacing="2"
    2.80 + cellpadding="2">
    2.81 +  <tbody>
    2.82 +<tr>
    2.83 +<td width="112"> <strong> Identifier: </strong> </td>
    2.84 +<td>
    2.85 +<xsl:value-of select="RULESET/ID"/>
    2.86 +</td>
    2.87 +</tr>
    2.88 +</tbody>
    2.89 +</table>
    2.90 +<hr></hr>
    2.91 +<div class="context">
    2.92 +</div>
    2.93 +<hr></hr>
    2.94  
    2.95 -<xsl:for-each select="RULESETDATA">
    2.96  <xsl:for-each select="RULESET/RULES">
    2.97 -<h3>Rules:</h3>
    2.98 -<table style="text-align: left; width: 100%;" border="1" cellspacing="2"
    2.99 +<strong>Rules:</strong>
   2.100 +<table style="text-align: left; width: 100%;" border="0" cellspacing="2"
   2.101   cellpadding="2">
   2.102    <tbody>
   2.103  <xsl:for-each select="RULE">
   2.104  <tr>
   2.105  
   2.106 -<td>
   2.107 +<td  width="112">
   2.108  <xsl:value-of select="TAG"/>
   2.109  </td>
   2.110  <td>
   2.111 -
   2.112 -<xsl:element name="a">
   2.113 -<xsl:attribute name="href">
   2.114 -<xsl:text><xsl:value-of select="normalize-space(GUH)"/></xsl:text><xsl:text>.html</xsl:text>
   2.115 -</xsl:attribute>
   2.116 -<xsl:value-of select="STRING"/>
   2.117 -</xsl:element>
   2.118 +  <xsl:call-template name="insert_link">
   2.119 +    <xsl:with-param name="text" select="."/>
   2.120 +  </xsl:call-template>
   2.121  </td>
   2.122  </tr>
   2.123  </xsl:for-each> 
   2.124 @@ -60,37 +119,76 @@
   2.125  </tbody>
   2.126  </table>
   2.127  </xsl:for-each> 
   2.128 +
   2.129 +<xsl:for-each select="RULESET/ORDER">
   2.130 +<br/>
   2.131 +<strong>For applying rules:</strong>
   2.132 +<table style="text-align: left; width: 100%;" border="0" cellspacing="2"
   2.133 + cellpadding="2">
   2.134 +  <tbody>
   2.135 +<tr>
   2.136 +
   2.137 +<td  width="112">
   2.138 +Rewriteorder
   2.139 +</td>
   2.140 +<td>
   2.141 +<xsl:value-of select="STRING"/>
   2.142 +</td>
   2.143 +</tr>
   2.144 +</tbody>
   2.145 +</table>
   2.146 +</xsl:for-each>
   2.147 +
   2.148 +<xsl:for-each select="RULESET/ERLS">
   2.149 +<br/>
   2.150 +<strong>For evaluating conditions in rules:</strong>
   2.151 +<table style="text-align: left; width: 100%;" border="0" cellspacing="2"
   2.152 + cellpadding="2">
   2.153 +  <tbody>
   2.154 +<tr>
   2.155 +
   2.156 +<td  width="112">
   2.157 +<xsl:value-of select="TAG"/>
   2.158 +</td>
   2.159 +<td>
   2.160 +  <xsl:call-template name="insert_link">
   2.161 +    <xsl:with-param name="text" select="."/>
   2.162 +  </xsl:call-template>
   2.163 +</td>
   2.164 +</tr>
   2.165 +</tbody>
   2.166 +</table>
   2.167 +</xsl:for-each>
   2.168 +
   2.169 +
   2.170 +<hr></hr>
   2.171  <xsl:for-each select="EXPLANATIONS">
   2.172 -<xsl:value-of select="."/>
   2.173 +<xsl:apply-templates/>
   2.174 +</xsl:for-each>
   2.175 +
   2.176  <hr></hr>
   2.177 -</xsl:for-each>
   2.178  <xsl:for-each select="MATHAUTHORS">
   2.179  <xsl:for-each select="STRING">
   2.180 -(c) <xsl:value-of select="."/> (math-autor)
   2.181 +(c) <xsl:value-of select="."/> (math-autor) <br/>
   2.182  </xsl:for-each>
   2.183 -<hr></hr>
   2.184  </xsl:for-each>
   2.185  <xsl:for-each select="COURSEDESIGNS/STRING">
   2.186 -(c) <xsl:value-of select="."/> (course-designer)
   2.187 +(c) <xsl:value-of select="."/> (course-designer) <br/>
   2.188  </xsl:for-each>
   2.189  </xsl:for-each> 
   2.190  
   2.191 -
   2.192 -
   2.193 -
   2.194  <xsl:for-each select="HTMLDATA">
   2.195  <xsl:for-each select="EXPLANATIONS">
   2.196 -<xsl:value-of select="."/>
   2.197 +<xsl:apply-templates/>
   2.198 +</xsl:for-each>
   2.199  <hr></hr>
   2.200 -</xsl:for-each>
   2.201  <xsl:for-each select="MATHAUTHORS">
   2.202  <xsl:for-each select="STRING">
   2.203 -(c) <xsl:value-of select="."/> (math-autor)
   2.204 +(c) <xsl:value-of select="."/> (math-autor) <br/>
   2.205  </xsl:for-each>
   2.206 -<hr></hr>
   2.207  </xsl:for-each>
   2.208  <xsl:for-each select="COURSEDESIGNS/STRING">
   2.209 -(c) <xsl:value-of select="."/> (course-designer)
   2.210 +(c) <xsl:value-of select="."/> (course-designer) <br/>
   2.211  </xsl:for-each>
   2.212  </xsl:for-each> 
   2.213  
   2.214 @@ -123,21 +221,37 @@
   2.215  </table>
   2.216  </xsl:for-each> 
   2.217  
   2.218 +<hr></hr>
   2.219  <div class="context">
   2.220  </div>
   2.221  <hr></hr>
   2.222 +
   2.223 +<xsl:for-each select="PROOF">
   2.224 +
   2.225 +<xsl:element name="a">
   2.226 +<xsl:attribute name="href">
   2.227 +<xsl:value-of select="normalize-space(EXTREF/URL)"/>
   2.228 +
   2.229 +</xsl:attribute>
   2.230 +<xsl:value-of select="normalize-space(EXTREF/TEXT)"/>
   2.231 +</xsl:element>
   2.232 +</xsl:for-each>
   2.233 +
   2.234 +<hr></hr>
   2.235 +
   2.236  <xsl:for-each select="EXPLANATIONS">
   2.237 -<xsl:value-of select="."/>
   2.238 +<xsl:apply-templates/>
   2.239 +</xsl:for-each>
   2.240  <hr></hr>
   2.241 -</xsl:for-each>
   2.242 +
   2.243  <xsl:for-each select="MATHAUTHORS">
   2.244  <xsl:for-each select="STRING">
   2.245 -(c) <xsl:value-of select="."/> (math-autor)
   2.246 +(c) <xsl:value-of select="."/> (math-autor) <br/>
   2.247  </xsl:for-each>
   2.248 -<hr></hr>
   2.249  </xsl:for-each>
   2.250 +
   2.251  <xsl:for-each select="COURSEDESIGNS/STRING">
   2.252 -(c) <xsl:value-of select="."/> (course-designer)
   2.253 +(c) <xsl:value-of select="."/> (course-designer) <br/>
   2.254  </xsl:for-each>
   2.255  </xsl:for-each> 
   2.256  
     3.1 --- a/src/java/isac/util/genhtml/templates/thy_node_content_nomodel.xsl	Sun Sep 17 20:32:33 2006 +0200
     3.2 +++ b/src/java/isac/util/genhtml/templates/thy_node_content_nomodel.xsl	Mon Sep 18 21:59:56 2006 +0200
     3.3 @@ -4,6 +4,19 @@
     3.4  
     3.5  
     3.6  <!--
     3.7 +  This is a template which inserts unknown tags (such as html
     3.8 +  tags inside the EXPLANATIONS field) by simply writing:
     3.9 + <xsl:apply-templates/>
    3.10 +  If no other template matches better, this one is taken
    3.11 +-->
    3.12 +<xsl:template match="*">
    3.13 + <xsl:copy>
    3.14 +  <xsl:copy-of select="@*"/>
    3.15 + <xsl:apply-templates/>
    3.16 +</xsl:copy>
    3.17 +</xsl:template>
    3.18 +
    3.19 +<!--
    3.20    Call the template below to insert the content of a tag with
    3.21    replacement of newlines by <br> as following: 
    3.22    <xsl:call-template name="insert_with_line_breaks">
    3.23 @@ -14,8 +27,17 @@
    3.24    <xsl:param name="text" select="."/>
    3.25    <xsl:choose>
    3.26    <xsl:when test="contains($text, '&#xa;')">
    3.27 +  
    3.28 +  
    3.29 +    <xsl:variable name="token-before" select="substring-before($text,'&#xa;')"/>
    3.30 +    <xsl:choose>
    3.31 +  	<xsl:when test="string-length($token-before) > 0">
    3.32 +  
    3.33    	<xsl:value-of select="substring-before($text,'&#xa;')"/>
    3.34 -  	<br/>
    3.35 +
    3.36 +  	<br/> <xsl:text>&#xa;</xsl:text>
    3.37 +  	</xsl:when>   
    3.38 +	</xsl:choose>
    3.39    	<xsl:call-template name="insert_with_line_breaks">
    3.40    		<xsl:with-param name="text" select="substring-after($text,'&#xa;')"/>
    3.41    	</xsl:call-template>
    3.42 @@ -26,33 +48,70 @@
    3.43    </xsl:choose>
    3.44  </xsl:template>
    3.45  
    3.46 +<!--
    3.47 +  Call the template below to insert a link. The template expects
    3.48 +  that there is a <STRING> tag and a <GUH> tag inside of the 
    3.49 +  selected element. The content of the <STRING> tag is used as
    3.50 +  test of the link, the link is created out of the content 
    3.51 +  of the <GUH> tag. Call the template as following:
    3.52 +  <xsl:call-template name="insert_link">
    3.53 +    <xsl:with-param name="text" select="TAG_TO_SELECT"/>
    3.54 +  </xsl:call-template>
    3.55 +-->
    3.56 +<xsl:template name="insert_link">
    3.57 +  <xsl:param name="text" select="."/>
    3.58 +  <xsl:variable name="guh" select="normalize-space(GUH)"/>
    3.59 +	<xsl:element name="a">
    3.60 +		<xsl:attribute name="href">
    3.61 +			<xsl:text>../</xsl:text>
    3.62 +			<xsl:text><xsl:value-of select="substring-before($guh, '_')"/></xsl:text>
    3.63 +			<xsl:text>/</xsl:text>
    3.64 +			<xsl:text><xsl:value-of select="normalize-space(GUH)"/></xsl:text>
    3.65 +			<xsl:text>.html</xsl:text>
    3.66 +		</xsl:attribute>
    3.67 +		<xsl:value-of select="STRING"/>
    3.68 +	</xsl:element>
    3.69 +</xsl:template>
    3.70 +
    3.71 +
    3.72  <xsl:template match="/">
    3.73  <html>
    3.74  
    3.75  <body>
    3.76  
    3.77 +<xsl:for-each select="RULESETDATA">
    3.78  
    3.79 +<table style="text-align: left; width: 100%;" border="0" cellspacing="2"
    3.80 + cellpadding="2">
    3.81 +  <tbody>
    3.82 +<tr>
    3.83 +<td width="112"> <strong> Identifier: </strong> </td>
    3.84 +<td>
    3.85 +<xsl:value-of select="RULESET/ID"/>
    3.86 +</td>
    3.87 +</tr>
    3.88 +</tbody>
    3.89 +</table>
    3.90 +<hr></hr>
    3.91 +<div class="context">
    3.92 +</div>
    3.93 +<hr></hr>
    3.94  
    3.95 -<xsl:for-each select="RULESETDATA">
    3.96  <xsl:for-each select="RULESET/RULES">
    3.97 -<h3>Rules:</h3>
    3.98 -<table style="text-align: left; width: 100%;" border="1" cellspacing="2"
    3.99 +<strong>Rules:</strong>
   3.100 +<table style="text-align: left; width: 100%;" border="0" cellspacing="2"
   3.101   cellpadding="2">
   3.102    <tbody>
   3.103  <xsl:for-each select="RULE">
   3.104  <tr>
   3.105  
   3.106 -<td>
   3.107 +<td  width="112">
   3.108  <xsl:value-of select="TAG"/>
   3.109  </td>
   3.110  <td>
   3.111 -
   3.112 -<xsl:element name="a">
   3.113 -<xsl:attribute name="href">
   3.114 -<xsl:text><xsl:value-of select="normalize-space(GUH)"/></xsl:text><xsl:text>.html</xsl:text>
   3.115 -</xsl:attribute>
   3.116 -<xsl:value-of select="STRING"/>
   3.117 -</xsl:element>
   3.118 +  <xsl:call-template name="insert_link">
   3.119 +    <xsl:with-param name="text" select="."/>
   3.120 +  </xsl:call-template>
   3.121  </td>
   3.122  </tr>
   3.123  </xsl:for-each> 
   3.124 @@ -60,37 +119,76 @@
   3.125  </tbody>
   3.126  </table>
   3.127  </xsl:for-each> 
   3.128 +
   3.129 +<xsl:for-each select="RULESET/ORDER">
   3.130 +<br/>
   3.131 +<strong>For applying rules:</strong>
   3.132 +<table style="text-align: left; width: 100%;" border="0" cellspacing="2"
   3.133 + cellpadding="2">
   3.134 +  <tbody>
   3.135 +<tr>
   3.136 +
   3.137 +<td  width="112">
   3.138 +Rewriteorder
   3.139 +</td>
   3.140 +<td>
   3.141 +<xsl:value-of select="STRING"/>
   3.142 +</td>
   3.143 +</tr>
   3.144 +</tbody>
   3.145 +</table>
   3.146 +</xsl:for-each>
   3.147 +
   3.148 +<xsl:for-each select="RULESET/ERLS">
   3.149 +<br/>
   3.150 +<strong>For evaluating conditions in rules:</strong>
   3.151 +<table style="text-align: left; width: 100%;" border="0" cellspacing="2"
   3.152 + cellpadding="2">
   3.153 +  <tbody>
   3.154 +<tr>
   3.155 +
   3.156 +<td  width="112">
   3.157 +<xsl:value-of select="TAG"/>
   3.158 +</td>
   3.159 +<td>
   3.160 +  <xsl:call-template name="insert_link">
   3.161 +    <xsl:with-param name="text" select="."/>
   3.162 +  </xsl:call-template>
   3.163 +</td>
   3.164 +</tr>
   3.165 +</tbody>
   3.166 +</table>
   3.167 +</xsl:for-each>
   3.168 +
   3.169 +
   3.170 +<hr></hr>
   3.171  <xsl:for-each select="EXPLANATIONS">
   3.172 -<xsl:value-of select="."/>
   3.173 +<xsl:apply-templates/>
   3.174 +</xsl:for-each>
   3.175 +
   3.176  <hr></hr>
   3.177 -</xsl:for-each>
   3.178  <xsl:for-each select="MATHAUTHORS">
   3.179  <xsl:for-each select="STRING">
   3.180 -(c) <xsl:value-of select="."/> (math-autor)
   3.181 +(c) <xsl:value-of select="."/> (math-autor) <br/>
   3.182  </xsl:for-each>
   3.183 -<hr></hr>
   3.184  </xsl:for-each>
   3.185  <xsl:for-each select="COURSEDESIGNS/STRING">
   3.186 -(c) <xsl:value-of select="."/> (course-designer)
   3.187 +(c) <xsl:value-of select="."/> (course-designer) <br/>
   3.188  </xsl:for-each>
   3.189  </xsl:for-each> 
   3.190  
   3.191 -
   3.192 -
   3.193 -
   3.194  <xsl:for-each select="HTMLDATA">
   3.195  <xsl:for-each select="EXPLANATIONS">
   3.196 -<xsl:value-of select="."/>
   3.197 +<xsl:apply-templates/>
   3.198 +</xsl:for-each>
   3.199  <hr></hr>
   3.200 -</xsl:for-each>
   3.201  <xsl:for-each select="MATHAUTHORS">
   3.202  <xsl:for-each select="STRING">
   3.203 -(c) <xsl:value-of select="."/> (math-autor)
   3.204 +(c) <xsl:value-of select="."/> (math-autor) <br/>
   3.205  </xsl:for-each>
   3.206 -<hr></hr>
   3.207  </xsl:for-each>
   3.208  <xsl:for-each select="COURSEDESIGNS/STRING">
   3.209 -(c) <xsl:value-of select="."/> (course-designer)
   3.210 +(c) <xsl:value-of select="."/> (course-designer) <br/>
   3.211  </xsl:for-each>
   3.212  </xsl:for-each> 
   3.213  
   3.214 @@ -124,18 +222,36 @@
   3.215  </xsl:for-each> 
   3.216  
   3.217  <hr></hr>
   3.218 +<div class="context">
   3.219 +</div>
   3.220 +<hr></hr>
   3.221 +
   3.222 +<xsl:for-each select="PROOF">
   3.223 +
   3.224 +<xsl:element name="a">
   3.225 +<xsl:attribute name="href">
   3.226 +<xsl:value-of select="normalize-space(EXTREF/URL)"/>
   3.227 +
   3.228 +</xsl:attribute>
   3.229 +<xsl:value-of select="normalize-space(EXTREF/TEXT)"/>
   3.230 +</xsl:element>
   3.231 +</xsl:for-each>
   3.232 +
   3.233 +<hr></hr>
   3.234 +
   3.235  <xsl:for-each select="EXPLANATIONS">
   3.236 -<xsl:value-of select="."/>
   3.237 +<xsl:apply-templates/>
   3.238 +</xsl:for-each>
   3.239  <hr></hr>
   3.240 -</xsl:for-each>
   3.241 +
   3.242  <xsl:for-each select="MATHAUTHORS">
   3.243  <xsl:for-each select="STRING">
   3.244 -(c) <xsl:value-of select="."/> (math-autor)
   3.245 +(c) <xsl:value-of select="."/> (math-autor) <br/>
   3.246  </xsl:for-each>
   3.247 -<hr></hr>
   3.248  </xsl:for-each>
   3.249 +
   3.250  <xsl:for-each select="COURSEDESIGNS/STRING">
   3.251 -(c) <xsl:value-of select="."/> (course-designer)
   3.252 +(c) <xsl:value-of select="."/> (course-designer) <br/>
   3.253  </xsl:for-each>
   3.254  </xsl:for-each> 
   3.255