Name
cx:merge-properties — Merges the properties of two documents.
Synopsis
This step merges the properties of two documents, optionally merging map valued properties as well.
Input port | Primary | Sequence | Content types |
---|---|---|---|
source | ✔ | ||
alternate |
Output port | Primary | Sequence | Content types |
---|---|---|---|
result | ✔ |
Option name | Type | Default value |
---|---|---|
merge-maps | xs:boolean | true() |
This is an extension step; to use it, your pipeline must include its declaration.
For example, by including the extension library with an import at the top of your
pipeline:
<p:import href="https://xmlcalabash.com/ext/library/merge-properties.xpl"/>
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
| <p:input port="source" primary="true"/>
| <p:input port="alternate"/>
| <p:output port="result"/>
5 | <p:option name="merge-maps" as="xs:boolean" select="true()"/>
|</p:declare-step>
Description
This step merges the properties of the alternate document with the properties of the source document. That is, the result document has all the properties of the source document plus any properties that exist on the alternate document but not on the source document.
If merge-maps
is true, the keys of any map-valued properties
on both ports are merged.