diff --git a/ChangeLog b/ChangeLog index 01e06eb4..2a45a170 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu May 10 17:30:22 CEST 2001 Daniel Veillard + + * xmlIO.c catalog.c: plugged in the default catalog resolution + * doc/gnome-xml.sgml: linked in the Docbook parser and catalog + documentations + * doc/html/libxml-*.html: rebuild added the missing ones to CVS + Thu May 10 16:14:36 CEST 2001 Daniel Veillard * Makefile.am xmlversion.h.in configure.in include/Makefile.am: diff --git a/catalog.c b/catalog.c index 437474a9..6487cb09 100644 --- a/catalog.c +++ b/catalog.c @@ -97,6 +97,79 @@ xmlFreeCatalogEntry(xmlCatalogEntryPtr ret) { xmlFree(ret); } +/** + * xmlCatalogDumpEntry: + * @entry: the + * @out: the file. + * + * Free up all the memory associated with catalogs + */ +static void +xmlCatalogDumpEntry(xmlCatalogEntryPtr entry, FILE *out) { + if ((entry == NULL) || (out == NULL)) + return; + switch (entry->type) { + case XML_CATA_ENTITY: + fprintf(out, "ENTITY "); break; + case XML_CATA_PENTITY: + fprintf(out, "ENTITY %%"); break; + case XML_CATA_DOCTYPE: + fprintf(out, "DOCTYPE "); break; + case XML_CATA_LINKTYPE: + fprintf(out, "LINKTYPE "); break; + case XML_CATA_NOTATION: + fprintf(out, "NOTATION "); break; + case XML_CATA_PUBLIC: + fprintf(out, "PUBLIC "); break; + case XML_CATA_SYSTEM: + fprintf(out, "SYSTEM "); break; + case XML_CATA_DELEGATE: + fprintf(out, "DELEGATE "); break; + case XML_CATA_BASE: + fprintf(out, "BASE "); break; + case XML_CATA_CATALOG: + fprintf(out, "CATALOG "); break; + case XML_CATA_DOCUMENT: + fprintf(out, "DOCUMENT "); break; + case XML_CATA_SGMLDECL: + fprintf(out, "SGMLDECL "); break; + default: + return; + } + switch (entry->type) { + case XML_CATA_ENTITY: + case XML_CATA_PENTITY: + case XML_CATA_DOCTYPE: + case XML_CATA_LINKTYPE: + case XML_CATA_NOTATION: + fprintf(out, "%s", entry->name); break; + case XML_CATA_PUBLIC: + case XML_CATA_SYSTEM: + case XML_CATA_SGMLDECL: + case XML_CATA_DOCUMENT: + case XML_CATA_CATALOG: + case XML_CATA_BASE: + case XML_CATA_DELEGATE: + fprintf(out, "\"%s\"", entry->name); break; + default: + break; + } + switch (entry->type) { + case XML_CATA_ENTITY: + case XML_CATA_PENTITY: + case XML_CATA_DOCTYPE: + case XML_CATA_LINKTYPE: + case XML_CATA_NOTATION: + case XML_CATA_PUBLIC: + case XML_CATA_SYSTEM: + case XML_CATA_DELEGATE: + fprintf(out, " \"%s\"", entry->value); break; + default: + break; + } + fprintf(out, "\n"); +} + /************************************************************************ * * * The parser * @@ -441,78 +514,48 @@ xmlCatalogCleanup(void) { } /** - * xmlCatalogDumpEntry: - * @entry: the - * @out: the file. + * xmlCatalogGetSystem: + * @sysId: the system ID string * - * Free up all the memory associated with catalogs + * Try to lookup the resource associated to a system ID + * + * Returns the resource name if found or NULL otherwise. */ -static void -xmlCatalogDumpEntry(xmlCatalogEntryPtr entry, FILE *out) { - if ((entry == NULL) || (out == NULL)) - return; - switch (entry->type) { - case XML_CATA_ENTITY: - fprintf(out, "ENTITY "); break; - case XML_CATA_PENTITY: - fprintf(out, "ENTITY %%"); break; - case XML_CATA_DOCTYPE: - fprintf(out, "DOCTYPE "); break; - case XML_CATA_LINKTYPE: - fprintf(out, "LINKTYPE "); break; - case XML_CATA_NOTATION: - fprintf(out, "NOTATION "); break; - case XML_CATA_PUBLIC: - fprintf(out, "PUBLIC "); break; - case XML_CATA_SYSTEM: - fprintf(out, "SYSTEM "); break; - case XML_CATA_DELEGATE: - fprintf(out, "DELEGATE "); break; - case XML_CATA_BASE: - fprintf(out, "BASE "); break; - case XML_CATA_CATALOG: - fprintf(out, "CATALOG "); break; - case XML_CATA_DOCUMENT: - fprintf(out, "DOCUMENT "); break; - case XML_CATA_SGMLDECL: - fprintf(out, "SGMLDECL "); break; - default: - return; - } - switch (entry->type) { - case XML_CATA_ENTITY: - case XML_CATA_PENTITY: - case XML_CATA_DOCTYPE: - case XML_CATA_LINKTYPE: - case XML_CATA_NOTATION: - fprintf(out, "%s", entry->name); break; - case XML_CATA_PUBLIC: - case XML_CATA_SYSTEM: - case XML_CATA_SGMLDECL: - case XML_CATA_DOCUMENT: - case XML_CATA_CATALOG: - case XML_CATA_BASE: - case XML_CATA_DELEGATE: - fprintf(out, "\"%s\"", entry->name); break; - default: - break; - } - switch (entry->type) { - case XML_CATA_ENTITY: - case XML_CATA_PENTITY: - case XML_CATA_DOCTYPE: - case XML_CATA_LINKTYPE: - case XML_CATA_NOTATION: - case XML_CATA_PUBLIC: - case XML_CATA_SYSTEM: - case XML_CATA_DELEGATE: - fprintf(out, " \"%s\"", entry->value); break; - default: - break; - } - fprintf(out, "\n"); +const xmlChar * +xmlCatalogGetSystem(const xmlChar *sysID) { + xmlCatalogEntryPtr entry; + + if ((sysID == NULL) || (xmlDefaultCatalog == NULL)) + return(NULL); + entry = (xmlCatalogEntryPtr) xmlHashLookup(xmlDefaultCatalog, sysID); + if (entry == NULL) + return(NULL); + if (entry->type == XML_CATA_SYSTEM) + return(entry->value); + return(NULL); } +/** + * xmlCatalogGetPublic: + * @pubId: the public ID string + * + * Try to lookup the system ID associated to a public ID + * + * Returns the system ID if found or NULL otherwise. + */ +const xmlChar * +xmlCatalogGetPublic(const xmlChar *pubID) { + xmlCatalogEntryPtr entry; + + if ((pubID == NULL) || (xmlDefaultCatalog == NULL)) + return(NULL); + entry = (xmlCatalogEntryPtr) xmlHashLookup(xmlDefaultCatalog, pubID); + if (entry == NULL) + return(NULL); + if (entry->type == XML_CATA_PUBLIC) + return(entry->value); + return(NULL); +} /** * xmlCatalogDump: * @out: the file. diff --git a/catalog.h b/catalog.h index f91ee94e..eb778454 100644 --- a/catalog.h +++ b/catalog.h @@ -21,9 +21,11 @@ extern "C" { #endif -int xmlLoadCatalog (const char *URL); -void xmlCatalogCleanup (void); -void xmlCatalogDump (FILE *out); +int xmlLoadCatalog (const char *URL); +void xmlCatalogCleanup (void); +void xmlCatalogDump (FILE *out); +const xmlChar * xmlCatalogGetSystem (const xmlChar *sysID); +const xmlChar * xmlCatalogGetPublic (const xmlChar *pubID); #ifdef __cplusplus } diff --git a/doc/gnome-xml.sgml b/doc/gnome-xml.sgml index 1dc156ee..07123c2c 100644 --- a/doc/gnome-xml.sgml +++ b/doc/gnome-xml.sgml @@ -15,6 +15,8 @@ + + @@ -93,6 +95,8 @@ &nanohttp; &nanoftp; &xmlIO; + &catalog; + &DOCBparser; &parserInternals; &encoding; &debugXML; diff --git a/doc/html/book1.html b/doc/html/book1.html index 6794bf9e..ccd289de 100644 --- a/doc/html/book1.html +++ b/doc/html/book1.html @@ -196,6 +196,16 @@ HREF="libxml-xmlio.html" > —
catalog
DOCBparser
parserInternals
+ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/html/libxml-catalog.html b/doc/html/libxml-catalog.html new file mode 100644 index 00000000..7f5c043c --- /dev/null +++ b/doc/html/libxml-catalog.html @@ -0,0 +1,635 @@ +catalog
Gnome XML Library Reference Manual
<<< Previous PageHomeUpNext Page >>>

catalog

Name

catalog -- 

Synopsis


+
+int         xmlLoadCatalog                  (const char *URL);
+void        xmlCatalogCleanup               (void);
+void        xmlCatalogDump                  (FILE *out);
+const xmlChar* xmlCatalogGetSystem          (const xmlChar *sysID);
+const xmlChar* xmlCatalogGetPublic          (const xmlChar *pubID);

Description

Details

xmlLoadCatalog ()

int         xmlLoadCatalog                  (const char *URL);

URL : 
Returns :


xmlCatalogCleanup ()

void        xmlCatalogCleanup               (void);

Free up all the memory associated with catalogs


xmlCatalogDump ()

void        xmlCatalogDump                  (FILE *out);

Free up all the memory associated with catalogs

out : the file.


xmlCatalogGetSystem ()

const xmlChar* xmlCatalogGetSystem          (const xmlChar *sysID);

Try to lookup the resource associated to a system ID

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


xmlCatalogGetPublic ()

const xmlChar* xmlCatalogGetPublic          (const xmlChar *pubID);

Try to lookup the system ID associated to a public ID

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

\ No newline at end of file diff --git a/doc/html/libxml-debugxml.html b/doc/html/libxml-debugxml.html index 5a53f135..5d2fac04 100644 --- a/doc/html/libxml-debugxml.html +++ b/doc/html/libxml-debugxml.html @@ -121,7 +121,7 @@ NAME="LIBXML-DEBUGXML" >

Name

Synopsis

Description

Details
















DOCBparser
Gnome XML Library Reference Manual
<<< Previous PageHomeUpNext Page >>>

DOCBparser

Name

DOCBparser -- 

Synopsis


+
+typedef     docbParserCtxt;
+typedef     docbParserCtxtPtr;
+typedef     docbParserNodeInfo;
+typedef     docbSAXHandler;
+typedef     docbSAXHandlerPtr;
+typedef     docbParserInput;
+typedef     docbParserInputPtr;
+typedef     docbDocPtr;
+typedef     docbNodePtr;
+int         docbEncodeEntities              (unsigned char *out,
+                                             int *outlen,
+                                             unsigned char *in,
+                                             int *inlen,
+                                             int quoteChar);
+docbDocPtr  docbSAXParseDoc                 (xmlChar *cur,
+                                             const char *encoding,
+                                             docbSAXHandlerPtr sax,
+                                             void *userData);
+docbDocPtr  docbParseDoc                    (xmlChar *cur,
+                                             const char *encoding);
+docbDocPtr  docbSAXParseFile                (const char *filename,
+                                             const char *encoding,
+                                             docbSAXHandlerPtr sax,
+                                             void *userData);
+docbDocPtr  docbParseFile                   (const char *filename,
+                                             const char *encoding);
+void        docbFreeParserCtxt              (docbParserCtxtPtr ctxt);
+docbParserCtxtPtr docbCreatePushParserCtxt  (docbSAXHandlerPtr sax,
+                                             void *user_data,
+                                             const char *chunk,
+                                             int size,
+                                             const char *filename,
+                                             xmlCharEncoding enc);
+int         docbParseChunk                  (docbParserCtxtPtr ctxt,
+                                             const char *chunk,
+                                             int size,
+                                             int terminate);
+docbParserCtxtPtr docbCreateFileParserCtxt  (const char *filename,
+                                             const char *encoding);
+int         docbParseDocument               (docbParserCtxtPtr ctxt);

Description

Details

docbParserCtxt

typedef xmlParserCtxt docbParserCtxt;


docbParserCtxtPtr

typedef xmlParserCtxtPtr docbParserCtxtPtr;


docbParserNodeInfo

typedef xmlParserNodeInfo docbParserNodeInfo;


docbSAXHandler

typedef xmlSAXHandler docbSAXHandler;


docbSAXHandlerPtr

typedef xmlSAXHandlerPtr docbSAXHandlerPtr;


docbParserInput

typedef xmlParserInput docbParserInput;


docbParserInputPtr

typedef xmlParserInputPtr docbParserInputPtr;


docbDocPtr

typedef xmlDocPtr docbDocPtr;


docbNodePtr

typedef xmlNodePtr docbNodePtr;


docbEncodeEntities ()

int         docbEncodeEntities              (unsigned char *out,
+                                             int *outlen,
+                                             unsigned char *in,
+                                             int *inlen,
+                                             int quoteChar);

Take a block of UTF-8 chars in and try to convert it to an ASCII +plus SGML entities block of chars out.

out : a pointer to an array of bytes to store the result
outlen : the length of out
in : a pointer to an array of UTF-8 chars
inlen : the length of in
quoteChar : the quote character to escape (' or ") or zero.
Returns :0 if success, -2 if the transcoding fails, or -1 otherwise +The value of inlen after return is the number of octets consumed +as the return value is positive, else unpredictiable. +The value of outlen after return is the number of octets consumed.


docbSAXParseDoc ()

docbDocPtr  docbSAXParseDoc                 (xmlChar *cur,
+                                             const char *encoding,
+                                             docbSAXHandlerPtr sax,
+                                             void *userData);

parse an SGML in-memory document and build a tree. +It use the given SAX function block to handle the parsing callback. +If sax is NULL, fallback to the default DOM tree building routines.

cur : a pointer to an array of xmlChar
encoding : a free form C string describing the SGML document encoding, or NULL
sax : the SAX handler block
userData : if using SAX, this pointer will be provided on callbacks.
Returns :the resulting document tree


docbParseDoc ()

docbDocPtr  docbParseDoc                    (xmlChar *cur,
+                                             const char *encoding);

parse an SGML in-memory document and build a tree.

cur : a pointer to an array of xmlChar
encoding : a free form C string describing the SGML document encoding, or NULL
Returns :the resulting document tree


docbSAXParseFile ()

docbDocPtr  docbSAXParseFile                (const char *filename,
+                                             const char *encoding,
+                                             docbSAXHandlerPtr sax,
+                                             void *userData);

parse an SGML file and build a tree. Automatic support for ZLIB/Compress +compressed document is provided by default if found at compile-time. +It use the given SAX function block to handle the parsing callback. +If sax is NULL, fallback to the default DOM tree building routines.

filename : the filename
encoding : a free form C string describing the SGML document encoding, or NULL
sax : the SAX handler block
userData : if using SAX, this pointer will be provided on callbacks.
Returns :the resulting document tree


docbParseFile ()

docbDocPtr  docbParseFile                   (const char *filename,
+                                             const char *encoding);

parse a Docbook SGML file and build a tree. Automatic support for +ZLIB/Compress compressed document is provided by default if found +at compile-time.

filename : the filename
encoding : a free form C string describing document encoding, or NULL
Returns :the resulting document tree


docbFreeParserCtxt ()

void        docbFreeParserCtxt              (docbParserCtxtPtr ctxt);

Free all the memory used by a parser context. However the parsed +document in ctxt->myDoc is not freed.

ctxt : an SGML parser context


docbCreatePushParserCtxt ()

docbParserCtxtPtr docbCreatePushParserCtxt  (docbSAXHandlerPtr sax,
+                                             void *user_data,
+                                             const char *chunk,
+                                             int size,
+                                             const char *filename,
+                                             xmlCharEncoding enc);

Create a parser context for using the DocBook SGML parser in push mode +To allow content encoding detection, size should be >= 4 +The value of filename is used for fetching external entities +and error/warning reports.

sax : a SAX handler
user_data : The user data returned on SAX callbacks
chunk : a pointer to an array of chars
size : number of chars in the array
filename : an optional file name or URI
enc : an optional encoding
Returns :the new parser context or NULL


docbParseChunk ()

int         docbParseChunk                  (docbParserCtxtPtr ctxt,
+                                             const char *chunk,
+                                             int size,
+                                             int terminate);

Parse a Chunk of memory

ctxt : an XML parser context
chunk : an char array
size : the size in byte of the chunk
terminate : last chunk indicator
Returns :zero if no error, the xmlParserErrors otherwise.


docbCreateFileParserCtxt ()

docbParserCtxtPtr docbCreateFileParserCtxt  (const char *filename,
+                                             const char *encoding);

Create a parser context for a file content. +Automatic support for ZLIB/Compress compressed document is provided +by default if found at compile-time.

filename : the filename
encoding : the SGML document encoding, or NULL
Returns :the new parser context or NULL


docbParseDocument ()

int         docbParseDocument               (docbParserCtxtPtr ctxt);

parse an SGML document (and build a tree if using the standard SAX +interface).

ctxt : an SGML parser context
Returns :0, -1 in case of error. the parser context is augmented +as a result of the parsing.

\ No newline at end of file diff --git a/doc/html/libxml-encoding.html b/doc/html/libxml-encoding.html index abfe9732..7319454c 100644 --- a/doc/html/libxml-encoding.html +++ b/doc/html/libxml-encoding.html @@ -121,7 +121,7 @@ NAME="LIBXML-ENCODING" >

Name

Synopsis

Description

Details

























catalog
DOCBparser
parserInternals

Name

Synopsis

Description

Details



















































































































xmlIODOCBparserxmlerror
Gnome XML Library Reference Manual
<<< Previous PageHomeUpNext Page >>>

xmlerror

Name

xmlerror -- 

Synopsis


+
+enum        xmlParserErrors;
+void        (*xmlGenericErrorFunc)          (void *ctx,
+                                             const char *msg,
+                                             ...);
+void        xmlSetGenericErrorFunc          (void *ctx,
+                                             xmlGenericErrorFunc handler);
+void        xmlParserError                  (void *ctx,
+                                             const char *msg,
+                                             ...);
+void        xmlParserWarning                (void *ctx,
+                                             const char *msg,
+                                             ...);
+void        xmlParserValidityError          (void *ctx,
+                                             const char *msg,
+                                             ...);
+void        xmlParserValidityWarning        (void *ctx,
+                                             const char *msg,
+                                             ...);
+void        xmlParserPrintFileInfo          (xmlParserInputPtr input);
+void        xmlParserPrintFileContext       (xmlParserInputPtr input);

Description

Details

enum xmlParserErrors

typedef enum {
+    XML_ERR_OK = 0,
+    XML_ERR_INTERNAL_ERROR,
+    XML_ERR_NO_MEMORY,
+    
+    XML_ERR_DOCUMENT_START, /* 3 */
+    XML_ERR_DOCUMENT_EMPTY,
+    XML_ERR_DOCUMENT_END,
+
+    XML_ERR_INVALID_HEX_CHARREF, /* 6 */
+    XML_ERR_INVALID_DEC_CHARREF,
+    XML_ERR_INVALID_CHARREF,
+    XML_ERR_INVALID_CHAR,
+
+    XML_ERR_CHARREF_AT_EOF, /* 10 */
+    XML_ERR_CHARREF_IN_PROLOG,
+    XML_ERR_CHARREF_IN_EPILOG,
+    XML_ERR_CHARREF_IN_DTD,
+    XML_ERR_ENTITYREF_AT_EOF,
+    XML_ERR_ENTITYREF_IN_PROLOG,
+    XML_ERR_ENTITYREF_IN_EPILOG,
+    XML_ERR_ENTITYREF_IN_DTD,
+    XML_ERR_PEREF_AT_EOF,
+    XML_ERR_PEREF_IN_PROLOG,
+    XML_ERR_PEREF_IN_EPILOG,
+    XML_ERR_PEREF_IN_INT_SUBSET,
+
+    XML_ERR_ENTITYREF_NO_NAME, /* 22 */
+    XML_ERR_ENTITYREF_SEMICOL_MISSING,
+
+    XML_ERR_PEREF_NO_NAME, /* 24 */
+    XML_ERR_PEREF_SEMICOL_MISSING,
+
+    XML_ERR_UNDECLARED_ENTITY, /* 26 */
+    XML_WAR_UNDECLARED_ENTITY,
+    XML_ERR_UNPARSED_ENTITY,
+    XML_ERR_ENTITY_IS_EXTERNAL,
+    XML_ERR_ENTITY_IS_PARAMETER,
+
+    XML_ERR_UNKNOWN_ENCODING, /* 31 */
+    XML_ERR_UNSUPPORTED_ENCODING,
+
+    XML_ERR_STRING_NOT_STARTED, /* 33 */
+    XML_ERR_STRING_NOT_CLOSED,
+    XML_ERR_NS_DECL_ERROR,
+
+    XML_ERR_ENTITY_NOT_STARTED, /* 36 */
+    XML_ERR_ENTITY_NOT_FINISHED,
+    
+    XML_ERR_LT_IN_ATTRIBUTE, /* 38 */
+    XML_ERR_ATTRIBUTE_NOT_STARTED,
+    XML_ERR_ATTRIBUTE_NOT_FINISHED,
+    XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
+    XML_ERR_ATTRIBUTE_REDEFINED,
+
+    XML_ERR_LITERAL_NOT_STARTED, /* 43 */
+    XML_ERR_LITERAL_NOT_FINISHED,
+    
+    XML_ERR_COMMENT_NOT_FINISHED, /* 45 */
+
+    XML_ERR_PI_NOT_STARTED, /* 47 */
+    XML_ERR_PI_NOT_FINISHED,
+
+    XML_ERR_NOTATION_NOT_STARTED, /* 49 */
+    XML_ERR_NOTATION_NOT_FINISHED,
+
+    XML_ERR_ATTLIST_NOT_STARTED, /* 51 */
+    XML_ERR_ATTLIST_NOT_FINISHED,
+
+    XML_ERR_MIXED_NOT_STARTED, /* 53 */
+    XML_ERR_MIXED_NOT_FINISHED,
+
+    XML_ERR_ELEMCONTENT_NOT_STARTED, /* 55 */
+    XML_ERR_ELEMCONTENT_NOT_FINISHED,
+
+    XML_ERR_XMLDECL_NOT_STARTED, /* 57 */
+    XML_ERR_XMLDECL_NOT_FINISHED,
+
+    XML_ERR_CONDSEC_NOT_STARTED, /* 59 */
+    XML_ERR_CONDSEC_NOT_FINISHED,
+
+    XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 61 */
+
+    XML_ERR_DOCTYPE_NOT_FINISHED, /* 62 */
+
+    XML_ERR_MISPLACED_CDATA_END, /* 63 */
+    XML_ERR_CDATA_NOT_FINISHED,
+
+    XML_ERR_RESERVED_XML_NAME, /* 65 */
+
+    XML_ERR_SPACE_REQUIRED, /* 66 */
+    XML_ERR_SEPARATOR_REQUIRED,
+    XML_ERR_NMTOKEN_REQUIRED,
+    XML_ERR_NAME_REQUIRED,
+    XML_ERR_PCDATA_REQUIRED,
+    XML_ERR_URI_REQUIRED,
+    XML_ERR_PUBID_REQUIRED,
+    XML_ERR_LT_REQUIRED,
+    XML_ERR_GT_REQUIRED,
+    XML_ERR_LTSLASH_REQUIRED,
+    XML_ERR_EQUAL_REQUIRED,
+
+    XML_ERR_TAG_NAME_MISMATCH, /* 77 */
+    XML_ERR_TAG_NOT_FINISED,
+
+    XML_ERR_STANDALONE_VALUE, /* 79 */
+
+    XML_ERR_ENCODING_NAME, /* 80 */
+
+    XML_ERR_HYPHEN_IN_COMMENT, /* 81 */
+
+    XML_ERR_INVALID_ENCODING, /* 82 */
+
+    XML_ERR_EXT_ENTITY_STANDALONE, /* 83 */
+
+    XML_ERR_CONDSEC_INVALID, /* 84 */
+
+    XML_ERR_VALUE_REQUIRED, /* 85 */
+
+    XML_ERR_NOT_WELL_BALANCED, /* 86 */
+    XML_ERR_EXTRA_CONTENT, /* 87 */
+    XML_ERR_ENTITY_CHAR_ERROR, /* 88 */
+    XML_ERR_ENTITY_PE_INTERNAL, /* 88 */
+    XML_ERR_ENTITY_LOOP, /* 89 */
+    XML_ERR_ENTITY_BOUNDARY, /* 90 */
+    XML_ERR_INVALID_URI, /* 91 */
+    XML_ERR_URI_FRAGMENT /* 92 */
+}xmlParserErrors;


