aboutsummaryrefslogtreecommitdiffstats
path: root/xmlschemastypes.c
diff options
context:
space:
mode:
authorKasimier T. Buchcik <kbuchcik@src.gnome.org>2005-04-01 15:17:27 +0000
committerKasimier T. Buchcik <kbuchcik@src.gnome.org>2005-04-01 15:17:27 +0000
commitaba15f7670990df4aeedf9b8301c0f43fade5f58 (patch)
tree9e042afbc273ef8e51e9876ce384ae16b42ec1a8 /xmlschemastypes.c
parent5d4644ef6e38479a648615eca758c5e962a141d5 (diff)
downloadandroid_external_libxml2-aba15f7670990df4aeedf9b8301c0f43fade5f58.tar.gz
android_external_libxml2-aba15f7670990df4aeedf9b8301c0f43fade5f58.tar.bz2
android_external_libxml2-aba15f7670990df4aeedf9b8301c0f43fade5f58.zip
Corrected 'length' facet validation for QNames and notations. Corrected
* xmlschemastypes.c: Corrected 'length' facet validation for QNames and notations. Corrected xmlSchemaGetCanonValue: some data types did not return a value if already in normalized form. * xmlschemas.c include/libxml/schemasInternals.h: Eliminated creation of structs for <restriction>, <extension>, <simpleContent>, <complexContent>, <list> and <union>: the information is now set directly on the corresponding simple/ complex type. Added some more complex type constraints. Added facet derivation constraints. Introduced "particle" components, which seem to be really needed if applying constraints. Corrected/change some of the parsing functions. This is all a bit scary, since a significant change to the code. * result/schemas/src-element2-*.err result/schemas/element-*.err: Adapted regression test results.
Diffstat (limited to 'xmlschemastypes.c')
-rw-r--r--xmlschemastypes.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 42e69c43..85134491 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -4820,6 +4820,14 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet,
}
return(XML_SCHEMAV_CVC_ENUMERATION_VALID);
case XML_SCHEMA_FACET_LENGTH:
+ /*
+ * SPEC (1.3) "if {primitive type definition} is QName or NOTATION,
+ * then any {value} is facet-valid."
+ */
+ if ((valType == XML_SCHEMAS_QNAME) ||
+ (valType == XML_SCHEMAS_NOTATION))
+ return (0);
+ /* No break on purpose. */
case XML_SCHEMA_FACET_MAXLENGTH:
case XML_SCHEMA_FACET_MINLENGTH: {
unsigned int len = 0;
@@ -4870,9 +4878,6 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet,
case XML_SCHEMAS_NAME:
case XML_SCHEMAS_NCNAME:
case XML_SCHEMAS_ID:
- /*
- * FIXME: What exactly to do with anyURI?
- */
case XML_SCHEMAS_ANYURI:
if (value != NULL)
len = xmlSchemaNormLen(value);
@@ -5048,7 +5053,11 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue)
case XML_SCHEMAS_ANYURI:
if (val->value.str == NULL)
return (-1);
- *retValue = BAD_CAST xmlSchemaCollapseString(BAD_CAST val->value.str);
+ *retValue =
+ BAD_CAST xmlSchemaCollapseString(BAD_CAST val->value.str);
+ if (*retValue == NULL)
+ *retValue =
+ BAD_CAST xmlStrdup((const xmlChar *) val->value.str);
break;
case XML_SCHEMAS_QNAME:
/*