Name

p:invisible-xml — The standard p:invisible-xml step.

Synopsis

The p:invisible-xml step performs Invisible XML processing per Invisible XML. It transforms a non-XML input into XML by applying the specified Invisible XML grammar.

Input portPrimarySequenceContent types
grammar ✔ text xml 
source✔  any -xml -html 
Output portPrimarySequenceContent types
result✔ ✔ any 
Option nameTypeDefault value
fail-on-errorxs:booleantrue()
parametersmap(xs:QName, item()*)?()
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" type="p:ixml">
  |   <p:input port="grammar" sequence="true" content-types="text xml"/>
  |   <p:input port="source" primary="true" content-types="any -xml -html"/>
  |   <p:output port="result" sequence="true" content-types="any"/>
5 |   <p:option name="parameters" as="map(xs:QName, item()*)?"/>
  |   <p:option name="fail-on-error" as="xs:boolean" select="true()"/>
  |</p:declare-step>
Errors
CodeDescription
err:XC0205It is a dynamic error (err:XC0205) if the source document cannot be parsed by the provided grammar.
err:XC0211It is a dynamic error (err:XC0211) if more than one document appears on the grammar port.
err:XC0212It is a dynamic error (err:XC0212) if the grammar provided is not a valid Invisible XML grammar.

Description

The p:invisible-xml step is a standard XProc 3.1 step. It is also described on XProcRef.org.

The default Invisible XML implementation in XML Calabash is NineML. It is also possible to use Markup Blitz. In order to use Markup Blitz, you must include the cx:markup-blitz dependencies on your class path.

Configuring the Invisible XML Processor

You can specify the default processor by setting the Java system property “com.xmlcalabash.invisible-xml” to either “nineml” or “markup-blitz”. If the requested processor is not available, processing will fallback to the other. (If neither is available, the step will fail.)

You can also specify the processor on a per-step basis by setting the extension attribute cx:processor to “nineml” or “markup-blitz”.

If the Markup Blitz extension step is available, you can also run cx:markup-blitz instead of p:invisible-xml.

Extension attributes

cx:processor

To configure the NineML or Markup Blitz processor.

cx:cache-grammar

If the cx:cache-grammar attribute is true, and the grammar has a base URI, then that grammar will be cached. The first time a cached grammar is encountered, it is compiled and saved. Subsequent uses of that cached grammar will reuse the previously compiled version.

See Caching compiled resources for more details.