:- use_module(library(sgml_write)).(can be autoloaded)
- 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
false, 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
identis 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
net(false)). For SGML, this applies to empty elements, so you get
<foo>(if foo is declared to be
EMPTYin the DTD),
net(true)). In SGML code, short character content not containing
can be emitted as