Commit 1fd36d27 authored by Daniel Veillard's avatar Daniel Veillard

fixed a URI-Reference computation problem when validating small cleanup

* SAX.c: fixed a URI-Reference computation problem when validating
* xmlIO.c: small cleanup
Daniel
parent 4d65a1c5
Thu Jul 5 00:52:25 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* SAX.c: fixed a URI-Reference computation problem when validating
* xmlIO.c: small cleanup
Thu Jul 5 00:04:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* parser.c: improved the description of a couple of interfaces
......
......@@ -26,12 +26,6 @@
/* #define DEBUG_SAX */
/* #define DEBUG_SAX_TREE */
#ifdef __GNUC__
#ifdef DEBUG_SAX
#define ATTRIBUTE_UNUSED
#endif
#endif
/**
* getPublicId:
* @ctx: the user data (XML parser context)
......@@ -369,7 +363,7 @@ getEntity(void *ctx, const xmlChar *name)
xmlNodePtr children;
parse = xmlParseCtxtExternalEntity(ctxt,
ret->SystemID, ret->ExternalID, &children);
ret->URI, ret->ExternalID, &children);
xmlAddChildList((xmlNodePtr) ret, children);
}
return(ret);
......@@ -530,34 +524,36 @@ attributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname,
* An element definition has been parsed
*/
void
elementDecl(void *ctx, const xmlChar *name, int type,
xmlElementContentPtr content)
elementDecl(void *ctx, const xmlChar * name, int type,
xmlElementContentPtr content)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlElementPtr elem = NULL;
#ifdef DEBUG_SAX
xmlGenericError(xmlGenericErrorContext,
"SAX.elementDecl(%s, %d, ...)\n",
fullname, type);
"SAX.elementDecl(%s, %d, ...)\n", name, type);
#endif
if (ctxt->inSubset == 1)
elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
name, (xmlElementTypeVal) type, content);
elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
name, (xmlElementTypeVal) type, content);
else if (ctxt->inSubset == 2)
elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
name, (xmlElementTypeVal) type, content);
elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
name, (xmlElementTypeVal) type, content);
else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt,
"SAX.elementDecl(%s) called while not in subset\n", name);
return;
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt,
"SAX.elementDecl(%s) called while not in subset\n",
name);
return;
}
if (elem == NULL) ctxt->valid = 0;
if (elem == NULL)
ctxt->valid = 0;
if (ctxt->validate && ctxt->wellFormed &&
ctxt->myDoc && ctxt->myDoc->intSubset)
ctxt->valid &= xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
ctxt->valid &=
xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
}
/**
......
......@@ -74,7 +74,7 @@
#define xmlRegisterDefaultOutputCallbacks xmlRegisterDefOutputCallbacks
#endif
#define DEBUG_EXTERNAL_ENTITIES
/* #define DEBUG_EXTERNAL_ENTITIES */
/* #define DEBUG_INPUT */
#ifdef DEBUG_INPUT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment