blob: 5705d71aebccb85154fb098099f505ef2eb553c2 [file] [log] [blame]
Daniel Veillard8135e5f2002-10-01 11:13:14 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5<link rel="SHORTCUT ICON" href="/favicon.ico">
6<style type="text/css"><!--
7TD {font-family: Verdana,Arial,Helvetica}
8BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
9H1 {font-family: Verdana,Arial,Helvetica}
10H2 {font-family: Verdana,Arial,Helvetica}
11H3 {font-family: Verdana,Arial,Helvetica}
12A:link, A:visited, A:active { text-decoration: underline }
13--></style>
Daniel Veillard595978c2002-10-09 18:46:35 +000014<title>Search the documentation on XMLSoft.org</title>
Daniel Veillard8135e5f2002-10-01 11:13:14 +000015</head>
16<body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
17<table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr>
18<td width="180">
19<a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo"></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo"></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo"></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo"></a></div>
20</td>
21<td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center">
22<h1>The XML C library for Gnome</h1>
23<h2>Search engine</h2>
24</td></tr></table></td></tr></table></td>
25</tr></table>
26<table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr>
27<td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td>
28<table width="100%" border="0" cellspacing="1" cellpadding="3">
29<tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr>
30<tr><td bgcolor="#fffacd"><ul>
31<li><a href="index.html">Home</a></li>
32<li><a href="intro.html">Introduction</a></li>
33<li><a href="FAQ.html">FAQ</a></li>
34<li><a href="docs.html">Documentation</a></li>
35<li><a href="bugs.html">Reporting bugs and getting help</a></li>
36<li><a href="help.html">How to help</a></li>
37<li><a href="downloads.html">Downloads</a></li>
38<li><a href="news.html">News</a></li>
39<li><a href="XMLinfo.html">XML</a></li>
40<li><a href="XSLT.html">XSLT</a></li>
41<li><a href="python.html">Python and bindings</a></li>
42<li><a href="architecture.html">libxml architecture</a></li>
43<li><a href="tree.html">The tree output</a></li>
44<li><a href="interface.html">The SAX interface</a></li>
45<li><a href="xmldtd.html">Validation &amp; DTDs</a></li>
46<li><a href="xmlmem.html">Memory Management</a></li>
47<li><a href="encoding.html">Encodings support</a></li>
48<li><a href="xmlio.html">I/O Interfaces</a></li>
49<li><a href="catalog.html">Catalog support</a></li>
50<li><a href="library.html">The parser interfaces</a></li>
51<li><a href="entities.html">Entities or no entities</a></li>
52<li><a href="namespaces.html">Namespaces</a></li>
53<li><a href="upgrade.html">Upgrading 1.x code</a></li>
54<li><a href="threads.html">Thread safety</a></li>
55<li><a href="DOM.html">DOM Principles</a></li>
56<li><a href="example.html">A real example</a></li>
57<li><a href="contribs.html">Contributions</a></li>
58<li><a href="tutorial/index.html">Tutorial</a></li>
59<li>
60<a href="xml.html">flat page</a>, <a href="site.xsl">stylesheet</a>
61</li>
62</ul></td></tr>
63</table>
64<table width="100%" border="0" cellspacing="1" cellpadding="3">
65<tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr>
66<tr><td bgcolor="#fffacd"><ul>
67<li><a href="APIchunk0.html">Alphabetic</a></li>
68<li><a href="APIconstructors.html">Constructors</a></li>
69<li><a href="APIfunctions.html">Functions/Types</a></li>
70<li><a href="APIfiles.html">Modules</a></li>
71<li><a href="APIsymbols.html">Symbols</a></li>
72</ul></td></tr>
73</table>
74<table width="100%" border="0" cellspacing="1" cellpadding="3">
75<tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr>
76<tr><td bgcolor="#fffacd"><ul>
77<li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li>
78<li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li>
79<li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li>
80<li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li>
81<li><a href="ftp://xmlsoft.org/">FTP</a></li>
Daniel Veillardbeb70bd2002-12-18 14:53:54 +000082<li><a href="http://ww.zlatkovic.com/projects/libxml/">Windows binaries</a></li>
Daniel Veillard8135e5f2002-10-01 11:13:14 +000083<li><a href="http://garypennington.net/libxml2/">Solaris binaries</a></li>
84<li><a href="http://www.zveno.com/open_source/libxml2xslt.html">MacOsX binaries</a></li>
85<li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li>
86<li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml&amp;product=libxml2">Bug Tracker</a></li>
87</ul></td></tr>
88</table>
89</td></tr></table></td>
90<td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd">
91<?php
92 // We handle only the first argument so far
William M. Bracka2e844a2004-01-06 11:52:13 +000093 $query = $_GET['query'];
Daniel Veillard8135e5f2002-10-01 11:13:14 +000094 $query = ltrim ($query);
95 if (! $query) {
Daniel Veillard595978c2002-10-09 18:46:35 +000096 echo "<h1 align='center'>Search the documentation on XMLSoft.org</h1>";
Daniel Veillard8135e5f2002-10-01 11:13:14 +000097 }
Daniel Veillardf0070122002-10-09 14:24:17 +000098 if ($scope == NULL)
99 $scope = "any";
100 $scope = ltrim ($scope);
101 if ($scope == "")
102 $scope = "any";
103
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000104?>
Daniel Veillardf0070122002-10-09 14:24:17 +0000105<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:
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000106<p>
107<form action="<?php echo "$PHP_SELF", "?query=", rawurlencode($query) ?>"
108 enctype="application/x-www-form-urlencoded" method="GET">
109 <input name="query" type="TEXT" size="50" value="<?php echo $query?>">
Daniel Veillardf0070122002-10-09 14:24:17 +0000110 <select name="scope">
111 <option value="any">Search All</option>
112 <option value="XML" <?php if ($scope == 'XML') print "selected"?>>XML resources</option>
113 <option value="XSLT" <?php if ($scope == 'XSLT') print "selected"?>>XSLT resources</option>
114 <option value="API" <?php if ($scope == 'API') print "selected"?>>Only the APIs</option>
115 <option value="XMLAPI" <?php if ($scope == 'XMLAPI') print "selected"?>>Only the XML API</option>
116 <option value="XSLTAPI" <?php if ($scope == 'XSLTAPI') print "selected"?>>Only the XSLT API</option>
117 <option value="DOCS" <?php if ($scope == 'DOCS') print "selected"?>>Only the Documentation</option>
118 <option value="XMLDOC" <?php if ($scope == 'XMLDOC') print "selected"?>>Only the XML Documentation</option>
119 <option value="XSLTDOC" <?php if ($scope == 'XSLTDOC') print "selected"?>>Only the XSLT Documentation</option>
120 <option value="LISTS" <?php if ($scope == 'LISTS') print "selected"?>>Only the lists archives</option>
121 <option value="XMLLIST" <?php if ($scope == 'XMLLIST') print "selected"?>>Only the XML list archive</option>
122 <option value="XSLTLIST" <?php if ($scope == 'XSLTLIST') print "selected"?>>Only the XSLT list archive</option>
123 </select>
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000124 <input name=submit type=submit value="Search ...">
125</form>
126<?php
Daniel Veillarddc6d4ab2002-10-04 15:58:34 +0000127 function logQueryWord($word) {
128 $result = mysql_query ("SELECT ID,Count FROM Queries WHERE Value='$word'");
129 if ($result) {
130 $i = mysql_num_rows($result);
131 if ($i == 0) {
132 mysql_free_result($result);
133 mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
134 } else {
135 $id = mysql_result($result, 0, 0);
136 $count = mysql_result($result, 0, 1);
137 $count ++;
138 mysql_query ("UPDATE Queries SET Count=$count WHERE ID=$id");
139 }
140 } else {
141 mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
142 }
143 }
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000144 function queryWord($word) {
145 $result = NULL;
146 $j = 0;
147 if ($word) {
Daniel Veillard10543b12002-10-08 17:30:30 +0000148 $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");
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000149 if ($result) {
150 $j = mysql_num_rows($result);
151 if ($j == 0)
152 mysql_free_result($result);
153 }
Daniel Veillarddc6d4ab2002-10-04 15:58:34 +0000154 logQueryWord($word);
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000155 }
156 return array($result, $j);
157 }
Daniel Veillard9b006132002-10-07 11:13:27 +0000158 function queryHTMLWord($word) {
159 $result = NULL;
160 $j = 0;
161 if ($word) {
Daniel Veillard10543b12002-10-08 17:30:30 +0000162 $result = mysql_query ("SELECT relevance, name, id, resource, section FROM wordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75");
Daniel Veillard9b006132002-10-07 11:13:27 +0000163 if ($result) {
164 $j = mysql_num_rows($result);
165 if ($j == 0)
166 mysql_free_result($result);
167 }
168 logQueryWord($word);
169 }
170 return array($result, $j);
171 }
Daniel Veillard01e87d22002-10-08 16:55:06 +0000172 function queryArchiveWord($word) {
173 $result = NULL;
174 $j = 0;
175 if ($word) {
Daniel Veillardf0070122002-10-09 14:24:17 +0000176 $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");
177 if ($result) {
178 $j = mysql_num_rows($result);
179 if ($j == 0)
180 mysql_free_result($result);
181 }
182 logQueryWord($word);
183 }
184 return array($result, $j);
185 }
186 function XSLTqueryWord($word) {
187 $result = NULL;
188 $j = 0;
189 if ($word) {
190 $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");
191 if ($result) {
192 $j = mysql_num_rows($result);
193 if ($j == 0)
194 mysql_free_result($result);
195 }
196 logQueryWord($word);
197 }
198 return array($result, $j);
199 }
200 function XSLTqueryHTMLWord($word) {
201 $result = NULL;
202 $j = 0;
203 if ($word) {
204 $result = mysql_query ("SELECT relevance, name, id, resource, section FROM XSLTwordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75");
205 if ($result) {
206 $j = mysql_num_rows($result);
207 if ($j == 0)
208 mysql_free_result($result);
209 }
210 logQueryWord($word);
211 }
212 return array($result, $j);
213 }
214 function XSLTqueryArchiveWord($word) {
215 $result = NULL;
216 $j = 0;
217 if ($word) {
218 $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");
Daniel Veillard01e87d22002-10-08 16:55:06 +0000219 if ($result) {
220 $j = mysql_num_rows($result);
221 if ($j == 0)
222 mysql_free_result($result);
223 }
224 logQueryWord($word);
225 }
226 return array($result, $j);
227 }
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000228 function resSort ($a, $b) {
229 list($ra,$ta,$ma,$na,$da) = $a;
230 list($rb,$tb,$mb,$nb,$db) = $b;
231 if ($ra == $rb) return 0;
232 return ($ra > $rb) ? -1 : 1;
233 }
234 if (($query) && (strlen($query) <= 50)) {
235 $link = mysql_connect ("localhost", "nobody");
236 if (!$link) {
237 echo "<p> Could not connect to the database: ", mysql_error();
238 } else {
239 mysql_select_db("xmlsoft", $link);
240 $list = explode (" ", $query);
241 $results = array();
242 $number = 0;
243 for ($number = 0;$number < count($list);$number++) {
244
245 $word = $list[$number];
Daniel Veillardf0070122002-10-09 14:24:17 +0000246 if (($scope == 'any') || ($scope == 'XML') ||
247 ($scope == 'API') || ($scope == 'XMLAPI')) {
248 list($result, $j) = queryWord($word);
249 if ($j > 0) {
250 for ($i = 0; $i < $j; $i++) {
251 $relevance = mysql_result($result, $i, 0);
252 $name = mysql_result($result, $i, 1);
253 $type = mysql_result($result, $i, 2);
254 $module = mysql_result($result, $i, 3);
255 $desc = mysql_result($result, $i, 4);
256 if (array_key_exists($name, $results)) {
257 list($r,$t,$m,$d,$w,$u) = $results[$name];
258 $results[$name] = array(($r + $relevance) * 2,
259 $t,$m,$d,$w,$u);
260 } else {
Daniel Veillard2f9cf622003-11-18 14:29:49 +0000261 $id = $name;
William M. Brack008c06b2003-09-01 22:17:39 +0000262 $m = strtolower($module);
William M. Brack3f479502003-09-01 04:58:15 +0000263 $url = "html/libxml-$module.html#$id";
Daniel Veillardf0070122002-10-09 14:24:17 +0000264 $results[$name] = array($relevance,$type,
Daniel Veillarda6287a42002-10-07 13:17:22 +0000265 $module, $desc, $name, $url);
Daniel Veillardf0070122002-10-09 14:24:17 +0000266 }
Daniel Veillard01e87d22002-10-08 16:55:06 +0000267 }
Daniel Veillardf0070122002-10-09 14:24:17 +0000268 mysql_free_result($result);
Daniel Veillard01e87d22002-10-08 16:55:06 +0000269 }
Daniel Veillardf0070122002-10-09 14:24:17 +0000270 }
271 if (($scope == 'any') || ($scope == 'XSLT') ||
272 ($scope == 'API') || ($scope == 'XSLTAPI')) {
273 list($result, $j) = XSLTqueryWord($word);
274 if ($j > 0) {
275 for ($i = 0; $i < $j; $i++) {
276 $relevance = mysql_result($result, $i, 0);
277 $name = mysql_result($result, $i, 1);
278 $type = mysql_result($result, $i, 2);
279 $module = mysql_result($result, $i, 3);
280 $desc = mysql_result($result, $i, 4);
281 if (array_key_exists($name, $results)) {
282 list($r,$t,$m,$d,$w,$u) = $results[$name];
283 $results[$name] = array(($r + $relevance) * 2,
284 $t,$m,$d,$w,$u);
285 } else {
Daniel Veillard2f9cf622003-11-18 14:29:49 +0000286 $id = $name;
Daniel Veillardf0070122002-10-09 14:24:17 +0000287 $m = strtolower($module);
William M. Brack008c06b2003-09-01 22:17:39 +0000288 $url = "XSLT/html/libxslt-$module.html#$id";
Daniel Veillardf0070122002-10-09 14:24:17 +0000289 $results[$name] = array($relevance,$type,
290 $module, $desc, $name, $url);
291 }
292 }
293 mysql_free_result($result);
294 }
295 }
296 if (($scope == 'any') || ($scope == 'XML') ||
297 ($scope == 'DOCS') || ($scope == 'XMLDOC')) {
298 list($result, $k) = queryHTMLWord($word);
299 if ($k > 0) {
300 for ($i = 0; $i < $k; $i++) {
301 $relevance = mysql_result($result, $i, 0);
302 $name = mysql_result($result, $i, 1);
303 $id = mysql_result($result, $i, 2);
304 $module = mysql_result($result, $i, 3);
305 $desc = mysql_result($result, $i, 4);
306 $url = $module;
307 if ($id != "") {
308 $url = $url + "#$id";
309 }
310 $results["$name _html_ $number _ $i"] =
311 array($relevance, "XML docs",
312 $module, $desc, $name, $url);
313 }
314 mysql_free_result($result);
315 }
316 }
317 if (($scope == 'any') || ($scope == 'XSLT') ||
318 ($scope == 'DOCS') || ($scope == 'XSLTDOC')) {
319 list($result, $k) = XSLTqueryHTMLWord($word);
320 if ($k > 0) {
321 for ($i = 0; $i < $k; $i++) {
322 $relevance = mysql_result($result, $i, 0);
323 $name = mysql_result($result, $i, 1);
324 $id = mysql_result($result, $i, 2);
325 $module = mysql_result($result, $i, 3);
326 $desc = mysql_result($result, $i, 4);
327 $url = "XSLT/$module";
328 if ($id != "") {
329 $url = $url + "#$id";
330 }
331 $results["$name xslthtml $number _ $i "] =
332 array($relevance, "XSLT docs",
333 $module, $desc, $name, $url);
334 }
335 mysql_free_result($result);
336 }
337 }
338 if (($scope == 'any') || ($scope == 'XML') ||
339 ($scope == 'LISTS') || ($scope == 'XMLLIST')) {
340 list($result, $j) = queryArchiveWord($word);
341 if ($j > 0) {
342 for ($i = 0; $i < $j; $i++) {
343 $relevance = mysql_result($result, $i, 0);
344 $name = mysql_result($result, $i, 1);
345 $type = mysql_result($result, $i, 2);
346 $url = mysql_result($result, $i, 3);
347 $desc = mysql_result($result, $i, 4);
348 if (array_key_exists($url, $results)) {
349 list($r,$t,$m,$d,$w,$u) = $results[$url];
350 $results[$name] = array(($r + $relevance) * 2,
351 $t,$m,$d,$w,$u);
352 } else {
Daniel Veillard2f9cf622003-11-18 14:29:49 +0000353 $id = $name;
Daniel Veillardf0070122002-10-09 14:24:17 +0000354 $m = strtolower($module);
355 $u = str_replace(
356 "http://mail.gnome.org/archives/xml/", "", $url);
357 $results[$url] = array($relevance,$type,
358 $u, $desc, $name, $url);
359 }
360 }
361 mysql_free_result($result);
362 }
363 }
364 if (($scope == 'any') || ($scope == 'XSLT') ||
365 ($scope == 'LISTS') || ($scope == 'XSLTLIST')) {
366 list($result, $j) = XSLTqueryArchiveWord($word);
367 if ($j > 0) {
368 for ($i = 0; $i < $j; $i++) {
369 $relevance = mysql_result($result, $i, 0);
370 $name = mysql_result($result, $i, 1);
371 $type = mysql_result($result, $i, 2);
372 $url = mysql_result($result, $i, 3);
373 $desc = mysql_result($result, $i, 4);
374 if (array_key_exists($url, $results)) {
375 list($r,$t,$m,$d,$w,$u) = $results[$url];
376 $results[$name] = array(($r + $relevance) * 2,
377 $t,$m,$d,$w,$u);
378 } else {
Daniel Veillard2f9cf622003-11-18 14:29:49 +0000379 $id = $name;
Daniel Veillardf0070122002-10-09 14:24:17 +0000380 $m = strtolower($module);
381 $u = str_replace(
382 "http://mail.gnome.org/archives/xslt/", "", $url);
383 $results[$url] = array($relevance,$type,
384 $u, $desc, $name, $url);
385 }
386 }
387 mysql_free_result($result);
388 }
Daniel Veillard01e87d22002-10-08 16:55:06 +0000389 }
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000390 }
391 mysql_close($link);
392 $nb = count($results);
393 echo "<h3 align='center'>Found $nb results for query $query</h3>\n";
394 usort($results, "resSort");
395
396 if ($nb > 0) {
397 printf("<table><tbody>\n");
398 printf("<tr><td>Quality</td><td>Symbol</td><td>Type</td><td>module</td><td>Description</td></tr>\n");
Daniel Veillard06665ec2002-10-08 17:26:56 +0000399 $i = 0;
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000400 while (list ($name, $val) = each ($results)) {
Daniel Veillard9b006132002-10-07 11:13:27 +0000401 list($r,$t,$m,$d,$s,$u) = $val;
Daniel Veillard01e87d22002-10-08 16:55:06 +0000402 $m = str_replace("<", "&lt;", $m);
403 $s = str_replace("<", "&lt;", $s);
404 $d = str_replace("<", "&lt;", $d);
Daniel Veillard9b006132002-10-07 11:13:27 +0000405 echo "<tr><td>$r</td><td><a href='$u'>$s</a></td><td>$t</td><td>$m</td><td>$d</td></tr>";
Daniel Veillard06665ec2002-10-08 17:26:56 +0000406 $i = $i + 1;
407 if ($i > 75)
408 break;
Daniel Veillard8135e5f2002-10-01 11:13:14 +0000409 }
410 printf("</tbody></table>\n");
411 }
412 }
413 }
414?>
415
416</td></tr></table></td></tr></table></td></tr></table></td>
417</tr></table></td></tr></table>
418</body>
419</html>
420