annotate html.xsl @ 61:2da454c30b47

minor bugfix for multi-refs
author Henry S. Thompson <ht@markup.co.uk>
date Fri, 02 Jun 2017 16:11:13 +0100
parents 588cb9ba7c9c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
61
2da454c30b47 minor bugfix for multi-refs
Henry S. Thompson <ht@markup.co.uk>
parents: 60
diff changeset
35 <xsl:variable name="backfi" select="distinct-values(for $ii in /e:a/e:r/e:c/e:i/@ri return string-join(subsequence(tokenize($ii,'_'),1,4),
2da454c30b47 minor bugfix for multi-refs
Henry S. Thompson <ht@markup.co.uk>
parents: 60
diff changeset
36 '_'))"/>
60
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
37 <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
38
15
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
39 <xsl:template match="/">
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
40 <html>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
41 <head>
34
93fd0d532754 fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents: 20
diff changeset
42 <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
43 <style>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
44 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
45 td {padding: 0}
15
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
46 .e {color: red}
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
47 .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
48 .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
49 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
50 th {width: 1en}
15
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
51 </style>
60
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($colourClassStyles,'&#10; ')"/></style>
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
53 <style><xsl:value-of select="string-join($borderClassStyles,'&#10; ')"/></style>
15
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
54 </head>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
55 <body>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
56 <xsl:apply-templates/>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
57 </body>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
58 </html>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
59 </xsl:template>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
60
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
61 <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
62 <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
63 <table>
34
93fd0d532754 fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents: 20
diff changeset
64 <thead>
93fd0d532754 fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents: 20
diff changeset
65 <tr>
93fd0d532754 fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents: 20
diff changeset
66 <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
67 <th/>
93fd0d532754 fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents: 20
diff changeset
68 </xsl:for-each>
93fd0d532754 fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents: 20
diff changeset
69 </tr>
93fd0d532754 fix bug in refs wrt e.g. [1]!.SGX,
Henry S. Thompson <ht@markup.co.uk>
parents: 20
diff changeset
70 </thead>
15
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
71 <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
72 </table>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
73 </xsl:template>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
74
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
75 <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
76 <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
77 <xsl:text>&#10;</xsl:text>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
78 </xsl:template>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
79
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
80 <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
81 <td>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
82 <xsl:choose>
44
5b2333e59d91 updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents: 34
diff changeset
83 <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
84 <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
85 <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
86 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
87 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
88 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
89 </xsl:attribute>
44
5b2333e59d91 updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents: 34
diff changeset
90 <xsl:attribute name="title">
5b2333e59d91 updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents: 34
diff changeset
91 <xsl:choose>
5b2333e59d91 updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents: 34
diff changeset
92 <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
93 <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
94 </xsl:when>
5b2333e59d91 updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents: 34
diff changeset
95 <xsl:otherwise>
5b2333e59d91 updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents: 34
diff changeset
96 <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
97 </xsl:otherwise>
5b2333e59d91 updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents: 34
diff changeset
98 </xsl:choose>
5b2333e59d91 updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents: 34
diff changeset
99 </xsl:attribute>
5b2333e59d91 updated html, ascii output to new raw doctype
Henry S. Thompson <ht@markup.co.uk>
parents: 34
diff changeset
100 <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
101 <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
102 </xsl:choose>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
103 </td>
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
104 </xsl:template>
59
f90bbd38b8f6 towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents: 50
diff changeset
105
f90bbd38b8f6 towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents: 50
diff changeset
106 <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
107
60
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
108 <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
109 <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
110 <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
111 concat('.b',$fiss,' {',
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
112 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
113 e:bfs($fis[$i],
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
114 $borders[$i]),
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 '}')"/>
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
117 </xsl:function>
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
118
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
119 <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
120 <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
121 <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
122 <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
123 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
124 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
125 $colours[xs:integer($fi)])"/>
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
126 </xsl:function>
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
127
59
f90bbd38b8f6 towards display of reffed info via colour
Henry S. Thompson <ht@markup.co.uk>
parents: 50
diff changeset
128 <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
129 <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
130 <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
131 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
132 return if (empty($ff))
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
133 then 'reffed'
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
134 else concat('b',
588cb9ba7c9c display of reffed info via colour minimally working
Henry S. Thompson <ht@markup.co.uk>
parents: 59
diff changeset
135 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
136 </xsl:function>
15
e767bef35bb9 default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
137 </xsl:stylesheet>