Write a term as created by the SGML/XML parser to a stream in
SGML or XML format. Options:
true (default), remove duplicate
- The DTD. This is needed for SGML documents that contain
elements with content model EMPTY. Characters which may
not be written directly in the Stream's encoding will be
written using character data entities from the DTD if at
all possible, otherwise as numeric character references.
Note that the DTD will NOT be written out at all; as yet
there is no way to write out an internal subset, though
it would not be hard to add one.
- Document type for the SGML document type declaration.
If omitted it is taken from the root element. There is
never any point in having this be disagree with the
root element. A <!DOCTYPE> declaration will be written
if and only if at least one of
system(_) is provided in Options.
- public PubId
- The public identifier to be written in the <!DOCTYPE> line.
- The system identifier to be written in the <!DOCTYPE> line.
- If Bool is 'false', do not emit the <xml ...> header
line. (xml_write/3 only)
- When emitting embedded XML, assume these namespaces
are already defined from the environment. (xml_write/3
- Indentation of the document (for embedding)
- Emit/do not emit layout characters to make output
- Use/do not use Null End Tags.
For XML, this applies only to empty elements, so you get
<foo/> (default, net(true))
For SGML, this applies to empty elements, so you get
<foo> (if foo is declared to be EMPTY in the DTD)
<foo></foo> (default, net(false))
and also to elements with character content not containing /
<b>xxx</b> (default, net(false))
Note that if the stream is UTF-8, the system will write special
characters as UTF-8 sequences, while if it is ISO Latin-1 it
will use (character) entities if there is a DTD that provides
them, otherwise it will use numeric character references.