Name

p:compare — The standard p:compare step.

Synopsis

The p:compare step compares two documents for equality.

Input portPrimarySequenceContent types
source✔  any 
alternate  any 
Output portPrimarySequenceContent types
result  application/xml 
differences ✔ any 
Option nameTypeDefault value
fail-if-not-equalxs:booleanfalse()
methodxs:QName?()
parametersmap(xs:QName,item()*)?()
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
  |   <p:input port="source" primary="true" content-types="any"/>
  |   <p:input port="alternate" content-types="any"/>
  |   <p:output port="result" content-types="application/xml"/>
5 |   <p:output port="differences" content-types="any" sequence="true"/>
  |   <p:option name="parameters" as="map(xs:QName,item()*)?"/>
  |   <p:option name="method" as="xs:QName?"/>
  |   <p:option name="fail-if-not-equal" as="xs:boolean" select="false()"/>
  |</p:declare-step>
Errors
CodeDescription
err:XC0019It is a dynamic error (err:XC0019) if the documents are not equal according to the specified comparison method, and the value of the fail-if-not-equal option is true.
err:XC0076It is a dynamic error (err:XC0076) if the comparison method specified in p:compare is not supported by the implementation.
err:XC0077It is a dynamic error (err:XC0077) if the media types of the documents supplied are incompatible with the comparison method.
Implementation defined features
  • Implementations of p:compare must support the deep-equal method; other supported methods are implementation-defined.
  • If fail-if-not-equal is false, and the documents differ, an implementation-defined summary of the differences between the two documents may appear on the differences port.

Description

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