*
* Handle a validation error
*/
-static void LIBXML_ATTR_FORMAT(3,0)
+static void
xmlErrValid(xmlValidCtxtPtr ctxt, xmlParserErrors error,
const char *msg, const char *extra)
{
*
* Handle a validation error, provide contextual informations
*/
-static void LIBXML_ATTR_FORMAT(4,0)
+static void
xmlErrValidNode(xmlValidCtxtPtr ctxt,
xmlNodePtr node, xmlParserErrors error,
const char *msg, const xmlChar * str1,
*
* Handle a validation error, provide contextual informations
*/
-static void LIBXML_ATTR_FORMAT(4,0)
+static void
xmlErrValidNodeNr(xmlValidCtxtPtr ctxt,
xmlNodePtr node, xmlParserErrors error,
const char *msg, const xmlChar * str1,
*
* Handle a validation error, provide contextual information
*/
-static void LIBXML_ATTR_FORMAT(4,0)
+static void
xmlErrValidWarning(xmlValidCtxtPtr ctxt,
xmlNodePtr node, xmlParserErrors error,
const char *msg, const xmlChar * str1,
if (cur == NULL) return(NULL);
ret = xmlCreateEnumeration((xmlChar *) cur->name);
- if (ret == NULL) return(NULL);
if (cur->next != NULL) ret->next = xmlCopyEnumeration(cur->next);
else ret->next = NULL;
* DICT_FREE:
* @str: a string
*
- * Free a string if it is not owned by the "dict" dictionary in the
+ * Free a string if it is not owned by the "dict" dictionnary in the
* current scope
*/
#define DICT_FREE(str) \
/*
* The id is already defined in this DTD.
*/
- if (ctxt != NULL) {
+ if ((ctxt != NULL) && (ctxt->error != NULL)) {
xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
- "ID %s already defined\n", value, NULL, NULL);
+ "ID %s already defined\n",
+ value, NULL, NULL);
}
#endif /* LIBXML_VALID_ENABLED */
xmlFreeID(ret);
if (doc == NULL) return(-1);
if (attr == NULL) return(-1);
-
table = (xmlIDTablePtr) doc->ids;
if (table == NULL)
return(-1);
+ if (attr == NULL)
+ return(-1);
ID = xmlNodeListGetString(doc, attr->children, 1);
if (ID == NULL)
- return(-1);
-
+ return(-1);
id = xmlHashLookup(table, ID);
if (id == NULL || id->attr != attr) {
- xmlFree(ID);
- return(-1);
+ xmlFree(ID);
+ return(-1);
}
-
xmlHashRemoveEntry(table, ID, (xmlHashDeallocator) xmlFreeID);
xmlFree(ID);
- attr->atype = 0;
+ attr->atype = 0;
return(0);
}
if (doc == NULL) return(-1);
if (attr == NULL) return(-1);
-
table = (xmlRefTablePtr) doc->refs;
if (table == NULL)
return(-1);
+ if (attr == NULL)
+ return(-1);
ID = xmlNodeListGetString(doc, attr->children, 1);
if (ID == NULL)
return(-1);
-
ref_list = xmlHashLookup(table, ID);
+
if(ref_list == NULL) {
xmlFree(ID);
return (-1);
}
-
/* At this point, ref_list refers to a list of references which
* have the same key as the supplied attr. Our list of references
* is ordered by reference address and we don't have that information
xmlElementContentPtr cont;
const xmlChar *name;
- if ((elemDecl == NULL) || (parent == NULL) || (ctxt == NULL))
+ if ((elemDecl == NULL) || (parent == NULL))
return(-1);
cont = elemDecl->content;
name = elemDecl->name;
int max) {
xmlValidCtxt vctxt;
int nb_valid_elements = 0;
- const xmlChar *elements[256]={0};
+ const xmlChar *elements[256];
int nb_elements = 0, i;
const xmlChar *name;
* Creates a dummy node and insert it into the tree
*/
test_node = xmlNewDocNode (ref_node->doc, NULL, BAD_CAST "<!dummy?>", NULL);
- if (test_node == NULL)
- return(-1);
-
test_node->parent = parent;
test_node->prev = prev;
test_node->next = next;