xmlGenericErrorFunc ()

void        (*xmlGenericErrorFunc)          (void *ctx,
+                                             const char *msg,
+                                             ...);

ctx : 
msg : 
... :


xmlSetGenericErrorFunc ()

void        xmlSetGenericErrorFunc          (void *ctx,
+                                             xmlGenericErrorFunc handler);

Function to reset the handler and the error context for out of +context error messages. +This simply means that handler will be called for subsequent +error messages while not parsing nor validating. And ctx will +be passed as first argument to handler +One can simply force messages to be emitted to another FILE * than +stderr by setting ctx to this file handle and handler to NULL.

ctx : the new error handling context
handler : the new handler function


xmlParserError ()

void        xmlParserError                  (void *ctx,
+                                             const char *msg,
+                                             ...);

Display and format an error messages, gives file, line, position and +extra parameters.

ctx : an XML parser context
msg : the message to display/transmit
... : extra parameters for the message display


xmlParserWarning ()

void        xmlParserWarning                (void *ctx,
+                                             const char *msg,
+                                             ...);

Display and format a warning messages, gives file, line, position and +extra parameters.

ctx : an XML parser context
msg : the message to display/transmit
... : extra parameters for the message display


xmlParserValidityError ()

void        xmlParserValidityError          (void *ctx,
+                                             const char *msg,
+                                             ...);

