Back to Turicreate

catalog: interfaces to the Catalog handling system

deps/src/libxml2-2.9.1/doc/devhelp/libxml2-catalog.html

6.4.118.7 KB
Original Source

| | | | | libxml2 Reference Manual |

catalog

catalog - interfaces to the Catalog handling system

the catalog module implements the support for XML Catalogs and SGML catalogs

Author(s): Daniel Veillard

Synopsis

#define[XML\_CATALOG\_PI](#XML_CATALOG_PI);
#define[XML\_CATALOGS\_NAMESPACE](#XML_CATALOGS_NAMESPACE);
typedef enum[xmlCatalogAllow](#xmlCatalogAllow);
typedef enum[xmlCatalogPrefer](#xmlCatalogPrefer);
typedef struct _xmlCatalog[xmlCatalog](#xmlCatalog);
typedef[xmlCatalog](libxml2-catalog.html#xmlCatalog)*[xmlCatalogPtr](#xmlCatalogPtr);
void[xmlFreeCatalog](#xmlFreeCatalog)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal);
void[xmlLoadCatalogs](#xmlLoadCatalogs)(const char * pathss);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlCatalogLocalResolve](#xmlCatalogLocalResolve)(void * catalogs,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID);
int[xmlACatalogAdd](#xmlACatalogAdd)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* orig,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* replace);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlACatalogResolvePublic](#xmlACatalogResolvePublic)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID);[xmlCatalogAllow](libxml2-catalog.html#xmlCatalogAllow)[xmlCatalogGetDefaults](#xmlCatalogGetDefaults)(void);
int[xmlACatalogRemove](#xmlACatalogRemove)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* value);[xmlCatalogPrefer](libxml2-catalog.html#xmlCatalogPrefer)[xmlCatalogSetDefaultPrefer](#xmlCatalogSetDefaultPrefer)([xmlCatalogPrefer](libxml2-catalog.html#xmlCatalogPrefer)prefer);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlACatalogResolveURI](#xmlACatalogResolveURI)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* URI);
int[xmlCatalogAdd](#xmlCatalogAdd)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* orig,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* replace);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlCatalogResolvePublic](#xmlCatalogResolvePublic)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID);
const[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlCatalogGetSystem](#xmlCatalogGetSystem)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID);
void[xmlInitializeCatalog](#xmlInitializeCatalog)(void);
int[xmlLoadCatalog](#xmlLoadCatalog)(const char * filename);
int[xmlCatalogRemove](#xmlCatalogRemove)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* value);
int[xmlCatalogIsEmpty](#xmlCatalogIsEmpty)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal);
void[xmlACatalogDump](#xmlACatalogDump)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
FILE * out);
void[xmlCatalogFreeLocal](#xmlCatalogFreeLocal)(void * catalogs);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlACatalogResolve](#xmlACatalogResolve)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlCatalogResolveSystem](#xmlCatalogResolveSystem)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID);[xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)[xmlLoadSGMLSuperCatalog](#xmlLoadSGMLSuperCatalog)(const char * filename);
int[xmlCatalogConvert](#xmlCatalogConvert)(void);
const[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlCatalogGetPublic](#xmlCatalogGetPublic)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID);[xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)[xmlLoadACatalog](#xmlLoadACatalog)(const char * filename);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlACatalogResolveSystem](#xmlACatalogResolveSystem)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlCatalogLocalResolveURI](#xmlCatalogLocalResolveURI)(void * catalogs,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* URI);
int[xmlConvertSGMLCatalog](#xmlConvertSGMLCatalog)([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal);
void *[xmlCatalogAddLocal](#xmlCatalogAddLocal)(void * catalogs,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* URL);[xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)[xmlNewCatalog](#xmlNewCatalog)(int sgml);[xmlDocPtr](libxml2-tree.html#xmlDocPtr)[xmlParseCatalogFile](#xmlParseCatalogFile)(const char * filename);
int[xmlCatalogSetDebug](#xmlCatalogSetDebug)(int level);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlCatalogResolve](#xmlCatalogResolve)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID);
void[xmlCatalogSetDefaults](#xmlCatalogSetDefaults)([xmlCatalogAllow](libxml2-catalog.html#xmlCatalogAllow)allow);
void[xmlCatalogDump](#xmlCatalogDump)(FILE * out);
void[xmlCatalogCleanup](#xmlCatalogCleanup)(void);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlCatalogResolveURI](#xmlCatalogResolveURI)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* URI);

Description

Details

Macro XML_CATALOGS_NAMESPACE

#define[XML\_CATALOGS\_NAMESPACE](#XML_CATALOGS_NAMESPACE);

The namespace for the XML Catalogs elements.


Macro XML_CATALOG_PI

#define[XML\_CATALOG\_PI](#XML_CATALOG_PI);

The specific XML Catalog Processing Instuction name.


Structure xmlCatalog

struct _xmlCatalog {
The content of this structure is not made public by the API.
} xmlCatalog;

Enum xmlCatalogAllow

enum[xmlCatalogAllow](#xmlCatalogAllow){XML\_CATA\_ALLOW\_NONE= 0XML\_CATA\_ALLOW\_GLOBAL= 1XML\_CATA\_ALLOW\_DOCUMENT= 2XML\_CATA\_ALLOW\_ALL= 3
};

Enum xmlCatalogPrefer

enum[xmlCatalogPrefer](#xmlCatalogPrefer){XML\_CATA\_PREFER\_NONE= 0XML\_CATA\_PREFER\_PUBLIC= 1XML\_CATA\_PREFER\_SYSTEM= 2
};

Typedef xmlCatalogPtr

[xmlCatalog](libxml2-catalog.html#xmlCatalog)* xmlCatalogPtr;

xmlACatalogAdd ()

int	xmlACatalogAdd ([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* orig,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* replace)

Add an entry in the catalog, it may overwrite existing but different entries.

| catal: | a Catalog | | type: | the type of record to add to the catalog | | orig: | the system, public or prefix to match | | replace: | the replacement value for the match | | Returns: | 0 if successful, -1 otherwise |


xmlACatalogDump ()

void	xmlACatalogDump ([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
FILE * out)

Dump the given catalog to the given file.

| catal: | a Catalog | | out: | the file. |


xmlACatalogRemove ()

int	xmlACatalogRemove ([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* value)

Remove an entry from the catalog

| catal: | a Catalog | | value: | the value to remove | | Returns: | the number of entries removed if successful, -1 otherwise |


xmlACatalogResolve ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlACatalogResolve	([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID)

Do a complete resolution lookup of an External Identifier

| catal: | a Catalog | | pubID: | the public ID string | | sysID: | the system ID string | | Returns: | the URI of the resource or NULL if not found, it must be freed by the caller. |


xmlACatalogResolvePublic ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlACatalogResolvePublic	([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID)

Try to lookup the catalog local reference associated to a public ID in that catalog

| catal: | a Catalog | | pubID: | the public ID string | | Returns: | the local resource if found or NULL otherwise, the value returned must be freed by the caller. |


xmlACatalogResolveSystem ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlACatalogResolveSystem	([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID)

Try to lookup the catalog resource for a system ID

| catal: | a Catalog | | sysID: | the system ID string | | Returns: | the resource if found or NULL otherwise, the value returned must be freed by the caller. |


xmlACatalogResolveURI ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlACatalogResolveURI	([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* URI)

Do a complete resolution lookup of an URI

| catal: | a Catalog | | URI: | the URI | | Returns: | the URI of the resource or NULL if not found, it must be freed by the caller. |


xmlCatalogAdd ()

int	xmlCatalogAdd (const[xmlChar](libxml2-xmlstring.html#xmlChar)* type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* orig,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* replace)

Add an entry in the catalog, it may overwrite existing but different entries. If called before any other catalog routine, allows to override the default shared catalog put in place by xmlInitializeCatalog();

| type: | the type of record to add to the catalog | | orig: | the system, public or prefix to match | | replace: | the replacement value for the match | | Returns: | 0 if successful, -1 otherwise |


xmlCatalogAddLocal ()

void *	xmlCatalogAddLocal (void * catalogs,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* URL)

Add the new entry to the catalog list

| catalogs: | a document's list of catalogs | | URL: | the URL to a new local catalog | | Returns: | the updated list |


xmlCatalogCleanup ()

void	xmlCatalogCleanup (void)

Free up all the memory associated with catalogs


xmlCatalogConvert ()

int	xmlCatalogConvert (void)

Convert all the SGML catalog entries as XML ones

| Returns: | the number of entries converted if successful, -1 otherwise |


xmlCatalogDump ()

void	xmlCatalogDump (FILE * out)

Dump all the global catalog content to the given file.

| out: | the file. |


xmlCatalogFreeLocal ()

void	xmlCatalogFreeLocal (void * catalogs)

Free up the memory associated to the catalog list

| catalogs: | a document's list of catalogs |


xmlCatalogGetDefaults ()

[xmlCatalogAllow](libxml2-catalog.html#xmlCatalogAllow)xmlCatalogGetDefaults	(void)

Used to get the user preference w.r.t. to what catalogs should be accepted

| Returns: | the current xmlCatalogAllow value |


xmlCatalogGetPublic ()

const[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlCatalogGetPublic	(const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID)

Try to lookup the catalog reference associated to a public ID DEPRECATED, use xmlCatalogResolvePublic()

| pubID: | the public ID string | | Returns: | the resource if found or NULL otherwise. |


xmlCatalogGetSystem ()

const[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlCatalogGetSystem	(const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID)

Try to lookup the catalog reference associated to a system ID DEPRECATED, use xmlCatalogResolveSystem()

| sysID: | the system ID string | | Returns: | the resource if found or NULL otherwise. |


xmlCatalogIsEmpty ()

int	xmlCatalogIsEmpty ([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal)

Check is a catalog is empty

| catal: | should this create an SGML catalog | | Returns: | 1 if the catalog is empty, 0 if not, amd -1 in case of error. |


xmlCatalogLocalResolve ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlCatalogLocalResolve	(void * catalogs,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID)

Do a complete resolution lookup of an External Identifier using a document's private catalog list

| catalogs: | a document's list of catalogs | | pubID: | the public ID string | | sysID: | the system ID string | | Returns: | the URI of the resource or NULL if not found, it must be freed by the caller. |


xmlCatalogLocalResolveURI ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlCatalogLocalResolveURI	(void * catalogs,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* URI)

Do a complete resolution lookup of an URI using a document's private catalog list

| catalogs: | a document's list of catalogs | | URI: | the URI | | Returns: | the URI of the resource or NULL if not found, it must be freed by the caller. |


xmlCatalogRemove ()

int	xmlCatalogRemove (const[xmlChar](libxml2-xmlstring.html#xmlChar)* value)

Remove an entry from the catalog

| value: | the value to remove | | Returns: | the number of entries removed if successful, -1 otherwise |


xmlCatalogResolve ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlCatalogResolve	(const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID)

Do a complete resolution lookup of an External Identifier

| pubID: | the public ID string | | sysID: | the system ID string | | Returns: | the URI of the resource or NULL if not found, it must be freed by the caller. |


xmlCatalogResolvePublic ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlCatalogResolvePublic	(const[xmlChar](libxml2-xmlstring.html#xmlChar)* pubID)

Try to lookup the catalog reference associated to a public ID

| pubID: | the public ID string | | Returns: | the resource if found or NULL otherwise, the value returned must be freed by the caller. |


xmlCatalogResolveSystem ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlCatalogResolveSystem	(const[xmlChar](libxml2-xmlstring.html#xmlChar)* sysID)

Try to lookup the catalog resource for a system ID

| sysID: | the system ID string | | Returns: | the resource if found or NULL otherwise, the value returned must be freed by the caller. |


xmlCatalogResolveURI ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlCatalogResolveURI	(const[xmlChar](libxml2-xmlstring.html#xmlChar)* URI)

Do a complete resolution lookup of an URI

| URI: | the URI | | Returns: | the URI of the resource or NULL if not found, it must be freed by the caller. |


xmlCatalogSetDebug ()

int	xmlCatalogSetDebug (int level)

Used to set the debug level for catalog operation, 0 disable debugging, 1 enable it

| level: | the debug level of catalogs required | | Returns: | the previous value of the catalog debugging level |


xmlCatalogSetDefaultPrefer ()

[xmlCatalogPrefer](libxml2-catalog.html#xmlCatalogPrefer)xmlCatalogSetDefaultPrefer	([xmlCatalogPrefer](libxml2-catalog.html#xmlCatalogPrefer)prefer)

Allows to set the preference between public and system for deletion in XML Catalog resolution. C.f. section 4.1.1 of the spec Values accepted are XML_CATA_PREFER_PUBLIC or XML_CATA_PREFER_SYSTEM

| prefer: | the default preference for delegation | | Returns: | the previous value of the default preference for delegation |


xmlCatalogSetDefaults ()

void	xmlCatalogSetDefaults ([xmlCatalogAllow](libxml2-catalog.html#xmlCatalogAllow)allow)

Used to set the user preference w.r.t. to what catalogs should be accepted

| allow: | what catalogs should be accepted |


xmlConvertSGMLCatalog ()

int	xmlConvertSGMLCatalog ([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal)

Convert all the SGML catalog entries as XML ones

| catal: | the catalog | | Returns: | the number of entries converted if successful, -1 otherwise |


xmlFreeCatalog ()

void	xmlFreeCatalog ([xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)catal)

Free the memory allocated to a Catalog

| catal: | a Catalog |


xmlInitializeCatalog ()

void	xmlInitializeCatalog (void)

Do the catalog initialization. this function is not thread safe, catalog initialization should preferably be done once at startup


xmlLoadACatalog ()

[xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)xmlLoadACatalog (const char * filename)

Load the catalog and build the associated data structures. This can be either an XML Catalog or an SGML Catalog It will recurse in SGML CATALOG entries. On the other hand XML Catalogs are not handled recursively.

| filename: | a file path | | Returns: | the catalog parsed or NULL in case of error |


xmlLoadCatalog ()

int	xmlLoadCatalog (const char * filename)

Load the catalog and makes its definitions effective for the default external entity loader. It will recurse in SGML CATALOG entries. this function is not thread safe, catalog initialization should preferably be done once at startup

| filename: | a file path | | Returns: | 0 in case of success -1 in case of error |


xmlLoadCatalogs ()

void	xmlLoadCatalogs (const char * pathss)

Load the catalogs and makes their definitions effective for the default external entity loader. this function is not thread safe, catalog initialization should preferably be done once at startup

| pathss: | a list of directories separated by a colon or a space. |


xmlLoadSGMLSuperCatalog ()

[xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)xmlLoadSGMLSuperCatalog	(const char * filename)

Load an SGML super catalog. It won't expand CATALOG or DELEGATE references. This is only needed for manipulating SGML Super Catalogs like adding and removing CATALOG or DELEGATE entries.

| filename: | a file path | | Returns: | the catalog parsed or NULL in case of error |


xmlNewCatalog ()

[xmlCatalogPtr](libxml2-catalog.html#xmlCatalogPtr)xmlNewCatalog (int sgml)

create a new Catalog.

| sgml: | should this create an SGML catalog | | Returns: | the xmlCatalogPtr or NULL in case of error |


xmlParseCatalogFile ()

[xmlDocPtr](libxml2-tree.html#xmlDocPtr)xmlParseCatalogFile	(const char * filename)

parse an XML file and build a tree. It's like xmlParseFile() except it bypass all catalog lookups.

| filename: | the filename | | Returns: | the resulting document tree or NULL in case of error |