xslt-examples/relpipe-out-xhtml.xsl
author František Kučera <franta-hg@frantovo.cz>
Thu, 04 Jun 2020 14:08:47 +0200
branchv_0
changeset 27 796ff16f32fc
parent 25 8e2d9b67b51c
child 29 509cac0cf411
permissions -rw-r--r--
xslt: relpipe-out-xhtml: display also record count
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'"/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
	<!--
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
		TODO:
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
			Parameters:
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
				title / h1
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
				introduction and footer for whole report
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
				introduction and footer for every relation
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
				custom CSS + optionaly remove default CSS
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
				custom JavaScript
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
				whether to display or hide types in table headers
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
				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
    47
				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
    48
				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
    49
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
			CSS:
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
				clean-up, better style
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    52
				attribute name
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
				attribute type
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
				relation name
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    55
				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
    56
	-->
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    57
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    58
	<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
    59
		<html>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    60
			<head>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    61
				<title>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    62
					<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
    63
				</title>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    64
				<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
    65
				<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
    66
					body {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    67
					font-family: sans;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    68
					background-color: #eee;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    69
					color: black;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    70
					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
    71
					}
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
					p {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    74
					max-width: 800px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    75
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    76
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    77
					h1,h2 {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    78
					max-width: 800px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    79
					border-radius: 8px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    80
					border: 1px solid #ddd;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    81
					background-color: #e8e8e8;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    82
					padding: 6px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    83
					text-shadow: 2px 2px 2px #aaa;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    84
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    85
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    86
					h1 {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    87
					font-size: 150%
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    88
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    89
					h2 {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    90
					font-size: 100%;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    91
					font-weight: bold;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    92
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    93
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    94
					pre,code {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    95
					color: #a00;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    96
					}
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
					table {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    99
					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
   100
					box-shadow: 3px 3px 3px grey;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   101
					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
   102
					margin-bottom: 10px;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   103
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   104
					td, th {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   105
					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
   106
					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
   107
					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
   108
					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
   109
					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
   110
					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
   111
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   112
					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
   113
					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
   114
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   115
					thead tr {
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   116
					background: #aaa;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   117
					color:black;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   118
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   119
					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
   120
					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
   121
					color:black;
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   122
					}
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   123
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   124
				</style>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   125
			</head>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   126
			<body>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   127
				<h1>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   128
					<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
   129
				</h1>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   130
				
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   131
				<p>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   132
					This is output of <code>relpipe-out-xml</code> converted to XHTML web page.
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   133
				</p>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   134
				
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   135
				<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
   136
					<h2>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   137
						<xsl:value-of select="rp:name"/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   138
					</h2>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   139
					
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   140
					<table>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   141
						<thead>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   142
							<tr>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   143
								<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
   144
									<td>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   145
										<xsl:value-of select="@name"/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   146
										<xsl:text> (</xsl:text>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   147
										<xsl:value-of select="@type"/>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   148
										<xsl:text>)</xsl:text>
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
					
27
796ff16f32fc xslt: relpipe-out-xhtml: display also record count
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
   168
					<p>
796ff16f32fc xslt: relpipe-out-xhtml: display also record count
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
   169
						Record count: <xsl:value-of select="count(rp:record)"/>
796ff16f32fc xslt: relpipe-out-xhtml: display also record count
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
   170
					</p>
796ff16f32fc xslt: relpipe-out-xhtml: display also record count
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
   171
					
25
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   172
				</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
   173
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   174
			</body>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   175
		</html>
8e2d9b67b51c xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   176
	</xsl:template>
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
</xsl:stylesheet>