1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
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"><!--
7 TD {font-family: Verdana,Arial,Helvetica}
8 BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
9 H1 {font-family: Verdana,Arial,Helvetica}
10 H2 {font-family: Verdana,Arial,Helvetica}
11 H3 {font-family: Verdana,Arial,Helvetica}
12 A:link, A:visited, A:active { text-decoration: underline }
14 <title>Search the documentation on XMLSoft.org</title>
16 <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
17 <table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr>
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>
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>
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 & 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>
60 <a href="xml.html">flat page</a>, <a href="site.xsl">stylesheet</a>
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>
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>
82 <li><a href="http://ww.zlatkovic.com/projects/libxml/">Windows binaries</a></li>
83 <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&product=libxml2">Bug Tracker</a></li>
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">
92 // We handle only the first argument so far
93 $query = ltrim ($query);
95 echo "<h1 align='center'>Search the documentation on XMLSoft.org</h1>";
99 $scope = ltrim ($scope);
104 <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:
106 <form action="<?php echo "$PHP_SELF", "?query=", rawurlencode($query) ?>"
107 enctype="application/x-www-form-urlencoded" method="GET">
108 <input name="query" type="TEXT" size="50" value="<?php echo $query?>">
109 <select name="scope">
110 <option value="any">Search All</option>
111 <option value="XML" <?php if ($scope == 'XML') print "selected"?>>XML resources</option>
112 <option value="XSLT" <?php if ($scope == 'XSLT') print "selected"?>>XSLT resources</option>
113 <option value="API" <?php if ($scope == 'API') print "selected"?>>Only the APIs</option>
114 <option value="XMLAPI" <?php if ($scope == 'XMLAPI') print "selected"?>>Only the XML API</option>
115 <option value="XSLTAPI" <?php if ($scope == 'XSLTAPI') print "selected"?>>Only the XSLT API</option>
116 <option value="DOCS" <?php if ($scope == 'DOCS') print "selected"?>>Only the Documentation</option>
117 <option value="XMLDOC" <?php if ($scope == 'XMLDOC') print "selected"?>>Only the XML Documentation</option>
118 <option value="XSLTDOC" <?php if ($scope == 'XSLTDOC') print "selected"?>>Only the XSLT Documentation</option>
119 <option value="LISTS" <?php if ($scope == 'LISTS') print "selected"?>>Only the lists archives</option>
120 <option value="XMLLIST" <?php if ($scope == 'XMLLIST') print "selected"?>>Only the XML list archive</option>
121 <option value="XSLTLIST" <?php if ($scope == 'XSLTLIST') print "selected"?>>Only the XSLT list archive</option>
123 <input name=submit type=submit value="Search ...">
126 function logQueryWord($word) {
127 $result = mysql_query ("SELECT ID,Count FROM Queries WHERE Value='$word'");
129 $i = mysql_num_rows($result);
131 mysql_free_result($result);
132 mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
134 $id = mysql_result($result, 0, 0);
135 $count = mysql_result($result, 0, 1);
137 mysql_query ("UPDATE Queries SET Count=$count WHERE ID=$id");
140 mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
143 function queryWord($word) {
147 $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");
149 $j = mysql_num_rows($result);
151 mysql_free_result($result);
155 return array($result, $j);
157 function queryHTMLWord($word) {
161 $result = mysql_query ("SELECT relevance, name, id, resource, section FROM wordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75");
163 $j = mysql_num_rows($result);
165 mysql_free_result($result);
169 return array($result, $j);
171 function queryArchiveWord($word) {
175 $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 $j = mysql_num_rows($result);
179 mysql_free_result($result);
183 return array($result, $j);
185 function XSLTqueryWord($word) {
189 $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 $j = mysql_num_rows($result);
193 mysql_free_result($result);
197 return array($result, $j);
199 function XSLTqueryHTMLWord($word) {
203 $result = mysql_query ("SELECT relevance, name, id, resource, section FROM XSLTwordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75");
205 $j = mysql_num_rows($result);
207 mysql_free_result($result);
211 return array($result, $j);
213 function XSLTqueryArchiveWord($word) {
217 $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");
219 $j = mysql_num_rows($result);
221 mysql_free_result($result);
225 return array($result, $j);
227 function resSort ($a, $b) {
228 list($ra,$ta,$ma,$na,$da) = $a;
229 list($rb,$tb,$mb,$nb,$db) = $b;
230 if ($ra == $rb) return 0;
231 return ($ra > $rb) ? -1 : 1;
233 if (($query) && (strlen($query) <= 50)) {
234 $link = mysql_connect ("localhost", "nobody");
236 echo "<p> Could not connect to the database: ", mysql_error();
238 mysql_select_db("xmlsoft", $link);
239 $list = explode (" ", $query);
242 for ($number = 0;$number < count($list);$number++) {
244 $word = $list[$number];
245 if (($scope == 'any') || ($scope == 'XML') ||
246 ($scope == 'API') || ($scope == 'XMLAPI')) {
247 list($result, $j) = queryWord($word);
249 for ($i = 0; $i < $j; $i++) {
250 $relevance = mysql_result($result, $i, 0);
251 $name = mysql_result($result, $i, 1);
252 $type = mysql_result($result, $i, 2);
253 $module = mysql_result($result, $i, 3);
254 $desc = mysql_result($result, $i, 4);
255 if (array_key_exists($name, $results)) {
256 list($r,$t,$m,$d,$w,$u) = $results[$name];
257 $results[$name] = array(($r + $relevance) * 2,
260 $id = strtoupper($name);
261 $m = strtolower($module);
262 $url = "html/libxml-$m.html#$id";
263 $results[$name] = array($relevance,$type,
264 $module, $desc, $name, $url);
267 mysql_free_result($result);
270 if (($scope == 'any') || ($scope == 'XSLT') ||
271 ($scope == 'API') || ($scope == 'XSLTAPI')) {
272 list($result, $j) = XSLTqueryWord($word);
274 for ($i = 0; $i < $j; $i++) {
275 $relevance = mysql_result($result, $i, 0);
276 $name = mysql_result($result, $i, 1);
277 $type = mysql_result($result, $i, 2);
278 $module = mysql_result($result, $i, 3);
279 $desc = mysql_result($result, $i, 4);
280 if (array_key_exists($name, $results)) {
281 list($r,$t,$m,$d,$w,$u) = $results[$name];
282 $results[$name] = array(($r + $relevance) * 2,
285 $id = strtoupper($name);
286 $m = strtolower($module);
287 $url = "XSLT/html/libxslt-$m.html#$id";
288 $results[$name] = array($relevance,$type,
289 $module, $desc, $name, $url);
292 mysql_free_result($result);
295 if (($scope == 'any') || ($scope == 'XML') ||
296 ($scope == 'DOCS') || ($scope == 'XMLDOC')) {
297 list($result, $k) = queryHTMLWord($word);
299 for ($i = 0; $i < $k; $i++) {
300 $relevance = mysql_result($result, $i, 0);
301 $name = mysql_result($result, $i, 1);
302 $id = mysql_result($result, $i, 2);
303 $module = mysql_result($result, $i, 3);
304 $desc = mysql_result($result, $i, 4);
307 $url = $url + "#$id";
309 $results["$name _html_ $number _ $i"] =
310 array($relevance, "XML docs",
311 $module, $desc, $name, $url);
313 mysql_free_result($result);
316 if (($scope == 'any') || ($scope == 'XSLT') ||
317 ($scope == 'DOCS') || ($scope == 'XSLTDOC')) {
318 list($result, $k) = XSLTqueryHTMLWord($word);
320 for ($i = 0; $i < $k; $i++) {
321 $relevance = mysql_result($result, $i, 0);
322 $name = mysql_result($result, $i, 1);
323 $id = mysql_result($result, $i, 2);
324 $module = mysql_result($result, $i, 3);
325 $desc = mysql_result($result, $i, 4);
326 $url = "XSLT/$module";
328 $url = $url + "#$id";
330 $results["$name xslthtml $number _ $i "] =
331 array($relevance, "XSLT docs",
332 $module, $desc, $name, $url);
334 mysql_free_result($result);
337 if (($scope == 'any') || ($scope == 'XML') ||
338 ($scope == 'LISTS') || ($scope == 'XMLLIST')) {
339 list($result, $j) = queryArchiveWord($word);
341 for ($i = 0; $i < $j; $i++) {
342 $relevance = mysql_result($result, $i, 0);
343 $name = mysql_result($result, $i, 1);
344 $type = mysql_result($result, $i, 2);
345 $url = mysql_result($result, $i, 3);
346 $desc = mysql_result($result, $i, 4);
347 if (array_key_exists($url, $results)) {
348 list($r,$t,$m,$d,$w,$u) = $results[$url];
349 $results[$name] = array(($r + $relevance) * 2,
352 $id = strtoupper($name);
353 $m = strtolower($module);
355 "http://mail.gnome.org/archives/xml/", "", $url);
356 $results[$url] = array($relevance,$type,
357 $u, $desc, $name, $url);
360 mysql_free_result($result);
363 if (($scope == 'any') || ($scope == 'XSLT') ||
364 ($scope == 'LISTS') || ($scope == 'XSLTLIST')) {
365 list($result, $j) = XSLTqueryArchiveWord($word);
367 for ($i = 0; $i < $j; $i++) {
368 $relevance = mysql_result($result, $i, 0);
369 $name = mysql_result($result, $i, 1);
370 $type = mysql_result($result, $i, 2);
371 $url = mysql_result($result, $i, 3);
372 $desc = mysql_result($result, $i, 4);
373 if (array_key_exists($url, $results)) {
374 list($r,$t,$m,$d,$w,$u) = $results[$url];
375 $results[$name] = array(($r + $relevance) * 2,
378 $id = strtoupper($name);
379 $m = strtolower($module);
381 "http://mail.gnome.org/archives/xslt/", "", $url);
382 $results[$url] = array($relevance,$type,
383 $u, $desc, $name, $url);
386 mysql_free_result($result);
389 if (($j <= 0) && ($k <= 0)) {
390 echo "<p> No result found for $word\n";
394 $nb = count($results);
395 echo "<h3 align='center'>Found $nb results for query $query</h3>\n";
396 usort($results, "resSort");
399 printf("<table><tbody>\n");
400 printf("<tr><td>Quality</td><td>Symbol</td><td>Type</td><td>module</td><td>Description</td></tr>\n");
402 while (list ($name, $val) = each ($results)) {
403 list($r,$t,$m,$d,$s,$u) = $val;
404 $m = str_replace("<", "<", $m);
405 $s = str_replace("<", "<", $s);
406 $d = str_replace("<", "<", $d);
407 echo "<tr><td>$r</td><td><a href='$u'>$s</a></td><td>$t</td><td>$m</td><td>$d</td></tr>";
412 printf("</tbody></table>\n");
418 </td></tr></table></td></tr></table></td></tr></table></td>
419 </tr></table></td></tr></table>