Justin Fletcher pointed out that xmlParseXMLCatalog was not used anymore !

* catalog.c: Justin Fletcher pointed out that xmlParseXMLCatalog
  was not used anymore !
Daniel
This commit is contained in:
Daniel Veillard 2001-10-30 17:41:38 +00:00
parent 5540daa9ea
commit 91c0040ace
2 changed files with 5 additions and 71 deletions

View File

@ -1,3 +1,8 @@
Tue Oct 30 18:38:53 CET 2001 Daniel Veillard <daniel@veillard.com>
* catalog.c: Justin Fletcher pointed out that xmlParseXMLCatalog
was not used anymore !
Tue Oct 30 13:33:13 CET 2001 Daniel Veillard <daniel@veillard.com>
* configure.in: preparing 2.4.7

View File

@ -879,9 +879,6 @@ xmlLoadFileContent(const char *filename)
static xmlCatalogEntryPtr
xmlParseXMLCatalogFile(xmlCatalogPrefer prefer, const xmlChar *filename);
static xmlCatalogEntryPtr
xmlParseXMLCatalog(const xmlChar *value, xmlCatalogPrefer prefer,
const char *file);
static void
xmlParseXMLCatalogNodeList(xmlNodePtr cur, xmlCatalogPrefer prefer,
xmlCatalogEntryPtr parent);
@ -1120,74 +1117,6 @@ xmlParseXMLCatalogNodeList(xmlNodePtr cur, xmlCatalogPrefer prefer,
/* TODO: sort the list according to REWRITE lengths and prefer value */
}
/**
* xmlParseXMLCatalog:
* @value: the content in-memory of the catalog serialization
* @prefer: the PUBLIC vs. SYSTEM current preference value
* @file: the filename for the catalog
*
* Parses the catalog content to extract the XML tree and then analyze the
* tree to build a list of Catalog entries corresponding to this catalog
*
* Returns the resulting Catalog entries list
*/
static xmlCatalogEntryPtr
xmlParseXMLCatalog(const xmlChar *value, xmlCatalogPrefer prefer,
const char *file) {
xmlDocPtr doc;
xmlNodePtr cur;
xmlChar *prop;
xmlCatalogEntryPtr parent = NULL;
if ((value == NULL) || (file == NULL))
return(NULL);
if (xmlDebugCatalogs)
xmlGenericError(xmlGenericErrorContext,
"Parsing catalog %s's content\n", file);
doc = xmlParseDoc((xmlChar *) value);
if (doc == NULL)
return(NULL);
doc->URL = xmlStrdup((const xmlChar *) file);
cur = xmlDocGetRootElement(doc);
if ((cur != NULL) && (xmlStrEqual(cur->name, BAD_CAST "catalog")) &&
(cur->ns != NULL) && (cur->ns->href != NULL) &&
(xmlStrEqual(cur->ns->href, XML_CATALOGS_NAMESPACE))) {
prop = xmlGetProp(cur, BAD_CAST "prefer");
if (prop != NULL) {
if (xmlStrEqual(prop, BAD_CAST "system")) {
prefer = XML_CATA_PREFER_SYSTEM;
} else if (xmlStrEqual(prop, BAD_CAST "public")) {
prefer = XML_CATA_PREFER_PUBLIC;
} else {
xmlGenericError(xmlGenericErrorContext,
"Invalid value for prefer: '%s'\n",
prop);
}
xmlFree(prop);
}
parent = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
(const xmlChar *)file, prefer);
if (parent == NULL) {
xmlFreeDoc(doc);
return(NULL);
}
cur = cur->children;
xmlParseXMLCatalogNodeList(cur, prefer, parent);
} else {
xmlGenericError(xmlGenericErrorContext,
"File %s is not an XML Catalog\n", file);
xmlFreeDoc(doc);
return(NULL);
}
xmlFreeDoc(doc);
return(parent);
}
/**
* xmlParseXMLCatalogFile:
* @prefer: the PUBLIC vs. SYSTEM current preference value