Changed non-prefixed QNames to be bound to a default namespace if

* xmlschemastypes.c: Changed non-prefixed QNames to be bound to a
  default namespace if existent.
This commit is contained in:
Kasimier T. Buchcik 2005-06-09 14:54:59 +00:00
parent 8dd1e1bcad
commit 1c720df4e5
2 changed files with 35 additions and 31 deletions

View File

@ -1,3 +1,8 @@
Thu Jun 9 16:51:31 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemastypes.c: Changed non-prefixed QNames to be bound to a
default namespace if existent.
Thu Jun 9 15:11:38 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemastypes.c: Fixed a bug which I invented: hexBinary's string

View File

@ -2489,47 +2489,46 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
}
goto done;
case XML_SCHEMAS_QNAME:{
xmlChar *uri = NULL;
const xmlChar *uri = NULL;
xmlChar *local = NULL;
ret = xmlValidateQName(value, 1);
if ((ret == 0) && (node != NULL)) {
if (ret != 0)
goto done;
if (node != NULL) {
xmlChar *prefix;
xmlNsPtr ns;
local = xmlSplitQName2(value, &prefix);
if (prefix != NULL) {
xmlNsPtr ns;
ns = xmlSearchNs(node->doc, node, prefix);
if (ns == NULL)
ret = 1;
else if (val != NULL)
uri = xmlStrdup(ns->href);
}
if ((local != NULL) && ((val == NULL) || (ret != 0)))
xmlFree(local);
ns = xmlSearchNs(node->doc, node, prefix);
if ((ns == NULL) && (prefix != NULL)) {
xmlFree(prefix);
if (local != NULL)
xmlFree(local);
goto return1;
}
if (ns != NULL)
uri = ns->href;
if (prefix != NULL)
xmlFree(prefix);
}
if ((ret == 0) && (val != NULL)) {
if (val != NULL) {
v = xmlSchemaNewValue(XML_SCHEMAS_QNAME);
if (v != NULL) {
if (local != NULL)
v->value.qname.name = local;
else
v->value.qname.name = xmlStrdup(value);
if (uri != NULL)
v->value.qname.uri = uri;
*val = v;
} else {
if (local != NULL)
xmlFree(local);
if (uri != NULL)
xmlFree(uri);
goto error;
}
}
if (v == NULL) {
if (local != NULL)
xmlFree(local);
goto error;
}
if (local != NULL)
v->value.qname.name = local;
else
v->value.qname.name = xmlStrdup(value);
if (uri != NULL)
v->value.qname.uri = xmlStrdup(uri);
*val = v;
} else
if (local != NULL)
xmlFree(local);
goto done;
}
case XML_SCHEMAS_NCNAME: