Name

p:set-attributes — The standard p:set-attributes step.

Synopsis

The p:set-attributes step sets attributes on matching elements.

Input portPrimarySequenceContent types
source✔  xml html 
Output portPrimarySequenceContent types
result✔  xml html 
Option nameTypeDefault valueRequired
attributesmap(xs:QName, xs:anyAtomicType) ✔ 
matchXSLTSelectionPattern'/*' 
Declaration
 1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
   |   <p:input port="source" primary="true" content-types="xml html"/>
   |   <p:output port="result" content-types="xml html"/>
   |   <p:option xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
 5 |             name="match"
   |             as="xs:string"
   |             select="'/*'"
   |             e:type="XSLTSelectionPattern"/>
   |   <p:option name="attributes"
10 |             required="true"
   |             as="map(xs:QName, xs:anyAtomicType)"/>
   |</p:declare-step>
Errors
CodeDescription
err:XC0023It is a dynamic error (err:XC0023) if that pattern matches anything other than element nodes.
err:XC0059It is a dynamic error (err:XC0059) if the name of any attribute is “xmlns” or uses the prefix “xmlns” or any other prefix that resolves to the namespace name http://www.w3.org/2000/xmlns/.

Description

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