view visualise.xpl @ 15:e767bef35bb9

default to ascii, but accept html.xsl for pretty
author Henry S. Thompson <ht@markup.co.uk>
date Mon, 03 Apr 2017 16:02:10 +0100
parents f78e8c55c06b
children a874f2a81ed2
line wrap: on
line source

<?xml version='1.0'?>
<!DOCTYPE p:pipeline SYSTEM "../../../WWW/XML/XProc/docs/schemas/xproc.dtd" >
<p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:x="http://www.w3.org/1999/xhtml" version="1.0" name="vis">
 
 <p:documentation xmlns="http://www.w3.org/1999/xhtml">
  <div>Run this e.g. as follows:
       xproc --input source=sample2/xl/worksheets/sheet1.xml visualise.xpl elabDir=file:/d/MT/sonra/OOXML</div>
 </p:documentation>
 
 <p:option name="elabDir" required="true">
  <p:documentation xmlns="http://www.w3.org/1999/xhtml">
   <div>Directory where stylesheets, other info for stylesheet elaboration are found</div>
  </p:documentation>
 </p:option>
 
 <p:option name="format" select="'ascii.xsl'">
  <p:documentation xmlns="http://www.w3.org/1999/xhtml">
   <div>If supplied, then use as stylesheet (located relative to elabDir)</div>
  </p:documentation>
 </p:option>
 
 <p:load name="ss1">
  <p:with-option name="href" select="concat($elabDir,'/format.xsl')"/>
 </p:load>

 <p:xslt name="format">
   <p:input port="source">
    <p:pipe step="vis" port="source"/>
   </p:input>
  <p:input port="stylesheet">
   <p:pipe step="ss1" port="result"/>
  </p:input>
  <p:with-param name="elabDir" select="$elabDir"/>
 </p:xslt>
 
 <p:load name="ss2">
  <p:with-option name="href" select="concat($elabDir,'/rect.xsl')"/>
 </p:load>
 
 <p:xslt name="rect">
   <p:input port="source">
    <p:pipe step="format" port="result"/>
   </p:input>
  <p:input port="stylesheet">
   <p:pipe step="ss2" port="result"/>
  </p:input>
 </p:xslt>
 
 <p:load name="ss3">
  <p:with-option name="href" select="concat($elabDir,'/',$format)"/>
 </p:load>
 
 <p:xslt name="asc">
   <p:input port="source">
    <p:pipe step="rect" port="result"/>
   </p:input>
  <p:input port="stylesheet">
   <p:pipe step="ss3" port="result"/>
  </p:input>
 </p:xslt>
</p:pipeline>