+Term, +Options)Write the XML header with encoding information and the content of the
document as represented by Term to Stream. This
predicate deals with XML with or without namespaces. If namespace
identifiers are not provided they are generated. This predicate defines
the following Options
- Specify the DTD. In SGML documents the DTD is required to distinguish
between elements that are declared empty in the DTD and elements that
just happen to have no content. Further optimisation (shortref, omitted
tags, etc.) could be considered in the future. The DTD is also used to
find the declared named character entities.
- Document type to include in the header. When omitted it is taken from
the outer element.
- If Bool is
false, the XML header is suppressed.
Useful for embedding in other XML streams.
- Do/do not emit layout characters to make the output readable, Default is
to emit layout. With layout enabled, elements only containing other
elements are written using increasing indentation. This introduces
(depending on the mode and defined whitespace handling) CDATA sequences
with only layout between elements when read back in. If
no layout characters are added. As this mode does not need to analyse
the document it is faster and guarantees correct output when read back.
Unfortunately the output is hardly human readable and causes problems
with many editors.
- Set the initial element indentation. It more than zero, the indent is
written before the document.
- Set the initial namespace map. Map is a list of
Name = URI. This option, together with
ident is added to use xml_write/3
to generate XML that is embedded in a larger XML document.
- Use/do not use Null End Tags. For XML, this applies only to
empty elements, so you get
For SGML, this applies to empty elements, so you get
(if foo is declared to be
EMPTY in the DTD),
net(true)). In SGML code, short
character content not containing