diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2002-02-17 22:47:37 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2002-02-17 22:47:37 +0000 |
commit | c7612996ad1148c324dcd75ca732cf4c0cb68ae0 (patch) | |
tree | f3aadbd19452360b2f5981c8a32efc3bb6771e8d /SAX.c | |
parent | bb7ddb342917c61f9c95e97b9a0f16ada6d3cdc9 (diff) | |
download | libxml2-c7612996ad1148c324dcd75ca732cf4c0cb68ae0.tar.gz |
improved the behaviour a bit as well as the logs fixed a few more bugs
* check-xml-test-suite.py: improved the behaviour a bit as
well as the logs
* parser.c valid.c SAX.c: fixed a few more bugs
"Ran 1819 tests: 1778 suceeded, 41 failed, and 0 generated an error"
Daniel
Diffstat (limited to 'SAX.c')
-rw-r--r-- | SAX.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -479,6 +479,7 @@ attributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, elem, fullname, type, def, defaultValue); #endif name = xmlSplitQName(ctxt, fullname, &prefix); + ctxt->vctxt.valid = 1; if (ctxt->inSubset == 1) attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, elem, name, prefix, (xmlAttributeType) type, @@ -493,7 +494,8 @@ attributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, "SAX.attributeDecl(%s) called while not in subset\n", name); return; } - /* if (attr == 0) ctxt->valid = 0; */ + if (ctxt->vctxt.valid == 0) + ctxt->valid = 0; if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc && ctxt->myDoc->intSubset) ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc, @@ -892,10 +894,25 @@ attribute(void *ctx, const xmlChar *fullname, const xmlChar *value) val = xmlStringDecodeEntities(ctxt, value, XML_SUBSTITUTE_REF, 0,0,0); ctxt->depth--; + if (val == NULL) ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc, ctxt->node, ret, value); else { + xmlChar *nvalnorm; + + /* + * Do the last stage of the attribute normalization + * It need to be done twice ... it's an extra burden related + * to the ability to keep references in attributes + */ + nvalnorm = xmlValidNormalizeAttributeValue(ctxt->myDoc, + ctxt->node, fullname, val); + if (nvalnorm != NULL) { + xmlFree(val); + val = nvalnorm; + } + ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc, ctxt->node, ret, val); xmlFree(val); |