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

How to invoke a step recursively?

From: Manfred Staudinger <manfred.staudinger@gmail.com>
Date: Fri, 11 Sep 2009 13:09:20 +0200
Message-ID: <a946be3a0909110409p59e3b4b3q13ca8d362a79b87b@mail.gmail.com>
To: xproc-dev <xproc-dev@w3.org>
I would like to invoke step level-1 of my pipeline [1] recursively. So
iteration n should invoke this step with using the output from
iteration n-1 as its input. I need to have also the output from all
the iterations explicit in result. How can I achive this?

Regards,
Manfred

[1] xpl:
<p:declare-step name="myPipeline"
	xmlns:c="http://www.w3.org/ns/xproc-step"
	xmlns:p="http://www.w3.org/ns/xproc">
	<p:option name="dir"/>
	<p:output port="result" sequence="true">
		<p:pipe step="level-0" port="result"/>
		<p:pipe step="level-1" port="result"/>
	</p:output>
	<p:serialization port="result" indent="true" omit-xml-declaration="false"/>
	<p:directory-list name="level-0">
		<p:with-option name="path" select="concat($dir,
'/')"><p:empty/></p:with-option>
	</p:directory-list>
	<p:make-absolute-uris match="*/c:directory/@name">
		<p:with-option name="base-uri" select="concat($dir, '/')"/>
	</p:make-absolute-uris>
	<p:for-each name="level-1">
		<p:iteration-source select="/c:directory/c:directory"/>
		<p:output port="result"/>
		<p:variable name="dirpath" select="concat(c:directory/@name, '/')"/>
		<p:directory-list>
			<p:with-option name="path" select="$dirpath"/>
		</p:directory-list>
		<p:make-absolute-uris match="*/c:directory/@name">
			<p:with-option name="base-uri" select="$dirpath"/>
		</p:make-absolute-uris>
	</p:for-each>
</p:declare-step>
Received on Friday, 11 September 2009 11:10:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 11 September 2009 11:10:02 GMT