<% 'this page strips all but the most basic tags out of a hopelessly bloated HTML page output by 'Microsoft Office 2000 'Gus Mueller 'December 9 1999 strTagsToKill="div,span,title,sub,link,link,meta,html,body,head,style,font,span,o,w,xml,!,!" arrTags=split(strTagsToKill, ",") if request("file")<>"" then strPath=request("file") set fso=CreateObject("scripting.filesystemobject") set filThis=fso.opentextfile(server.mappath(strPath), 1) strThis=filThis.readall filThis.close for intTags=0 to ubound(arrTags) strThis=tagdel(strThis, arrTags(intTags)) next strThis=pstrip(strThis) strThis=bstrip(strThis) strThis=istrip(strThis) strThis=spanstrip(strThis) strThis=slashpdel(strThis) 'a little extra processing strThis=replace(strThis, "( ", "(",1,-1,1) strThis=replace(strThis, " ", "",1,-1,1) strThis=replace(strThis, " )", ") ",1,-1,1) strThis=replace(strThis, " )", ") ",1,-1,1) strThis=replace(strThis, " ", " ",1,-1,1) strThis=replace(strThis, " ", " ",1,-1,1) strThis=replace(strThis, vbTab, " ",1,-1,1) strThis=replace(strThis, chr(160), " ",1,-1,1) strThis=demultiplespace(strThis) strThis=demultiple(strThis, chr(13) & chr(10)) set filThis=fso.opentextfile(server.mappath(strPath) & ".htm", 2, true) filThis.write(strThis) filThis.close end if %>
input path:
<% function pstrip(byval strIn) if strIn<>"" then intPLocation=instr(1, strIn, "", 1)+1 strIn=left(strIn, intPLocation-1) & "

" & mid(strIn, intPEndLocation) intPLocation=instr(2+intPLocation, strIn, """ then intPLocation=instr(1, strIn, "", 1)+1 strIn=left(strIn, intPLocation-1) & "" & mid(strIn, intPEndLocation) intPLocation=instr(2+intPLocation, strIn, """ then intPLocation=instr(1, strIn, "", 1)+1 strIn=left(strIn, intPLocation-1) & "" & mid(strIn, intPEndLocation) intPLocation=instr(2+intPLocation, strIn, """ then intPLocation=instr(1, strIn, "", 1)+1 strIn=left(strIn, intPLocation-1) & "" & mid(strIn, intPEndLocation) intPLocation=instr(2+intPLocation, strIn, """ then intPLocation=instr(1, strIn, "", 1)+1 strIn=left(strIn, intPLocation-1) & mid(strIn, intPEndLocation) intPLocation=instr(2+intPLocation, strIn, """ then intPLocation=instr(1, strIn, "", 1)+1 strIn=left(strIn, intPLocation-1) & mid(strIn, intPEndLocation) intPLocation=instr(2+intPLocation, strIn, """ then intPLocation=instr(1, strIn, "<" & strTag, 1) do until intPLocation=0 'response.write strIn & vbnewline intPEndLocation=instr(intPLocation, strIn, ">", 1)+1 strIn=left(strIn, intPLocation-1) & mid(strIn, intPEndLocation) intPLocation=instr(2+intPLocation, strIn, "<" & strTag, 1) loop end if if strIn<>"" then intPLocation=instr(1, strIn, "", 1)+1 strIn=left(strIn, intPLocation-1) & mid(strIn, intPEndLocation) intPLocation=instr(2+intPLocation, strIn, """ then DeMultiple=strIn do while instr(DeMultiple, strCharIn & strCharIn) DeMultiple=replace(DeMultiple, strCharIn & strCharIn, strCharIn) loop else DeMultiple="" end if end Function function DeMultipleSpace(byval strIn) DeMultipleSpace=DeMultiple(strIn, " ") end Function function DeMultipleForwardSlash(byval strIn) DeMultipleForwardSlash=DeMultiple(strIn, "/") end Function function DeMultipleSlash(strIn) DeMultipleSlash=DeMultiple(strIn, "\") end Function function DeMultipleCR(strIn) DeMultipleCR=DeMultiple(strIn, chr(13)) end Function function DeMultipleUp(strIn) DeMultipleUp=DeMultiple(strIn, chr(13)) end Function %>