Mercurial > hg > ooxml
annotate html.xsl @ 60:588cb9ba7c9c
display of reffed info via colour minimally working
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Fri, 02 Jun 2017 15:50:43 +0100 |
parents | f90bbd38b8f6 |
children | 2da454c30b47 |
rev | line source |
---|---|
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
1 <?xml version='1.0'?> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
2 <!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" > |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" xmlns:s="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:e="http://markup.co.uk/excel" exclude-result-prefixes="xs s xpf e" xmlns="http://www.w3.org/1999/xhtml" xmlns:xpf="http://www.w3.org/2005/xpath-functions"> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
4 <xsl:strip-space elements="e:a"/> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
5 <xsl:output omit-xml-declaration="yes"/> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
6 |
34
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
7 <xsl:include href="n2a.xsl"/> |
59
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
8 |
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
9 <xsl:variable name="colours" select="( |
60
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
10 (: Thanks to http://stackoverflow.com/questions/470690/how-to-automatically-generate-n-distinct-colors :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
11 '#FFB300', (: Vivid Yellow :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
12 '#803E75', (: Strong Purple :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
13 '#FF6800', (: Vivid Orange :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
14 '#A6BDD7', (: Very Light Blue :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
15 '#C10020', (: Vivid Red :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
16 '#CEA262', (: Grayish Yellow :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
17 '#817066', (: Medium Gray :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
18 (: The following don't work well for people with defective color vision :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
19 '#007D34', (: Vivid Green :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
20 '#F6768E', (: Strong Purplish Pink :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
21 '#00538A', (: Strong Blue :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
22 '#FF7A5C', (: Strong Yellowish Pink :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
23 '#53377A', (: Strong Violet :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
24 '#FF8E00', (: Vivid Orange Yellow :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
25 '#B32851', (: Strong Purplish Red :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
26 '#F4C800', (: Vivid Greenish Yellow :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
27 '#7F180D', (: Strong Reddish Brown :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
28 '#93AA00', (: Vivid Yellowish Green :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
29 '#593315', (: Deep Yellowish Brown :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
30 '#F13A13', (: Vivid Reddish Orange :) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
31 '#232C16' (: Dark Olive Green :))"/> |
59
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
32 <xsl:variable name="nColours" select="count($colours)"/> |
60
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
33 <xsl:variable name="colourClassStyles" select="for $i in (1 to $nColours) return concat('.c',$i,' {background-color: ',$colours[$i],'}')"/> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
34 |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
35 <xsl:variable name="backfi" select="distinct-values(/e:a/e:r/e:c/e:i/@ri)"/> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
36 <xsl:variable name="borderClassStyles" select="for $fis in $backfi return e:bcs($fis)"></xsl:variable> |
34
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
37 |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
38 <xsl:template match="/"> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
39 <html> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
40 <head> |
34
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
41 <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
42 <style> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
43 body {font-family: 'DejaVu Sans Mono' , monospace} |
16
2bbd067529b6
improve efficiency, detect blank rows, don't type empty cells
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
44 td {padding: 0} |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
45 .e {color: red} |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
46 .formula {font-style: italic} |
19
9b1b169dc8db
use refs, but broken: doesn't deal with ranges (false negs) or external refs (false pos), and not finding things it should (e.g. kenneth_lay X88)
Henry S. Thompson <ht@markup.co.uk>
parents:
16
diff
changeset
|
47 .reffed {border: solid 1px black} |
34
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
48 table {table-layout: fixed} |
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
49 th {width: 1en} |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
50 </style> |
60
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
51 <style><xsl:value-of select="string-join($colourClassStyles,' ')"/></style> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
52 <style><xsl:value-of select="string-join($borderClassStyles,' ')"/></style> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
53 </head> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
54 <body> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
55 <xsl:apply-templates/> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
56 </body> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
57 </html> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
58 </xsl:template> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
59 |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
60 <xsl:template match="e:a"> |
34
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
61 <xsl:variable name="n" select="count(e:r[1]/e:c)"/> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
62 <table> |
34
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
63 <thead> |
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
64 <tr> |
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
65 <xsl:for-each select="1 to $n"> |
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
66 <th/> |
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
67 </xsl:for-each> |
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
68 </tr> |
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
69 </thead> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
70 <tbody><xsl:apply-templates/></tbody> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
71 </table> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
72 </xsl:template> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
73 |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
74 <xsl:template match="e:r"> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
75 <tr><xsl:apply-templates/></tr> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
76 <xsl:text> </xsl:text> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
77 </xsl:template> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
78 |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
79 <xsl:template match="e:c"> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
80 <td> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
81 <xsl:choose> |
44
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
82 <xsl:when test="@t|text()"> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
83 <xsl:attribute name="class"> |
44
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
84 <xsl:value-of select="(if (@t) then @t else text(), |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
85 if (e:f) then 'formula' else (), |
59
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
86 if (e:i) then e:rf(e:i/@ri) else (), |
50
01a7c2ebd3d1
top 20 shared formulae coloured in
Henry S. Thompson <ht@markup.co.uk>
parents:
44
diff
changeset
|
87 if (@fi) then concat('c',@fi) else ())"/> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
88 </xsl:attribute> |
44
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
89 <xsl:attribute name="title"> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
90 <xsl:choose> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
91 <xsl:when test="e:i"> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
92 <xsl:value-of select="e:i/@r"/>: <xsl:value-of select="e:i/e:r"/> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
93 </xsl:when> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
94 <xsl:otherwise> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
95 <xsl:value-of select="e:n2a(@c)"/><xsl:value-of select="../@r"/> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
96 </xsl:otherwise> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
97 </xsl:choose> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
98 </xsl:attribute> |
5b2333e59d91
updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents:
34
diff
changeset
|
99 <xsl:value-of select="if (@t) then @t else text()"/></xsl:when> |
34
93fd0d532754
fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents:
20
diff
changeset
|
100 <xsl:otherwise></xsl:otherwise> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
101 </xsl:choose> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
102 </td> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
103 </xsl:template> |
59
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
104 |
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
105 <xsl:variable name="borders" select="('left','right','top','bottom')"/> |
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
106 |
60
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
107 <xsl:function name="e:bcs" as="xs:string"> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
108 <xsl:param name="fiss" as="xs:string"/> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
109 <xsl:value-of select="let $fis := tokenize($fiss,'_') return |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
110 concat('.b',$fiss,' {', |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
111 string-join(for $i in (1 to 4) return |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
112 e:bfs($fis[$i], |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
113 $borders[$i]), |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
114 '; '), |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
115 '}')"/> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
116 </xsl:function> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
117 |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
118 <xsl:function name="e:bfs" as="xs:string"> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
119 <xsl:param name="fi" as="xs:string?"/> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
120 <xsl:param name="pos" as="xs:string"/> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
121 <xsl:value-of select="if (empty($fi)) then |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
122 concat('border-',$pos,': solid 1px black') else |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
123 concat('border-',$pos,': solid 2px ', |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
124 $colours[xs:integer($fi)])"/> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
125 </xsl:function> |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
126 |
59
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
127 <xsl:function name="e:rf" as="xs:string"> |
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
128 <xsl:param name="ris" as="attribute(ri)*"/> |
60
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
129 <xsl:value-of select="let $ff := (for $ri in tokenize(string($ris),'_') |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
130 return if (xs:integer($ri) le $nColours) then $ri else ()) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
131 return if (empty($ff)) |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
132 then 'reffed' |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
133 else concat('b', |
588cb9ba7c9c
display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents:
59
diff
changeset
|
134 string-join(subsequence($ff,1,4),'_'))"/> |
59
f90bbd38b8f6
towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents:
50
diff
changeset
|
135 </xsl:function> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
136 </xsl:stylesheet> |