applied patch from Mark Vakoc except the API change, preserved it. updated
* debugXML.c: applied patch from Mark Vakoc except the API
change, preserved it.
* doc/*: updated the docs to point to the search engine for
information lookup or before bug/help reports.
Daniel
diff --git a/ChangeLog b/ChangeLog
index 165d7b2..3178d9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Oct 8 23:24:20 CEST 2002 Daniel Veillard <daniel@veillard.com>
+
+ * debugXML.c: applied patch from Mark Vakoc except the API
+ change, preserved it.
+ * doc/*: updated the docs to point to the search engine for
+ information lookup or before bug/help reports.
+
Tue Oct 8 18:53:31 CEST 2002 Daniel Veillard <daniel@veillard.com>
* doc/index.py doc/search.php: added mailing-list archives
diff --git a/debugXML.c b/debugXML.c
index 22bbb56..fabcd12 100644
--- a/debugXML.c
+++ b/debugXML.c
@@ -1346,38 +1346,53 @@
/**
- * xmlShellPrintNode:
- * @node : a non-null node to print to stdout
+ * xmlShellPrintNodeCtxt:
+ * @ctxt : a non-null shell context
+ * @node : a non-null node to print to the output FILE
*
- * Print node to stdout
+ * Print node to the output FILE
+ */
+static void
+xmlShellPrintNodeCtxt(xmlShellCtxtPtr ctxt,xmlNodePtr node)
+{
+ if (!ctxt || !node)
+ return;
+
+ if (node->type == XML_DOCUMENT_NODE)
+ xmlDocDump(ctxt->output, (xmlDocPtr) node);
+ else if (node->type == XML_ATTRIBUTE_NODE)
+ xmlDebugDumpAttrList(ctxt->output, (xmlAttrPtr) node, 0);
+ else
+ xmlElemDump(ctxt->output, node->doc, node);
+
+ fprintf(ctxt->output, "\n");
+}
+
+/**
+ * xmlShellPrintNode:
+ * @node : a non-null node to print to the output FILE
+ *
+ * Print node to the output FILE
*/
void
xmlShellPrintNode(xmlNodePtr node)
{
- if (!node)
- return;
-
- if (node->type == XML_DOCUMENT_NODE)
- xmlDocDump(stdout, (xmlDocPtr) node);
- else if (node->type == XML_ATTRIBUTE_NODE)
- xmlDebugDumpAttrList(stdout, (xmlAttrPtr) node, 0);
- else
- xmlElemDump(stdout, node->doc, node);
-
- fprintf(stdout, "\n");
+ xmlShellPrintNodeCtxt(NULL, node);
}
-
/**
- * xmlShellPrintXPathResult:
+ * xmlShellPrintXPathResultCtxt:
+ * @ctxt: a valid shell context
* @list: a valid result generated by an xpath evaluation
*
- * Prints result to stdout
+ * Prints result to the output FILE
*/
-void
-xmlShellPrintXPathResult(xmlXPathObjectPtr list)
+static void
+xmlShellPrintXPathResultCtxt(xmlShellCtxtPtr ctxt,xmlXPathObjectPtr list)
{
int i = 0;
+ if (!ctxt)
+ return;
if (list != NULL) {
switch (list->type) {
@@ -1389,8 +1404,8 @@
indx++) {
if (i > 0)
fprintf(stderr, " -------\n");
- xmlShellPrintNode(list->nodesetval->
- nodeTab[indx]);
+ xmlShellPrintNodeCtxt(ctxt,
+ list->nodesetval->nodeTab[indx]);
}
} else {
xmlGenericError(xmlGenericErrorContext,
@@ -1419,6 +1434,18 @@
}
/**
+ * xmlShellPrintXPathResult:
+ * @list: a valid result generated by an xpath evaluation
+ *
+ * Prints result to the output FILE
+ */
+void
+xmlShellPrintXPathResult(xmlXPathObjectPtr list)
+{
+ xmlShellPrintXPathResultCtxt(NULL, list);
+}
+
+/**
* xmlShellList:
* @ctxt: the shell context
* @arg: unused
@@ -1431,29 +1458,31 @@
* Returns 0
*/
int
-xmlShellList(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
+xmlShellList(xmlShellCtxtPtr ctxt,
char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
xmlNodePtr node2 ATTRIBUTE_UNUSED)
{
xmlNodePtr cur;
+ if (!ctxt)
+ return (0);
if (node == NULL) {
- fprintf(stdout, "NULL\n");
+ fprintf(ctxt->output, "NULL\n");
return (0);
}
if ((node->type == XML_DOCUMENT_NODE) ||
(node->type == XML_HTML_DOCUMENT_NODE)) {
cur = ((xmlDocPtr) node)->children;
} else if (node->type == XML_NAMESPACE_DECL) {
- xmlLsOneNode(stdout, node);
+ xmlLsOneNode(ctxt->output, node);
return (0);
} else if (node->children != NULL) {
cur = node->children;
} else {
- xmlLsOneNode(stdout, node);
+ xmlLsOneNode(ctxt->output, node);
return (0);
}
while (cur != NULL) {
- xmlLsOneNode(stdout, cur);
+ xmlLsOneNode(ctxt->output, cur);
cur = cur->next;
}
return (0);
@@ -1472,22 +1501,24 @@
* Returns 0
*/
int
-xmlShellBase(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
+xmlShellBase(xmlShellCtxtPtr ctxt,
char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
xmlNodePtr node2 ATTRIBUTE_UNUSED)
{
xmlChar *base;
+ if (!ctxt)
+ return 0;
if (node == NULL) {
- fprintf(stdout, "NULL\n");
+ fprintf(ctxt->output, "NULL\n");
return (0);
}
base = xmlNodeGetBase(node->doc, node);
if (base == NULL) {
- fprintf(stdout, " No base found !!!\n");
+ fprintf(ctxt->output, " No base found !!!\n");
} else {
- fprintf(stdout, "%s\n", base);
+ fprintf(ctxt->output, "%s\n", base);
xmlFree(base);
}
return (0);
@@ -1531,17 +1562,19 @@
char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
xmlNodePtr node2 ATTRIBUTE_UNUSED)
{
+ if (!ctxt)
+ return (0);
if (node == NULL) {
- fprintf(stdout, "NULL\n");
+ fprintf(ctxt->output, "NULL\n");
return (0);
}
if ((node->type == XML_DOCUMENT_NODE) ||
(node->type == XML_HTML_DOCUMENT_NODE)) {
- xmlDebugDumpDocumentHead(stdout, (xmlDocPtr) node);
+ xmlDebugDumpDocumentHead(ctxt->output, (xmlDocPtr) node);
} else if (node->type == XML_ATTRIBUTE_NODE) {
- xmlDebugDumpAttr(stdout, (xmlAttrPtr) node, 0);
+ xmlDebugDumpAttr(ctxt->output, (xmlAttrPtr) node, 0);
} else {
- xmlDebugDumpOneNode(stdout, node, 0);
+ xmlDebugDumpOneNode(ctxt->output, node, 0);
}
return (0);
}
@@ -1562,29 +1595,31 @@
xmlShellCat(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
xmlNodePtr node, xmlNodePtr node2 ATTRIBUTE_UNUSED)
{
+ if (!ctxt)
+ return (0);
if (node == NULL) {
- fprintf(stdout, "NULL\n");
+ fprintf(ctxt->output, "NULL\n");
return (0);
}
if (ctxt->doc->type == XML_HTML_DOCUMENT_NODE) {
#ifdef LIBXML_HTML_ENABLED
if (node->type == XML_HTML_DOCUMENT_NODE)
- htmlDocDump(stdout, (htmlDocPtr) node);
+ htmlDocDump(ctxt->output, (htmlDocPtr) node);
else
- htmlNodeDumpFile(stdout, ctxt->doc, node);
+ htmlNodeDumpFile(ctxt->output, ctxt->doc, node);
#else
if (node->type == XML_DOCUMENT_NODE)
- xmlDocDump(stdout, (xmlDocPtr) node);
+ xmlDocDump(ctxt->output, (xmlDocPtr) node);
else
- xmlElemDump(stdout, ctxt->doc, node);
+ xmlElemDump(ctxt->output, ctxt->doc, node);
#endif /* LIBXML_HTML_ENABLED */
} else {
if (node->type == XML_DOCUMENT_NODE)
- xmlDocDump(stdout, (xmlDocPtr) node);
+ xmlDocDump(ctxt->output, (xmlDocPtr) node);
else
- xmlElemDump(stdout, ctxt->doc, node);
+ xmlElemDump(ctxt->output, ctxt->doc, node);
}
- fprintf(stdout, "\n");
+ fprintf(ctxt->output, "\n");
return (0);
}
@@ -1615,7 +1650,7 @@
#ifdef LIBXML_HTML_ENABLED
doc = htmlParseFile(filename, NULL);
#else
- fprintf(stdout, "HTML support not compiled in\n");
+ fprintf(ctxt->output, "HTML support not compiled in\n");
doc = NULL;
#endif /* LIBXML_HTML_ENABLED */
} else {
@@ -1822,24 +1857,27 @@
* Returns 0 or -1 in case of error
*/
int
-xmlShellDu(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
+xmlShellDu(xmlShellCtxtPtr ctxt,
char *arg ATTRIBUTE_UNUSED, xmlNodePtr tree,
xmlNodePtr node2 ATTRIBUTE_UNUSED)
{
xmlNodePtr node;
int indent = 0, i;
+ if (!ctxt)
+ return (-1);
+
if (tree == NULL)
return (-1);
node = tree;
while (node != NULL) {
if ((node->type == XML_DOCUMENT_NODE) ||
(node->type == XML_HTML_DOCUMENT_NODE)) {
- fprintf(stdout, "/\n");
+ fprintf(ctxt->output, "/\n");
} else if (node->type == XML_ELEMENT_NODE) {
for (i = 0; i < indent; i++)
- fprintf(stdout, " ");
- fprintf(stdout, "%s\n", node->name);
+ fprintf(ctxt->output, " ");
+ fprintf(ctxt->output, "%s\n", node->name);
} else {
}
@@ -1934,7 +1972,7 @@
* @doc: the initial document
* @filename: the output buffer
* @input: the line reading function
- * @output: the output FILE*
+ * @output: the output FILE*, defaults to stdout if NULL
*
* Implements the XML shell
* This allow to load, validate, view, modify and save a document
@@ -1960,7 +1998,7 @@
if (input == NULL)
return;
if (output == NULL)
- return;
+ output = stdout;
ctxt = (xmlShellCtxtPtr) xmlMalloc(sizeof(xmlShellCtxt));
if (ctxt == NULL)
return;
@@ -2038,26 +2076,26 @@
if (!strcmp(command, "bye"))
break;
if (!strcmp(command, "help")) {
- fprintf(stdout, "\tbase display XML base of the node\n");
- fprintf(stdout, "\tsetbase URI change the XML base of the node\n");
- fprintf(stdout, "\tbye leave shell\n");
- fprintf(stdout, "\tcat [node] display node or current node\n");
- fprintf(stdout, "\tcd [path] change directory to path or to root\n");
- fprintf(stdout, "\tdir [path] dumps informations about the node (namespace, attributes, content)\n");
- fprintf(stdout, "\tdu [path] show the structure of the subtree under path or the current node\n");
- fprintf(stdout, "\texit leave shell\n");
- fprintf(stdout, "\thelp display this help\n");
- fprintf(stdout, "\tfree display memory usage\n");
- fprintf(stdout, "\tload [name] load a new document with name\n");
- fprintf(stdout, "\tls [path] list contents of path or the current directory\n");
+ fprintf(ctxt->output, "\tbase display XML base of the node\n");
+ fprintf(ctxt->output, "\tsetbase URI change the XML base of the node\n");
+ fprintf(ctxt->output, "\tbye leave shell\n");
+ fprintf(ctxt->output, "\tcat [node] display node or current node\n");
+ fprintf(ctxt->output, "\tcd [path] change directory to path or to root\n");
+ fprintf(ctxt->output, "\tdir [path] dumps informations about the node (namespace, attributes, content)\n");
+ fprintf(ctxt->output, "\tdu [path] show the structure of the subtree under path or the current node\n");
+ fprintf(ctxt->output, "\texit leave shell\n");
+ fprintf(ctxt->output, "\thelp display this help\n");
+ fprintf(ctxt->output, "\tfree display memory usage\n");
+ fprintf(ctxt->output, "\tload [name] load a new document with name\n");
+ fprintf(ctxt->output, "\tls [path] list contents of path or the current directory\n");
#ifdef LIBXML_XPATH_ENABLED
- fprintf(stdout, "\txpath expr evaluate the XPath expression in that context and print the result\n");
+ fprintf(ctxt->output, "\txpath expr evaluate the XPath expression in that context and print the result\n");
#endif /* LIBXML_XPATH_ENABLED */
- fprintf(stdout, "\tpwd display current working directory\n");
- fprintf(stdout, "\tquit leave shell\n");
- fprintf(stdout, "\tsave [name] save this document to name or the original name\n");
- fprintf(stdout, "\tvalidate check the document for errors\n");
- fprintf(stdout, "\twrite [name] write the current node to the filename\n");
+ fprintf(ctxt->output, "\tpwd display current working directory\n");
+ fprintf(ctxt->output, "\tquit leave shell\n");
+ fprintf(ctxt->output, "\tsave [name] save this document to name or the original name\n");
+ fprintf(ctxt->output, "\tvalidate check the document for errors\n");
+ fprintf(ctxt->output, "\twrite [name] write the current node to the filename\n");
} else if (!strcmp(command, "validate")) {
xmlShellValidate(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "load")) {
@@ -2068,18 +2106,18 @@
xmlShellWrite(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "free")) {
if (arg[0] == 0) {
- xmlMemShow(stdout, 0);
+ xmlMemShow(ctxt->output, 0);
} else {
int len = 0;
sscanf(arg, "%d", &len);
- xmlMemShow(stdout, len);
+ xmlMemShow(ctxt->output, len);
}
} else if (!strcmp(command, "pwd")) {
char dir[500];
if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL))
- fprintf(stdout, "%s\n", dir);
+ fprintf(ctxt->output, "%s\n", dir);
} else if (!strcmp(command, "du")) {
xmlShellDu(ctxt, NULL, ctxt->node, NULL);
} else if (!strcmp(command, "base")) {
@@ -2092,7 +2130,7 @@
} else {
ctxt->pctxt->node = ctxt->node;
list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
- xmlXPathDebugDumpObject(stdout, list, 0);
+ xmlXPathDebugDumpObject(ctxt->output, list, 0);
xmlXPathFreeObject(list);
}
#endif /* LIBXML_XPATH_ENABLED */
@@ -2283,7 +2321,7 @@
indx < list->nodesetval->nodeNr;
indx++) {
if (i > 0)
- fprintf(stdout, " -------\n");
+ fprintf(ctxt->output, " -------\n");
xmlShellCat(ctxt, NULL,
list->nodesetval->
nodeTab[indx], NULL);
diff --git a/doc/bugs.html b/doc/bugs.html
index 4dd8db1..93ba2d1 100644
--- a/doc/bugs.html
+++ b/doc/bugs.html
@@ -106,7 +106,8 @@
<p>Check the following <strong><span style="color: #FF0000">before
posting</span></strong>:</p>
<ul>
-<li>Read the <a href="FAQ.html">FAQ</a>.</li>
+<li>Read the <a href="FAQ.html">FAQ</a> and <a href="search.php">use the
+ search engine</a> to get informations related to your problem.</li>
<li>Make sure you are <a href="ftp://xmlsoft.org/">using a recent
version</a>, and that the problem still shows up in a recent version.</li>
<li>Check the <a href="http://mail.gnome.org/archives/xml/">list
diff --git a/doc/docs.html b/doc/docs.html
index 86ad34b..18844d5 100644
--- a/doc/docs.html
+++ b/doc/docs.html
@@ -95,7 +95,9 @@
<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">
<p>There are several on-line resources related to using libxml:</p>
<ol>
-<li>Check the <a href="FAQ.html">FAQ.</a>
+<li>Use the <a href="search.php">search engine</a> to lookup
+ informations.</li>
+ <li>Check the <a href="FAQ.html">FAQ.</a>
</li>
<li>Check the <a href="http://xmlsoft.org/html/libxml-lib.html">extensive
documentation</a> automatically extracted from code comments (using <a href="http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&dir=gtk-doc">gtk
diff --git a/doc/downloads.html b/doc/downloads.html
index c4def4a..45b9841 100644
--- a/doc/downloads.html
+++ b/doc/downloads.html
@@ -96,7 +96,7 @@
<p>The latest versions of libxml can be found on <a href="ftp://xmlsoft.org/">xmlsoft.org</a> (<a href="ftp://speakeasy.rpmfind.net/pub/libxml/">Seattle</a>, <a href="ftp://fr.rpmfind.net/pub/libxml/">France</a>) or on the <a href="ftp://ftp.gnome.org/pub/GNOME/MIRRORS.html">Gnome FTP server</a> either
as a <a href="ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.4/">source
archive</a>
-, Antonin Sprinzl also provide <a href="ftp://gd.tuwien.ac.at/pub/libxml/">a
+ , Antonin Sprinzl also provide <a href="ftp://gd.tuwien.ac.at/pub/libxml/">a
mirror in Austria</a>. (NOTE that you need both the <a href="http://rpmfind.net/linux/RPM/libxml2.html">libxml(2)</a> and <a href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml(2)-devel</a>
packages installed to compile applications using libxml.) <a href="mailto:igor@stud.fh-frankfurt.de">Igor Zlatkovic</a> is now the
maintainer of the Windows port, <a href="http://www.fh-frankfurt.de/~igor/projects/libxml/index.html">he
diff --git a/doc/index.py b/doc/index.py
index 128d11a..600871b 100755
--- a/doc/index.py
+++ b/doc/index.py
@@ -152,6 +152,17 @@
if not tables.has_key(table):
print "table %s missing" % (table)
createTable(db, table)
+ try:
+ ret = c.execute("SELECT count(*) from %s" % table);
+ row = c.fetchone()
+ print "Table %s contains %d records" % (table, row[0])
+ except:
+ print "Troubles with table %s : repairing" % (table)
+ ret = c.execute("repair table %s" % table);
+ print "repairing returned %d" % (ret)
+ ret = c.execute("SELECT count(*) from %s" % table);
+ row = c.fetchone()
+ print "Table %s contains %d records" % (table, row[0])
print "checkTables finished"
# make sure apache can access the tables read-only
@@ -1118,7 +1129,7 @@
print "Found %d associations in HTML pages" % (i)
-def analyzeHTML():
+def analyzeHTMLTop():
global wordsDictHTML
ret = analyzeHTMLPages()
@@ -1138,8 +1149,9 @@
print "Found %d associations in HTML pages" % (i)
-def analyzeAPI():
+def analyzeAPITop():
global wordsDict
+ global API
try:
doc = loadAPI(API)
@@ -1205,9 +1217,9 @@
print "Failed to index month archive:"
print sys.exc_type, sys.exc_value
elif args[i] == '--API':
- analyzeAPI()
+ analyzeAPITop()
elif args[i] == '--docs':
- analyzeHTML()
+ analyzeHTMLTop()
else:
usage()
i = i + 1
diff --git a/doc/news.html b/doc/news.html
index 0a72ca5..47bf937 100644
--- a/doc/news.html
+++ b/doc/news.html
@@ -113,7 +113,7 @@
<li>Better handling of Windows file paths, improvement of Makefiles (Igor,
Daniel Gehriger, Mark Vakoc)</li>
<li>Improved the python I/O bindings, the tests, added resolver and regexp
- APIs </li>
+ APIs</li>
<li>New logos from Marc Liyanage</li>
<li>Tutorial improvements: John Fleck, Christopher Harris</li>
<li>Makefile: Fixes for AMD x86_64 (Mandrake), DESTDIR (Christophe
diff --git a/doc/xml.html b/doc/xml.html
index 97e6293..0e25a93 100644
--- a/doc/xml.html
+++ b/doc/xml.html
@@ -416,6 +416,8 @@
<p>There are several on-line resources related to using libxml:</p>
<ol>
+ <li>Use the <a href="search.php">search engine</a> to lookup
+ informations.</li>
<li>Check the <a href="FAQ.html">FAQ.</a></li>
<li>Check the <a href="http://xmlsoft.org/html/libxml-lib.html">extensive
documentation</a> automatically extracted from code comments (using <a
@@ -462,7 +464,8 @@
<p>Check the following <strong><span style="color: #FF0000">before
posting</span></strong>:</p>
<ul>
- <li>Read the <a href="FAQ.html">FAQ</a>.</li>
+ <li>Read the <a href="FAQ.html">FAQ</a> and <a href="search.php">use the
+ search engine</a> to get informations related to your problem.</li>
<li>Make sure you are <a href="ftp://xmlsoft.org/">using a recent
version</a>, and that the problem still shows up in a recent version.</li>
<li>Check the <a href="http://mail.gnome.org/archives/xml/">list
@@ -526,7 +529,7 @@
archive</a><!-- commenting this out because they seem to have disappeared or <a
href="ftp://ftp.gnome.org/pub/GNOME/stable/redhat/i386/libxml/">RPM
packages</a> -->
-, Antonin Sprinzl also provide <a href="ftp://gd.tuwien.ac.at/pub/libxml/">a
+ , Antonin Sprinzl also provide <a href="ftp://gd.tuwien.ac.at/pub/libxml/">a
mirror in Austria</a>. (NOTE that you need both the <a
href="http://rpmfind.net/linux/RPM/libxml2.html">libxml(2)</a> and <a
href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml(2)-devel</a>
@@ -590,7 +593,7 @@
<li>Better handling of Windows file paths, improvement of Makefiles (Igor,
Daniel Gehriger, Mark Vakoc)</li>
<li>Improved the python I/O bindings, the tests, added resolver and regexp
- APIs </li>
+ APIs</li>
<li>New logos from Marc Liyanage</li>
<li>Tutorial improvements: John Fleck, Christopher Harris</li>
<li>Makefile: Fixes for AMD x86_64 (Mandrake), DESTDIR (Christophe
@@ -2688,6 +2691,7 @@
+
} </pre>
</li>
<li>And then use it to save the document:
diff --git a/doc/xmlio.html b/doc/xmlio.html
index fe4106e..c324799 100644
--- a/doc/xmlio.html
+++ b/doc/xmlio.html
@@ -247,6 +247,7 @@
+
} </pre>
</li>
<li>And then use it to save the document: