mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
added integer and fixed one of the IDREFS regression tests pbm updated
* xmlschemastypes.c: added integer and fixed one of the IDREFS regression tests pbm * result/relaxng/docbook_0.err: updated Daniel
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Thu Mar 20 17:22:00 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* xmlschemastypes.c: added integer and fixed one of the
|
||||||
|
IDREFS regression tests pbm
|
||||||
|
* result/relaxng/docbook_0.err: updated
|
||||||
|
|
||||||
Wed Mar 19 21:58:47 CET 2003 Daniel Veillard <daniel@veillard.com>
|
Wed Mar 19 21:58:47 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* valid.c xmlschemastypes.c: attempt to cope with ID/IDREF(S)
|
* valid.c xmlschemastypes.c: attempt to cope with ID/IDREF(S)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
./test/relaxng/docbook_0.xml:1864: error: Entity 'copy' not defined
|
./test/relaxng/docbook_0.xml:1864: error: Entity 'copy' not defined
|
||||||
<sgmltag>&copy;</sgmltag> — copyright sign (©)
|
<sgmltag>&copy;</sgmltag> — copyright sign (©)
|
||||||
^
|
^
|
||||||
Unimplemented block at xmlschemastypes.c:1636
|
|
||||||
|
@ -1343,6 +1343,42 @@ xmlSchemaValPredefTypeNode(xmlSchemaTypePtr type, const xmlChar *value,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(0);
|
return(0);
|
||||||
|
} else if (type == xmlSchemaTypeIntegerDef) {
|
||||||
|
const xmlChar *cur = value;
|
||||||
|
unsigned long base = 0;
|
||||||
|
int total = 0;
|
||||||
|
int sign = 0;
|
||||||
|
if (cur == NULL)
|
||||||
|
return(1);
|
||||||
|
if (*cur == '-') {
|
||||||
|
sign = 1;
|
||||||
|
cur++;
|
||||||
|
} else if (*cur == '+')
|
||||||
|
cur++;
|
||||||
|
while (*cur == '0') {
|
||||||
|
total++;
|
||||||
|
cur++;
|
||||||
|
}
|
||||||
|
while ((*cur >= '0') && (*cur <= '9')) {
|
||||||
|
base = base * 10 + (*cur - '0');
|
||||||
|
total++;
|
||||||
|
cur++;
|
||||||
|
}
|
||||||
|
if (*cur != 0)
|
||||||
|
return(1);
|
||||||
|
if ((sign == 1) && (total == 0))
|
||||||
|
return(1);
|
||||||
|
if (val != NULL) {
|
||||||
|
v = xmlSchemaNewValue(XML_SCHEMAS_INTEGER);
|
||||||
|
if (v != NULL) {
|
||||||
|
v->value.decimal.base = base;
|
||||||
|
v->value.decimal.sign = sign;
|
||||||
|
v->value.decimal.frac = 0;
|
||||||
|
v->value.decimal.total = total;
|
||||||
|
*val = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
} else if ((type == xmlSchemaTypeFloatDef) ||
|
} else if ((type == xmlSchemaTypeFloatDef) ||
|
||||||
(type == xmlSchemaTypeDoubleDef)) {
|
(type == xmlSchemaTypeDoubleDef)) {
|
||||||
const xmlChar *cur = value;
|
const xmlChar *cur = value;
|
||||||
@ -1526,22 +1562,15 @@ xmlSchemaValPredefTypeNode(xmlSchemaTypePtr type, const xmlChar *value,
|
|||||||
if ((ret == 0) && (node != NULL) &&
|
if ((ret == 0) && (node != NULL) &&
|
||||||
(node->type == XML_ATTRIBUTE_NODE)) {
|
(node->type == XML_ATTRIBUTE_NODE)) {
|
||||||
xmlAttrPtr attr = (xmlAttrPtr) node;
|
xmlAttrPtr attr = (xmlAttrPtr) node;
|
||||||
|
xmlChar *strip;
|
||||||
|
|
||||||
/*
|
strip = xmlSchemaStrip(value);
|
||||||
* NOTE: the REFness might have already be declared in the DTD
|
if (strip != NULL) {
|
||||||
*/
|
xmlAddRef(NULL, node->doc, strip, attr);
|
||||||
if ((attr->atype != XML_ATTRIBUTE_IDREF) &&
|
xmlFree(strip);
|
||||||
(attr->atype != XML_ATTRIBUTE_IDREFS)) {
|
} else
|
||||||
xmlChar *strip;
|
xmlAddRef(NULL, node->doc, value, attr);
|
||||||
|
attr->atype = XML_ATTRIBUTE_IDREF;
|
||||||
strip = xmlSchemaStrip(value);
|
|
||||||
if (strip != NULL) {
|
|
||||||
xmlAddRef(NULL, node->doc, strip, attr);
|
|
||||||
xmlFree(strip);
|
|
||||||
} else
|
|
||||||
xmlAddRef(NULL, node->doc, value, attr);
|
|
||||||
attr->atype = XML_ATTRIBUTE_IDREF;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(ret);
|
return(ret);
|
||||||
} else if (type == xmlSchemaTypeIdrefsDef) {
|
} else if (type == xmlSchemaTypeIdrefsDef) {
|
||||||
|
Reference in New Issue
Block a user