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 portPrimarySequenceContent types
result✔  any 
Option nameTypeDefault valueRequired
hrefxs:anyURI ✔ 
content-typexs:string?() 
document-propertiesmap(xs:QName, item()*)?() 
parametersmap(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
CodeDescription
err:XD0011It is a dynamic error (err:XD0011) if the resource referenced by a p:load element does not exist or cannot be accessed.
err:XD0023It 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:XD0043It is a dynamic error (err:XD0043) if the dtd-validate parameter is true and the processor does not support DTD validation.
err:XD0049It is a dynamic error (err:XD0049) if the loaded content is not a well-formed XML document.
err:XD0057It 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:XD0058It 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:XD0059It 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:XD0060It is a dynamic error (err:XD0060) if the content-type specifies an encoding, which is not supported by the processor.
err:XD0062It 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:XD0064It is a dynamic error (err:XD0064) if the base URI is not both absolute and valid according to RFC 3986.
err:XD0078It is a dynamic error (err:XD0078) if the loaded document cannot be represented as an HTML document in the XPath data model.
err:XD0079It 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

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:xmlnt

Enables the XMLn’t parser. Allowed values are:

attributes or true()

To enable the parser.

entities

To enable the parser and also preserve entity references.

cx:xmlnt-startchar

Specifies the initial character to use for encoding entity references. (This value only applies if cx:xmlnt is set to entities.) 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:name

Use the attribute name xml:name. This is the default for each name attribute.

name

Use 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.

Note

This parameter applies only when parsing HTML; it is otherwise ignored.