Name

p:label-elements — The standard p:label-elements step.

Synopsis

The p:label-elements step generates a label for each matched element and stores that label in the specified attribute.

Input portPrimarySequenceContent types
source✔  xml html 
Output portPrimarySequenceContent types
result✔  xml html 
Option nameTypeDefault value
attributexs:QName'xml:id'
labelXPathExpression'concat("_",$p:index)'
matchXSLTSelectionPattern'*'
replacexs:booleantrue()
Declaration
 1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
   |   <p:input port="source" content-types="xml html"/>
   |   <p:output port="result" content-types="xml html"/>
   |   <p:option name="attribute" as="xs:QName" select="'xml:id'"/>
 5 |   <p:option xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
   |             name="label"
   |             as="xs:string"
   |             select="'concat(&#34;_&#34;,$p:index)'"
   |             e:type="XPathExpression"/>
10 |   <p:option xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
   |             name="match"
   |             as="xs:string"
   |             select="'*'"
   |             e:type="XSLTSelectionPattern"/>
15 |   <p:option name="replace" as="xs:boolean" select="true()"/>
   |</p:declare-step>
Errors
CodeDescription
err:XC0023It is a dynamic error (err:XC0023) if that expression matches anything other than element nodes.

Description

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