Commit b06b4ded authored by Kasimier T. Buchcik's avatar Kasimier T. Buchcik
Browse files

Added validation for the attribute "id" in the schemata; doing this needed

* xmlschemas.c: Added validation for the attribute "id" in the
  schemata; doing this needed error report fixes for notations,
  facets and group. Changed NOTATION validation to work with the
  declared NOTATIONs in the schema; this does have no impact on
  the validation via the relaxng module.
* xmlschemastypes.c include/libxml/xmlschemastypes.h:
  Added xmlSchemaNewNOTATIONValue to the API to be able to do
  the NOTATION validation described above.
* test/schemas/element-err_0.xsd test/schemas/annot-err_0.xsd:
  Fixed the values of the "id" attributes, which were not validated
  previously.
parent 6e224f12
Thu Feb 17 19:57:35 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemas.c: Added validation for the attribute "id" in the
schemata; doing this needed error report fixes for notations,
facets and group. Changed NOTATION validation to work with the
declared NOTATIONs in the schema; this does have no impact on
the validation via the relaxng module.
* xmlschemastypes.c include/libxml/xmlschemastypes.h:
Added xmlSchemaNewNOTATIONValue to the API to be able to do
the NOTATION validation described above.
* test/schemas/element-err_0.xsd test/schemas/annot-err_0.xsd:
Fixed the values of the "id" attributes, which were not validated
previously.
Thu Feb 17 12:03:46 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
 
* xmlschemas.c: Fixed comparison for default/fixed attribute
......
......@@ -100,6 +100,10 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN xmlSchemaValPtr XMLCALL
xmlSchemaNewStringValue (xmlSchemaValType type,
const xmlChar *value);
XMLPUBFUN xmlSchemaValPtr XMLCALL
xmlSchemaNewNOTATIONValue (const xmlChar *name,
const xmlChar *ns);
XMLPUBFUN int XMLCALL
xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
xmlSchemaWhitespaceValueType xws,
......
This diff is collapsed.
......@@ -708,6 +708,29 @@ xmlSchemaNewStringValue(xmlSchemaValType type,
return(val);
}
/**
* xmlSchemaNewNOTATIONValue:
* @type: the value type
*
* Allocate a new NOTATION value.
*
* Returns a pointer to the new value or NULL in case of error
*/
xmlSchemaValPtr
xmlSchemaNewNOTATIONValue(const xmlChar *name,
const xmlChar *ns)
{
xmlSchemaValPtr val;
val = xmlSchemaNewValue(XML_SCHEMAS_NOTATION);
if (val == NULL)
return (NULL);
val->value.qname.name = name;
if (ns != NULL)
val->value.qname.uri = ns;
return(val);
}
/**
* xmlSchemaFreeValue:
......@@ -732,12 +755,12 @@ xmlSchemaFreeValue(xmlSchemaValPtr value) {
case XML_SCHEMAS_IDREF:
case XML_SCHEMAS_IDREFS:
case XML_SCHEMAS_ENTITY:
case XML_SCHEMAS_ENTITIES:
case XML_SCHEMAS_NOTATION:
case XML_SCHEMAS_ENTITIES:
case XML_SCHEMAS_ANYURI:
if (value->value.str != NULL)
xmlFree(value->value.str);
break;
case XML_SCHEMAS_NOTATION:
case XML_SCHEMAS_QNAME:
if (value->value.qname.uri != NULL)
xmlFree(value->value.qname.uri);
......
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