Fundamentally, assuming the code is working, you simply need to re-encapsulate it in a function, open the "incomming_file", bring it into a buffer and feed it to tidy. Then take the output buffer and write it out to the "output_file" specified in the second arg.
What's the "config_file" arg for? If it contains tidy configuration directives (projecting, here), you'll have to open that up, parse out the directives, and then set up a construct to set the directives found.
rickb





Reply With Quote
Bookmarks