Previous Up Next


p:store

p:store — Stores a document (usually on the filesystem).

Synopsis

<p:declare-step type="p:store">
     <p:input port="source"/>
     <p:output port="result" primary="false"/>
     <p:option name="href" required="true"/>                       <!-- anyURI -->
     <p:option name="byte-order-mark"/>                            <!-- boolean -->
     <p:option name="cdata-section-elements" select="''"/>         <!-- ListOfQNames -->
     <p:option name="doctype-public"/>                             <!-- string -->
     <p:option name="doctype-system"/>                             <!-- anyURI -->
     <p:option name="encoding"/>                                   <!-- string -->
     <p:option name="escape-uri-attributes" select="'false'"/>     <!-- boolean -->
     <p:option name="include-content-type" select="'true'"/>       <!-- boolean -->
     <p:option name="indent" select="'false'"/>                    <!-- boolean -->
     <p:option name="media-type"/>                                 <!-- string -->
     <p:option name="method" select="'xml'"/>                      <!-- QName -->
     <p:option name="normalization-form" select="'none'"/>         <!-- NormalizationForm -->
     <p:option name="omit-xml-declaration" select="'true'"/>       <!-- boolean -->
     <p:option name="standalone" select="'omit'"/>                 <!-- "true" | "false" | "omit" -->
     <p:option name="undeclare-prefixes"/>                         <!-- boolean -->
     <p:option name="version" select="'1.0'"/>                     <!-- string -->
</p:declare-step>

Description

The p:store step serializes its input document and stores it at the specified URI.

If the href option is relative, it's made absolute against the base URI of the element on which it is specified in the pipeline.

The output of this step is a document containing a single c:result element whose content is the absolute URI of the document stored by the step.

The standard serialization options are provided to control the serialization of the XML content when it is stored. These options are as specified in Section 2, “Serialization”.

Errors

Error Description
err:C0050 Occurs if the URI scheme is not supported or the step cannot store to the specified location.

Examples

In this example, we store a document to the filesystem.

  1 <p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
                version="1.0">
    
      <p:store name="store" href="/tmp/out.xml"/>
  5 
      <p:identity>
        <p:input port="source">
          <p:pipe step="store" port="result"/>
        </p:input>
 10   </p:identity>
    </p:pipeline>
Output
1 <c:result xmlns:c="http://www.w3.org/ns/xproc-step">file:/tmp/out.xml</c:result>