Input Parameters
The table below describes the input parameters to a transform function:
Parameter |
Description |
---|---|
$content |
Data about the original input document. The map contains the following keys:
|
$context |
Additional context information about the insertion, such as tranformation-specific parameter values. The map can contain the following keys when your transform function is invoked:
|
The type of node your function receives in the “value” property of $content
depends on the input document type, as determined by mlcp from the -document_type
option or URI extension. For details, see How mlcp Determines Document Type. The type of node your function returns in the “value” property should follow the same guidelines.
The table below outlines the relationship between document type and the node type your transform function should expect.
Document Type |
“value” node type |
---|---|
XML |
document-node |
JSON |
document-node |
BINARY |
binary-node |
TEXT |
text-node |
The collections, permissions, quality, and temporal collection metadata from the mlcp command line is made available to your function so that you can modify or replace the values. If a given metadata category is not specified on the command line, the key will not be present in the input map.