On Thu, Apr 03, 2008 at 11:01:20PM +0200, Mark Wielaard wrote: > Hi Andrew, > > On Thu, 2008-04-03 at 10:39 -0400, Andrew Cagney wrote: > > I'm not fluent in XML either, however I still managed to hack up the > > attached (from htdocs/bugzilla). Can we do something with that? > > Yes, you probably could. Note that all the rest of the manpage index > generation is done with sed. You might need to replace all of that. But > I wouldn't put too much work into it unless you really want to. It does > work pretty well as is now. While I agree xslt is the proper way, I also immediately know the sed syntax. So here goes: //{ :loop /<\/refpurpose>/b break N b loop :break s,^.*,, s,.*$,, s,\(^[[:space:]]*\|[[:space:]]*$\),,g s,[[:space:]]\+, ,g p q } Save to file and use like this: $ sed -n -f foo.sed < foo.xml