W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > November 2007

A small stress test

From: Richard Tobin <richard@inf.ed.ac.uk>
Date: Fri, 30 Nov 2007 18:40:47 +0000 (GMT)
To: public-xml-processing-model-wg@w3.org
Message-Id: <20071130184047.CD3B129A01A@macpro.inf.ed.ac.uk>

The pipeline below computes Ackermann's function.  For example,
given the input file


it produces the output


Given the input


it should produce


but with my implementation produces "fork: Resource temporarily unavailable".

<p:pipeline name="ackermann" xmlns:p="http://www.w3.org/ns/xproc">

<p:input port="in"/>
<p:output port="out"/>

<p:xslt name="transform">
  <p:input port="stylesheet">

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="node()">
      <xsl:apply-templates select="node()"/>

  <xsl:template match="a[.//a]" priority="10">
      <xsl:apply-templates select="node()"/>

  <xsl:template match="a[m=0]">
      <xsl:value-of select="n + 1"/>

  <xsl:template match="a[m>0 and n=0]">
      <m><xsl:value-of select="m - 1"/></m>

  <xsl:template match="a[m>0 and n>0]">
      <m><xsl:value-of select="m - 1"/></m>
	  <m><xsl:value-of select="m"/></m>
	  <n><xsl:value-of select="n - 1"/></n>



<p:choose name="choose">
  <p:when test="//a" name="when">
    <ackermann name="rec-ack"/>
  <p:otherwise name="otherwise">
    <p:identity name="identity"/>


-- Richard
Received on Friday, 30 November 2007 18:40:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:32:45 UTC