I'm just learning to use the product and having a trouble outputting to XML. I have followed the examples for using vb.net to return an html result set. I have taken that example and ported it to c# but I can't get the results to return in XML format. I indexed with output to cgi/windows. Here is the code:
Results
string parameters = string.Empty;
parameters = "&zoom_query=" + this.SearchTextbox.Text;
parameters += "&zoom_page=1";
parameters += "&zoom_per_page=10";
parameters += "&zoom_and=0";
parameters += "&zoom_xml=1";
string cgi_path = AppDomain.CurrentDomain.BaseDirectory + "search.cgi";
ProcessStartInfo psi = new ProcessStartInfo(cgi_path);
psi.EnvironmentVariables["REQUEST_METHOD"] = "GET";
psi.EnvironmentVariables["QUERY_STRING"] = parameters;
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
Process proc = Process.Start(psi);
proc.StandardOutput.ReadLine();
string zoom_results = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
string results = zoom_results;
parameters = "&zoom_query=" + this.SearchTextbox.Text;
parameters += "&zoom_page=1";
parameters += "&zoom_per_page=10";
parameters += "&zoom_and=0";
parameters += "&zoom_xml=1";
string cgi_path = AppDomain.CurrentDomain.BaseDirectory + "search.cgi";
ProcessStartInfo psi = new ProcessStartInfo(cgi_path);
psi.EnvironmentVariables["REQUEST_METHOD"] = "GET";
psi.EnvironmentVariables["QUERY_STRING"] = parameters;
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
Process proc = Process.Start(psi);
proc.StandardOutput.ReadLine();
string zoom_results = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
string results = zoom_results;
Results
<?xml version="1.0" encoding="windows-1252"?>
<!--Zoom Search Engine Version 5.1 (1009)-->
<rss version="2.0" xmlnspensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"> xmlns:zoom="http://www.wrensoft.com/zoom/response/5.0/schema/">
<channel>
<title></title>
<description></description>
<link></link>
</channel>
</rss>
<!--Zoom Search Engine Version 5.1 (1009)-->
<rss version="2.0" xmlnspensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"> xmlns:zoom="http://www.wrensoft.com/zoom/response/5.0/schema/">
<channel>
<title></title>
<description></description>
<link></link>
</channel>
</rss>
Comment