- From: <vojtech.toman@emc.com>
- Date: Wed, 25 Apr 2012 11:25:32 -0400
- To: <public-xml-processing-model-wg@w3.org>
Why isn't the following pipeline sufficient to satisfy the use case?
<p:declare-step version="1.0"xmlns:p="http://www.w3.org/ns/xproc">
<p:input port="source" sequence="true"/>
<p:input port="parameters" kind="parameter"/>
<p:output port="result"/>
<p:xslt>
<p:input port="stylesheet">
<p:inline>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output method="xml" encoding="utf-8" indent="no"
omit-xml-declaration="yes"/>
<xsl:template match="/">
<collection>
<xsl:value-of select="count(collection())"/>
</collection>
</xsl:template>
</xsl:stylesheet>
</p:inline>
</p:input>
</p:xslt>
</p:declare-step>
Regards,
Vojtech
--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech
> -----Original Message-----
> From: Norman Walsh [mailto:ndw@nwalsh.com]
> Sent: Wednesday, April 25, 2012 4:56 PM
> To: public-xml-processing-model-wg@w3.org
> Subject: Pipeline for 5.16
>
> Here's an XML Calabash pipeline for 5.16:
>
> <p:pipeline name="main" version="1.0"
> xmlns:cx="http://xmlcalabash.com/ns/extensions"
> xmlns:p="http://www.w3.org/ns/xproc">
>
> <p:declare-step type="cx:collection-manager">
> <p:input port="source" sequence="true"/>
> <p:output port="result" sequence="true" primary="false"/>
> <p:option name="href" required="true"/> </p:declare-step>
>
> <cx:collection-manager name="cxmgr"
> href="http://example.org/collection">
> <p:input port="source">
> <p:inline><doc1/></p:inline>
> <p:inline><doc2/></p:inline>
> <p:inline><doc3/></p:inline>
> </p:input>
> </cx:collection-manager>
>
> <p:xslt>
> <p:input port="source">
> <p:pipe step="cxmgr" port="result"/>
> </p:input>
> <p:input port="stylesheet">
> <p:inline>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="2.0">
>
> <xsl:output method="xml" encoding="utf-8" indent="no"
> omit-xml-declaration="yes"/>
>
> <xsl:param name="collection" select="'http://example.org/collection'"/>
>
> <xsl:template match="/">
> <collection uri="{$collection}">
> <xsl:value-of select="count(collection($collection))"/>
> </collection>
> </xsl:template>
>
> </xsl:stylesheet>
> </p:inline>
> </p:input>
> </p:xslt>
>
> </p:pipeline>
>
> Its output is
>
> <collection uri="http://example.org/collection">3</collection>
>
> The mapping of collection URIs to documents is implementation defined,
> so an extension step is one possibility, but command line arguments or
> other approaches are equally possible.
>
> Be seeing you,
> norm
>
> --
> Norman Walsh
> Lead Engineer
> MarkLogic Corporation
> Phone: +1 413 624 6676
> www.marklogic.com
Received on Wednesday, 25 April 2012 15:26:26 UTC