MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlCatalogListXMLResolveURI

Function xmlCatalogListXMLResolveURI

ThirdParty/libxml2/vtklibxml2/catalog.c:2059–2098  ·  view source on GitHub ↗

* xmlCatalogListXMLResolveURI: * @catal: a catalog list * @URI: the URI * * Do a complete resolution lookup of an URI for a list of catalogs * * Implements (or tries to) 7.2. URI Resolution * from http://www.oasis-open.org/committees/entity/spec-2001-08-06.html * * Returns the URI of the resource or NULL if not found */

Source from the content-addressed store, hash-verified

2057 * Returns the URI of the resource or NULL if not found
2058 */
2059static xmlChar *
2060xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) {
2061 xmlChar *ret = NULL;
2062 xmlChar *urnID = NULL;
2063
2064 if (catal == NULL)
2065 return(NULL);
2066 if (URI == NULL)
2067 return(NULL);
2068
2069 if (!xmlStrncmp(URI, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) {
2070 urnID = xmlCatalogUnWrapURN(URI);
2071 if (xmlDebugCatalogs) {
2072 if (urnID == NULL)
2073 fprintf(stderr,
2074 "URN ID %s expanded to NULL\n", URI);
2075 else
2076 fprintf(stderr,
2077 "URN ID expanded to %s\n", urnID);
2078 }
2079 ret = xmlCatalogListXMLResolve(catal, urnID, NULL);
2080 if (urnID != NULL)
2081 xmlFree(urnID);
2082 return(ret);
2083 }
2084 while (catal != NULL) {
2085 if (catal->type == XML_CATA_CATALOG) {
2086 if (catal->children == NULL) {
2087 xmlFetchXMLCatalogFile(catal);
2088 }
2089 if (catal->children != NULL) {
2090 ret = xmlCatalogXMLResolveURI(catal->children, URI);
2091 if (ret != NULL)
2092 return(ret);
2093 }
2094 }
2095 catal = catal->next;
2096 }
2097 return(ret);
2098}
2099
2100/************************************************************************
2101 * *

Callers 3

xmlCatalogXMLResolveURIFunction · 0.85
xmlACatalogResolveURIFunction · 0.85

Calls 6

xmlStrncmpFunction · 0.85
xmlCatalogUnWrapURNFunction · 0.85
fprintfFunction · 0.85
xmlCatalogListXMLResolveFunction · 0.85
xmlFetchXMLCatalogFileFunction · 0.85
xmlCatalogXMLResolveURIFunction · 0.85

Tested by

no test coverage detected