Commit 9c215eb3 authored by Kasimier T. Buchcik's avatar Kasimier T. Buchcik

Fixed NULL values to be validated as empty string values (reported by

* xmlschemas.c: Fixed NULL values to be validated as empty
  string values (reported by Dhyanesh to the mailing list).
  Adjusted text concatenation of mixed content.
parent da6f4af3
Tue Jun 21 10:35:43 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemas.c: Fixed NULL values to be validated as empty
string values (reported by Dhyanesh to the mailing list).
Adjusted text concatenation of mixed content.
Mon Jun 20 18:11:32 CEST 2005 Daniel Veillard <daniel@veillard.com>
* tree.c valid.c: applied patch from Rob Richards for removal
......
......@@ -20482,6 +20482,8 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
*/
if ((! valNeeded) && (type->flags & XML_SCHEMAS_TYPE_FACETSNEEDVALUE))
valNeeded = 1;
if (value == NULL)
value = BAD_CAST "";
if (IS_ANY_SIMPLE_TYPE(type) || VARIETY_ATOMIC(type)) {
xmlSchemaTypePtr biType; /* The built-in type. */
/*
......@@ -20610,9 +20612,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
* VAL TODO: Optimize validation of empty values.
* VAL TODO: We do not have computed values for lists.
*/
itemType = GET_LIST_ITEM_TYPE(type);
if (value == NULL)
value = BAD_CAST "";
itemType = GET_LIST_ITEM_TYPE(type);
cur = value;
do {
while (IS_BLANK_CH(*cur))
......@@ -22747,11 +22747,8 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
* Concat the value.
*/
if (vctxt->inode->flags & XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES) {
xmlChar *tmp;
tmp = BAD_CAST xmlStrncatNew(vctxt->inode->value, value, len);
xmlFree((xmlChar *) vctxt->inode->value);
vctxt->inode->value = tmp;
vctxt->inode->value = BAD_CAST xmlStrncat(
(xmlChar *) vctxt->inode->value, value, len);
} else {
vctxt->inode->value =
BAD_CAST xmlStrncatNew(vctxt->inode->value, value, len);
......
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