[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Script to de-minimize tags like <tt/this/



I was checking the HOWTO-HOWTO for information on updating the 
appropriate tags in moving from linuxdoc SGML to docbook SGML
(one thing that doesn't appear to be covered) and noticed that 
abbreviated tags are to be phased out - the following script 
may prove useful - as shown on some example sgml. (Were things
like <tt>foobar</> ever legal mimimizations as well?)

Paul.

-------------------------------------------------------
$ cat test.sgml

These <em/abbrev./ tags <tt/here/ need to be fixed.
This tag <em>here</em> is already okay.
Complex text like <tt/123abc:=+(-^!)/ can be fixed too.

$ ./deminimize test.sgml

These <em>abbrev.</em> tags <tt>here</tt> need to be fixed.
This tag <em>here</em> is already okay.
Complex text like <tt>123abc:=+(-^!)</tt> can be fixed too.

$ cat ./deminimize
#!/bin/sh
#
# deminimize SGML tags - e.g. <bold/hello/  -->  <bold>hello</bold>
# assumes tags are lowercase.  Don't you just love sed?
#
#                                               Paul Gortmaker 08/2000.

cat $1 | sed 's/<\([a-z]\+\)\/\([^\/]\+\)\//<\1>\2<\/\1>/g'

$ exit
--------------------------------------------------------




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



--  
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]