Name

p:insert — The standard p:insert step.

Synopsis

The p:insert step inserts the insertion port's document into the source port's document relative to the matching elements in the source port's document.

Input portPrimarySequenceContent types
source✔  xml html 
insertion ✔ xml html 
Output portPrimarySequenceContent types
result✔  xml html 
Option nameTypeValuesDefault value
matchXSLTSelectionPattern '/*'
positionxs:string('first-child','last-child','before','after') 'after'
Declaration
 1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
   |   <p:input port="source" primary="true" content-types="xml html"/>
   |   <p:input port="insertion" sequence="true" content-types="xml html"/>
   |   <p:output port="result" content-types="xml html"/>
 5 |   <p:option xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
   |             name="match"
   |             as="xs:string"
   |             select="'/*'"
   |             e:type="XSLTSelectionPattern"/>
10 |   <p:option name="position"
   |             values="('first-child','last-child','before','after')"
   |             select="'after'"/>
   |</p:declare-step>
Errors
CodeDescription
err:XC0023It is a dynamic error (err:XC0023) if that pattern matches an attribute or a namespace node.
err:XC0024It is a dynamic error (err:XC0024) if the selection pattern (err:XC0024) matches a document node and the value of the position is “before” or “after”.
err:XC0025It is a dynamic error (err:XC0025) if the selection pattern (err:XC0025) matches anything other than an element or a document node and the value of the position option is “first-child” or “last-child”.

Description

The p:insert step is defined in the XProc 3.0: Standard Step Library. It is also described on XProcRef.org.