p:cast-content-type — The standard p:cast-content-type step.
The p:cast-content-type
step creates a new document by
changing the media type of its input. If the value of the content-type
option and the current media type of the document on source port are
the same, this document will appear unchanged on result port.
Input port | Primary | Sequence | Content types |
---|
source | ✔ | | any |
Output port | Primary | Sequence | Content types |
---|
result | ✔ | | any |
Option name | Type | Default value | Required |
---|
content-type | xs:string | | ✔ |
parameters | map(xs:QName,item()*)? | () | |
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
| <p:input port="source" content-types="any"/>
| <p:output port="result" content-types="any"/>
| <p:option name="content-type" required="true" as="xs:string"/>
5 | <p:option name="parameters" as="map(xs:QName,item()*)?"/>
|</p:declare-step>
Errors
Code | Description |
---|
err:XC0071 | It is a dynamic
error (err:XC0071 ) if the p:cast-content-type step
cannot perform the requested cast. |
err:XC0072 | It is a dynamic
error (err:XC0072 ) if the c:data contains content is not
a valid base64 string. |
err:XC0073 | It is a dynamic
error (err:XC0073 ) if the c:data element does not have
a content-type attribute. |
err:XC0074 | It is a dynamic
error (err:XC0074 ) if the content-type is supplied and is
not the same as the content-type specified on
the c:data element. |
err:XC0079 | It is a dynamic error (err:XC0079 ) if the map
parameters contains an entry whose key is defined by the
implementation and whose value is not valid for that key. |
err:XD0014 | It is a
dynamic error (err:XD0014 ) for any unqualified
attribute names to appear on a c:param-set element. |
err:XD0018 | It is a dynamic error (err:XD0018 ) if
the parameter list contains any elements other than c:param . |
err:XD0025 | It is a
dynamic error (err:XD0025 ) if the namespace attribute is
specified, the name contains a colon, and the specified namespace is not
the same as the in-scope namespace binding for the specified prefix. |
err:XD0049 | It is a dynamic error (err:XD0049 ) if the text value is not
a well-formed XML document |
err:XD0057 | It is a dynamic
error (err:XD0057 ) if the text document does not conform to the JSON grammar, unless the
parameter liberal is true and the processor chooses to accept the deviation. |
err:XD0058 | It is a dynamic error (err:XD0058 ) if the parameter duplicates is
reject and the text document contains a JSON object with duplicate keys. |
err:XD0059 | It is a dynamic error (err:XD0059 ) if the parameter map contains
an entry whose key is defined in the specification of fn:parse-json and
whose value is not valid for that key, or if it contains an entry with the key fallback
when the parameter escape with true() is also
present. |
err:XD0060 | It is a
dynamic error (err:XD0060 ) if the text document can not be converted into
the XPath data model |
err:XD0079 | It is a dynamic error (err:XD0079 ) if a supplied content-type is not
a valid media type of the form
“type/subtype+ext ”
or “type/subtype ”. |
err:XD0081 | It is a
dynamic error (err:XD0081 ) if the c:param element has a
value attribute and is not empty. |
err:XD0082 | It is a dynamic error (err:XD0082 ) if the
c:param specifies a sequence type and the value does not
satisfy that type. |
Implementation defined features
The p:cast-content-type
step is defined in the
XProc 3.0:
Standard Step Library. It is also described on
XProcRef.org.