1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
2<html><head xmlns="http://www.w3.org/1999/xhtml"><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/><style type="text/css" xml:space="preserve">
3TD {font-family: Verdana,Arial,Helvetica}
4BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
5H1 {font-family: Verdana,Arial,Helvetica}
6H2 {font-family: Verdana,Arial,Helvetica}
7H3 {font-family: Verdana,Arial,Helvetica}
8A:link, A:visited, A:active { text-decoration: underline }
9    </style><title>Search engine</title></head><body xmlns="http://www.w3.org/1999/xhtml" bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120" rowspan="1" colspan="1"><a href="http://swpat.ffii.org/" shape="rect"><img src="epatents.png" alt="Action against software patents"/></a></td><td width="180" rowspan="1" colspan="1"><a href="http://www.gnome.org/" shape="rect"><img src="gnome2.png" alt="GNOME2 Logo"/></a><a href="http://www.w3.org/Status" shape="rect"><img src="w3c.png" alt="W3C logo"/></a><a href="http://www.redhat.com" shape="rect"><img src="redhat.gif" alt="Red Hat Logo"/></a><div align="left"><a href="http://xmlsoft.org/XSLT/" shape="rect"><img src="Libxslt-Logo-180x168.gif" alt="Made with Libxslt Logo"/></a></div></td><td rowspan="1" colspan="1"><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td rowspan="1" colspan="1"><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center" rowspan="1" colspan="1"><h1>The XSLT C library for GNOME</h1><h2>Search engine</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765" rowspan="1" colspan="1"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765" rowspan="1" colspan="1"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td rowspan="1" colspan="1"><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center" rowspan="1"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd" rowspan="1" colspan="1"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value=""/><input name="submit" type="submit" value="Search ..."/></form><ul><li><a href="index.html" shape="rect">Home</a></li><li><a href="intro.html" shape="rect">Introduction</a></li><li><a href="docs.html" shape="rect">Documentation</a></li><li><a href="bugs.html" shape="rect">Reporting bugs and getting help</a></li><li><a href="help.html" shape="rect">How to help</a></li><li><a href="downloads.html" shape="rect">Downloads</a></li><li><a href="FAQ.html" shape="rect">FAQ</a></li><li><a href="news.html" shape="rect">News</a></li><li><a href="xsltproc2.html" shape="rect">The xsltproc tool</a></li><li><a href="docbook.html" shape="rect">DocBook</a></li><li><a href="API.html" shape="rect">The programming API</a></li><li><a href="python.html" shape="rect">Python and bindings</a></li><li><a href="internals.html" shape="rect">Library internals</a></li><li><a href="extensions.html" shape="rect">Writing extensions</a></li><li><a href="contribs.html" shape="rect">Contributions</a></li><li><a href="EXSLT/index.html" style="font-weight:bold" shape="rect">libexslt</a></li><li><a href="xslt.html" shape="rect">flat page</a>, <a href="site.xsl" shape="rect">stylesheet</a></li><li><a href="html/index.html" style="font-weight:bold" shape="rect">API Menu</a></li><li><a href="ChangeLog.html" shape="rect">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center" rowspan="1"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd" rowspan="1" colspan="1"><ul><li><a href="tutorial/libxslttutorial.html" shape="rect">Tutorial</a>,
10          <a href="tutorial2/libxslt_pipes.html" shape="rect">Tutorial2</a></li><li><a href="xsltproc.html" shape="rect">Man page for xsltproc</a></li><li><a href="http://mail.gnome.org/archives/xslt/" shape="rect">Mail archive</a></li><li><a href="http://xmlsoft.org/" shape="rect">XML libxml2</a></li><li><a href="ftp://xmlsoft.org/" shape="rect">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/" shape="rect">Windows binaries</a></li><li><a href="http://garypennington.net/libxml2/" shape="rect">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html" shape="rect">MacOsX binaries</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt" shape="rect">Bug Tracker</a></li><li><a href="http://codespeak.net/lxml/" shape="rect">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXSLT" shape="rect">Perl XSLT bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading17" shape="rect">XSLT with PHP</a></li><li><a href="http://www.mod-xslt2.com/" shape="rect">Apache module</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/" shape="rect">Pascal bindings</a></li><li><a href="http://xsldbg.sourceforge.net/" shape="rect">Xsldbg Debugger</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center" rowspan="1"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd" rowspan="1" colspan="1"><ul><li><a href="APIchunk0.html" shape="rect">Alphabetic</a></li><li><a href="APIconstructors.html" shape="rect">Constructors</a></li><li><a href="APIfunctions.html" shape="rect">Functions/Types</a></li><li><a href="APIfiles.html" shape="rect">Modules</a></li><li><a href="APIsymbols.html" shape="rect">Symbols</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765" rowspan="1" colspan="1"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td rowspan="1" colspan="1"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td rowspan="1" colspan="1"><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd" rowspan="1" colspan="1">
11
12<?php
13    $query = $HTTP_GET_VARS[ "query" ];
14    $scope = $HTTP_GET_VARS[ "scope" ];
15    // We handle only the first argument so far
16    $query = $_GET['query'];
17    $query = ltrim ($query);
18    if (! $query) {
19        echo "<h1 align='center'>Search the documentation on XMLSoft.org</h1>";
20    }
21    if ($scope == NULL)
22        $scope = "any";
23    $scope = ltrim ($scope);
24    if ($scope == "")
25        $scope = "any";
26
27?>
28<p> The search service indexes the libxml2 and libxslt APIs and documentation as well as the xml@gnome.org and xslt@gnome.org mailing-list archives. To use it simply provide a set of keywords:
29<p>
30<form action="<?php echo "$PHP_SELF", "?query=", rawurlencode($query) ?>"
31      enctype="application/x-www-form-urlencoded" method="GET">
32  <input name="query" type="TEXT" size="50" value="<?php echo $query?>">
33  <select name="scope">
34    <option value="any">Search All</option>
35    <option value="XML" <?php if ($scope == 'XML') print "selected"?>>XML resources</option>
36    <option value="XSLT" <?php if ($scope == 'XSLT') print "selected"?>>XSLT resources</option>
37    <option value="API" <?php if ($scope == 'API') print "selected"?>>Only the APIs</option>
38    <option value="XMLAPI" <?php if ($scope == 'XMLAPI') print "selected"?>>Only the XML API</option>
39    <option value="XSLTAPI" <?php if ($scope == 'XSLTAPI') print "selected"?>>Only the XSLT API</option>
40    <option value="DOCS" <?php if ($scope == 'DOCS') print "selected"?>>Only the Documentation</option>
41    <option value="XMLDOC" <?php if ($scope == 'XMLDOC') print "selected"?>>Only the XML Documentation</option>
42    <option value="XSLTDOC" <?php if ($scope == 'XSLTDOC') print "selected"?>>Only the XSLT Documentation</option>
43    <option value="LISTS" <?php if ($scope == 'LISTS') print "selected"?>>Only the lists archives</option>
44    <option value="XMLLIST" <?php if ($scope == 'XMLLIST') print "selected"?>>Only the XML list archive</option>
45    <option value="XSLTLIST" <?php if ($scope == 'XSLTLIST') print "selected"?>>Only the XSLT list archive</option>
46  </select>
47  <input name=submit type=submit value="Search ...">
48</form>
49<?php
50    function logQueryWord($word) {
51        $result = mysql_query ("SELECT ID,Count FROM Queries WHERE Value='$word'");
52	if ($result) {
53	    $i = mysql_num_rows($result);
54	    if ($i == 0) {
55	        mysql_free_result($result);
56		mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
57	    } else {
58	        $id = mysql_result($result, 0, 0);
59		$count = mysql_result($result, 0, 1);
60		$count ++;
61		mysql_query ("UPDATE Queries SET Count=$count WHERE ID=$id");
62	    }
63	} else {
64	    mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
65	}
66    }
67    function queryWord($word) {
68        $result = NULL;
69	$j = 0;
70        if ($word) {
71	    $result = mysql_query ("SELECT words.relevance, symbols.name, symbols.type, symbols.module, symbols.descr FROM words, symbols WHERE LCASE(words.name) LIKE LCASE('$word') and words.symbol = symbols.name ORDER BY words.relevance DESC LIMIT 75");
72	    if ($result) {
73		$j = mysql_num_rows($result);
74		if ($j == 0)
75		    mysql_free_result($result);
76	    }
77	    logQueryWord($word);
78	}
79	return array($result, $j);
80    }
81    function queryHTMLWord($word) {
82        $result = NULL;
83	$j = 0;
84        if ($word) {
85	    $result = mysql_query ("SELECT relevance, name, id, resource, section FROM wordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75");
86	    if ($result) {
87		$j = mysql_num_rows($result);
88		if ($j == 0)
89		    mysql_free_result($result);
90	    }
91	    logQueryWord($word);
92	}
93	return array($result, $j);
94    }
95    function queryArchiveWord($word) {
96        $result = NULL;
97	$j = 0;
98        if ($word) {
99	    $result = mysql_query ("SELECT wordsArchive.relevance, wordsArchive.name, 'xml-list', archives.resource, archives.title FROM wordsArchive, archives WHERE LCASE(wordsArchive.name) LIKE LCASE('$word') and wordsArchive.ID = archives.ID ORDER BY relevance DESC LIMIT 75");
100	    if ($result) {
101		$j = mysql_num_rows($result);
102		if ($j == 0)
103		    mysql_free_result($result);
104	    }
105	    logQueryWord($word);
106	}
107	return array($result, $j);
108    }
109    function XSLTqueryWord($word) {
110        $result = NULL;
111	$j = 0;
112        if ($word) {
113	    $result = mysql_query ("SELECT XSLTwords.relevance, XSLTsymbols.name, XSLTsymbols.type, XSLTsymbols.module, XSLTsymbols.descr FROM XSLTwords, XSLTsymbols WHERE LCASE(XSLTwords.name) LIKE LCASE('$word') and XSLTwords.symbol = XSLTsymbols.name ORDER BY XSLTwords.relevance DESC LIMIT 75");
114	    if ($result) {
115		$j = mysql_num_rows($result);
116		if ($j == 0)
117		    mysql_free_result($result);
118	    }
119	    logQueryWord($word);
120	}
121	return array($result, $j);
122    }
123    function XSLTqueryHTMLWord($word) {
124        $result = NULL;
125	$j = 0;
126        if ($word) {
127	    $result = mysql_query ("SELECT relevance, name, id, resource, section FROM XSLTwordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75");
128	    if ($result) {
129		$j = mysql_num_rows($result);
130		if ($j == 0)
131		    mysql_free_result($result);
132	    }
133	    logQueryWord($word);
134	}
135	return array($result, $j);
136    }
137    function XSLTqueryArchiveWord($word) {
138        $result = NULL;
139	$j = 0;
140        if ($word) {
141	    $result = mysql_query ("SELECT XSLTwordsArchive.relevance, XSLTwordsArchive.name, 'xslt-list', archives.resource, archives.title FROM XSLTwordsArchive, archives WHERE LCASE(XSLTwordsArchive.name) LIKE LCASE('$word') and XSLTwordsArchive.ID = archives.ID ORDER BY relevance DESC LIMIT 75");
142	    if ($result) {
143		$j = mysql_num_rows($result);
144		if ($j == 0)
145		    mysql_free_result($result);
146	    }
147	    logQueryWord($word);
148	}
149	return array($result, $j);
150    }
151    function resSort ($a, $b) {
152	list($ra,$ta,$ma,$na,$da) = $a;
153	list($rb,$tb,$mb,$nb,$db) = $b;
154	if ($ra == $rb) return 0;
155	return ($ra > $rb) ? -1 : 1;
156    }
157    if (($query) && (strlen($query) <= 50)) {
158	$link = mysql_connect ("localhost", "nobody");
159	if (!$link) {
160	    echo "<p> Could not connect to the database: ", mysql_error();
161	} else {
162	    mysql_select_db("xmlsoft", $link);
163	    $list = explode (" ", $query);
164	    $results = array();
165	    $number = 0;
166	    for ($number = 0;$number < count($list);$number++) {
167
168		$word = $list[$number];
169		if (($scope == 'any') || ($scope == 'XML') ||
170		    ($scope == 'API') || ($scope == 'XMLAPI')) {
171		    list($result, $j) = queryWord($word);
172		    if ($j > 0) {
173			for ($i = 0; $i < $j; $i++) {
174			    $relevance = mysql_result($result, $i, 0);
175			    $name = mysql_result($result, $i, 1);
176			    $type = mysql_result($result, $i, 2);
177			    $module = mysql_result($result, $i, 3);
178			    $desc = mysql_result($result, $i, 4);
179			    if (array_key_exists($name, $results)) {
180				list($r,$t,$m,$d,$w,$u) = $results[$name];
181				$results[$name] = array(($r + $relevance) * 2,
182							$t,$m,$d,$w,$u);
183			    } else {
184				$id = strtoupper($name);
185//				$m = strtolower($module);
186				$m = $module;
187				$url = "../html/libxml-$m.html#$id";
188				$results[$name] = array($relevance,$type,
189						$module, $desc, $name, $url);
190			    }
191			}
192			mysql_free_result($result);
193		    }
194		}
195		if (($scope == 'any') || ($scope == 'XSLT') ||
196		    ($scope == 'API') || ($scope == 'XSLTAPI')) {
197		    list($result, $j) = XSLTqueryWord($word);
198		    if ($j > 0) {
199			for ($i = 0; $i < $j; $i++) {
200			    $relevance = mysql_result($result, $i, 0);
201			    $name = mysql_result($result, $i, 1);
202			    $type = mysql_result($result, $i, 2);
203			    $module = mysql_result($result, $i, 3);
204			    $desc = mysql_result($result, $i, 4);
205			    if (array_key_exists($name, $results)) {
206				list($r,$t,$m,$d,$w,$u) = $results[$name];
207				$results[$name] = array(($r + $relevance) * 2,
208							$t,$m,$d,$w,$u);
209			    } else {
210				$id = strtoupper($name);
211//				$m = strtolower($module);
212				$m = $module;
213				$url = "html/libxslt-$m.html#$id";
214				$results[$name] = array($relevance,$type,
215						$module, $desc, $name, $url);
216			    }
217			}
218			mysql_free_result($result);
219		    }
220		}
221		if (($scope == 'any') || ($scope == 'XML') ||
222		    ($scope == 'DOCS') || ($scope == 'XMLDOC')) {
223		    list($result, $k) = queryHTMLWord($word);
224		    if ($k > 0) {
225			for ($i = 0; $i < $k; $i++) {
226			    $relevance = mysql_result($result, $i, 0);
227			    $name = mysql_result($result, $i, 1);
228			    $id = mysql_result($result, $i, 2);
229			    $module = mysql_result($result, $i, 3);
230			    $desc = mysql_result($result, $i, 4);
231			    $url = $module;
232			    if ($id != "") {
233				$url = $url + "#$id";
234			    }
235			    $results["$name _html_ $number _ $i"] =
236					  array($relevance, "XML docs",
237						$module, $desc, $name, $url);
238			}
239			mysql_free_result($result);
240		    }
241		}
242		if (($scope == 'any') || ($scope == 'XSLT') ||
243		    ($scope == 'DOCS') || ($scope == 'XSLTDOC')) {
244		    list($result, $k) = XSLTqueryHTMLWord($word);
245		    if ($k > 0) {
246			for ($i = 0; $i < $k; $i++) {
247			    $relevance = mysql_result($result, $i, 0);
248			    $name = mysql_result($result, $i, 1);
249			    $id = mysql_result($result, $i, 2);
250			    $module = mysql_result($result, $i, 3);
251			    $desc = mysql_result($result, $i, 4);
252			    $url = "$module";
253			    if ($id != "") {
254				$url = $url + "#$id";
255			    }
256			    $results["$name xslthtml $number _ $i "] =
257					  array($relevance, "XSLT docs",
258						$module, $desc, $name, $url);
259			}
260			mysql_free_result($result);
261		    }
262		}
263		if (($scope == 'any') || ($scope == 'XML') ||
264		    ($scope == 'LISTS') || ($scope == 'XMLLIST')) {
265		    list($result, $j) = queryArchiveWord($word);
266		    if ($j > 0) {
267			for ($i = 0; $i < $j; $i++) {
268			    $relevance = mysql_result($result, $i, 0);
269			    $name = mysql_result($result, $i, 1);
270			    $type = mysql_result($result, $i, 2);
271			    $url = mysql_result($result, $i, 3);
272			    $desc = mysql_result($result, $i, 4);
273			    if (array_key_exists($url, $results)) {
274				list($r,$t,$m,$d,$w,$u) = $results[$url];
275				$results[$name] = array(($r + $relevance) * 2,
276							$t,$m,$d,$w,$u);
277			    } else {
278				$id = strtoupper($name);
279//				$m = strtolower($module);
280				$m = $module;
281				$u = str_replace(
282			"http://mail.gnome.org/archives/xml/", "", $url);
283				$results[$url] = array($relevance,$type,
284						$u, $desc, $name, $url);
285			    }
286			}
287			mysql_free_result($result);
288		    }
289		}
290		if (($scope == 'any') || ($scope == 'XSLT') ||
291		    ($scope == 'LISTS') || ($scope == 'XSLTLIST')) {
292		    list($result, $j) = XSLTqueryArchiveWord($word);
293		    if ($j > 0) {
294			for ($i = 0; $i < $j; $i++) {
295			    $relevance = mysql_result($result, $i, 0);
296			    $name = mysql_result($result, $i, 1);
297			    $type = mysql_result($result, $i, 2);
298			    $url = mysql_result($result, $i, 3);
299			    $desc = mysql_result($result, $i, 4);
300			    if (array_key_exists($url, $results)) {
301				list($r,$t,$m,$d,$w,$u) = $results[$url];
302				$results[$name] = array(($r + $relevance) * 2,
303							$t,$m,$d,$w,$u);
304			    } else {
305				$id = strtoupper($name);
306//				$m = strtolower($module);
307				$m = $module;
308				$u = str_replace(
309			"http://mail.gnome.org/archives/xslt/", "", $url);
310				$results[$url] = array($relevance,$type,
311						$u, $desc, $name, $url);
312			    }
313			}
314			mysql_free_result($result);
315		    }
316		}
317		if (($j <= 0) && ($k <= 0)) {
318		    echo "<p> No result found for $word\n";
319		}
320	    }
321	    mysql_close($link);
322	    $nb = count($results);
323	    echo "<h3 align='center'>Found $nb results for query $query</h3>\n";
324	    usort($results, "resSort");
325
326            if ($nb > 0) {
327		printf("<table><tbody>\n");
328		printf("<tr><td>Quality</td><td>Symbol</td><td>Type</td><td>module</td><td>Description</td></tr>\n");
329		$i = 0;
330		while (list ($name, $val) = each ($results)) {
331		    list($r,$t,$m,$d,$s,$u) = $val;
332		    $m = str_replace("<", "&lt;", $m);
333		    $s = str_replace("<", "&lt;", $s);
334		    $d = str_replace("<", "&lt;", $d);
335		    echo "<tr><td>$r</td><td><a href='$u'>$s</a></td><td>$t</td><td>$m</td><td>$d</td></tr>";
336		    $i = $i + 1;
337		    if ($i > 75)
338		        break;
339		}
340		printf("</tbody></table>\n");
341	    }
342	}
343    }
344?>
345
346    <p><a href="bugs.html" shape="rect">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
347