diff --git a/ChangeLog b/ChangeLog index 825a3814..f2cd8070 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Oct 9 16:22:54 CEST 2002 Daniel Veillard + + * doc/index.py doc/search.php: integrated the XSLT indexing, + a few fixed in the indexer, added a scope selection at the + search level. + Wed Oct 9 12:18:37 CEST 2002 Daniel Veillard * valid.c: Joe Marcus Clarke reported a segfault on FBsd diff --git a/doc/index.py b/doc/index.py index 600871b3..49a2cfc8 100755 --- a/doc/index.py +++ b/doc/index.py @@ -469,7 +469,6 @@ def cleanupWordsString(str): str = string.replace(str, "'", " ") str = string.replace(str, '"', " ") str = string.replace(str, ";", " ") - str = string.replace(str, "-", " ") str = string.replace(str, "(", " ") str = string.replace(str, ")", " ") str = string.replace(str, "{", " ") @@ -489,6 +488,7 @@ def cleanupWordsString(str): return str def cleanupDescrString(str): + str = string.replace(str, "'", " ") str = string.replace(str, "\n", " ") str = string.replace(str, "\r", " ") str = string.replace(str, "\xc2", " ") @@ -781,6 +781,8 @@ def analyzeAPIStruct(top): info = top.prop("info") if info != None: + info = string.replace(info, "'", " ") + info = string.strip(info) l = string.split(info) for word in l: if len(word) > 2: @@ -794,6 +796,8 @@ def analyzeAPIMacro(top): symbol = top.prop("name") if symbol == None: return 0 + symbol = string.replace(symbol, "'", " ") + symbol = string.strip(symbol) info = None cur = top.children @@ -815,6 +819,8 @@ def analyzeAPIMacro(top): print "Macro %s description has no " % (symbol) return 0 + info = string.replace(info, "'", " ") + info = string.strip(info) addMacro(symbol, file, info) l = string.split(info) for word in l: @@ -830,6 +836,8 @@ def analyzeAPIFunction(top): if symbol == None: return 0 + symbol = string.replace(symbol, "'", " ") + symbol = string.strip(symbol) info = None cur = top.children while cur != None: @@ -841,19 +849,27 @@ def analyzeAPIFunction(top): elif cur.name == "return": rinfo = cur.prop("info") if rinfo != None: + rinfo = string.replace(rinfo, "'", " ") + rinfo = string.strip(rinfo) addString(rinfo, file, symbol, 7) elif cur.name == "arg": ainfo = cur.prop("info") - if rinfo != None: + if ainfo != None: + ainfo = string.replace(ainfo, "'", " ") + ainfo = string.strip(ainfo) addString(ainfo, file, symbol, 5) name = cur.prop("name") if name != None: + name = string.replace(name, "'", " ") + name = string.strip(name) addWord(name, file, symbol, 7) cur = cur.next if info == None: print "Function %s description has no " % (symbol) addFunction(symbol, file, "") else: + info = string.replace(info, "'", " ") + info = string.strip(info) addFunction(symbol, file, info) addString(info, file, symbol, 5) diff --git a/doc/search.php b/doc/search.php index 1d19db7d..232cd5f7 100644 --- a/doc/search.php +++ b/doc/search.php @@ -94,12 +94,32 @@ A:link, A:visited, A:active { text-decoration: underline } if (! $query) { echo "

Search the X documentation on XMLSoft.org

"; } + if ($scope == NULL) + $scope = "any"; + $scope = ltrim ($scope); + if ($scope == "") + $scope = "any"; + ?> -

The search service indexes the XML API, the XML documentation and the xml@gnome.org mailing-list archive. To use it simply provide a set of keywords: +

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:

+
0) { - for ($i = 0; $i < $j; $i++) { - $relevance = mysql_result($result, $i, 0); - $name = mysql_result($result, $i, 1); - $type = mysql_result($result, $i, 2); - $module = mysql_result($result, $i, 3); - $desc = mysql_result($result, $i, 4); - if (array_key_exists($name, $results)) { - list($r,$t,$m,$d,$w,$u) = $results[$name]; - $results[$name] = array(($r + $relevance) * 2, - $t,$m,$d,$w,$u); - } else { - $id = strtoupper($name); - $m = strtolower($module); - $url = "html/libxml-$m.html#$id"; - $results[$name] = array($relevance,$type, - $module, $desc, $name, $url); - } - } - mysql_free_result($result); - } - list($result, $k) = queryHTMLWord($word); - if ($k > 0) { - for ($i = 0; $i < $k; $i++) { - $relevance = mysql_result($result, $i, 0); - $name = mysql_result($result, $i, 1); - $id = mysql_result($result, $i, 2); - $module = mysql_result($result, $i, 3); - $desc = mysql_result($result, $i, 4); - $url = $module; - if ($id != "") { - $url = $url + "#$id"; - } - $results[$name + "_html_" + $number+ "_" + $i] = - array($relevance, "documentation", + if (($scope == 'any') || ($scope == 'XML') || + ($scope == 'API') || ($scope == 'XMLAPI')) { + list($result, $j) = queryWord($word); + if ($j > 0) { + for ($i = 0; $i < $j; $i++) { + $relevance = mysql_result($result, $i, 0); + $name = mysql_result($result, $i, 1); + $type = mysql_result($result, $i, 2); + $module = mysql_result($result, $i, 3); + $desc = mysql_result($result, $i, 4); + if (array_key_exists($name, $results)) { + list($r,$t,$m,$d,$w,$u) = $results[$name]; + $results[$name] = array(($r + $relevance) * 2, + $t,$m,$d,$w,$u); + } else { + $id = strtoupper($name); + $m = strtolower($module); + $url = "html/libxml-$m.html#$id"; + $results[$name] = array($relevance,$type, $module, $desc, $name, $url); - } - mysql_free_result($result); - } - list($result, $j) = queryArchiveWord($word); - if ($j > 0) { - for ($i = 0; $i < $j; $i++) { - $relevance = mysql_result($result, $i, 0); - $name = mysql_result($result, $i, 1); - $type = mysql_result($result, $i, 2); - $url = mysql_result($result, $i, 3); - $desc = mysql_result($result, $i, 4); - if (array_key_exists($url, $results)) { - list($r,$t,$m,$d,$w,$u) = $results[$url]; - $results[$name] = array(($r + $relevance) * 2, - $t,$m,$d,$w,$u); - } else { - $id = strtoupper($name); - $m = strtolower($module); - $u = str_replace("http://mail.gnome.org/archives/xml/", "", $url); - $results[$url] = array($relevance,$type, - $u, $desc, $name, $url); + } } + mysql_free_result($result); + } + } + if (($scope == 'any') || ($scope == 'XSLT') || + ($scope == 'API') || ($scope == 'XSLTAPI')) { + list($result, $j) = XSLTqueryWord($word); + if ($j > 0) { + for ($i = 0; $i < $j; $i++) { + $relevance = mysql_result($result, $i, 0); + $name = mysql_result($result, $i, 1); + $type = mysql_result($result, $i, 2); + $module = mysql_result($result, $i, 3); + $desc = mysql_result($result, $i, 4); + if (array_key_exists($name, $results)) { + list($r,$t,$m,$d,$w,$u) = $results[$name]; + $results[$name] = array(($r + $relevance) * 2, + $t,$m,$d,$w,$u); + } else { + $id = strtoupper($name); + $m = strtolower($module); + $url = "XSLT/html/libxslt-$m.html#$id"; + $results[$name] = array($relevance,$type, + $module, $desc, $name, $url); + } + } + mysql_free_result($result); + } + } + if (($scope == 'any') || ($scope == 'XML') || + ($scope == 'DOCS') || ($scope == 'XMLDOC')) { + list($result, $k) = queryHTMLWord($word); + if ($k > 0) { + for ($i = 0; $i < $k; $i++) { + $relevance = mysql_result($result, $i, 0); + $name = mysql_result($result, $i, 1); + $id = mysql_result($result, $i, 2); + $module = mysql_result($result, $i, 3); + $desc = mysql_result($result, $i, 4); + $url = $module; + if ($id != "") { + $url = $url + "#$id"; + } + $results["$name _html_ $number _ $i"] = + array($relevance, "XML docs", + $module, $desc, $name, $url); + } + mysql_free_result($result); + } + } + if (($scope == 'any') || ($scope == 'XSLT') || + ($scope == 'DOCS') || ($scope == 'XSLTDOC')) { + list($result, $k) = XSLTqueryHTMLWord($word); + if ($k > 0) { + for ($i = 0; $i < $k; $i++) { + $relevance = mysql_result($result, $i, 0); + $name = mysql_result($result, $i, 1); + $id = mysql_result($result, $i, 2); + $module = mysql_result($result, $i, 3); + $desc = mysql_result($result, $i, 4); + $url = "XSLT/$module"; + if ($id != "") { + $url = $url + "#$id"; + } + $results["$name xslthtml $number _ $i "] = + array($relevance, "XSLT docs", + $module, $desc, $name, $url); + } + mysql_free_result($result); + } + } + if (($scope == 'any') || ($scope == 'XML') || + ($scope == 'LISTS') || ($scope == 'XMLLIST')) { + list($result, $j) = queryArchiveWord($word); + if ($j > 0) { + for ($i = 0; $i < $j; $i++) { + $relevance = mysql_result($result, $i, 0); + $name = mysql_result($result, $i, 1); + $type = mysql_result($result, $i, 2); + $url = mysql_result($result, $i, 3); + $desc = mysql_result($result, $i, 4); + if (array_key_exists($url, $results)) { + list($r,$t,$m,$d,$w,$u) = $results[$url]; + $results[$name] = array(($r + $relevance) * 2, + $t,$m,$d,$w,$u); + } else { + $id = strtoupper($name); + $m = strtolower($module); + $u = str_replace( + "http://mail.gnome.org/archives/xml/", "", $url); + $results[$url] = array($relevance,$type, + $u, $desc, $name, $url); + } + } + mysql_free_result($result); + } + } + if (($scope == 'any') || ($scope == 'XSLT') || + ($scope == 'LISTS') || ($scope == 'XSLTLIST')) { + list($result, $j) = XSLTqueryArchiveWord($word); + if ($j > 0) { + for ($i = 0; $i < $j; $i++) { + $relevance = mysql_result($result, $i, 0); + $name = mysql_result($result, $i, 1); + $type = mysql_result($result, $i, 2); + $url = mysql_result($result, $i, 3); + $desc = mysql_result($result, $i, 4); + if (array_key_exists($url, $results)) { + list($r,$t,$m,$d,$w,$u) = $results[$url]; + $results[$name] = array(($r + $relevance) * 2, + $t,$m,$d,$w,$u); + } else { + $id = strtoupper($name); + $m = strtolower($module); + $u = str_replace( + "http://mail.gnome.org/archives/xslt/", "", $url); + $results[$url] = array($relevance,$type, + $u, $desc, $name, $url); + } + } + mysql_free_result($result); } - mysql_free_result($result); } if (($j <= 0) && ($k <= 0)) { echo "

No result found for $word\n";