Mercurial > hg > ooxml
annotate visualise.xpl @ 26:d2ca3ea1f5ae
plumb in and use inverted ref table (via key)
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Fri, 07 Apr 2017 18:42:47 +0100 |
parents | a5125a2e77ea |
children | 8309dcfce613 |
rev | line source |
---|---|
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
1 <?xml version='1.0'?> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
2 <!DOCTYPE p:pipeline SYSTEM "../../../WWW/XML/XProc/docs/schemas/xproc.dtd" > |
13 | 3 <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:x="http://www.w3.org/1999/xhtml" version="1.0" name="vis"> |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
4 |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
5 <p:documentation xmlns="http://www.w3.org/1999/xhtml"> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
6 <div>Run this e.g. as follows: |
13 | 7 xproc --input source=sample2/xl/worksheets/sheet1.xml visualise.xpl elabDir=file:/d/MT/sonra/OOXML</div> |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
8 </p:documentation> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
9 |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
10 <p:option name="elabDir" required="true"> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
11 <p:documentation xmlns="http://www.w3.org/1999/xhtml"> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
12 <div>Directory where stylesheets, other info for stylesheet elaboration are found</div> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
13 </p:documentation> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
14 </p:option> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
15 |
17
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
16 <p:option name="format"> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
13
diff
changeset
|
17 <p:documentation xmlns="http://www.w3.org/1999/xhtml"> |
25
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
18 <div>If supplied, then use as stylesheet (located relative to elabDir), to |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
19 produce pretty output (e.g. ascii, html)</div> |
15
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
13
diff
changeset
|
20 </p:documentation> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
13
diff
changeset
|
21 </p:option> |
e767bef35bb9
default to ascii, but accept html.xsl for pretty
Henry S. Thompson <ht@markup.co.uk>
parents:
13
diff
changeset
|
22 |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
23 <p:load name="ss1"> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
24 <p:with-option name="href" select="concat($elabDir,'/format.xsl')"/> |
25
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
25 <p:documentation> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
26 <div>Use cell format and other cues in order to assign classes to cells</div> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
27 </p:documentation> |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
28 </p:load> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
29 |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
30 <p:xslt name="format"> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
31 <p:input port="source"> |
13 | 32 <p:pipe step="vis" port="source"/> |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
33 </p:input> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
34 <p:input port="stylesheet"> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
35 <p:pipe step="ss1" port="result"/> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
36 </p:input> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
37 <p:with-param name="elabDir" select="$elabDir"/> |
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:
17
diff
changeset
|
38 </p:xslt> |
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:
17
diff
changeset
|
39 |
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:
17
diff
changeset
|
40 <p:load name="ssr"> |
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:
17
diff
changeset
|
41 <p:with-option name="href" select="concat($elabDir,'/refs.xsl')"/> |
25
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
42 <p:documentation> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
43 <div>Tokenise cell formulae and extract local, range and external references</div> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
44 </p:documentation> |
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:
17
diff
changeset
|
45 </p:load> |
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:
17
diff
changeset
|
46 |
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:
17
diff
changeset
|
47 <p:xslt name="refs"> |
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:
17
diff
changeset
|
48 <p:input port="source"> |
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:
17
diff
changeset
|
49 <p:pipe step="vis" port="source"/> |
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:
17
diff
changeset
|
50 </p:input> |
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:
17
diff
changeset
|
51 <p:input port="stylesheet"> |
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:
17
diff
changeset
|
52 <p:pipe step="ssr" port="result"/> |
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:
17
diff
changeset
|
53 </p:input> |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
54 </p:xslt> |
25
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
55 |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
56 <p:load name="ssr2"> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
57 <p:with-option name="href" select="concat($elabDir,'/refs2.xsl')"/> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
58 <p:documentation> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
59 <div>Invert refs data into a map from cell to cells which point to it</div> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
60 </p:documentation> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
61 </p:load> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
62 |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
63 <p:xslt name="refs2"> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
64 <p:input port="source"> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
65 <p:pipe step="refs" port="result"/> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
66 </p:input> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
67 <p:input port="stylesheet"> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
68 <p:pipe step="ssr2" port="result"/> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
69 </p:input> |
a5125a2e77ea
towards inverted map of refs
Henry S. Thompson <ht@markup.co.uk>
parents:
19
diff
changeset
|
70 </p:xslt> |
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:
17
diff
changeset
|
71 |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
72 <p:load name="ss2"> |
12
01e125d722be
widening scope so better names
Henry S. Thompson <ht@markup.co.uk>
parents:
10
diff
changeset
|
73 <p:with-option name="href" select="concat($elabDir,'/rect.xsl')"/> |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
74 </p:load> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
75 |
13 | 76 <p:xslt name="rect"> |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
77 <p:input port="source"> |
10
01e80c7a9575
simple ascii type matrix output working
Henry S. Thompson <ht@markup.co.uk>
parents:
8
diff
changeset
|
78 <p:pipe step="format" port="result"/> |
26
d2ca3ea1f5ae
plumb in and use inverted ref table (via key)
Henry S. Thompson <ht@markup.co.uk>
parents:
25
diff
changeset
|
79 <p:pipe step="refs2" port="result"/> |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
80 </p:input> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
81 <p:input port="stylesheet"> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
82 <p:pipe step="ss2" port="result"/> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
83 </p:input> |
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
84 </p:xslt> |
12
01e125d722be
widening scope so better names
Henry S. Thompson <ht@markup.co.uk>
parents:
10
diff
changeset
|
85 |
17
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
86 <p:choose> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
87 <p:when test="p:value-available('format')"> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
88 <p:load name="ss3"> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
89 <p:with-option name="href" select="concat($elabDir,'/',$format)"/> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
90 </p:load> |
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:
17
diff
changeset
|
91 <p:xslt name="fmt"> |
17
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
92 <p:input port="source"> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
93 <p:pipe step="rect" port="result"/> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
94 </p:input> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
95 <p:input port="stylesheet"> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
96 <p:pipe step="ss3" port="result"/> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
97 </p:input> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
98 </p:xslt> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
99 </p:when> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
100 <p:otherwise> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
101 <p:identity/> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
102 </p:otherwise> |
a874f2a81ed2
default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
15
diff
changeset
|
103 </p:choose> |
8
785187b9caef
working toward doing an ascii-rectangle repr of a sheet
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
104 </p:pipeline> |