discuss: Looking for DocBook pretty printer
Subject:
Re: Looking for DocBook pretty printer
From:
Sandy Harris ####@####.####
Date:
13 Jul 2001 15:08:41 -0000
Message-Id: <3B4F0F0D.B626523B@storm.ca>
Mark Komarinski wrote:
>
> Any apps out there that will reformat DocBook into a nicer-looking format?
> as in, take:
>
> <foo><bar>baz</bar></foo>
>
> And make:
>
> <foo>
> <bar>
> baz
> </bar>
> </foo>
>
> I guess the C equivalent is "pretty printer" or some such. I'm converting text
> documents into DocBook, and am spending a lot of time making it look nicer
> instead of actually doing tags (doh!)
I don't know if it will be of any use in your situation, but (last I looked,
a release or two back) the Amaya editor/browser from w3c.org would accept
either HTML or XHTML input, parse it, and save it in either format with missing
tags filled in and the nesting as you show. Maybe by now it handles general XML,
or perhaps you can fake it somehow.
e.g. in HTML, give it:
<dl>
<dt>term1<dd>blah blah 1
<dt>term2<dd>blah blah 2
</dl>
and it produces:
<dl>
<dt>term1</dt>
<dd>blah blah 1</dd>
<dt>term2</dt>
<dd>blah blah 2</dd>
</dl>
I'm not sure exactly what it would do with this in XHTML, but it would
be valid XML and with nesting shown by indents.