#7 Making PSGML suitable for XHTML editing

J. J. Ramsey

The attached patch applies against psgml 1.3.1 and adds
the following features:

* If sgml-xml-space-before-empty-tag-slash is non-nil,
a space will be inserted before the `/>' of empty XML
tags. The W3C recommends adding the space before the
"/>" of empty XHTML tags so that non-XHTML-aware
browsers will still render the XHTML correctly. (See

* Strictly conforming XHTML documents must have the
xmlns attribute of the "html" set, and it must have the
value http://www.w3.org/1999/xhtml. (See
<http://www.w3.org/TR/xhtml1/#strict>.) In the XHTML
DTD, however, the xmlns attribute is #FIXED. To
accomodate this, fixed attributes can now be inserted
with sgml-insert-attribute. Since a #FIXED attribute
can only have one value, sgml-insert-attribute (or more
accurately, sgml-read-attribute-value) does not prompt
for the value of the attribute but enters the correct
one automatically. Also, sgml-default-asl automatically
inserts the xmlns attribute and attributes beginning
with "xmlns:" (note the colon) the way it does
#REQUIRED attributes.

* In the Customize buffer, Emacs 21 tries to treat
"sgml-set-face" like a face variable. Originally, I
fixed this by changing sgml-set-face to sgml-set-faces,
but undid this, and used defcustom instead of defvar
for PSGML's user options, so that the Customize buffer
could handle them more intelligently. Now sgml-set-face
is treated like a yes/no value as it should, and the
UIs for editing user options like sgml-markup-faces are
somewhat nicer as well.


  • J. J. Ramsey
    J. J. Ramsey

    Patch w/ fixes for XHTML suitability (updated)