Display and format an validity error messages, gives file, +line, position and extra parameters.

ctx : an XML parser context
msg : the message to display/transmit
... : extra parameters for the message display


xmlParserValidityWarning ()

void        xmlParserValidityWarning        (void *ctx,
+                                             const char *msg,
+                                             ...);

Display and format a validity warning messages, gives file, line, +position and extra parameters.

ctx : an XML parser context
msg : the message to display/transmit
... : extra parameters for the message display


xmlParserPrintFileInfo ()

void        xmlParserPrintFileInfo          (xmlParserInputPtr input);

Displays the associated file and line informations for the current input

input : an xmlParserInputPtr input


xmlParserPrintFileContext ()

void        xmlParserPrintFileContext       (xmlParserInputPtr input);

Displays current context within the input content for error tracking

input : an xmlParserInputPtr input

\ No newline at end of file diff --git a/doc/html/libxml-xmlio.html b/doc/html/libxml-xmlio.html index 4d0b958a..56f833c8 100644 --- a/doc/html/libxml-xmlio.html +++ b/doc/html/libxml-xmlio.html @@ -15,8 +15,8 @@ REL="PREVIOUS" TITLE="nanoftp" HREF="libxml-nanoftp.html">parserInternalscatalog

Name

Synopsis

Description

Details





















