Subject: Re: PROPOSAL: Indentation style and other nits
To: Mike M. Volokhov <mishka@apk.od.ua>
From: Rui Paulo <rpaulo@NetBSD.org>
List: netbsd-docs
Date: 07/18/2005 13:00:29
On 2005.07.18 14:44:28 +0000, Mike M. Volokhov wrote:
 | Hello!
 | 
 | On Sun, 17 Jul 2005 11:43:17 +0200
 | Klaus Heinz <k.heinz.jul.fuenf@onlinehome.de> wrote:
 | 
 | > Hubert Feyrer wrote:
 | > 
 | > > I wonder if there's some tool like pkgsrc/www/tidy or indent(1) for 
 | > > DocBook/XML, to make it easier to get to that style?
 | > 
 | > I found textproc/xmlindent and wip/xmlformat-{perl,ruby} but have not
 | > used either of them. Maybe Mishka can say something about the latter.
 | 
 | The xmlformat is easy to use and robust tool. You may format any XML
 | document by providing compact specification, which is described in
 | detail and accomplished with many good examples at:
 | 
 | 	http://www.kitebird.com/software/xmlformat/
 | 
 | Some time ago we (Hiroki Sato, Rui Paulo, and me) have discussed it at
 | netbsd-docs (please see posts with topic "Re: CVS commit: htdocs/guide/
 | en" at http://mail-index.netbsd.org/netbsd-docs/2005/05/). I've created
 | bare minimum configuration and Hiroki optimized it in own way (both
 | included in archives).
 | 
 | There are only one problem I've found when using xmlformat. When it
 | handles block of text, say <para/>, the calculated line lengths after
 | wrapping don't take into account opening tag, which results in
 | overestimated length of the very first line in case if opening tag
 | located at this line too. For example:
 | 
 | 	<exampletag>text text text text
 | 	text text text text
 | 	text text text text
 | 	text</exampletag>
 | 
 | This problem appears only if you've used inline formatting, word
 | wrapping, and point xmlformat to non and, of course, may be
 | workarounded using the following way:
 | 
 | 	<exampletag>
 | 	text text text text
 | 	text text text text
 | 	text text text text
 | 	text
 | 	</exampletag>
 | 
 | I hope fix this bug, but haven't looking it closely :-/ Anyone?

Well, isn't the proper way:
	<exampletag>text text text text
	  text text text text
	  text text text text
	  text</exampletag>
?

Anyway, xmlformat seems pretty cool. Despite depending on ruby, I'll
give it a try and, when I find time, I'll probably post a configuration 
file.

		-- Rui Paulo