mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Bunch of fixes, finishing moving datastructures to the hash stuff:
- hash.[ch] debugXML.c: expanded/enhanced the API, added multikey tuples, made hash structure opaque - valid.[ch]: moved elements, attributes, notations decalarations as well as ID and refs to hash tables. - entities.c: hash cleanup - xmlmemory.c: fixed a dump problem in debug mode - include/Makefile.am: problem passing in DESTDIR= values patch from Marc Christensen <marc@calderasystems.com> - nanohttp.c: removed debugging remains - HTMLparser.c: the bogus tag should be ignored (Wayne) - HTMLparser.c parser.c: fixing a number of problems with the macros in the *parser.c files (Wayne). - HTMLparser.c: close the previous option when opening a new one (Marc Sanfacon). - result/HTML/*: updated the HTML results accordingly Daniel
This commit is contained in:
114
debugXML.c
114
debugXML.c
@ -771,11 +771,41 @@ void xmlDebugDumpDTD(FILE *output, xmlDtdPtr dtd) {
|
||||
xmlDebugDumpNodeList(output, dtd->children, 1);
|
||||
}
|
||||
|
||||
void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) {
|
||||
int i;
|
||||
xmlHashEntryPtr ent;
|
||||
xmlEntityPtr cur;
|
||||
void xmlDebugDumpEntityCallback(xmlEntityPtr cur, FILE *output,
|
||||
const xmlChar *name) {
|
||||
fprintf(output, "%s : ", cur->name);
|
||||
switch (cur->etype) {
|
||||
case XML_INTERNAL_GENERAL_ENTITY:
|
||||
fprintf(output, "INTERNAL GENERAL, ");
|
||||
break;
|
||||
case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
|
||||
fprintf(output, "EXTERNAL PARSED, ");
|
||||
break;
|
||||
case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
|
||||
fprintf(output, "EXTERNAL UNPARSED, ");
|
||||
break;
|
||||
case XML_INTERNAL_PARAMETER_ENTITY:
|
||||
fprintf(output, "INTERNAL PARAMETER, ");
|
||||
break;
|
||||
case XML_EXTERNAL_PARAMETER_ENTITY:
|
||||
fprintf(output, "EXTERNAL PARAMETER, ");
|
||||
break;
|
||||
default:
|
||||
fprintf(output, "UNKNOWN TYPE %d",
|
||||
cur->etype);
|
||||
}
|
||||
if (cur->ExternalID != NULL)
|
||||
fprintf(output, "ID \"%s\"", cur->ExternalID);
|
||||
if (cur->SystemID != NULL)
|
||||
fprintf(output, "SYSTEM \"%s\"", cur->SystemID);
|
||||
if (cur->orig != NULL)
|
||||
fprintf(output, "\n orig \"%s\"", cur->orig);
|
||||
if (cur->content != NULL)
|
||||
fprintf(output, "\n content \"%s\"", cur->content);
|
||||
fprintf(output, "\n");
|
||||
}
|
||||
|
||||
void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) {
|
||||
if (output == NULL) output = stdout;
|
||||
if (doc == NULL) {
|
||||
fprintf(output, "DOCUMENT == NULL !\n");
|
||||
@ -829,86 +859,14 @@ void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) {
|
||||
xmlEntitiesTablePtr table = (xmlEntitiesTablePtr)
|
||||
doc->intSubset->entities;
|
||||
fprintf(output, "Entities in internal subset\n");
|
||||
for (i = 0;i < table->size;i++) {
|
||||
ent = table->table[i];
|
||||
while (ent != NULL) {
|
||||
cur = (xmlEntityPtr) ent->payload;
|
||||
fprintf(output, "%d : %s : ", i, cur->name);
|
||||
switch (cur->etype) {
|
||||
case XML_INTERNAL_GENERAL_ENTITY:
|
||||
fprintf(output, "INTERNAL GENERAL, ");
|
||||
break;
|
||||
case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
|
||||
fprintf(output, "EXTERNAL PARSED, ");
|
||||
break;
|
||||
case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
|
||||
fprintf(output, "EXTERNAL UNPARSED, ");
|
||||
break;
|
||||
case XML_INTERNAL_PARAMETER_ENTITY:
|
||||
fprintf(output, "INTERNAL PARAMETER, ");
|
||||
break;
|
||||
case XML_EXTERNAL_PARAMETER_ENTITY:
|
||||
fprintf(output, "EXTERNAL PARAMETER, ");
|
||||
break;
|
||||
default:
|
||||
fprintf(output, "UNKNOWN TYPE %d",
|
||||
cur->etype);
|
||||
}
|
||||
if (cur->ExternalID != NULL)
|
||||
fprintf(output, "ID \"%s\"", cur->ExternalID);
|
||||
if (cur->SystemID != NULL)
|
||||
fprintf(output, "SYSTEM \"%s\"", cur->SystemID);
|
||||
if (cur->orig != NULL)
|
||||
fprintf(output, "\n orig \"%s\"", cur->orig);
|
||||
if (cur->content != NULL)
|
||||
fprintf(output, "\n content \"%s\"", cur->content);
|
||||
fprintf(output, "\n");
|
||||
ent = ent->next;
|
||||
}
|
||||
}
|
||||
xmlHashScan(table, (xmlHashScanner)xmlDebugDumpEntityCallback, output);
|
||||
} else
|
||||
fprintf(output, "No entities in internal subset\n");
|
||||
if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
|
||||
xmlEntitiesTablePtr table = (xmlEntitiesTablePtr)
|
||||
doc->extSubset->entities;
|
||||
fprintf(output, "Entities in external subset\n");
|
||||
for (i = 0;i < table->size;i++) {
|
||||
ent = table->table[i];
|
||||
while (ent != NULL) {
|
||||
cur = (xmlEntityPtr) ent->payload;
|
||||
fprintf(output, "%d : %s : ", i, cur->name);
|
||||
switch (cur->etype) {
|
||||
case XML_INTERNAL_GENERAL_ENTITY:
|
||||
fprintf(output, "INTERNAL GENERAL, ");
|
||||
break;
|
||||
case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
|
||||
fprintf(output, "EXTERNAL PARSED, ");
|
||||
break;
|
||||
case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
|
||||
fprintf(output, "EXTERNAL UNPARSED, ");
|
||||
break;
|
||||
case XML_INTERNAL_PARAMETER_ENTITY:
|
||||
fprintf(output, "INTERNAL PARAMETER, ");
|
||||
break;
|
||||
case XML_EXTERNAL_PARAMETER_ENTITY:
|
||||
fprintf(output, "EXTERNAL PARAMETER, ");
|
||||
break;
|
||||
default:
|
||||
fprintf(output, "UNKNOWN TYPE %d",
|
||||
cur->etype);
|
||||
}
|
||||
if (cur->ExternalID != NULL)
|
||||
fprintf(output, "ID \"%s\"", cur->ExternalID);
|
||||
if (cur->SystemID != NULL)
|
||||
fprintf(output, "SYSTEM \"%s\"", cur->SystemID);
|
||||
if (cur->orig != NULL)
|
||||
fprintf(output, "\n orig \"%s\"", cur->orig);
|
||||
if (cur->content != NULL)
|
||||
fprintf(output, "\n content \"%s\"", cur->content);
|
||||
fprintf(output, "\n");
|
||||
ent = ent->next;
|
||||
}
|
||||
}
|
||||
xmlHashScan(table, (xmlHashScanner)xmlDebugDumpEntityCallback, output);
|
||||
} else
|
||||
fprintf(output, "No entities in external subset\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user