[Doc-SIG] reStructuredText-to-HTML XSLT

Paul Wright paul.wright@pobox.com
Thu, 18 Oct 2001 14:40:42 +0100 (BST)


On Wed, 17 Oct 2001, 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.

I ended up hacking the quicktest.py script so the delimiters were all
null strings:

def _rawxml(input, document):
    return document.asdom().toprettyxml('', '')

That seems to work.

> > (It also leaves footnotes in the middle of the document; do we want them
> > all at the end?  I suppose so.  Hadn't thought about it.)
> 
> I think there will be several choices, but the tree transforms should take
> care of it.

I'm not sure whether tree transformations refers to XSLT or to ReST
transforming its tree before output, but XLST can put them at the end.
The latest sheet I've got does this. It also does autonumbered footnoes,
via the joys of XPath. I also had a go at tables and got those working
to my satisfaction.

The new sheet is at <http://www.verence.demon.co.uk/paul/2html.xsl>.

I guess your stylesheet contributors should have a look at other peoples'
sheets and think about merging them: Alan's done a few things I've not
done and vice versa (feel free to mail me, Alan). I'll have a look at the
other sheets when I've got a moment.

-- 
----- Paul Wright ------| "Well," said Aslan, "I suppose we could try lasers."
-paul.wright@pobox.com--| 
http://pobox.com/~pw201 |