+Option)Sets attributes to the parser. Currently defined attributes:
- Sets the file for reporting errors and warnings. Sets the line to 1.
- Sets the current line. Useful if the stream is not at the start of the
(file) object for generating proper line-numbers.
- Sets notion of the current column in the source line.
- Sets the current character location. See also the
- Set source location from a stream position term as obtained using
- Set the markup dialect. Known dialects:
- The default dialect is to process as SGML. This implies markup is
case-insensitive and standard SGML abbreviation is allowed (abreviated
attributes and omitted tags).
- This is the same as
sgml, but implies
and accepts XML empty element declarations (e.g.,
- In addition to
html, accept attributes named
without warning. This value initialises the charset to UTF-8.
- These document types are processed as
xhtml5 accepts attributes named
- This dialect is selected automatically if the processing instruction
<?xml ...> is encountered. See section
3.3 for details.
- Process file as XML file with namespace support. See section
3.3.1 for details. See also the
- Set the default namespace of the outer environment. This option is
provided to process partial XML content with proper namespace
- xmlns(+NS, +URI)
- Specify a namespace for the outer environment. This option is provided
to process partial XML content with proper namespace resolution.
- How to handle unqualified attribute (i.e. without an explicit namespace)
in XML namespace (
xmlns) mode. Default and standard
compliant is not to qualify such elements. If
attributes are qualified with the namespace of the element they appear
in. This option is for backward compatibility as this is the behaviour
of older versions. In addition, the namespace document suggests
unqualified attributes are often interpreted in the namespace of their
- Define the initial handling of white-space in PCDATA. This attribute is
described in section 3.2.
token (default), attributes of type number are passed as
a Prolog atom. If
integer, such attributes are translated
into Prolog integers. If the conversion fails (e.g. due to overflow) a
warning is issued and the value is passed as an atom.
- Set the initial encoding. The default initial encoding for XML documents
is UTF-8 and for SGML documents ISO-8859-1. XML documents may change the
encoding using the
encoding= attribute in the header.
Explicit use of this option is only required to parse non-conforming
documents. Currently accepted values are
- Defines the toplevel element expected. If a
declaration has been parsed, the default is the defined doctype. The
parser can be instructed to accept the first element encountered as the
doctype(_). This feature is especially
useful when parsing part of a document (see the