W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2009

Testing serialization options

From: Norman Walsh <ndw@nwalsh.com>
Date: Sun, 14 Jun 2009 14:55:52 -0400
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m2hbyik5l3.fsf@nwalsh.com>
Hello implementors,

I've taken a stab at creating tests for a few of the serialization
options. It's tricky because what needs to be tested is *the
serialization of the result* and not the result itself. To that end,
here's what the tests look like:

<t:test xmlns:t="http://xproc.org/ns/testsuite"

<t:title>Serialization test doctype-system-001</t:title>

<t:input port='source' href="../doc/s-input.xml"/>

<p:declare-step name="main">
  <p:input port="source"/>
  <p:output port="uri"/>

  <p:store href="file:///tmp/doctype-system-001.xml"

  <p:string-replace match="c:result/text()">
    <p:input port="source">
    <p:with-option name="replace"
      <p:pipe step="main" port="source"/>


<p:declare-step name="main">
<p:input port="uri"/>
<p:output port="result"/>

<p:exec name="diff"
  <p:input port="source"><p:empty/></p:input>
  <p:with-option name="args"
	         select="concat('/tmp/doctype-system-001.xml ',
    <p:pipe step="main" port="uri"/>

  <p:input port="source">
    <p:pipe step="diff" port="exit-status"/>


<t:output port="result"><c:result>0</c:result></t:output>


The way this works is like this:

1. The main pipeline uses p:store to write the results into /tmp 
2. It passes that location to the compare pipeline
3. The compare pipeline uses serdiff to compare the serialized forms

You can find my very crude initial implementation of serdiff at

The idea is that over time serdiff can grow to filter out the
non-essential differences between outputs. Right now, it just does a
straight compare.

Comments, thoughts, other implementors results against the
serialization tests most welcome.

                                        Be seeing you,

Norman Walsh <ndw@nwalsh.com> | Democracy consists of choosing your
http://nwalsh.com/            | dictators, after they've told you what
                              | you think it is you want to hear.--Alan
                              | Corenk

Received on Sunday, 14 June 2009 18:56:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:05 UTC