Name
p:load — The standard p:load step.
Synopsis
The p:load step has no inputs but produces as its
result a document specified by an IRI.
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ | any |
| Option name | Type | Default value | Required |
|---|---|---|---|
| href | xs:anyURI | ✔ | |
| content-type | xs:string? | () | |
| document-properties | map(xs:QName, item()*)? | () | |
| parameters | map(xs:QName,item()*)? | () |
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" type="p:load">
| <p:output port="result" content-types="any"/>
| <p:option name="href" required="true" as="xs:anyURI"/>
| <p:option name="parameters" as="map(xs:QName,item()*)?"/>
5 | <p:option name="content-type" as="xs:string?"/>
| <p:option name="document-properties" as="map(xs:QName, item()*)?"/>
|</p:declare-step>Errors
| Code | Description |
|---|---|
err:XD0011 | It is a dynamic error (err:XD0011)
if the resource referenced by a p:load element does not exist
or cannot be accessed. |
err:XD0023 | It is a dynamic error (err:XD0023) if a DTD validation
is performed and either the document is not valid or no DTD is found. |
err:XD0043 | It is a dynamic error (err:XD0043)
if the dtd-validate parameter is true and
the processor does not support DTD validation. |
err:XD0049 | It is a dynamic error (err:XD0049) if
the loaded content is not a well-formed XML document. |
err:XD0057 | It is a dynamic error (err:XD0057) if the loaded content
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 value of
loaded content 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
content-type specifies an encoding, which is not supported
by the processor. |
err:XD0062 | It is a dynamic error (err:XD0062)
if the content-type is specified and the
document-properties has a “content-type” that is not the
same. |
err:XD0064 | It is a dynamic
error (err:XD0064) if the base URI is not both absolute and valid according to RFC 3986. |
err:XD0078 | It is a dynamic error (err:XD0078)
if the loaded document cannot be represented as an HTML document in
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”. |
Implementation defined features
- In the absence of an explicit type, the content type is implementation-defined
- Additional XML parameters are implementation-defined.
- Text parameters are implementation-defined.
- Additional JSON parameters are implementation-defined.
- The precise way in which HTML documents are parsed into the XPath data model is implementation-defined.
- HTML parameters are implementation-defined.
- How a processor interprets other media types is implementation-defined.
- Parameters for other media types are implementation-defined.
Description
The p:load step is a
standard XProc 3.0 step.
It is also described on XProcRef.org.
The XML Calabash p:load step accepts additional parameters.
Line numbering
The cx:line-numbering parameter allows the pipeline to selectively
preserve line numbers in the parsed document.
cx:line-numbering(boolean)Line numbers are preserved if the parameter has an effective boolean value of true.
Conversely, if line numbering is enabled globally, this parameter can be used to selectively disable line numbers.
XMLn’t parser
The XMLn’t parser can be configured with addtional parameters.
cx:xmlntEnables the XMLn’t parser. Allowed values are:
attributesortrue()To enable the parser.
entitiesTo enable the parser and also preserve entity references.
cx:xmlnt-startcharSpecifies the initial character to use for encoding entity references. (This value only applies if
cx:xmlntis set toentities.) The default character is&xE000;, the first character in the Unicode private use area.
xml:* attributes in HTML parsing
The underlying HTML parser used by XML Calabash renames attributes in the XML namespace. This appears to be a consequence of attempting to avoid namespace qualified attributes in HTML. It’s unnecessary and almost always inconvenient for attributes in the XML namespace. By default, starting in version 3.0.38, XML Calabash “fixes” them so that they’re back in the XML namespace.
The cx:xml-attributes parameter can be used to
specify an alternate mapping. (Mapping to xmlU00003Aname
will restore the parser mapping.)
cx:xml-attributes(map)The keys in the map are the local names of attributes that might appear in the XML namespace (
base,space, …).The value for each key specifies how it should be mapped:
xml:nameUse the attribute name
xml:name. This is the default for eachnameattribute.nameUse the attribute name
name. It is not possible to specify a QName, this must be an NCName.()If the value is the empty sequence, the attribute is discarded.
This parameter applies only when parsing HTML; it is otherwise ignored.