XProc steps

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

p:store

<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>

With the help of <p:store>, the incoming document information is stored in an URI. The indication of the “href“ value is declared as “anyURI“ which means that the user has the free choice when indicating the target (usually a document name). Since <p:store> has no primary output port, it must be defined during the generation. The other options are all optional.

Example

In the following example the read in input is written into a XML file (“output.xml“).

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
   <p:input port="source">
      <p:document href="FilmCollection.xml"></p:document>
   </p:input>
   <p:output port="result">
      <p:empty/>
   </p:output>
   <p:store href="output.xml"></p:store>
</p:declare-step>

The “output.xml“ document is generated in the same directory where the XProc stylesheet is located.