Mercurial > hg > ooxml
annotate tokenise.xsl @ 37:ac3cd8de7a10
towards big rework of tokenisation
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Tue, 25 Apr 2017 18:30:04 +0100 |
parents | |
children | 468a6cf8bf0b |
rev | line source |
---|---|
37
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
1 <?xml version='1.0'?> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
2 <!DOCTYPE xsl:stylesheet SYSTEM "../../../lib/xml/xsl.dtd" > |
ac3cd8de7a10
towards big rework of tokenisation
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 e xf" xmlns="http://markup.co.uk/excel" xmlns:xf="http://www.w3.org/2005/xpath-functions"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
4 <xsl:param name="sheet-number"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
5 <xsl:param name="xlDir"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
6 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
7 <xsl:include href="a2n.xsl"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
8 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
9 <xsl:variable name="pat1">("[^"]*")|(\{[^}]+})|(,)|([^=\-+*/();:,.$<>^!]+(?:\.[^=\-+*/();:,.$<>^!]+)*\()|([)])|(^=|\()|((?:(?:'[^']+')|(?:\[[0-9]+\][^!]*)|(?:[a-zA-Z_][a-zA-Z0-9._]*)!))|(\$?[A-Z]+\$?[0-9]+)|([a-zA-Z_\\][a-zA-Z0-9._]*)|(.)</xsl:variable> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
10 <xsl:param name="pat" select="$pat1"/><!-- xsl:param for refinement debugging by passing in the pattern --> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
11 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
12 <xsl:variable name="workbook" select="document(concat($xlDir,'/workbook.xml'))/*"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
13 <xsl:variable name="sheet-name" select="$workbook/s:sheets/s:sheet[@sheetId=$sheet-number]/@name"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
14 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
15 <xsl:function name="e:lookup" as="xs:string*"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
16 <xsl:param name="name" as="xs:string" required="yes"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
17 <xsl:variable name="defn" select="$workbook/s:definedNames/s:definedName[@name=$name]"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
18 <xsl:sequence select="let $prefix := concat($sheet-name,'!') |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
19 return if ($defn and |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
20 starts-with($defn,$prefix)) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
21 then substring-after($defn,$prefix) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
22 else ()"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
23 </xsl:function> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
24 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
25 <xsl:function name="e:tokenise" as="element(*)*"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
26 <!-- Tokenise a formula, recursively wrt variables |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
27 Output is composed of e:* as follows: |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
28 c: A list (function parameter) separator |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
29 e: An external (variable, cell or range) reference |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
30 f: A function name followed by an opening parenthesis |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
31 l: The beginning of the formula or an opening paren |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
32 m: A constant matrix |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
33 p: A close-paren |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
34 q: A text (delimited by double quotes) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
35 r: A range reference |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
36 s: A single-cell reference |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
37 v: A variable name [should only occur inside e] |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
38 x: Amalgamated single characters not matched by anything else |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
39 --> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
40 <xsl:param name="formula" as="xs:string" required="yes"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
41 <!-- The row and column number of the cell whence the formula came --> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
42 <xsl:param name="row" required="yes" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
43 <xsl:param name="col" required="yes" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
44 <xsl:sequence select=" |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
45 let $tokens := analyze-string($formula,$pat)/xf:match/xf:group |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
46 return e:tok1($tokens,count($tokens),1,$row,$col,())"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
47 </xsl:function> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
48 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
49 <xsl:function name="e:tok1" as="element(*)*"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
50 <xsl:param name="tokens" as="element(xf:group)*" required="yes"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
51 <xsl:param name="n" required="yes" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
52 <xsl:param name="i" required="yes" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
53 <xsl:param name="row" required="yes" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
54 <xsl:param name="col" required="yes" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
55 <xsl:param name="soFar" required="yes" as="element(*)*"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
56 <xsl:sequence select=" |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
57 if ($i gt $n) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
58 then $soFar |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
59 else |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
60 let $next := e:expand($tokens,$i,true(),$row,$col), |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
61 $j := $next?1, |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
62 $res := $next?2 return |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
63 e:tok1($tokens,$n,$j,$row,$col,($soFar,$res))"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
64 </xsl:function> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
65 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
66 <xsl:function name="e:expand" as="element(*)*"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
67 <xsl:param name="tokens" required="yes" as="element(xf:group)*"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
68 <xsl:param name="i" required="yes" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
69 <xsl:param name="local" required="yes" as="xs:boolean"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
70 <xsl:param name="row" required="yes" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
71 <xsl:param name="col" required="yes" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
72 <xsl:sequence select=" |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
73 let $t := $tokens[$i], |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
74 $r := $tokens[$i + 1] return |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
75 if ($t/@nr=1) then e:exp1($i,'q',string($t)) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
76 else if ($t/@nr=2) then e:exp1($i,'m',string($t)) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
77 else if ($t/@nr=3) then e:exp1($i,'c',',') |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
78 else if ($t/@nr=4) then e:exp1($i,'f',string($t)) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
79 else if ($t/@nr=5) then e:exp1($i,'p',')') |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
80 else if ($t/@nr=6) then e:exp1($i,'l',string($t)) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
81 else if ($t/@nr=7) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
82 then if (substring-before($t,'!')=('[0]',$sheet-name)) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
83 then (: it's a local reference after all :) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
84 e:expand($tokens,$i+1,true(),$row,$col) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
85 else let $ext := e:expand($tokens,$i+1,false(),$row,$col) return |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
86 [$ext?1,e:external($ext?2)] |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
87 else if ($t/@nr=10) then e:amalgamate($tokens,$i+1,string($t)) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
88 else if ($r[@nr=10 and .=':']) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
89 then (: a range, takes priority :) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
90 e:range($tokens,$i,$ext,$row,$col) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
91 else if ($t/@nr=8) then e:single($i,$ext,string($t)) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
92 else if ($t/@nr=9) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
93 then if ($ext) then (: can't expand :) e:exp1($i,'v',string($t)) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
94 else e:tokenise(e:lookup(string($t)),$row,$col) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
95 else (-- shouldn't ever get here --) ()"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
96 </xsl:function> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
97 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
98 <xsl:function name="e:exp1" as="array(*)"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
99 <xsl:param name="i" as="xs:int"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
100 <xsl:param name="name" as="xs:string"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
101 <xsl:param name="val" as="xs:string"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
102 <xsl:variable name="elt"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
103 <xsl:element name="{$name}" namespace="http://markup.co.uk/excel"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
104 <xsl:value-of select="$val"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
105 </xsl:element> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
106 </xsl:variable> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
107 <xsl:sequence select="[$i+1,$elt]"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
108 </xsl:function> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
109 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
110 <xsl:function name="e:single" as="element(*)"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
111 <xsl:param name="group" as="element(xf:group)"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
112 <xsl:param name="row" as="xs:integer"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
113 <xsl:param name="col" as="xs:integer"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
114 <xsl:param name="external" as="xs:boolean"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
115 <xsl:variable name="val" select="if ($group/@nr=9) then e:lookup($group) |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
116 else string($group)"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
117 <xsl:choose> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
118 <xsl:when test="count($val)>0 or not($external)"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
119 <xsl:sequence select="e:cr($val,$row,$col)"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
120 </xsl:when> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
121 <xsl:otherwise> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
122 <v><xsl:value-of select="$group"/></v> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
123 </xsl:otherwise> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
124 </xsl:choose> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
125 </xsl:function> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
126 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
127 <xsl:function name="e:range" as="element(e:r)"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
128 <xsl:param name="l" as="element(e:s)" required="yes"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
129 <xsl:param name="r" as="element(e:s)" required="yes"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
130 <r><xsl:copy-of select="$l"/><xsl:copy-of select="$r"/></r> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
131 </xsl:function> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
132 |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
133 <xsl:function name="e:external" as="element(e:e)"> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
134 <xsl:param name="source" as="element(xf:group)" required="yes"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
135 <xsl:param name="ref" as="element(*)" required="yes"/> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
136 <e s="{$source}"><xsl:sequence select="$ref"/></e> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
137 </xsl:function> |
ac3cd8de7a10
towards big rework of tokenisation
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
138 </xsl:stylesheet> |