xslt-examples/relpipe-out-xhtml.xsl
author František Kučera <franta-hg@frantovo.cz>
Sat, 04 Dec 2021 21:14:52 +0100
branchv_0
changeset 34 03a167952dcd
parent 29 509cac0cf411
permissions -rw-r--r--
Added tag v0.18 for changeset a1024068410c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
<!--
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
Relational pipes
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
Copyright © 2020 František Kučera (Frantovo.cz, GlobalCode.info)
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
This program is free software: you can redistribute it and/or modify
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
it under the terms of the GNU General Public License as published by
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
the Free Software Foundation, version 3 of the License.
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
This program is distributed in the hope that it will be useful,
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
but WITHOUT ANY WARRANTY; without even the implied warranty of
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
GNU General Public License for more details.
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
You should have received a copy of the GNU General Public License
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
along with this program. If not, see <http://www.gnu.org/licenses/>.
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
-->
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
<xsl:stylesheet version="1.0"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
				xmlns="http://www.w3.org/1999/xhtml"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
				xmlns:h="http://www.w3.org/1999/xhtml"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
				xmlns:rp="tag:globalcode.info,2018:relpipe"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
				xmlns:fn="http://www.w3.org/2005/xpath-functions"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
				xmlns:svg="http://www.w3.org/2000/svg"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
				xmlns:xs="http://www.w3.org/2001/XMLSchema"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
				exclude-result-prefixes="fn h rp xs">
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
	<xsl:output
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
		method="xml"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
		indent="yes"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
		encoding="UTF-8"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
		doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
		doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
	<xsl:param name="title" select="'Relational pipes XHTML output'"/>
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    35
	<xsl:param name="description">This is output of <code>relpipe-out-xml</code> converted to XHTML web page.</xsl:param>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    36
	<xsl:param name="recordCountPrefix">Record count: </xsl:param>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    37
	<xsl:param name="recordCountSuffix"></xsl:param>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    38
	<xsl:param name="relationNamePrefix"></xsl:param>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    39
	<xsl:param name="relationNameSuffix"></xsl:param>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    40
	<xsl:param name="cssAppendix"></xsl:param>
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
	<!--
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
		TODO:
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
			Parameters:
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
				custom JavaScript
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
				whether to insert CSS classes for data types in each <td/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
				custom pre regex (see below)
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
				metadata relation name (will be hidden and we will get texts or custom titles for particular relations)
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
			CSS:
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    52
				table class for each relation (if [a-zA-Z0-9]+)
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
	-->
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    55
	<xsl:template match="/">
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    56
		<html>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    57
			<head>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    58
				<title>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    59
					<xsl:value-of select="$title"/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    60
				</title>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    61
				<meta name="generator" content="Relational pipes: https://relational-pipes.globalcode.info/"/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    62
				<style type="text/css">
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    63
					body {
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    64
					font-family: "Latin Modern Sans", sans;
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    65
					background-color: #efefef;
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    66
					color: black;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    67
					padding-left: 20px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    68
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    69
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    70
					p {
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    71
					max-width: 1200px;
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    72
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    73
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    74
					h1 {
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    75
					font-size: 160%;
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    76
					font-weight: bolder;
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    77
					}
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    78
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    79
					h2 {
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    80
					font-size: 130%;
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    81
					font-weight: bolder;
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    82
					}
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    83
					
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    84
					code {
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    85
					font-family: "Latin Modern Mono", "Dejavu Sans Mono", monospace;
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    86
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    87
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    88
					pre,code {
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    89
					font-family: "Latin Modern Mono", "Dejavu Sans Mono", monospace;
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    90
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    91
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    92
					table {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    93
					border-collapse:collapse;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    94
					margin-top: 10px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    95
					margin-bottom: 10px;
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    96
					box-shadow: 3px 3px 2px 0px rgba(0,0,0,0.2);
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    97
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    98
					td, th {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    99
					border: 1px solid black;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   100
					padding-top: 4px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   101
					padding-bottom: 4px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   102
					padding-left: 6px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   103
					padding-right: 6px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   104
					font-weight: normal;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   105
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   106
					td.type_integer,td.type_boolean {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   107
					text-align: right;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   108
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   109
					thead tr {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   110
					background: #aaa;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   111
					color:black;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   112
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   113
					tbody tr:hover {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   114
					background-color: silver;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   115
					color:black;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   116
					}
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   117
					<xsl:value-of select="$cssAppendix"/>
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   118
				</style>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   119
			</head>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   120
			<body>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   121
				<h1>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   122
					<xsl:value-of select="$title"/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   123
				</h1>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   124
				
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   125
				<p class="description">
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   126
					<xsl:copy-of select="$description"/>
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   127
				</p>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   128
				
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   129
				<xsl:for-each select="/rp:relpipe/rp:relation">
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   130
					<h2>
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   131
						<xsl:copy-of select="$relationNamePrefix"/>
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   132
						<xsl:value-of select="rp:name"/>
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   133
						<xsl:copy-of select="$relationNameSuffix"/>
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   134
					</h2>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   135
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   136
					<table>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   137
						<thead>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   138
							<tr>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   139
								<xsl:for-each select="rp:attributes-metadata/rp:attribute-metadata">
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   140
									<td>
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   141
										<span class="attributeName">
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   142
											<xsl:value-of select="@name"/>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   143
										</span>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   144
										<span class="attributeType">
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   145
											<xsl:text> (</xsl:text>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   146
											<xsl:value-of select="@type"/>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   147
											<xsl:text>)</xsl:text>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   148
										</span>
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   149
									</td>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   150
								</xsl:for-each>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   151
							</tr>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   152
						</thead>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   153
						<tbody>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   154
							<xsl:for-each select="rp:record">
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   155
								<tr>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   156
									<xsl:for-each select="rp:attribute">
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   157
										<xsl:variable name="column" select="position()"/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   158
										<!-- TODO: wrap in <pre/> for relations/attributes matching a regular expression passed as a XSLT parameter e.g. „relation1:attribute1|relation2:attribute3“  -->
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   159
										<td class="type_{../../rp:attributes-metadata/rp:attribute-metadata[$column]/@type}">
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   160
											<xsl:apply-templates/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   161
										</td>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   162
									</xsl:for-each>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   163
								</tr>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   164
							</xsl:for-each>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   165
						</tbody>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   166
					</table>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   167
					
29
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   168
					<p class="recordCount">
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   169
						<xsl:copy-of select="$recordCountPrefix"/>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   170
						<span class="recordCount">
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   171
							<xsl:value-of select="count(rp:record)"/>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   172
						</span>
509cac0cf411 xslt: relpipe-out-xhtml: customizable strings and CSS
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
   173
						<xsl:copy-of select="$recordCountSuffix"/>
27
796ff16f32fc xslt: relpipe-out-xhtml: display also record count
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
   174
					</p>
796ff16f32fc xslt: relpipe-out-xhtml: display also record count
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
   175
					
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   176
				</xsl:for-each>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   177
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   178
			</body>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   179
		</html>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   180
	</xsl:template>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   181
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   182
</xsl:stylesheet>