%!ps
% autoval1.psl
% Attempts to repair specific validation errors in our book title pages as an xhtml document
% ==========================================================================================
% by Don Lancaster
% Copyright c 2009 and earlier by Don Lancaster and Synergetics, Box 809,
% Thatcher Arizona, 5552 (928) 428-4073 don@tinaja.com support
% via http://www.tinaja.com All commercial rights and all electronic
% media rights **FULLY** reserved. Reposting is expressly forbidden.
% IMPORTANT NOTE: Don Lancaster's file gonzo.ps is optional for this program.
% After obvious location mods, uncomment ONE of the following two lines:
(C:\\gonzo2\\gonzo.ps)run % use internal gonzo % use internal gonzo
% (A:\\gonzo.ps) run % use external gonzo
% NOTE THAT ALL PS FILENAME STRINGS !!!DEMAND!!! DOUBLE REVERSE SLASHES.
% Gonzo is available as http://www.tinaja.com/post01.asp#gonzo with a
% tutorial at http://www.tinaja.com/glib/gonzotut.pdf
%%%%%%%%%%%%%
% Newer versions of XHTML are much more strict in their formatting.
% They generally require everything lower case, everything in quotes,
% all ampersands in & format, blockquotes instead of
, etc etc.
% This PostScript utility is a general purpose "search and replace"
% that can read most any uncompressed disk file and make selective
% changes to it. xhtml validation repair is used as an example. The
% utility repairs most but not all validation problems, greatly
% simplifying and shortening the time required for an update.
% The following algorithm is used: An iccoming file is broken up into
% 40K strings. Each string is search and replaced and then rewritten
% to disk. A command array is forall looped for the individual replacements.
% Additional vm management is used to ease buildups.
% To use, edit as a standard ASCII text file and send to Acrobat
% Distiller. Distiller versions newer than 8.1 default to prohibiting
% file writes and must be activated by a "run acrodist -F from the
% Windows command line.
% At present, input, output, and program files must be in the same folder.
% Note that an "Empty Job - No File Produced" is normal and expected.
% An excerpt from the Gonzo Utilities....
% mergestr merges the two top stack strings into one top stack string
/mergestr {2 copy length exch length add string dup dup 4 3 roll
4 index length exch putinterval 3 1 roll exch 0 exch putinterval} def
% /srpairs is an array of format [ [(oldstr0) (newstr0)] [(oldstr1) (newstr1)]... [(oldstrn) (newstrn)] ]
% this is used to program the corrections to be made...
% Be sure your actual textual content does not include any similar text strings!!!!
/srpairs [
{
[ (
)(
) ] % delimit breaks
[ (
)(
) ]
[ ()() ] % set blockquote
[ (
)() ] % end blockquote
[ ()() ] % set blockquote
[ (
)() ] % end blockquote
[ ()(.com">) ] % terminate href quotes
[ (.com/>)(.com/">) ]
[ (.pdf>)(.pdf">) ]
[ (.psl>)(.psl">) ]
[ (.asp>)(.asp">) ]
[ (.net>)(.net">) ]
[ (.bmp>)(.bmp">) ]
[ (.html>)(.html">) ]
[ ()(
) ] % change case
[ (
)() ]
[ ()() ]
[ ()() ]
[ ()() ]
[ (
) () ]
[ ( COLOR=) ( color=) ]
[ (NAME=) (name=) ]
[ (size=1>)(size="1">) ] % watch for longer JavaScript sizes!
[ (size=2>)(size="2">) ]
[ (size=3>)(size="3">) ]
[ (size=+1>)(size="+1">) ]
[ (size=+2>)(size="+2">) ]
[ (size=+3>)(size="+3">) ]
[ (size=-1>)(size="-1">) ]
[ (size=-2>)(size="-2">) ]
[ (size=-3>)(size="-3">) ]
[ (size=1 )(size="1" ) ] % watch for longer JavaScript sizes!
[ (size=2 )(size="2" ) ]
[ (size=3 )(size="3" ) ]
[ (size=+1 )(size="+1" ) ]
[ (size=+2 )(size="+2" ) ]
[ (size=+3 )(size="+3" ) ]
[ (size=-1 )(size="-1" ) ]
[ (size=-2 )(size="-2" ) ]
[ (size=-3 )(size="-3" ) ]
[ (nowrap ) (nowrap="nowrap" ) ]
[ () () ]
[ (
) (
) ]
[ () ( | ) ]
[ ( | ) ( | ) ]
[ (COLSPAN=) (colspan=)]
[ ()
() ]
[() () ]
[() () ]
[() () ]
[() (") ]
[() (") ]
[ (onMouseOver) (onmouseover) ]
[ (onMoustOut) (onmouseout) ]
[(width=100%) (width="100%") ]
[ () () ]
[ (/HTML) (/html) ]
[()
()]
[()
( ) ]
[ (align=CENTER valign=CENTER) (align="center" valign="middle") ]
[ () () ]
[ ()
() ]
[( | ) ( | ) ]
[(valign=middle) (valign="middle")]
[(border=1 cellpadding=0 cellspacing=2 width=310) (border="1" cellpadding="0" cellspacing="2" width="310") ]
[(cellpadding=0 cellspacing=2 width=600) (cellpadding="0" cellspacing="2" width="600") ]
[ (onMouseOver) (onmouseover) ]
[ (onMoustOut) (onmouseout) ]
[ (/HTML) (/html) ]
[() ()]
[(width=75) (width="75") ]
[(width=87) (width="87") ]
[(height=25) (height="25") ]
[( align=CENTER) ( align="center") ]
[(bgcolor=#FF9999) (bgcolor="#FF9999") ]
[(cellpadding=0 cellspacing=2) (cellpadding="0" cellspacing="2") ]
[( |