#! /bin/sh # $NetBSD: list2xml,v 1.4 2007/04/07 11:45:05 hubertf Exp $ # # Convert a .list or .html file to a .xml file # # ./list2xml set -e if test $# -ne 2 || test x"$1" = x"" || test x"$2" = x""; then echo "usage: $0 " 1>&2 exit 1 fi exec 0< "$1" exec 1> "$2" echo \ ' ' sed \ -e 's|||g' \ -e 's|||g' \ -e 's|||g' \ -e 's|||g' \ -e 's|<[aA]|||g' \ -e 's|||g' \ -e 's|\([^ ]*\)|\1|g' \ -e 's|<[dD][lL]>||g' \ -e 's|||g' \ -e 's|<[dD][tT]>| |g' \ -e 's|||g' \ -e 's|<[dD][dD]>||g' \ -e 's|| |g' \ -e 's|<[eE][mM]>||g' \ -e 's|||g' \ -e 's|\([^ ]*\) \(.*\)| \2 |g' \ -e 's|

\(.*\)

| \1|g' \ -e 's|

\(.*\)

| \1|g' \ -e 's|

\(.*\)

| \1|g' \ -e 's|

\(.*\)

| \1|g' \ -e 's||
|g' \ -e 's|<[hH][rR]>||g' \ -e 's|<[iI]>||g' \ -e 's|<[lL][iI]>||g' \ -e 's|||g' \ -e 's|| |g' \ -e 's|||g' \ -e 's|<[o][lL]>||g' \ -e 's|||g' \ -e 's|<[pP]>||g' \ -e 's|||g' \ -e 's|\([^ :;,<\.\)]*\)|\1|g' \ -e 's|
\(.*\)| \1|g' \ -e 's|<[sS][tT][rR][oO][nN][gG]>||g' \ -e 's|||g' \ -e 's|<[tT][tT]>||g' \ -e 's|||g' \ -e 's|<[uU][lL]>||g' \ -e 's|||g' \ -e 's|\([ >]\)\([^ >]*\)(\([0-9]\))|\1\&man\.\2\.\3;|g' \ -e 's|| |g' \ -e 's|\(<\)\([tT][aA][bB][lL][eE][^>]*>\)|\1informal\2 |g' \ -e 's|\(]*>\)| \1informal\2|g' \ -e 's|<\(/*\)[tT][rR]>|<\1row>|g' \ -e 's|<\(/*\)[tT][hH]>|<\1entry>|g' \ -e 's|<\(/*\)[tT][dD]>|<\1entry>|g' \ | tr '\015' '\012'