#!/l/local/bin/perl -i # Each match must capture one and only one Text Class tag. For example, # the regexp for catching P must not catch PB also or it will create a # spurious closed P tag, as in

. The solution is to do it in # two passes: First, change P tags with attributes. Then change ones # without atts. while (<>) { ## Strip this stuff s,<\?xml version=\"1.0\" encoding=\"iso-8859-1\"\?>,,g; s,,,g; s,,,g; ## Empty elements s,,,g; s,,,g; s,,,g; s,,,g; ## Closed elements s,,,g; s,,,g; s,,,g; s,,,g; s,,,g; s,,,g; s,,,g; s,,,g; s,,,g; s,,,g; s,,,g; s,,,g; ## These closed elements have to be done in ## two steps. Otherwise the regexp would pick ## up other tags beginning with L or P. s,,,g; s,,,g; s,,,g; s,,,g; s,

,

,g; s,

,

,g; s,&,&,g; print; }