Mercurial > hg > ooxml
comparison visualise.xpl @ 27:8309dcfce613
preparing for variable deref
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Mon, 10 Apr 2017 17:29:24 +0100 |
parents | d2ca3ea1f5ae |
children | ae605b77d1e4 |
comparison
equal
deleted
inserted
replaced
26:d2ca3ea1f5ae | 27:8309dcfce613 |
---|---|
1 <?xml version='1.0'?> | 1 <?xml version='1.0'?> |
2 <!DOCTYPE p:pipeline SYSTEM "../../../WWW/XML/XProc/docs/schemas/xproc.dtd" > | 2 <!DOCTYPE p:pipeline SYSTEM "../../../WWW/XML/XProc/docs/schemas/xproc.dtd" > |
3 <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:x="http://www.w3.org/1999/xhtml" version="1.0" name="vis"> | 3 <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:x="http://www.w3.org/1999/xhtml" version="1.0" name="vis" xmlns:xf="http://www.w3.org/2005/xpath-functions" xmlns:cx="http://xmlcalabash.com/ns/extensions"> |
4 <p:import href="http://xmlcalabash.com/extension/steps/library-1.0.xpl"/> | |
4 | 5 |
5 <p:documentation xmlns="http://www.w3.org/1999/xhtml"> | 6 <p:documentation xmlns="http://www.w3.org/1999/xhtml"> |
6 <div>Run this e.g. as follows: | 7 <div>Run this e.g. as follows: |
7 xproc --input source=sample2/xl/worksheets/sheet1.xml visualise.xpl elabDir=file:/d/MT/sonra/OOXML</div> | 8 xproc --input source=sample2/xl/worksheets/sheet1.xml visualise.xpl elabDir=file:/d/MT/sonra/OOXML</div> |
8 </p:documentation> | 9 </p:documentation> |
18 <div>If supplied, then use as stylesheet (located relative to elabDir), to | 19 <div>If supplied, then use as stylesheet (located relative to elabDir), to |
19 produce pretty output (e.g. ascii, html)</div> | 20 produce pretty output (e.g. ascii, html)</div> |
20 </p:documentation> | 21 </p:documentation> |
21 </p:option> | 22 </p:option> |
22 | 23 |
24 <p:variable name="base" select="base-uri()"> | |
25 <p:pipe step="vis" port="source"/> | |
26 </p:variable> | |
27 <p:variable name="buPat" select="'^(.*/xl/)worksheets/sheet([^/]*).xml$'"/> | |
28 | |
29 <!-- Will only work in XProc 3 :-( <p:variable name="baseParts" select="analyze-string($base,)"/>--> | |
30 | |
31 <p:variable name="root" select="analyze-string($base,$buPat)/xf:match/xf:group[@nr=1]"/> | |
32 <p:variable name="sheet-number" select="analyze-string($base,$buPat)/xf:match/xf:group[@nr=2]"/> | |
33 <!--<cx:message> | |
34 <p:with-option name="message" select="concat($base,'|',$sheet-number,'|')"/> | |
35 </cx:message>--> | |
36 | |
23 <p:load name="ss1"> | 37 <p:load name="ss1"> |
24 <p:with-option name="href" select="concat($elabDir,'/format.xsl')"/> | 38 <p:with-option name="href" select="concat($elabDir,'/format.xsl')"/> |
25 <p:documentation> | 39 <p:documentation> |
26 <div>Use cell format and other cues in order to assign classes to cells</div> | 40 <div>Use cell format and other cues in order to assign classes to cells</div> |
27 </p:documentation> | 41 </p:documentation> |
33 </p:input> | 47 </p:input> |
34 <p:input port="stylesheet"> | 48 <p:input port="stylesheet"> |
35 <p:pipe step="ss1" port="result"/> | 49 <p:pipe step="ss1" port="result"/> |
36 </p:input> | 50 </p:input> |
37 <p:with-param name="elabDir" select="$elabDir"/> | 51 <p:with-param name="elabDir" select="$elabDir"/> |
52 <p:with-param name="xlDir" select="$root"/> | |
38 </p:xslt> | 53 </p:xslt> |
39 | 54 |
40 <p:load name="ssr"> | 55 <p:load name="ssr"> |
41 <p:with-option name="href" select="concat($elabDir,'/refs.xsl')"/> | 56 <p:with-option name="href" select="concat($elabDir,'/refs.xsl')"/> |
42 <p:documentation> | 57 <p:documentation> |
49 <p:pipe step="vis" port="source"/> | 64 <p:pipe step="vis" port="source"/> |
50 </p:input> | 65 </p:input> |
51 <p:input port="stylesheet"> | 66 <p:input port="stylesheet"> |
52 <p:pipe step="ssr" port="result"/> | 67 <p:pipe step="ssr" port="result"/> |
53 </p:input> | 68 </p:input> |
69 <p:with-param name="sheet-number" select="$sheet-number"/> | |
70 <p:with-param name="xlDir" select="$root"/> | |
54 </p:xslt> | 71 </p:xslt> |
55 | 72 |
56 <p:load name="ssr2"> | 73 <p:load name="ssr2"> |
57 <p:with-option name="href" select="concat($elabDir,'/refs2.xsl')"/> | 74 <p:with-option name="href" select="concat($elabDir,'/refs2.xsl')"/> |
58 <p:documentation> | 75 <p:documentation> |