This library provides the inverse functionality of the sgml.pl parser library, writing XML, SGML and HTML documents from the parsed output. It is intended to allow rewriting in a different dialect or encoding or to perform document transformation in Prolog on the parsed representation.
The current implementation is particularly keen on getting character encoding and the use of character entities right. Some work has been done providing layout, but space handling in XML and SGML make this a very hazardous area.
The Prolog-based low-level character and escape handling is the real bottleneck in this library and will probably be moved to C in a later stage.
true
(default), remove duplicate xmlns
attributes.doctype(_)
, public(_)
, or
system(_)
is provided in Options.<foo/> (default, net(true)) <foo></foo> (net(false))
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)) <foo// (net(true))
and also to elements with character content not containing /
<b>xxx</b> (default, net(false)) <b/xxx/ (net(true)).
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.
Default XML namespaces are:
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
true
(default), remove duplicate xmlns
attributes.doctype(_)
, public(_)
, or
system(_)
is provided in Options.<foo/> (default, net(true)) <foo></foo> (net(false))
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)) <foo// (net(true))
and also to elements with character content not containing /
<b>xxx</b> (default, net(false)) <b/xxx/ (net(true)).
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.
true
(default), remove duplicate xmlns
attributes.doctype(_)
, public(_)
, or
system(_)
is provided in Options.<foo/> (default, net(true)) <foo></foo> (net(false))
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)) <foo// (net(true))
and also to elements with character content not containing /
<b>xxx</b> (default, net(false)) <b/xxx/ (net(true)).
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.
true
(default), remove duplicate xmlns
attributes.doctype(_)
, public(_)
, or
system(_)
is provided in Options.<foo/> (default, net(true)) <foo></foo> (net(false))
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)) <foo// (net(true))
and also to elements with character content not containing /
<b>xxx</b> (default, net(false)) <b/xxx/ (net(true)).
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.
true
(default), remove duplicate xmlns
attributes.doctype(_)
, public(_)
, or
system(_)
is provided in Options.<foo/> (default, net(true)) <foo></foo> (net(false))
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)) <foo// (net(true))
and also to elements with character content not containing /
<b>xxx</b> (default, net(false)) <b/xxx/ (net(true)).
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.
true
(default), remove duplicate xmlns
attributes.doctype(_)
, public(_)
, or
system(_)
is provided in Options.<foo/> (default, net(true)) <foo></foo> (net(false))
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)) <foo// (net(true))
and also to elements with character content not containing /
<b>xxx</b> (default, net(false)) <b/xxx/ (net(true)).
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.