converted too small cleanup Daniel

* HTMLtree.c include/libxml/xmlerror.h: converted too
* tree.c: small cleanup
Daniel
This commit is contained in:
Daniel Veillard 2003-10-09 13:14:55 +00:00
parent 69d2c171fa
commit e2238d5617
4 changed files with 378 additions and 371 deletions

View File

@ -1,3 +1,8 @@
Thu Oct 9 15:13:53 CEST 2003 Daniel Veillard <daniel@veillard.com>
* HTMLtree.c include/libxml/xmlerror.h: converted too
* tree.c: small cleanup
Thu Oct 9 13:44:57 CEST 2003 Daniel Veillard <daniel@veillard.com>
* xinclude.c: comment fix

View File

@ -316,6 +316,55 @@ htmlIsBooleanAttr(const xmlChar *name)
}
#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************
* *
* Output error handlers *
* *
************************************************************************/
/**
* htmlSaveErrMemory:
* @extra: extra informations
*
* Handle an out of memory condition
*/
static void
htmlSaveErrMemory(const char *extra)
{
__xmlSimpleError(XML_FROM_OUTPUT, XML_ERR_NO_MEMORY, NULL, NULL, extra);
}
/**
* htmlSaveErr:
* @code: the error number
* @node: the location of the error.
* @extra: extra informations
*
* Handle an out of memory condition
*/
static void
htmlSaveErr(int code, xmlNodePtr node, const char *extra)
{
const char *msg = NULL;
switch(code) {
case XML_SAVE_NOT_UTF8:
msg = "string is not in UTF-8";
break;
case XML_SAVE_CHAR_INVALID:
msg = "invalid character value";
break;
case XML_SAVE_UNKNOWN_ENCODING:
msg = "unknown encoding %s";
break;
case XML_SAVE_NO_DOCTYPE:
msg = "HTML has no DOCTYPE";
break;
default:
msg = "unexpected error number";
}
__xmlSimpleError(XML_FROM_OUTPUT, code, node, msg, extra);
}
/************************************************************************
* *
* Dumping HTML tree content to a simple buffer *
@ -352,8 +401,7 @@ htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
}
outbuf = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
if (outbuf == NULL) {
xmlGenericError(xmlGenericErrorContext,
"htmlNodeDumpFormat: out of memory!\n");
htmlSaveErrMemory("allocating HTML output buffer");
return (-1);
}
memset(outbuf, 0, (size_t) sizeof(xmlOutputBuffer));
@ -475,10 +523,6 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
xmlInitParser();
if (cur == NULL) {
#ifdef DEBUG_TREE
xmlGenericError(xmlGenericErrorContext,
"htmlDocDumpMemory : document == NULL\n");
#endif
*mem = NULL;
*size = 0;
return;
@ -561,8 +605,7 @@ htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
xmlDtdPtr cur = doc->intSubset;
if (cur == NULL) {
xmlGenericError(xmlGenericErrorContext,
"htmlDtdDumpOutput : no internal subset\n");
htmlSaveErr(XML_SAVE_NO_DOCTYPE, (xmlNodePtr) doc, NULL);
return;
}
xmlOutputBufferWriteString(buf, "<!DOCTYPE ");
@ -602,8 +645,6 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
*/
if (cur == NULL) {
xmlGenericError(xmlGenericErrorContext,
"htmlAttrDumpOutput : property == NULL\n");
return;
}
xmlOutputBufferWriteString(buf, " ");
@ -655,8 +696,6 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
static void
htmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding) {
if (cur == NULL) {
xmlGenericError(xmlGenericErrorContext,
"htmlAttrListDumpOutput : property == NULL\n");
return;
}
while (cur != NULL) {
@ -681,8 +720,6 @@ static void
htmlNodeListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
xmlNodePtr cur, const char *encoding, int format) {
if (cur == NULL) {
xmlGenericError(xmlGenericErrorContext,
"htmlNodeListDumpOutput : node == NULL\n");
return;
}
while (cur != NULL) {
@ -709,8 +746,6 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
xmlInitParser();
if (cur == NULL) {
xmlGenericError(xmlGenericErrorContext,
"htmlNodeDumpFormatOutput : node == NULL\n");
return;
}
/*
@ -958,10 +993,6 @@ htmlDocDump(FILE *f, xmlDocPtr cur) {
xmlInitParser();
if (cur == NULL) {
#ifdef DEBUG_TREE
xmlGenericError(xmlGenericErrorContext,
"htmlDocDump : document == NULL\n");
#endif
return(-1);
}

View File

@ -77,123 +77,90 @@ struct _xmlError {
*/
typedef enum {
XML_ERR_OK = 0,
XML_ERR_INTERNAL_ERROR,
XML_ERR_NO_MEMORY,
XML_ERR_INTERNAL_ERROR, /* 1 */
XML_ERR_NO_MEMORY, /* 2 */
XML_ERR_DOCUMENT_START, /* 3 */
XML_ERR_DOCUMENT_EMPTY,
XML_ERR_DOCUMENT_END,
XML_ERR_DOCUMENT_EMPTY, /* 4 */
XML_ERR_DOCUMENT_END, /* 5 */
XML_ERR_INVALID_HEX_CHARREF, /* 6 */
XML_ERR_INVALID_DEC_CHARREF,
XML_ERR_INVALID_CHARREF,
XML_ERR_INVALID_CHAR,
XML_ERR_INVALID_DEC_CHARREF, /* 7 */
XML_ERR_INVALID_CHARREF, /* 8 */
XML_ERR_INVALID_CHAR, /* 9 */
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_CHARREF_IN_PROLOG, /* 11 */
XML_ERR_CHARREF_IN_EPILOG, /* 12 */
XML_ERR_CHARREF_IN_DTD, /* 13 */
XML_ERR_ENTITYREF_AT_EOF, /* 14 */
XML_ERR_ENTITYREF_IN_PROLOG, /* 15 */
XML_ERR_ENTITYREF_IN_EPILOG, /* 16 */
XML_ERR_ENTITYREF_IN_DTD, /* 17 */
XML_ERR_PEREF_AT_EOF, /* 18 */
XML_ERR_PEREF_IN_PROLOG, /* 19 */
XML_ERR_PEREF_IN_EPILOG, /* 20 */
XML_ERR_PEREF_IN_INT_SUBSET, /* 21 */
XML_ERR_ENTITYREF_NO_NAME, /* 22 */
XML_ERR_ENTITYREF_SEMICOL_MISSING,
XML_ERR_ENTITYREF_SEMICOL_MISSING, /* 23 */
XML_ERR_PEREF_NO_NAME, /* 24 */
XML_ERR_PEREF_SEMICOL_MISSING,
XML_ERR_PEREF_SEMICOL_MISSING, /* 25 */
XML_ERR_UNDECLARED_ENTITY, /* 26 */
XML_WAR_UNDECLARED_ENTITY,
XML_ERR_UNPARSED_ENTITY,
XML_ERR_ENTITY_IS_EXTERNAL,
XML_ERR_ENTITY_IS_PARAMETER,
XML_WAR_UNDECLARED_ENTITY, /* 27 */
XML_ERR_UNPARSED_ENTITY, /* 28 */
XML_ERR_ENTITY_IS_EXTERNAL, /* 29 */
XML_ERR_ENTITY_IS_PARAMETER, /* 30 */
XML_ERR_UNKNOWN_ENCODING, /* 31 */
XML_ERR_UNSUPPORTED_ENCODING,
XML_ERR_UNSUPPORTED_ENCODING, /* 32 */
XML_ERR_STRING_NOT_STARTED, /* 33 */
XML_ERR_STRING_NOT_CLOSED,
XML_ERR_NS_DECL_ERROR,
XML_ERR_STRING_NOT_CLOSED, /* 34 */
XML_ERR_NS_DECL_ERROR, /* 35 */
XML_ERR_ENTITY_NOT_STARTED, /* 36 */
XML_ERR_ENTITY_NOT_FINISHED,
XML_ERR_ENTITY_NOT_FINISHED, /* 37 */
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_ATTRIBUTE_NOT_STARTED, /* 39 */
XML_ERR_ATTRIBUTE_NOT_FINISHED, /* 40 */
XML_ERR_ATTRIBUTE_WITHOUT_VALUE, /* 41 */
XML_ERR_ATTRIBUTE_REDEFINED, /* 42 */
XML_ERR_LITERAL_NOT_STARTED, /* 43 */
XML_ERR_LITERAL_NOT_FINISHED,
XML_ERR_LITERAL_NOT_FINISHED, /* 44 */
XML_ERR_COMMENT_NOT_FINISHED, /* 45 */
XML_ERR_PI_NOT_STARTED, /* 46 */
XML_ERR_PI_NOT_FINISHED,
XML_ERR_PI_NOT_FINISHED, /* 47 */
XML_ERR_NOTATION_NOT_STARTED, /* 48 */
XML_ERR_NOTATION_NOT_FINISHED,
XML_ERR_NOTATION_NOT_FINISHED, /* 49 */
XML_ERR_ATTLIST_NOT_STARTED, /* 50 */
XML_ERR_ATTLIST_NOT_FINISHED,
XML_ERR_ATTLIST_NOT_FINISHED, /* 51 */
XML_ERR_MIXED_NOT_STARTED, /* 52 */
XML_ERR_MIXED_NOT_FINISHED,
XML_ERR_MIXED_NOT_FINISHED, /* 53 */
XML_ERR_ELEMCONTENT_NOT_STARTED, /* 54 */
XML_ERR_ELEMCONTENT_NOT_FINISHED,
XML_ERR_ELEMCONTENT_NOT_FINISHED, /* 55 */
XML_ERR_XMLDECL_NOT_STARTED, /* 56 */
XML_ERR_XMLDECL_NOT_FINISHED,
XML_ERR_XMLDECL_NOT_FINISHED, /* 57 */
XML_ERR_CONDSEC_NOT_STARTED, /* 58 */
XML_ERR_CONDSEC_NOT_FINISHED,
XML_ERR_CONDSEC_NOT_FINISHED, /* 59 */
XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 60 */
XML_ERR_DOCTYPE_NOT_FINISHED, /* 61 */
XML_ERR_MISPLACED_CDATA_END, /* 62 */
XML_ERR_CDATA_NOT_FINISHED,
XML_ERR_CDATA_NOT_FINISHED, /* 63 */
XML_ERR_RESERVED_XML_NAME, /* 64 */
XML_ERR_SPACE_REQUIRED, /* 65 */
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_SEPARATOR_REQUIRED, /* 66 */
XML_ERR_NMTOKEN_REQUIRED, /* 67 */
XML_ERR_NAME_REQUIRED, /* 68 */
XML_ERR_PCDATA_REQUIRED, /* 69 */
XML_ERR_URI_REQUIRED, /* 70 */
XML_ERR_PUBID_REQUIRED, /* 71 */
XML_ERR_LT_REQUIRED, /* 72 */
XML_ERR_GT_REQUIRED, /* 73 */
XML_ERR_LTSLASH_REQUIRED, /* 74 */
XML_ERR_EQUAL_REQUIRED, /* 75 */
XML_ERR_TAG_NAME_MISMATCH, /* 76 */
XML_ERR_TAG_NOT_FINISHED,
XML_ERR_TAG_NOT_FINISHED, /* 77 */
XML_ERR_STANDALONE_VALUE, /* 78 */
XML_ERR_ENCODING_NAME, /* 79 */
XML_ERR_HYPHEN_IN_COMMENT, /* 80 */
XML_ERR_INVALID_ENCODING, /* 81 */
XML_ERR_EXT_ENTITY_STANDALONE, /* 82 */
XML_ERR_CONDSEC_INVALID, /* 83 */
XML_ERR_VALUE_REQUIRED, /* 84 */
XML_ERR_NOT_WELL_BALANCED, /* 85 */
XML_ERR_EXTRA_CONTENT, /* 86 */
XML_ERR_ENTITY_CHAR_ERROR, /* 87 */
@ -203,281 +170,282 @@ typedef enum {
XML_ERR_INVALID_URI, /* 91 */
XML_ERR_URI_FRAGMENT, /* 92 */
XML_WAR_CATALOG_PI, /* 93 */
XML_ERR_NO_DTD, /* 94 */
XML_ERR_CONDSEC_INVALID_KEYWORD,
XML_ERR_VERSION_MISSING,
XML_WAR_UNKNOWN_VERSION,
XML_WAR_LANG_VALUE,
XML_WAR_NS_URI,
XML_WAR_NS_URI_RELATIVE,
XML_ERR_NO_DTD, /* 94 */
XML_ERR_CONDSEC_INVALID_KEYWORD, /* 95 */
XML_ERR_VERSION_MISSING, /* 96 */
XML_WAR_UNKNOWN_VERSION, /* 97 */
XML_WAR_LANG_VALUE, /* 98 */
XML_WAR_NS_URI, /* 99 */
XML_WAR_NS_URI_RELATIVE, /* 100 */
XML_NS_ERR_XML_NAMESPACE = 200,
XML_NS_ERR_UNDEFINED_NAMESPACE,
XML_NS_ERR_QNAME,
XML_NS_ERR_ATTRIBUTE_REDEFINED,
XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */
XML_NS_ERR_QNAME, /* 202 */
XML_NS_ERR_ATTRIBUTE_REDEFINED, /* 203 */
XML_DTD_ATTRIBUTE_DEFAULT = 500,
XML_DTD_ATTRIBUTE_REDEFINED,
XML_DTD_ATTRIBUTE_VALUE,
XML_DTD_CONTENT_ERROR,
XML_DTD_CONTENT_MODEL,
XML_DTD_CONTENT_NOT_DETERMINIST,
XML_DTD_DIFFERENT_PREFIX,
XML_DTD_ELEM_DEFAULT_NAMESPACE,
XML_DTD_ELEM_NAMESPACE,
XML_DTD_ELEM_REDEFINED,
XML_DTD_EMPTY_NOTATION,
XML_DTD_ENTITY_TYPE,
XML_DTD_ID_FIXED,
XML_DTD_ID_REDEFINED,
XML_DTD_ID_SUBSET,
XML_DTD_INVALID_CHILD,
XML_DTD_INVALID_DEFAULT,
XML_DTD_LOAD_ERROR,
XML_DTD_MISSING_ATTRIBUTE,
XML_DTD_MIXED_CORRUPT,
XML_DTD_MULTIPLE_ID,
XML_DTD_NO_DOC,
XML_DTD_NO_DTD,
XML_DTD_NO_ELEM_NAME,
XML_DTD_NO_PREFIX,
XML_DTD_NO_ROOT,
XML_DTD_NOTATION_REDEFINED,
XML_DTD_NOTATION_VALUE,
XML_DTD_NOT_EMPTY,
XML_DTD_NOT_PCDATA,
XML_DTD_NOT_STANDALONE,
XML_DTD_ROOT_NAME,
XML_DTD_STANDALONE_WHITE_SPACE,
XML_DTD_UNKNOWN_ATTRIBUTE,
XML_DTD_UNKNOWN_ELEM,
XML_DTD_UNKNOWN_ENTITY,
XML_DTD_UNKNOWN_ID,
XML_DTD_UNKNOWN_NOTATION,
XML_DTD_ATTRIBUTE_REDEFINED, /* 501 */
XML_DTD_ATTRIBUTE_VALUE, /* 502 */
XML_DTD_CONTENT_ERROR, /* 503 */
XML_DTD_CONTENT_MODEL, /* 504 */
XML_DTD_CONTENT_NOT_DETERMINIST, /* 505 */
XML_DTD_DIFFERENT_PREFIX, /* 506 */
XML_DTD_ELEM_DEFAULT_NAMESPACE, /* 507 */
XML_DTD_ELEM_NAMESPACE, /* 508 */
XML_DTD_ELEM_REDEFINED, /* 509 */
XML_DTD_EMPTY_NOTATION, /* 510 */
XML_DTD_ENTITY_TYPE, /* 511 */
XML_DTD_ID_FIXED, /* 512 */
XML_DTD_ID_REDEFINED, /* 513 */
XML_DTD_ID_SUBSET, /* 514 */
XML_DTD_INVALID_CHILD, /* 515 */
XML_DTD_INVALID_DEFAULT, /* 516 */
XML_DTD_LOAD_ERROR, /* 517 */
XML_DTD_MISSING_ATTRIBUTE, /* 518 */
XML_DTD_MIXED_CORRUPT, /* 519 */
XML_DTD_MULTIPLE_ID, /* 520 */
XML_DTD_NO_DOC, /* 521 */
XML_DTD_NO_DTD, /* 522 */
XML_DTD_NO_ELEM_NAME, /* 523 */
XML_DTD_NO_PREFIX, /* 524 */
XML_DTD_NO_ROOT, /* 525 */
XML_DTD_NOTATION_REDEFINED, /* 526 */
XML_DTD_NOTATION_VALUE, /* 527 */
XML_DTD_NOT_EMPTY, /* 528 */
XML_DTD_NOT_PCDATA, /* 529 */
XML_DTD_NOT_STANDALONE, /* 530 */
XML_DTD_ROOT_NAME, /* 531 */
XML_DTD_STANDALONE_WHITE_SPACE, /* 532 */
XML_DTD_UNKNOWN_ATTRIBUTE, /* 533 */
XML_DTD_UNKNOWN_ELEM, /* 534 */
XML_DTD_UNKNOWN_ENTITY, /* 535 */
XML_DTD_UNKNOWN_ID, /* 536 */
XML_DTD_UNKNOWN_NOTATION, /* 537 */
XML_HTML_STRUCURE_ERROR = 800,
XML_HTML_UNKNOWN_TAG,
XML_HTML_UNKNOWN_TAG, /* 801 */
XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000,
XML_RNGP_ATTR_CONFLICT,
XML_RNGP_ATTRIBUTE_CHILDREN,
XML_RNGP_ATTRIBUTE_CONTENT,
XML_RNGP_ATTRIBUTE_EMPTY,
XML_RNGP_ATTRIBUTE_NOOP,
XML_RNGP_CHOICE_CONTENT,
XML_RNGP_CHOICE_EMPTY,
XML_RNGP_CREATE_FAILURE,
XML_RNGP_DATA_CONTENT,
XML_RNGP_DEF_CHOICE_AND_INTERLEAVE,
XML_RNGP_DEFINE_CREATE_FAILED,
XML_RNGP_DEFINE_EMPTY,
XML_RNGP_DEFINE_MISSING,
XML_RNGP_DEFINE_NAME_MISSING,
XML_RNGP_ELEM_CONTENT_EMPTY,
XML_RNGP_ELEM_CONTENT_ERROR,
XML_RNGP_ELEMENT_EMPTY,
XML_RNGP_ELEMENT_CONTENT,
XML_RNGP_ELEMENT_NAME,
XML_RNGP_ELEMENT_NO_CONTENT,
XML_RNGP_ELEM_TEXT_CONFLICT,
XML_RNGP_EMPTY,
XML_RNGP_EMPTY_CONSTRUCT,
XML_RNGP_EMPTY_CONTENT,
XML_RNGP_EMPTY_NOT_EMPTY,
XML_RNGP_ERROR_TYPE_LIB,
XML_RNGP_EXCEPT_EMPTY,
XML_RNGP_EXCEPT_MISSING,
XML_RNGP_EXCEPT_MULTIPLE,
XML_RNGP_EXCEPT_NO_CONTENT,
XML_RNGP_EXTERNALREF_EMTPY,
XML_RNGP_EXTERNAL_REF_FAILURE,
XML_RNGP_EXTERNALREF_RECURSE,
XML_RNGP_FORBIDDEN_ATTRIBUTE,
XML_RNGP_FOREIGN_ELEMENT,
XML_RNGP_GRAMMAR_CONTENT,
XML_RNGP_GRAMMAR_EMPTY,
XML_RNGP_GRAMMAR_MISSING,
XML_RNGP_GRAMMAR_NO_START,
XML_RNGP_GROUP_ATTR_CONFLICT,
XML_RNGP_HREF_ERROR,
XML_RNGP_INCLUDE_EMPTY,
XML_RNGP_INCLUDE_FAILURE,
XML_RNGP_INCLUDE_RECURSE,
XML_RNGP_INTERLEAVE_ADD,
XML_RNGP_INTERLEAVE_CREATE_FAILED,
XML_RNGP_INTERLEAVE_EMPTY,
XML_RNGP_INTERLEAVE_NO_CONTENT,
XML_RNGP_INVALID_DEFINE_NAME,
XML_RNGP_INVALID_URI,
XML_RNGP_INVALID_VALUE,
XML_RNGP_MISSING_HREF,
XML_RNGP_NAME_MISSING,
XML_RNGP_NEED_COMBINE,
XML_RNGP_NOTALLOWED_NOT_EMPTY,
XML_RNGP_NSNAME_ATTR_ANCESTOR,
XML_RNGP_NSNAME_NO_NS,
XML_RNGP_PARAM_FORBIDDEN,
XML_RNGP_PARAM_NAME_MISSING,
XML_RNGP_PARENTREF_CREATE_FAILED,
XML_RNGP_PARENTREF_NAME_INVALID,
XML_RNGP_PARENTREF_NO_NAME,
XML_RNGP_PARENTREF_NO_PARENT,
XML_RNGP_PARENTREF_NOT_EMPTY,
XML_RNGP_PARSE_ERROR,
XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME,
XML_RNGP_PAT_ATTR_ATTR,
XML_RNGP_PAT_ATTR_ELEM,
XML_RNGP_PAT_DATA_EXCEPT_ATTR,
XML_RNGP_PAT_DATA_EXCEPT_ELEM,
XML_RNGP_PAT_DATA_EXCEPT_EMPTY,
XML_RNGP_PAT_DATA_EXCEPT_GROUP,
XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE,
XML_RNGP_PAT_DATA_EXCEPT_LIST,
XML_RNGP_PAT_DATA_EXCEPT_ONEMORE,
XML_RNGP_PAT_DATA_EXCEPT_REF,
XML_RNGP_PAT_DATA_EXCEPT_TEXT,
XML_RNGP_PAT_LIST_ATTR,
XML_RNGP_PAT_LIST_ELEM,
XML_RNGP_PAT_LIST_INTERLEAVE,
XML_RNGP_PAT_LIST_LIST,
XML_RNGP_PAT_LIST_REF,
XML_RNGP_PAT_LIST_TEXT,
XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME,
XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME,
XML_RNGP_PAT_ONEMORE_GROUP_ATTR,
XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR,
XML_RNGP_PAT_START_ATTR,
XML_RNGP_PAT_START_DATA,
XML_RNGP_PAT_START_EMPTY,
XML_RNGP_PAT_START_GROUP,
XML_RNGP_PAT_START_INTERLEAVE,
XML_RNGP_PAT_START_LIST,
XML_RNGP_PAT_START_ONEMORE,
XML_RNGP_PAT_START_TEXT,
XML_RNGP_PAT_START_VALUE,
XML_RNGP_PREFIX_UNDEFINED,
XML_RNGP_REF_CREATE_FAILED,
XML_RNGP_REF_CYCLE,
XML_RNGP_REF_NAME_INVALID,
XML_RNGP_REF_NO_DEF,
XML_RNGP_REF_NO_NAME,
XML_RNGP_REF_NOT_EMPTY,
XML_RNGP_START_CHOICE_AND_INTERLEAVE,
XML_RNGP_START_CONTENT,
XML_RNGP_START_EMPTY,
XML_RNGP_START_MISSING,
XML_RNGP_TEXT_EXPECTED,
XML_RNGP_TEXT_HAS_CHILD,
XML_RNGP_TYPE_MISSING,
XML_RNGP_TYPE_NOT_FOUND,
XML_RNGP_TYPE_VALUE,
XML_RNGP_UNKNOWN_ATTRIBUTE,
XML_RNGP_UNKNOWN_COMBINE,
XML_RNGP_UNKNOWN_CONSTRUCT,
XML_RNGP_UNKNOWN_TYPE_LIB,
XML_RNGP_URI_FRAGMENT,
XML_RNGP_URI_NOT_ABSOLUTE,
XML_RNGP_VALUE_EMPTY,
XML_RNGP_VALUE_NO_CONTENT,
XML_RNGP_XMLNS_NAME,
XML_RNGP_XML_NS,
XML_RNGP_ATTR_CONFLICT, /* 1001 */
XML_RNGP_ATTRIBUTE_CHILDREN, /* 1002 */
XML_RNGP_ATTRIBUTE_CONTENT, /* 1003 */
XML_RNGP_ATTRIBUTE_EMPTY, /* 1004 */
XML_RNGP_ATTRIBUTE_NOOP, /* 1005 */
XML_RNGP_CHOICE_CONTENT, /* 1006 */
XML_RNGP_CHOICE_EMPTY, /* 1007 */
XML_RNGP_CREATE_FAILURE, /* 1008 */
XML_RNGP_DATA_CONTENT, /* 1009 */
XML_RNGP_DEF_CHOICE_AND_INTERLEAVE, /* 1010 */
XML_RNGP_DEFINE_CREATE_FAILED, /* 1011 */
XML_RNGP_DEFINE_EMPTY, /* 1012 */
XML_RNGP_DEFINE_MISSING, /* 1013 */
XML_RNGP_DEFINE_NAME_MISSING, /* 1014 */
XML_RNGP_ELEM_CONTENT_EMPTY, /* 1015 */
XML_RNGP_ELEM_CONTENT_ERROR, /* 1016 */
XML_RNGP_ELEMENT_EMPTY, /* 1017 */
XML_RNGP_ELEMENT_CONTENT, /* 1018 */
XML_RNGP_ELEMENT_NAME, /* 1019 */
XML_RNGP_ELEMENT_NO_CONTENT, /* 1020 */
XML_RNGP_ELEM_TEXT_CONFLICT, /* 1021 */
XML_RNGP_EMPTY, /* 1022 */
XML_RNGP_EMPTY_CONSTRUCT, /* 1023 */
XML_RNGP_EMPTY_CONTENT, /* 1024 */
XML_RNGP_EMPTY_NOT_EMPTY, /* 1025 */
XML_RNGP_ERROR_TYPE_LIB, /* 1026 */
XML_RNGP_EXCEPT_EMPTY, /* 1027 */
XML_RNGP_EXCEPT_MISSING, /* 1028 */
XML_RNGP_EXCEPT_MULTIPLE, /* 1029 */
XML_RNGP_EXCEPT_NO_CONTENT, /* 1030 */
XML_RNGP_EXTERNALREF_EMTPY, /* 1031 */
XML_RNGP_EXTERNAL_REF_FAILURE, /* 1032 */
XML_RNGP_EXTERNALREF_RECURSE, /* 1033 */
XML_RNGP_FORBIDDEN_ATTRIBUTE, /* 1034 */
XML_RNGP_FOREIGN_ELEMENT, /* 1035 */
XML_RNGP_GRAMMAR_CONTENT, /* 1036 */
XML_RNGP_GRAMMAR_EMPTY, /* 1037 */
XML_RNGP_GRAMMAR_MISSING, /* 1038 */
XML_RNGP_GRAMMAR_NO_START, /* 1039 */
XML_RNGP_GROUP_ATTR_CONFLICT, /* 1040 */
XML_RNGP_HREF_ERROR, /* 1041 */
XML_RNGP_INCLUDE_EMPTY, /* 1042 */
XML_RNGP_INCLUDE_FAILURE, /* 1043 */
XML_RNGP_INCLUDE_RECURSE, /* 1044 */
XML_RNGP_INTERLEAVE_ADD, /* 1045 */
XML_RNGP_INTERLEAVE_CREATE_FAILED, /* 1046 */
XML_RNGP_INTERLEAVE_EMPTY, /* 1047 */
XML_RNGP_INTERLEAVE_NO_CONTENT, /* 1048 */
XML_RNGP_INVALID_DEFINE_NAME, /* 1049 */
XML_RNGP_INVALID_URI, /* 1050 */
XML_RNGP_INVALID_VALUE, /* 1051 */
XML_RNGP_MISSING_HREF, /* 1052 */
XML_RNGP_NAME_MISSING, /* 1053 */
XML_RNGP_NEED_COMBINE, /* 1054 */
XML_RNGP_NOTALLOWED_NOT_EMPTY, /* 1055 */
XML_RNGP_NSNAME_ATTR_ANCESTOR, /* 1056 */
XML_RNGP_NSNAME_NO_NS, /* 1057 */
XML_RNGP_PARAM_FORBIDDEN, /* 1058 */
XML_RNGP_PARAM_NAME_MISSING, /* 1059 */
XML_RNGP_PARENTREF_CREATE_FAILED, /* 1060 */
XML_RNGP_PARENTREF_NAME_INVALID, /* 1061 */
XML_RNGP_PARENTREF_NO_NAME, /* 1062 */
XML_RNGP_PARENTREF_NO_PARENT, /* 1063 */
XML_RNGP_PARENTREF_NOT_EMPTY, /* 1064 */
XML_RNGP_PARSE_ERROR, /* 1065 */
XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME, /* 1066 */
XML_RNGP_PAT_ATTR_ATTR, /* 1067 */
XML_RNGP_PAT_ATTR_ELEM, /* 1068 */
XML_RNGP_PAT_DATA_EXCEPT_ATTR, /* 1069 */
XML_RNGP_PAT_DATA_EXCEPT_ELEM, /* 1070 */
XML_RNGP_PAT_DATA_EXCEPT_EMPTY, /* 1071 */
XML_RNGP_PAT_DATA_EXCEPT_GROUP, /* 1072 */
XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE, /* 1073 */
XML_RNGP_PAT_DATA_EXCEPT_LIST, /* 1074 */
XML_RNGP_PAT_DATA_EXCEPT_ONEMORE, /* 1075 */
XML_RNGP_PAT_DATA_EXCEPT_REF, /* 1076 */
XML_RNGP_PAT_DATA_EXCEPT_TEXT, /* 1077 */
XML_RNGP_PAT_LIST_ATTR, /* 1078 */
XML_RNGP_PAT_LIST_ELEM, /* 1079 */
XML_RNGP_PAT_LIST_INTERLEAVE, /* 1080 */
XML_RNGP_PAT_LIST_LIST, /* 1081 */
XML_RNGP_PAT_LIST_REF, /* 1082 */
XML_RNGP_PAT_LIST_TEXT, /* 1083 */
XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME, /* 1084 */
XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME, /* 1085 */
XML_RNGP_PAT_ONEMORE_GROUP_ATTR, /* 1086 */
XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR, /* 1087 */
XML_RNGP_PAT_START_ATTR, /* 1088 */
XML_RNGP_PAT_START_DATA, /* 1089 */
XML_RNGP_PAT_START_EMPTY, /* 1090 */
XML_RNGP_PAT_START_GROUP, /* 1091 */
XML_RNGP_PAT_START_INTERLEAVE, /* 1092 */
XML_RNGP_PAT_START_LIST, /* 1093 */
XML_RNGP_PAT_START_ONEMORE, /* 1094 */
XML_RNGP_PAT_START_TEXT, /* 1095 */
XML_RNGP_PAT_START_VALUE, /* 1096 */
XML_RNGP_PREFIX_UNDEFINED, /* 1097 */
XML_RNGP_REF_CREATE_FAILED, /* 1098 */
XML_RNGP_REF_CYCLE, /* 1099 */
XML_RNGP_REF_NAME_INVALID, /* 1100 */
XML_RNGP_REF_NO_DEF, /* 1101 */
XML_RNGP_REF_NO_NAME, /* 1102 */
XML_RNGP_REF_NOT_EMPTY, /* 1103 */
XML_RNGP_START_CHOICE_AND_INTERLEAVE, /* 1104 */
XML_RNGP_START_CONTENT, /* 1105 */
XML_RNGP_START_EMPTY, /* 1106 */
XML_RNGP_START_MISSING, /* 1107 */
XML_RNGP_TEXT_EXPECTED, /* 1108 */
XML_RNGP_TEXT_HAS_CHILD, /* 1109 */
XML_RNGP_TYPE_MISSING, /* 1110 */
XML_RNGP_TYPE_NOT_FOUND, /* 1111 */
XML_RNGP_TYPE_VALUE, /* 1112 */
XML_RNGP_UNKNOWN_ATTRIBUTE, /* 1113 */
XML_RNGP_UNKNOWN_COMBINE, /* 1114 */
XML_RNGP_UNKNOWN_CONSTRUCT, /* 1115 */
XML_RNGP_UNKNOWN_TYPE_LIB, /* 1116 */
XML_RNGP_URI_FRAGMENT, /* 1117 */
XML_RNGP_URI_NOT_ABSOLUTE, /* 1118 */
XML_RNGP_VALUE_EMPTY, /* 1119 */
XML_RNGP_VALUE_NO_CONTENT, /* 1120 */
XML_RNGP_XMLNS_NAME, /* 1121 */
XML_RNGP_XML_NS, /* 1122 */
XML_XPATH_EXPRESSION_OK = 1200,
XML_XPATH_NUMBER_ERROR,
XML_XPATH_UNFINISHED_LITERAL_ERROR,
XML_XPATH_START_LITERAL_ERROR,
XML_XPATH_VARIABLE_REF_ERROR,
XML_XPATH_UNDEF_VARIABLE_ERROR,
XML_XPATH_INVALID_PREDICATE_ERROR,
XML_XPATH_EXPR_ERROR,
XML_XPATH_UNCLOSED_ERROR,
XML_XPATH_UNKNOWN_FUNC_ERROR,
XML_XPATH_INVALID_OPERAND,
XML_XPATH_INVALID_TYPE,
XML_XPATH_INVALID_ARITY,
XML_XPATH_INVALID_CTXT_SIZE,
XML_XPATH_INVALID_CTXT_POSITION,
XML_XPATH_MEMORY_ERROR,
XML_XPTR_SYNTAX_ERROR,
XML_XPTR_RESOURCE_ERROR,
XML_XPTR_SUB_RESOURCE_ERROR,
XML_XPATH_UNDEF_PREFIX_ERROR,
XML_XPATH_ENCODING_ERROR,
XML_XPATH_INVALID_CHAR_ERROR,
XML_XPATH_NUMBER_ERROR, /* 1201 */
XML_XPATH_UNFINISHED_LITERAL_ERROR, /* 1202 */
XML_XPATH_START_LITERAL_ERROR, /* 1203 */
XML_XPATH_VARIABLE_REF_ERROR, /* 1204 */
XML_XPATH_UNDEF_VARIABLE_ERROR, /* 1205 */
XML_XPATH_INVALID_PREDICATE_ERROR, /* 1206 */
XML_XPATH_EXPR_ERROR, /* 1207 */
XML_XPATH_UNCLOSED_ERROR, /* 1208 */
XML_XPATH_UNKNOWN_FUNC_ERROR, /* 1209 */
XML_XPATH_INVALID_OPERAND, /* 1210 */
XML_XPATH_INVALID_TYPE, /* 1211 */
XML_XPATH_INVALID_ARITY, /* 1212 */
XML_XPATH_INVALID_CTXT_SIZE, /* 1213 */
XML_XPATH_INVALID_CTXT_POSITION, /* 1214 */
XML_XPATH_MEMORY_ERROR, /* 1215 */
XML_XPTR_SYNTAX_ERROR, /* 1216 */
XML_XPTR_RESOURCE_ERROR, /* 1217 */
XML_XPTR_SUB_RESOURCE_ERROR, /* 1218 */
XML_XPATH_UNDEF_PREFIX_ERROR, /* 1219 */
XML_XPATH_ENCODING_ERROR, /* 1220 */
XML_XPATH_INVALID_CHAR_ERROR, /* 1221 */
XML_TREE_INVALID_HEX = 1300,
XML_TREE_INVALID_DEC,
XML_TREE_UNTERMINATED_ENTITY,
XML_TREE_INVALID_DEC, /* 1301 */
XML_TREE_UNTERMINATED_ENTITY, /* 1302 */
XML_SAVE_NOT_UTF8 = 1400,
XML_SAVE_CHAR_INVALID,
XML_SAVE_UNKNOWN_ENCODING,
XML_SAVE_CHAR_INVALID, /* 1401 */
XML_SAVE_NO_DOCTYPE, /* 1402 */
XML_SAVE_UNKNOWN_ENCODING, /* 1403 */
XML_REGEXP_COMPILE_ERROR = 1450,
XML_IO_UNKNOWN = 1500,
XML_IO_EACCES,
XML_IO_EAGAIN,
XML_IO_EBADF,
XML_IO_EBADMSG,
XML_IO_EBUSY,
XML_IO_ECANCELED,
XML_IO_ECHILD,
XML_IO_EDEADLK,
XML_IO_EDOM,
XML_IO_EEXIST,
XML_IO_EFAULT,
XML_IO_EFBIG,
XML_IO_EINPROGRESS,
XML_IO_EINTR,
XML_IO_EINVAL,
XML_IO_EIO,
XML_IO_EISDIR,
XML_IO_EMFILE,
XML_IO_EMLINK,
XML_IO_EMSGSIZE,
XML_IO_ENAMETOOLONG,
XML_IO_ENFILE,
XML_IO_ENODEV,
XML_IO_ENOENT,
XML_IO_ENOEXEC,
XML_IO_ENOLCK,
XML_IO_ENOMEM,
XML_IO_ENOSPC,
XML_IO_ENOSYS,
XML_IO_ENOTDIR,
XML_IO_ENOTEMPTY,
XML_IO_ENOTSUP,
XML_IO_ENOTTY,
XML_IO_ENXIO,
XML_IO_EPERM,
XML_IO_EPIPE,
XML_IO_ERANGE,
XML_IO_EROFS,
XML_IO_ESPIPE,
XML_IO_ESRCH,
XML_IO_ETIMEDOUT,
XML_IO_EXDEV,
XML_IO_NETWORK_ATTEMPT,
XML_IO_ENCODER,
XML_IO_FLUSH,
XML_IO_WRITE,
XML_IO_NO_INPUT,
XML_IO_BUFFER_FULL,
XML_IO_LOAD_ERROR,
XML_IO_EACCES, /* 1501 */
XML_IO_EAGAIN, /* 1502 */
XML_IO_EBADF, /* 1503 */
XML_IO_EBADMSG, /* 1504 */
XML_IO_EBUSY, /* 1505 */
XML_IO_ECANCELED, /* 1506 */
XML_IO_ECHILD, /* 1507 */
XML_IO_EDEADLK, /* 1508 */
XML_IO_EDOM, /* 1509 */
XML_IO_EEXIST, /* 1510 */
XML_IO_EFAULT, /* 1511 */
XML_IO_EFBIG, /* 1512 */
XML_IO_EINPROGRESS, /* 1513 */
XML_IO_EINTR, /* 1514 */
XML_IO_EINVAL, /* 1515 */
XML_IO_EIO, /* 1516 */
XML_IO_EISDIR, /* 1517 */
XML_IO_EMFILE, /* 1518 */
XML_IO_EMLINK, /* 1519 */
XML_IO_EMSGSIZE, /* 1520 */
XML_IO_ENAMETOOLONG, /* 1521 */
XML_IO_ENFILE, /* 1522 */
XML_IO_ENODEV, /* 1523 */
XML_IO_ENOENT, /* 1524 */
XML_IO_ENOEXEC, /* 1525 */
XML_IO_ENOLCK, /* 1526 */
XML_IO_ENOMEM, /* 1527 */
XML_IO_ENOSPC, /* 1528 */
XML_IO_ENOSYS, /* 1529 */
XML_IO_ENOTDIR, /* 1530 */
XML_IO_ENOTEMPTY, /* 1531 */
XML_IO_ENOTSUP, /* 1532 */
XML_IO_ENOTTY, /* 1533 */
XML_IO_ENXIO, /* 1534 */
XML_IO_EPERM, /* 1535 */
XML_IO_EPIPE, /* 1536 */
XML_IO_ERANGE, /* 1537 */
XML_IO_EROFS, /* 1538 */
XML_IO_ESPIPE, /* 1539 */
XML_IO_ESRCH, /* 1540 */
XML_IO_ETIMEDOUT, /* 1541 */
XML_IO_EXDEV, /* 1542 */
XML_IO_NETWORK_ATTEMPT, /* 1543 */
XML_IO_ENCODER, /* 1544 */
XML_IO_FLUSH, /* 1545 */
XML_IO_WRITE, /* 1546 */
XML_IO_NO_INPUT, /* 1547 */
XML_IO_BUFFER_FULL, /* 1548 */
XML_IO_LOAD_ERROR, /* 1549 */
XML_XINCLUDE_RECURSION=1600,
XML_XINCLUDE_PARSE_VALUE,
XML_XINCLUDE_ENTITY_DEF_MISMATCH,
XML_XINCLUDE_NO_HREF,
XML_XINCLUDE_NO_FALLBACK,
XML_XINCLUDE_HREF_URI,
XML_XINCLUDE_TEXT_FRAGMENT,
XML_XINCLUDE_TEXT_DOCUMENT,
XML_XINCLUDE_INVALID_CHAR,
XML_XINCLUDE_BUILD_FAILED,
XML_XINCLUDE_UNKNOWN_ENCODING,
XML_XINCLUDE_MULTIPLE_ROOT,
XML_XINCLUDE_XPTR_FAILED,
XML_XINCLUDE_XPTR_RESULT,
XML_XINCLUDE_INCLUDE_IN_INCLUDE,
XML_XINCLUDE_FALLBACKS_IN_INCLUDE,
XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE,
XML_XINCLUDE_PARSE_VALUE, /* 1601 */
XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */
XML_XINCLUDE_NO_HREF, /* 1603 */
XML_XINCLUDE_NO_FALLBACK, /* 1604 */
XML_XINCLUDE_HREF_URI, /* 1605 */
XML_XINCLUDE_TEXT_FRAGMENT, /* 1606 */
XML_XINCLUDE_TEXT_DOCUMENT, /* 1607 */
XML_XINCLUDE_INVALID_CHAR, /* 1608 */
XML_XINCLUDE_BUILD_FAILED, /* 1609 */
XML_XINCLUDE_UNKNOWN_ENCODING, /* 1610 */
XML_XINCLUDE_MULTIPLE_ROOT, /* 1611 */
XML_XINCLUDE_XPTR_FAILED, /* 1612 */
XML_XINCLUDE_XPTR_RESULT, /* 1613 */
XML_XINCLUDE_INCLUDE_IN_INCLUDE, /* 1614 */
XML_XINCLUDE_FALLBACKS_IN_INCLUDE, /* 1615 */
XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE, /* 1616 */
XML_CATALOG_MISSING_ATTR = 1650,
XML_CATALOG_ENTRY_BROKEN,
XML_CATALOG_PREFER_VALUE,
XML_CATALOG_NOT_CATALOG,
XML_CATALOG_RECURSION
XML_CATALOG_ENTRY_BROKEN, /* 1651 */
XML_CATALOG_PREFER_VALUE, /* 1652 */
XML_CATALOG_NOT_CATALOG, /* 1653 */
XML_CATALOG_RECURSION /* 1654 */
} xmlParserErrors;
/**

7
tree.c
View File

@ -6837,7 +6837,7 @@ xmlBufferWriteQuotedString(xmlBufferPtr buf, const xmlChar *string) {
#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************
* *
* Output memory error handler *
* Output error handlers *
* *
************************************************************************/
/**
@ -6875,10 +6875,13 @@ xmlSaveErr(int code, xmlNodePtr node, const char *extra)
case XML_SAVE_UNKNOWN_ENCODING:
msg = "unknown encoding %s";
break;
case XML_SAVE_NO_DOCTYPE:
msg = "document has no DOCTYPE";
break;
default:
msg = "unexpected error number";
}
__xmlSimpleError(XML_FROM_TREE, code, node, msg, extra);
__xmlSimpleError(XML_FROM_OUTPUT, code, node, msg, extra);
}
/************************************************************************
* *