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

How do I specify a dynamic value for href in p:store?

From: Costello, Roger L. <costello@mitre.org>
Date: Sat, 17 Jan 2009 11:28:03 -0500
To: "'xproc-dev@w3.org'" <xproc-dev@w3.org>, "Costello, Roger L." <costello@mitre.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB500365952A07@IMCMBX3.MITRE.ORG>

Hi Folks,

I have a juicers.xml document containing a sequence of <juicer> elements. 

I want to use p:foreach to iterate through each <juicer> element and p:store each <juicer> element into a different file, using the child <name> element concatenated with '.xml'

Here's my attempt at it:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">

        <p:input port="source">
            <p:document href="juicers.xml"/>
        <p:output port="result" sequence="true" />
        <p:iteration-source select="//juicer"/>
        <p:output port="result"/>
        <p:identity name="juicer" />
        <p:store name="store">
            <p:with-option name="href" select="concat(name, '.xml')">
                <p:pipe step="juicer" port="result"/>
            <p:input port="source">
                <p:pipe step="store" port="result"/>


The result I get is the last juicer, stored in a file ".xml"

Would someone please explain what I am doing wrong, and what is the correct approach?

Received on Saturday, 17 January 2009 16:28:38 UTC

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