#include #include +#ifdef LIBXML_CATALOG_ENABLED +#include +#endif #ifdef VMS #define xmlRegisterDefaultInputCallbacks xmlRegisterDefInputCallbacks @@ -1587,12 +1590,26 @@ xmlParserInputPtr xmlDefaultExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt) { xmlParserInputPtr ret = NULL; + const xmlChar *resource = NULL; #ifdef DEBUG_EXTERNAL_ENTITIES xmlGenericError(xmlGenericErrorContext, "xmlDefaultExternalEntityLoader(%s, xxx)\n", URL); #endif - if (URL == NULL) { +#ifdef LIBXML_CATALOG_ENABLED + /* + * Try to load it from the resource pointed in the catalog + */ + if (ID != NULL) + resource = xmlCatalogGetPublic((const xmlChar *)ID); + if ((resource == NULL) && (URL != NULL)) + resource = xmlCatalogGetSystem((const xmlChar *)URL); +#endif + + if (resource == NULL) + resource = (const xmlChar *)URL; + + if (resource == NULL) { if ((ctxt->validate) && (ctxt->sax != NULL) && (ctxt->sax->error != NULL)) ctxt->sax->error(ctxt, @@ -1602,15 +1619,15 @@ xmlDefaultExternalEntityLoader(const char *URL, const char *ID, "failed to load external entity \"%s\"\n", ID); return(NULL); } - ret = xmlNewInputFromFile(ctxt, URL); + ret = xmlNewInputFromFile(ctxt, (const char *)resource); if (ret == NULL) { if ((ctxt->validate) && (ctxt->sax != NULL) && (ctxt->sax->error != NULL)) ctxt->sax->error(ctxt, - "failed to load external entity \"%s\"\n", URL); + "failed to load external entity \"%s\"\n", resource); else if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) ctxt->sax->warning(ctxt, - "failed to load external entity \"%s\"\n", URL); + "failed to load external entity \"%s\"\n", resource); } return(ret); }