The XML 1.0 Specification prohibits a DOCTYPE definition with a Public ID and no System ID.
Converters
- 1. Introduction
- 2. Standard Converters
- 2.1. Configuration
- 2.2. XML Converter
- 2.3. HTML Converter
- 2.4. Text Converter
- 3. To-XML Converter
- 3.1. Configuration
- 3.2. Example
- 4. XSL-FO Converter
1. Introduction
Converters are processors converting XML documents from one format to another. For example, the standard HTML converter documented below converts an XML document into an HTML document. This HTML document can then be sent to a web browser using the HTTP serializer, or attached to an email with the Email processor.
Converters typically have a data
output containing the converted
document.
2. Standard Converters
The standard converters convert XML infosets (the XML documents that circulate in Orbeon Forms pipelines) into text according to standard output methods defined by the XSLT specification. They convert to the following formats:
- XML: a standard XML document
- HTML: a standard HTML document
- XHTML: a standard XHTML document
- Text: any text document
The resulting text is sent to the data
output. It is embedded in an XML
document as specified by the text
document format.
2.1. Configuration
The configuration of the standard converters consists of the following optional elements:
Element | Purpose | Default |
---|---|---|
method | XSLT output method (one of xml , html , xhtml or text )
|
xml , html or text , depending on the serializer
|
content-type | Content type hint specified on the output document element
|
Specific to each serializer |
encoding | Encoding hint specified on the output document element
|
utf-8 |
version | HTML or XML version number | 4.01 for HTML (ignored for XML, which always output 1.0) |
public-doctype | The public doctype | "-//W3C//DTD HTML 4.01 Transitional//EN" for HTML, none otherwise |
system-doctype | The system doctype | "http://www.w3.org/TR/html4/loose.dtd" for HTML, none otherwise |
omit-xml-declaration | Specifies whether an XML declaration must be omitted | false for XML and HTML (i.e. a declaration is output by default), ignored otherwise |
standalone |
If true, specifies standalone="yes" in the document
declaration. If false, specifies standalone="no" in the
document declaration. If missing, no standalone attribute is produced.
For more information about standalone document declarations, please
refer to the relevant
section of the XML specification. In most cases, this does not need
to be specified.
|
not specified for XML, ignored otherwise |
indent |
Specifies if the output is indented. This means that line breaks maybe
be inserted between adjacent elements. The actual level of indentation
is specified with the indent-amount configuration element.
|
true (ignored for text method) |
indent-amount | Specifies the number of indentation space | 1 (ignored for text method) |
Example:
2.2. XML Converter
The XML converter outputs an XML document conform to the XSLT xml
semantic. By default, the output is indented with no spaces and encoded using
the UTF-8 character set. The default MIME content type is
application/xml
. The following is a simple XML converter example:
This is an example of output produced by the XML converter:
2.3. HTML Converter
The HTML converter outputs an HTML document conform to the XSLT
html
semantic. By default, the doctype
is set to HTML
4.0 Transitional and the content is indented with no space and encoded
using the UTF-8 character set. The default content type is
text/html
. The following is a simple HTML converter example:
This is an example of output produced by the HTML converter:
2.4. Text Converter
The Text converter outputs a text document conform to the XSLT text
semantic. By default, the output is encoded using the UTF-8 character set. This
serializer is typically useful for pipelines generating Comma Separated Value
(CSV) files. The default content type is text/plain
. The following
is a simple Text converter example:
This is an example of output produced by the Text converter:
3. To-XML Converter
The To-XML Converter produces a parsed XML document from a binary document format.
3.1. Configuration
The data
input of the To-XML Converter follows the binary document format. Its data
output
is an XML document.
The mandatory config
input consists of the following optional elements:
Element | Purpose | Default |
---|---|---|
validate | Whether to perform validation at the time of parsing | false |
handle-xinclude | Whether to handle XInclude at the time of parsing | false |
3.2. Example
This is an example of use:
4. XSL-FO Converter
The XSL-FO Converter produces PDF documents from an XSL-FO description of the page. The default
content type is application/pdf
.
The resulting binary stream is sent to the data
output. It is embedded
in an XML document as specified by the binary document format.