Re: Debugging xproc files

On 16 April 2010 11:56, Norman Walsh <ndw@nwalsh.com> wrote:

> The p:log step is sometimes useful. Giving steps names is often useful.
> The cx:message and cx:tee steps are often useful.
>
> The cx:message step is an XML Calabash extension,
>
> <p:declare-step type="cx:message">
>  <p:input port="source"/>
>  <p:output port="result"/>
>  <p:option name="message" required="true"/>
> </p:declare-step>

So I could 'slip that in between' two steps? 'Splice' is the appropriate term
I think! At least for ropes.


>
> but cx:tee is an ordinary pipeline.
>
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
>                xmlns:cx="http://xmlcalabash.com/ns/extensions"
>                type="cx:tee" name="main" version="1.0">
>  <p:input port="source" sequence="true" primary="true"/>
>  <p:output port="result" sequence="true" primary="true"/>
>  <p:option name="href" required="true"/>
>  <p:option name="debug" select="0"/>
>
>  <p:choose>
>    <p:when test="$debug != 0">
>      <p:store name="saving-debugging-output" method="xml" indent="true">
>        <p:with-option name="href" select="$href"/>

??? Insert the .. xml debug output? in here?


>      </p:store>
>    </p:when>

Like it! memories of xslt  ;-)
Only dump output when $debug is true.


>    <p:otherwise>
>      <p:sink name="discarding-debugging-output"/>
>    </p:otherwise>
>  </p:choose>
>
>  <p:identity name="identity">
>    <p:input port="source">
>      <p:pipe step="main" port="source"/>
>    </p:input>
>  </p:identity>
> </p:declare-step>
>
> Working on improving the error messages in XML Calabash is about
> medium high on my list.

It is the one thing that sets Saxon apart IMHO, great debugging info.


regards

-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Received on Friday, 16 April 2010 11:03:26 UTC