p:compare — The standard p:compare step.
The p:compare step compares two documents for
equality.
| Input port | Primary | Sequence | Content types |
|---|
| source | ✔ | | any |
| alternate | | | any |
| Output port | Primary | Sequence | Content types |
|---|
| result | ✔ | | application/xml |
| differences | | ✔ | any |
| Option name | Type | Default value |
|---|
| fail-if-not-equal | xs:boolean | false() |
| method | xs:QName? | () |
| parameters | map(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" primary="true" 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
| Code | Description |
|---|
err:XC0019 | It 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:XC0076 | It is a dynamic error (err:XC0076) if
the comparison method specified in p:compare
is not supported by the implementation. |
err:XC0077 | It 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.