Re: 2 questions about p:store

On Mon, Sep 29, 2008 at 9:27 PM, James Garriss <james@garriss.org> wrote:
> A pipeline that contains this:
>
>    <p:for-each name="step1">
>        <p:iteration-source select="//Book"/>
>        <p:store href="books.xml"/>
>    </p:for-each>
>
>
> might overwrite the file "books.xml" many times.
>
> 1) Does the the XProc spec give guidance to XProc processors on how to
> handle overwrites?  Should it?

Don't think so
>
> 2) How would you prevent an overwrite?  Is there a way to give a unique
> filename for each book when p:store writes it?

Yes
Try

     <p:store>
       <p:with-option name="href" select="concat('books-',
p:iteration-position(), '.xml')">
          <p:empty/>
       </p:with-option>
     </p:store>


Xmlizer

Received on Monday, 29 September 2008 20:09:48 UTC