[Doc-SIG] reStructuredText-to-HTML XSLT

Tony J Ibbs (Tibs) tony@lsl.co.uk
Wed, 17 Oct 2001 09:53:00 +0100

David Goodger wrote:
> I'm going to experiment with xml.dom.minidom to try to get
> better XML output wrt whitespace. The trouble is that
> newlines are interpreted as spaces in mixed content, so
> I've got to figure out a way to avoid newlines before &
> after inline markup. We may have to give up newlines between
> body elements also though.

Hmm. If I understand what you're saying, then surely one just needs to
emit XML without putting in any extraneous whitespace? We already have
"pretty" mode, which can produce XML that is aimed at a human (i.e., has
indentation, etc.), but I don't see why one shouldn't represent the

          Some text
             more text.

(to invent an artifical and wrong example) as the XML::

   <document><paragraph>Some text <emphasis>more

In other words, the only whitespace outside <...> is that which the user


Tony J Ibbs (Tibs)      http://www.tibsnjoan.co.uk/
Give a pedant an inch and they'll take 25.4mm
(once they've established you're talking a post-1959 inch, of course)
My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.)