* xmlACatalogResolveURI: * @catal: a Catalog * @URI: the URI * * Do a complete resolution lookup of an URI * * Returns the URI of the resource or NULL if not found, it must be freed * by the caller. */
| 2862 | * by the caller. |
| 2863 | */ |
| 2864 | xmlChar * |
| 2865 | xmlACatalogResolveURI(xmlCatalogPtr catal, const xmlChar *URI) { |
| 2866 | xmlChar *ret = NULL; |
| 2867 | |
| 2868 | if ((URI == NULL) || (catal == NULL)) |
| 2869 | return(NULL); |
| 2870 | |
| 2871 | if (xmlDebugCatalogs) |
| 2872 | fprintf(stderr, |
| 2873 | "Resolve URI %s\n", URI); |
| 2874 | |
| 2875 | if (catal->type == XML_XML_CATALOG_TYPE) { |
| 2876 | ret = xmlCatalogListXMLResolveURI(catal->xml, URI); |
| 2877 | if (ret == XML_CATAL_BREAK) |
| 2878 | ret = NULL; |
| 2879 | } else { |
| 2880 | const xmlChar *sgml; |
| 2881 | |
| 2882 | sgml = xmlCatalogSGMLResolve(catal, NULL, URI); |
| 2883 | if (sgml != NULL) |
| 2884 | ret = xmlStrdup(sgml); |
| 2885 | } |
| 2886 | return(ret); |
| 2887 | } |
| 2888 | |
| 2889 | #ifdef LIBXML_OUTPUT_ENABLED |
| 2890 | /** |
no test coverage detected