According to Hand, Nathan: > I recently needed to process htdig results before sending them back to the > user. The htdig template system wasn't flexible enough to do what I wanted > (SQL queries on results). I originally modified the header/footer/results > templates to generate quasi-XML output and wrapped that inside PHP but there > were limitations there as well. The quasi-XML output didn't quite give me > enough information. Well, I took a closer look at xmlsearch, and I really don't see anything that it does that can't be done with templates, with the exception that the "Content-type: text/html" header is hard-coded. That can be changed with a simple wrapper script, or by adding a config attribute to htsearch to change the header. Using templates has two big advantages. First of all, it's easy to change the output as your requirements change. No recoding or recompiling C++ is needed. Secondly, it doesn't require a lot of duplicate code to maintain a second search program. > Would this xmlsearch CGI be useful as a contrib program to htdig? An XML-RPC > version of xmlsearch is another possibility and my preferred option: the CGI > is just a first stab. Either way, is there a standard HTDIG DTD and if not, > is the one I have included in the patch a possible starting point? There's no standard DTD yet that I know of. I think anyone else doing xml output in htsearch probably developed their own. The only change I can see that it needs is in the definition of MATCH_METHOD, where I changed the word "all" to "or". You could also add the remaining SORT option (title, revscore, revtime, revtitle) if you feel they'd be useful. Attached is my stab at this, using htsearch templates. Give it a try and let me know if it does things any differently from your xmlsearch program. -- Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]> Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil Dept. Physiology, U. of Manitoba Phone: (204)789-3766 Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
gzip compressed data, deflated, last modified: Tue Aug 28 16:33:38 2001, os: Unix