mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
more work on Relax-NG augmented/updated the regression tests added a
* relaxng.c: more work on Relax-NG * test/relaxng/* result/relaxng/*: augmented/updated the regression tests * xmlschemastypes.c: added a number of base type definition but not the associated checks, those are still TODOs Daniel
This commit is contained in:
10
ChangeLog
10
ChangeLog
@ -1,3 +1,11 @@
|
|||||||
|
Mon Jan 27 13:29:43 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* relaxng.c: more work on Relax-NG
|
||||||
|
* test/relaxng/* result/relaxng/*: augmented/updated the
|
||||||
|
regression tests
|
||||||
|
* xmlschemastypes.c: added a number of base type definition but not
|
||||||
|
the associated checks, those are still TODOs
|
||||||
|
|
||||||
Sun Jan 26 17:37:06 MST 2003 John Fleck <jfleck@inkstain.net>
|
Sun Jan 26 17:37:06 MST 2003 John Fleck <jfleck@inkstain.net>
|
||||||
|
|
||||||
in docs/tutorial:
|
in docs/tutorial:
|
||||||
@ -30,7 +38,7 @@ Sun Jan 26 17:02:29 MST 2003 John Fleck <jfleck@inkstain.net>
|
|||||||
|
|
||||||
Sun Jan 26 20:47:26 CET 2003 Daniel Veillard <daniel@veillard.com>
|
Sun Jan 26 20:47:26 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* xmlcatalog.c xmllint.c: applied patch for FreeBSD by
|
* xmlcatalog.c xmllint.c: applied patch for NetBSD by
|
||||||
Julio Merino, closing #104475
|
Julio Merino, closing #104475
|
||||||
|
|
||||||
Sun Jan 26 20:38:43 CET 2003 Daniel Veillard <daniel@veillard.com>
|
Sun Jan 26 20:38:43 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
@ -647,7 +647,7 @@ dnl for the spec file
|
|||||||
RELDATE=`date +'%a %b %e %Y'`
|
RELDATE=`date +'%a %b %e %Y'`
|
||||||
AC_SUBST(RELDATE)
|
AC_SUBST(RELDATE)
|
||||||
|
|
||||||
rm -f rm COPYING.LIB COPYING
|
rm -f COPYING.LIB COPYING
|
||||||
ln -s Copyright COPYING
|
ln -s Copyright COPYING
|
||||||
|
|
||||||
AC_OUTPUT(libxml.spec Makefile include/Makefile include/libxml/Makefile doc/Makefile example/Makefile python/Makefile python/tests/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc xml2Conf.sh python/setup.py)
|
AC_OUTPUT(libxml.spec Makefile include/Makefile include/libxml/Makefile doc/Makefile example/Makefile python/Makefile python/tests/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc xml2Conf.sh python/setup.py)
|
||||||
|
248
relaxng.c
248
relaxng.c
@ -24,6 +24,7 @@
|
|||||||
#include <libxml/xmlschemastypes.h>
|
#include <libxml/xmlschemastypes.h>
|
||||||
#include <libxml/xmlautomata.h>
|
#include <libxml/xmlautomata.h>
|
||||||
#include <libxml/xmlregexp.h>
|
#include <libxml/xmlregexp.h>
|
||||||
|
#include <libxml/xmlschemastypes.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The Relax-NG namespace
|
* The Relax-NG namespace
|
||||||
@ -172,6 +173,7 @@ struct _xmlRelaxNGValidState {
|
|||||||
xmlNodePtr seq; /* the sequence of children left to validate */
|
xmlNodePtr seq; /* the sequence of children left to validate */
|
||||||
int nbAttrs; /* the number of attributes */
|
int nbAttrs; /* the number of attributes */
|
||||||
xmlChar *value; /* the value when operating on string */
|
xmlChar *value; /* the value when operating on string */
|
||||||
|
xmlChar *endvalue; /* the end value when operating on string */
|
||||||
xmlAttrPtr attrs[1]; /* the array of attributes */
|
xmlAttrPtr attrs[1]; /* the array of attributes */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -668,8 +670,15 @@ static xmlChar *xmlRelaxNGNormalize(xmlRelaxNGValidCtxtPtr ctxt,
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlRelaxNGSchemaTypeHave(void *data ATTRIBUTE_UNUSED,
|
xmlRelaxNGSchemaTypeHave(void *data ATTRIBUTE_UNUSED,
|
||||||
const xmlChar *type ATTRIBUTE_UNUSED) {
|
const xmlChar *type) {
|
||||||
TODO
|
xmlSchemaTypePtr typ;
|
||||||
|
|
||||||
|
if (type == NULL)
|
||||||
|
return(-1);
|
||||||
|
typ = xmlSchemaGetPredefinedType(type,
|
||||||
|
BAD_CAST "http://www.w3.org/2001/XMLSchema");
|
||||||
|
if (typ == NULL)
|
||||||
|
return(0);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -686,10 +695,29 @@ xmlRelaxNGSchemaTypeHave(void *data ATTRIBUTE_UNUSED,
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlRelaxNGSchemaTypeCheck(void *data ATTRIBUTE_UNUSED,
|
xmlRelaxNGSchemaTypeCheck(void *data ATTRIBUTE_UNUSED,
|
||||||
const xmlChar *type ATTRIBUTE_UNUSED,
|
const xmlChar *type,
|
||||||
const xmlChar *value ATTRIBUTE_UNUSED) {
|
const xmlChar *value) {
|
||||||
TODO
|
xmlSchemaTypePtr typ;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: the type should be cached ab provided back, interface subject
|
||||||
|
* to changes.
|
||||||
|
* TODO: handle facets, may require an additional interface and keep
|
||||||
|
* the value returned from the validation.
|
||||||
|
*/
|
||||||
|
if ((type == NULL) || (value == NULL))
|
||||||
|
return(-1);
|
||||||
|
typ = xmlSchemaGetPredefinedType(type,
|
||||||
|
BAD_CAST "http://www.w3.org/2001/XMLSchema");
|
||||||
|
if (typ == NULL)
|
||||||
|
return(-1);
|
||||||
|
ret = xmlSchemaValidatePredefinedType(typ, value, NULL);
|
||||||
|
if (ret == 0)
|
||||||
return(1);
|
return(1);
|
||||||
|
if (ret > 0)
|
||||||
|
return(0);
|
||||||
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1260,7 +1288,7 @@ xmlRelaxNGParsePattern(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) {
|
|||||||
def = xmlRelaxNGNewDefine(ctxt, node);
|
def = xmlRelaxNGNewDefine(ctxt, node);
|
||||||
if (def == NULL)
|
if (def == NULL)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
def->type = XML_RELAXNG_ZEROORMORE;
|
def->type = XML_RELAXNG_ONEORMORE;
|
||||||
def->content = xmlRelaxNGParsePatterns(ctxt, node->children);
|
def->content = xmlRelaxNGParsePatterns(ctxt, node->children);
|
||||||
} else if (IS_RELAXNG(node, "optional")) {
|
} else if (IS_RELAXNG(node, "optional")) {
|
||||||
def = xmlRelaxNGNewDefine(ctxt, node);
|
def = xmlRelaxNGNewDefine(ctxt, node);
|
||||||
@ -1346,6 +1374,12 @@ xmlRelaxNGParsePattern(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) {
|
|||||||
def = NULL;
|
def = NULL;
|
||||||
} else if (IS_RELAXNG(node, "value")) {
|
} else if (IS_RELAXNG(node, "value")) {
|
||||||
def = xmlRelaxNGParseValue(ctxt, node);
|
def = xmlRelaxNGParseValue(ctxt, node);
|
||||||
|
} else if (IS_RELAXNG(node, "list")) {
|
||||||
|
def = xmlRelaxNGNewDefine(ctxt, node);
|
||||||
|
if (def == NULL)
|
||||||
|
return(NULL);
|
||||||
|
def->type = XML_RELAXNG_LIST;
|
||||||
|
def->content = xmlRelaxNGParsePatterns(ctxt, node->children);
|
||||||
} else {
|
} else {
|
||||||
TODO
|
TODO
|
||||||
}
|
}
|
||||||
@ -2632,6 +2666,8 @@ xmlRelaxNGDump(FILE * output, xmlRelaxNGPtr schema)
|
|||||||
************************************************************************/
|
************************************************************************/
|
||||||
static int xmlRelaxNGValidateDefinition(xmlRelaxNGValidCtxtPtr ctxt,
|
static int xmlRelaxNGValidateDefinition(xmlRelaxNGValidCtxtPtr ctxt,
|
||||||
xmlRelaxNGDefinePtr define);
|
xmlRelaxNGDefinePtr define);
|
||||||
|
static int xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt,
|
||||||
|
xmlRelaxNGDefinePtr define);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlRelaxNGSkipIgnored:
|
* xmlRelaxNGSkipIgnored:
|
||||||
@ -2744,6 +2780,55 @@ xmlRelaxNGValidateDatatype(xmlRelaxNGValidCtxtPtr ctxt, const xmlChar *value,
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlRelaxNGNextValue:
|
||||||
|
* @ctxt: a Relax-NG validation context
|
||||||
|
*
|
||||||
|
* Skip to the next value when validating within a list
|
||||||
|
*
|
||||||
|
* Returns 0 if the operation succeeded or an error code.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
xmlRelaxNGNextValue(xmlRelaxNGValidCtxtPtr ctxt) {
|
||||||
|
xmlChar *cur;
|
||||||
|
|
||||||
|
cur = ctxt->state->value;
|
||||||
|
if ((cur == NULL) || (ctxt->state->endvalue == NULL)) {
|
||||||
|
ctxt->state->value = NULL;
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
while (*cur != 0) cur++;
|
||||||
|
while ((cur != ctxt->state->endvalue) && (*cur == 0)) cur++;
|
||||||
|
if (cur == ctxt->state->endvalue)
|
||||||
|
ctxt->state->value = NULL;
|
||||||
|
else
|
||||||
|
ctxt->state->value = cur;
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlRelaxNGValidateValueList:
|
||||||
|
* @ctxt: a Relax-NG validation context
|
||||||
|
* @defines: the list of definitions to verify
|
||||||
|
*
|
||||||
|
* Validate the given set of definitions for the current value
|
||||||
|
*
|
||||||
|
* Returns 0 if the validation succeeded or an error code.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
xmlRelaxNGValidateValueList(xmlRelaxNGValidCtxtPtr ctxt,
|
||||||
|
xmlRelaxNGDefinePtr defines) {
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
while (defines != NULL) {
|
||||||
|
ret = xmlRelaxNGValidateValue(ctxt, defines);
|
||||||
|
if (ret != 0)
|
||||||
|
break;
|
||||||
|
defines = defines->next;
|
||||||
|
}
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlRelaxNGValidateValue:
|
* xmlRelaxNGValidateValue:
|
||||||
* @ctxt: a Relax-NG validation context
|
* @ctxt: a Relax-NG validation context
|
||||||
@ -2767,22 +2852,6 @@ xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt,
|
|||||||
break;
|
break;
|
||||||
case XML_RELAXNG_TEXT:
|
case XML_RELAXNG_TEXT:
|
||||||
break;
|
break;
|
||||||
case XML_RELAXNG_CHOICE: {
|
|
||||||
xmlRelaxNGDefinePtr list = define->content;
|
|
||||||
|
|
||||||
oldflags = ctxt->flags;
|
|
||||||
ctxt->flags |= FLAGS_IGNORABLE;
|
|
||||||
|
|
||||||
while (list != NULL) {
|
|
||||||
ret = xmlRelaxNGValidateValue(ctxt, list);
|
|
||||||
if (ret == 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
list = list->next;
|
|
||||||
}
|
|
||||||
ctxt->flags = oldflags;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case XML_RELAXNG_VALUE: {
|
case XML_RELAXNG_VALUE: {
|
||||||
if (!xmlStrEqual(value, define->value)) {
|
if (!xmlStrEqual(value, define->value)) {
|
||||||
if (define->name != NULL) {
|
if (define->name != NULL) {
|
||||||
@ -2825,6 +2894,102 @@ xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case XML_RELAXNG_DATATYPE: {
|
||||||
|
ret = xmlRelaxNGValidateDatatype(ctxt, value, define);
|
||||||
|
if (ret == 0)
|
||||||
|
xmlRelaxNGNextValue(ctxt);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case XML_RELAXNG_CHOICE: {
|
||||||
|
xmlRelaxNGDefinePtr list = define->content;
|
||||||
|
xmlChar *oldvalue;
|
||||||
|
|
||||||
|
oldflags = ctxt->flags;
|
||||||
|
ctxt->flags |= FLAGS_IGNORABLE;
|
||||||
|
|
||||||
|
oldvalue = ctxt->state->value;
|
||||||
|
while (list != NULL) {
|
||||||
|
ret = xmlRelaxNGValidateValue(ctxt, list);
|
||||||
|
if (ret == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ctxt->state->value = oldvalue;
|
||||||
|
list = list->next;
|
||||||
|
}
|
||||||
|
ctxt->flags = oldflags;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case XML_RELAXNG_LIST: {
|
||||||
|
xmlRelaxNGDefinePtr list = define->content;
|
||||||
|
xmlChar *oldvalue, *oldend, *val, *cur;
|
||||||
|
|
||||||
|
oldvalue = ctxt->state->value;
|
||||||
|
oldend = ctxt->state->endvalue;
|
||||||
|
|
||||||
|
val = xmlStrdup(oldvalue);
|
||||||
|
if (val == NULL) {
|
||||||
|
VALID_CTXT();
|
||||||
|
VALID_ERROR("Internal: no state\n");
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
cur = val;
|
||||||
|
while (*cur != 0) {
|
||||||
|
if (IS_BLANK(*cur))
|
||||||
|
*cur = 0;
|
||||||
|
cur++;
|
||||||
|
}
|
||||||
|
ctxt->state->endvalue = cur;
|
||||||
|
cur = val;
|
||||||
|
while ((*cur == 0) && (cur != ctxt->state->endvalue)) cur++;
|
||||||
|
|
||||||
|
ctxt->state->value = cur;
|
||||||
|
|
||||||
|
while (list != NULL) {
|
||||||
|
ret = xmlRelaxNGValidateValue(ctxt, list);
|
||||||
|
if (ret != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
list = list->next;
|
||||||
|
}
|
||||||
|
if ((ret == 0) && (ctxt->state->value != NULL) &&
|
||||||
|
(ctxt->state->value != ctxt->state->endvalue)) {
|
||||||
|
VALID_CTXT();
|
||||||
|
VALID_ERROR("Extra data in list: %s\n", ctxt->state->value);
|
||||||
|
ret = -1;
|
||||||
|
}
|
||||||
|
xmlFree(val);
|
||||||
|
ctxt->state->value = oldvalue;
|
||||||
|
ctxt->state->endvalue = oldend;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case XML_RELAXNG_ONEORMORE:
|
||||||
|
ret = xmlRelaxNGValidateValueList(ctxt, define->content);
|
||||||
|
if (ret != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* no break on purpose */
|
||||||
|
case XML_RELAXNG_ZEROORMORE: {
|
||||||
|
xmlChar *cur, *temp;
|
||||||
|
|
||||||
|
oldflags = ctxt->flags;
|
||||||
|
ctxt->flags |= FLAGS_IGNORABLE;
|
||||||
|
cur = ctxt->state->value;
|
||||||
|
temp = NULL;
|
||||||
|
while ((cur != NULL) && (cur != ctxt->state->endvalue) &&
|
||||||
|
(temp != cur)) {
|
||||||
|
temp = cur;
|
||||||
|
ret = xmlRelaxNGValidateValueList(ctxt, define->content);
|
||||||
|
if (ret != 0) {
|
||||||
|
ctxt->state->value = temp;
|
||||||
|
ret = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
cur = ctxt->state->value;
|
||||||
|
}
|
||||||
|
ctxt->flags = oldflags;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
TODO
|
TODO
|
||||||
ret = -1;
|
ret = -1;
|
||||||
@ -3101,9 +3266,6 @@ xmlRelaxNGValidateDefinition(xmlRelaxNGValidCtxtPtr ctxt,
|
|||||||
node->name, ret);
|
node->name, ret);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case XML_RELAXNG_LIST:
|
|
||||||
TODO
|
|
||||||
break;
|
|
||||||
case XML_RELAXNG_OPTIONAL:
|
case XML_RELAXNG_OPTIONAL:
|
||||||
oldflags = ctxt->flags;
|
oldflags = ctxt->flags;
|
||||||
ctxt->flags |= FLAGS_IGNORABLE;
|
ctxt->flags |= FLAGS_IGNORABLE;
|
||||||
@ -3239,7 +3401,7 @@ xmlRelaxNGValidateDefinition(xmlRelaxNGValidCtxtPtr ctxt,
|
|||||||
*/
|
*/
|
||||||
if ((node != NULL) && (node->next != NULL)) {
|
if ((node != NULL) && (node->next != NULL)) {
|
||||||
VALID_CTXT();
|
VALID_CTXT();
|
||||||
VALID_ERROR("The data does not cover the full element %s\n",
|
VALID_ERROR("The value does not cover the full element %s\n",
|
||||||
node->parent->name);
|
node->parent->name);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
@ -3247,10 +3409,42 @@ xmlRelaxNGValidateDefinition(xmlRelaxNGValidCtxtPtr ctxt,
|
|||||||
xmlFree(content);
|
xmlFree(content);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case XML_RELAXNG_LIST: {
|
||||||
|
xmlChar *content;
|
||||||
|
xmlChar *oldvalue, *oldendvalue;
|
||||||
|
int len;
|
||||||
|
|
||||||
TODO
|
content = xmlNodeGetContent(node);
|
||||||
|
len = xmlStrlen(content);
|
||||||
|
oldvalue = ctxt->state->value;
|
||||||
|
oldendvalue = ctxt->state->endvalue;
|
||||||
|
ctxt->state->value = content;
|
||||||
|
ctxt->state->endvalue = content + len;
|
||||||
|
ret = xmlRelaxNGValidateValue(ctxt, define);
|
||||||
|
ctxt->state->value = oldvalue;
|
||||||
|
ctxt->state->endvalue = oldendvalue;
|
||||||
|
if (ret == -1) {
|
||||||
|
VALID_CTXT();
|
||||||
|
VALID_ERROR("internal error validating list\n");
|
||||||
|
} else if (ret == 0) {
|
||||||
|
ctxt->state->seq = node->next;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* TODO cover the problems with
|
||||||
|
* <p>12<!-- comment -->34</p>
|
||||||
|
* TODO detect full element coverage at compilation time.
|
||||||
|
*/
|
||||||
|
if ((node != NULL) && (node->next != NULL)) {
|
||||||
|
VALID_CTXT();
|
||||||
|
VALID_ERROR("The list does not cover the full element %s\n",
|
||||||
|
node->parent->name);
|
||||||
|
ret = -1;
|
||||||
|
}
|
||||||
|
if (content != NULL)
|
||||||
|
xmlFree(content);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
error detected at relaxng.c:3030
|
error detected at relaxng.c:3195
|
||||||
error detected at relaxng.c:3078
|
error detected at relaxng.c:3243
|
||||||
xmlRelaxNGValidateDefinition(): validated card : -1
|
xmlRelaxNGValidateDefinition(): validated card : -1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
xmlRelaxNGValidateAttribute(name): -1
|
xmlRelaxNGValidateAttribute(name): -1
|
||||||
xmlRelaxNGValidateDefinition(): validated email : 0
|
xmlRelaxNGValidateDefinition(): validated email : 0
|
||||||
xmlRelaxNGValidateDefinition(): validated card : -1
|
xmlRelaxNGValidateDefinition(): validated card : -1
|
||||||
error detected at relaxng.c:3078
|
error detected at relaxng.c:3243
|
||||||
xmlRelaxNGValidateDefinition(): validated addressBook : -1
|
xmlRelaxNGValidateDefinition(): validated addressBook : -1
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
Unimplemented block at relaxng.c:672
|
Unimplemented block at xmlschemastypes.c:1138
|
||||||
Unimplemented block at relaxng.c:691
|
|
||||||
xmlRelaxNGValidateDefinition(): validated number : 0
|
xmlRelaxNGValidateDefinition(): validated number : 0
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
Unimplemented block at relaxng.c:672
|
Unimplemented block at xmlschemastypes.c:1135
|
||||||
Unimplemented block at relaxng.c:672
|
|
||||||
Unimplemented block at relaxng.c:691
|
|
||||||
xmlRelaxNGValidateDefinition(): validated x : 0
|
xmlRelaxNGValidateDefinition(): validated x : 0
|
||||||
Unimplemented block at relaxng.c:691
|
Unimplemented block at xmlschemastypes.c:1135
|
||||||
xmlRelaxNGValidateDefinition(): validated y : 0
|
xmlRelaxNGValidateDefinition(): validated y : 0
|
||||||
xmlRelaxNGValidateDefinition(): validated point : 0
|
xmlRelaxNGValidateDefinition(): validated point : 0
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
error detected at relaxng.c:3211
|
error detected at relaxng.c:3373
|
||||||
xmlRelaxNGValidateDefinition(): validated note : 0
|
xmlRelaxNGValidateDefinition(): validated note : 0
|
||||||
xmlRelaxNGValidateDefinition(): validated bad : -1
|
xmlRelaxNGValidateDefinition(): validated bad : -1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
xmlRelaxNGValidateAttribute(preferredFormat): -1
|
xmlRelaxNGValidateAttribute(preferredFormat): -1
|
||||||
xmlRelaxNGValidateAttribute(email): 0
|
xmlRelaxNGValidateAttribute(email): 0
|
||||||
xmlRelaxNGValidateAttribute(name): 0
|
xmlRelaxNGValidateAttribute(name): 0
|
||||||
error detected at relaxng.c:3086
|
error detected at relaxng.c:3251
|
||||||
xmlRelaxNGValidateDefinition(): validated card : -1
|
xmlRelaxNGValidateDefinition(): validated card : -1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
xmlRelaxNGValidateDefinition(): validated name : 0
|
xmlRelaxNGValidateDefinition(): validated name : 0
|
||||||
xmlRelaxNGValidateDefinition(): validated email : 0
|
xmlRelaxNGValidateDefinition(): validated email : 0
|
||||||
error detected at relaxng.c:3078
|
error detected at relaxng.c:3243
|
||||||
xmlRelaxNGValidateDefinition(): validated preferredFormat : -1
|
xmlRelaxNGValidateDefinition(): validated preferredFormat : -1
|
||||||
xmlRelaxNGValidateDefinition(): validated card : -1
|
xmlRelaxNGValidateDefinition(): validated card : -1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
xmlRelaxNGValidateAttribute(preferredFormat): -1
|
xmlRelaxNGValidateAttribute(preferredFormat): -1
|
||||||
xmlRelaxNGValidateAttribute(email): 0
|
xmlRelaxNGValidateAttribute(email): 0
|
||||||
xmlRelaxNGValidateAttribute(name): 0
|
xmlRelaxNGValidateAttribute(name): 0
|
||||||
error detected at relaxng.c:3086
|
error detected at relaxng.c:3251
|
||||||
xmlRelaxNGValidateDefinition(): validated card : -1
|
xmlRelaxNGValidateDefinition(): validated card : -1
|
||||||
|
1
result/relaxng/tutor7_1_1
Normal file
1
result/relaxng/tutor7_1_1
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/relaxng/tutor7_1_1.xml validates
|
3
result/relaxng/tutor7_1_1.err
Normal file
3
result/relaxng/tutor7_1_1.err
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Unimplemented block at xmlschemastypes.c:1132
|
||||||
|
Unimplemented block at xmlschemastypes.c:1132
|
||||||
|
xmlRelaxNGValidateDefinition(): validated vector : 0
|
4
result/relaxng/tutor7_1_2
Normal file
4
result/relaxng/tutor7_1_2
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Internal: failed to validate type float
|
||||||
|
internal error validating list
|
||||||
|
Extra content for element vector
|
||||||
|
./test/relaxng/tutor7_1_2.xml validation generated an internal error
|
5
result/relaxng/tutor7_1_2.err
Normal file
5
result/relaxng/tutor7_1_2.err
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Unimplemented block at xmlschemastypes.c:1132
|
||||||
|
error detected at relaxng.c:2769
|
||||||
|
error detected at relaxng.c:3427
|
||||||
|
error detected at relaxng.c:3243
|
||||||
|
xmlRelaxNGValidateDefinition(): validated vector : -1
|
4
result/relaxng/tutor7_1_3
Normal file
4
result/relaxng/tutor7_1_3
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Extra data in list: 5.6
|
||||||
|
internal error validating list
|
||||||
|
Extra content for element vector
|
||||||
|
./test/relaxng/tutor7_1_3.xml validation generated an internal error
|
6
result/relaxng/tutor7_1_3.err
Normal file
6
result/relaxng/tutor7_1_3.err
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Unimplemented block at xmlschemastypes.c:1132
|
||||||
|
Unimplemented block at xmlschemastypes.c:1132
|
||||||
|
error detected at relaxng.c:2957
|
||||||
|
error detected at relaxng.c:3427
|
||||||
|
error detected at relaxng.c:3243
|
||||||
|
xmlRelaxNGValidateDefinition(): validated vector : -1
|
1
result/relaxng/tutor7_1_4
Normal file
1
result/relaxng/tutor7_1_4
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/relaxng/tutor7_1_4.xml validates
|
3
result/relaxng/tutor7_1_4.err
Normal file
3
result/relaxng/tutor7_1_4.err
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Unimplemented block at xmlschemastypes.c:1132
|
||||||
|
Unimplemented block at xmlschemastypes.c:1132
|
||||||
|
xmlRelaxNGValidateDefinition(): validated vector : 0
|
1
result/relaxng/tutor7_2_1
Normal file
1
result/relaxng/tutor7_2_1
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/relaxng/tutor7_2_1.xml validates
|
2
result/relaxng/tutor7_2_1.err
Normal file
2
result/relaxng/tutor7_2_1.err
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Unimplemented block at xmlschemastypes.c:1135
|
||||||
|
xmlRelaxNGValidateDefinition(): validated vector : 0
|
1
result/relaxng/tutor7_2_2
Normal file
1
result/relaxng/tutor7_2_2
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/relaxng/tutor7_2_2.xml validates
|
4
result/relaxng/tutor7_2_2.err
Normal file
4
result/relaxng/tutor7_2_2.err
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Unimplemented block at xmlschemastypes.c:1135
|
||||||
|
Unimplemented block at xmlschemastypes.c:1135
|
||||||
|
Unimplemented block at xmlschemastypes.c:1135
|
||||||
|
xmlRelaxNGValidateDefinition(): validated vector : 0
|
1
result/relaxng/tutor7_2_3
Normal file
1
result/relaxng/tutor7_2_3
Normal file
@ -0,0 +1 @@
|
|||||||
|
./test/relaxng/tutor7_2_3.xml validates
|
3
result/relaxng/tutor7_2_3.err
Normal file
3
result/relaxng/tutor7_2_3.err
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Unimplemented block at xmlschemastypes.c:1135
|
||||||
|
Unimplemented block at xmlschemastypes.c:1135
|
||||||
|
xmlRelaxNGValidateDefinition(): validated vector : 0
|
3
result/relaxng/tutor7_2_4
Normal file
3
result/relaxng/tutor7_2_4
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Internal: no state
|
||||||
|
internal error validating list
|
||||||
|
./test/relaxng/tutor7_2_4.xml validation generated an internal error
|
3
result/relaxng/tutor7_2_4.err
Normal file
3
result/relaxng/tutor7_2_4.err
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
error detected at relaxng.c:2932
|
||||||
|
error detected at relaxng.c:3427
|
||||||
|
xmlRelaxNGValidateDefinition(): validated vector : -1
|
@ -1,3 +1,3 @@
|
|||||||
<element name="number" xmlns="http://relaxng.org/ns/structure/1.0">
|
<element name="number" xmlns="http://relaxng.org/ns/structure/1.0">
|
||||||
<data type="integer" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
|
<data type="int" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
|
||||||
</element>
|
</element>
|
||||||
|
7
test/relaxng/tutor7_1.rng
Normal file
7
test/relaxng/tutor7_1.rng
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<element name="vector" xmlns="http://relaxng.org/ns/structure/1.0"
|
||||||
|
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||||
|
<list>
|
||||||
|
<data type="float"/>
|
||||||
|
<data type="float"/>
|
||||||
|
</list>
|
||||||
|
</element>
|
1
test/relaxng/tutor7_1_1.xml
Normal file
1
test/relaxng/tutor7_1_1.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<vector>1.2 3.4</vector>
|
1
test/relaxng/tutor7_1_2.xml
Normal file
1
test/relaxng/tutor7_1_2.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<vector>1.2</vector>
|
1
test/relaxng/tutor7_1_3.xml
Normal file
1
test/relaxng/tutor7_1_3.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<vector>1.2 3.4 5.6</vector>
|
1
test/relaxng/tutor7_1_4.xml
Normal file
1
test/relaxng/tutor7_1_4.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<vector> 1.2 3.4 </vector>
|
8
test/relaxng/tutor7_2.rng
Normal file
8
test/relaxng/tutor7_2.rng
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<element name="vector" xmlns="http://relaxng.org/ns/structure/1.0"
|
||||||
|
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||||
|
<list>
|
||||||
|
<oneOrMore>
|
||||||
|
<data type="double"/>
|
||||||
|
</oneOrMore>
|
||||||
|
</list>
|
||||||
|
</element>
|
1
test/relaxng/tutor7_2_1.xml
Normal file
1
test/relaxng/tutor7_2_1.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<vector>1.2</vector>
|
1
test/relaxng/tutor7_2_2.xml
Normal file
1
test/relaxng/tutor7_2_2.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<vector>1.2 3.4 5.6</vector>
|
1
test/relaxng/tutor7_2_3.xml
Normal file
1
test/relaxng/tutor7_2_3.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<vector> 1.2 3.4 </vector>
|
1
test/relaxng/tutor7_2_4.xml
Normal file
1
test/relaxng/tutor7_2_4.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<vector></vector>
|
9
test/relaxng/tutor7_3.rng
Normal file
9
test/relaxng/tutor7_3.rng
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<element name="path" xmlns="http://relaxng.org/ns/structure/1.0"
|
||||||
|
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||||
|
<list>
|
||||||
|
<oneOrMore>
|
||||||
|
<data type="double"/>
|
||||||
|
<data type="double"/>
|
||||||
|
</oneOrMore>
|
||||||
|
</list>
|
||||||
|
</element>
|
@ -110,6 +110,9 @@ struct _xmlSchemaVal {
|
|||||||
static int xmlSchemaTypesInitialized = 0;
|
static int xmlSchemaTypesInitialized = 0;
|
||||||
static xmlHashTablePtr xmlSchemaTypesBank = NULL;
|
static xmlHashTablePtr xmlSchemaTypesBank = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Basic types
|
||||||
|
*/
|
||||||
static xmlSchemaTypePtr xmlSchemaTypeStringDef = NULL;
|
static xmlSchemaTypePtr xmlSchemaTypeStringDef = NULL;
|
||||||
static xmlSchemaTypePtr xmlSchemaTypeAnyTypeDef = NULL;
|
static xmlSchemaTypePtr xmlSchemaTypeAnyTypeDef = NULL;
|
||||||
static xmlSchemaTypePtr xmlSchemaTypeAnySimpleTypeDef = NULL;
|
static xmlSchemaTypePtr xmlSchemaTypeAnySimpleTypeDef = NULL;
|
||||||
@ -123,12 +126,27 @@ static xmlSchemaTypePtr xmlSchemaTypeGDayDef = NULL;
|
|||||||
static xmlSchemaTypePtr xmlSchemaTypeGMonthDayDef = NULL;
|
static xmlSchemaTypePtr xmlSchemaTypeGMonthDayDef = NULL;
|
||||||
static xmlSchemaTypePtr xmlSchemaTypeGMonthDef = NULL;
|
static xmlSchemaTypePtr xmlSchemaTypeGMonthDef = NULL;
|
||||||
static xmlSchemaTypePtr xmlSchemaTypeDurationDef = NULL;
|
static xmlSchemaTypePtr xmlSchemaTypeDurationDef = NULL;
|
||||||
static xmlSchemaTypePtr xmlSchemaTypePositiveIntegerDef = NULL;
|
|
||||||
static xmlSchemaTypePtr xmlSchemaTypeNonNegativeIntegerDef = NULL;
|
|
||||||
static xmlSchemaTypePtr xmlSchemaTypeNmtoken = NULL;
|
static xmlSchemaTypePtr xmlSchemaTypeNmtoken = NULL;
|
||||||
static xmlSchemaTypePtr xmlSchemaTypeFloatDef = NULL;
|
static xmlSchemaTypePtr xmlSchemaTypeFloatDef = NULL;
|
||||||
static xmlSchemaTypePtr xmlSchemaTypeDoubleDef = NULL;
|
static xmlSchemaTypePtr xmlSchemaTypeDoubleDef = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Derived types
|
||||||
|
*/
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypePositiveIntegerDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeNonPositiveIntegerDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeNegativeIntegerDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeNonNegativeIntegerDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeIntegerDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeLongDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeIntDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeShortDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeByteDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeUnsignedLongDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeUnsignedIntDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeUnsignedShortDef = NULL;
|
||||||
|
static xmlSchemaTypePtr xmlSchemaTypeUnsignedByteDef = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xmlSchemaInitBasicType:
|
* xmlSchemaInitBasicType:
|
||||||
* @name: the type name
|
* @name: the type name
|
||||||
@ -165,6 +183,9 @@ xmlSchemaInitTypes(void) {
|
|||||||
return;
|
return;
|
||||||
xmlSchemaTypesBank = xmlHashCreate(40);
|
xmlSchemaTypesBank = xmlHashCreate(40);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* primitive datatypes
|
||||||
|
*/
|
||||||
xmlSchemaTypeStringDef = xmlSchemaInitBasicType("string");
|
xmlSchemaTypeStringDef = xmlSchemaInitBasicType("string");
|
||||||
xmlSchemaTypeAnyTypeDef = xmlSchemaInitBasicType("anyType");
|
xmlSchemaTypeAnyTypeDef = xmlSchemaInitBasicType("anyType");
|
||||||
xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType");
|
xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType");
|
||||||
@ -178,13 +199,27 @@ xmlSchemaInitTypes(void) {
|
|||||||
xmlSchemaTypeGMonthDayDef = xmlSchemaInitBasicType("gMonthDay");
|
xmlSchemaTypeGMonthDayDef = xmlSchemaInitBasicType("gMonthDay");
|
||||||
xmlSchemaTypeGDayDef = xmlSchemaInitBasicType("gDay");
|
xmlSchemaTypeGDayDef = xmlSchemaInitBasicType("gDay");
|
||||||
xmlSchemaTypeDurationDef = xmlSchemaInitBasicType("duration");
|
xmlSchemaTypeDurationDef = xmlSchemaInitBasicType("duration");
|
||||||
xmlSchemaTypePositiveIntegerDef = xmlSchemaInitBasicType("positiveInteger");
|
|
||||||
xmlSchemaTypeNonNegativeIntegerDef =
|
|
||||||
xmlSchemaInitBasicType("nonNegativeInteger");
|
|
||||||
xmlSchemaTypeNmtoken = xmlSchemaInitBasicType("NMTOKEN");
|
xmlSchemaTypeNmtoken = xmlSchemaInitBasicType("NMTOKEN");
|
||||||
xmlSchemaTypeFloatDef = xmlSchemaInitBasicType("float");
|
xmlSchemaTypeFloatDef = xmlSchemaInitBasicType("float");
|
||||||
xmlSchemaTypeDoubleDef = xmlSchemaInitBasicType("double");
|
xmlSchemaTypeDoubleDef = xmlSchemaInitBasicType("double");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* derived datatypes
|
||||||
|
*/
|
||||||
|
xmlSchemaTypeIntegerDef = xmlSchemaInitBasicType("integer");;
|
||||||
|
xmlSchemaTypeNonPositiveIntegerDef = xmlSchemaInitBasicType("nonPositiveInteger");;
|
||||||
|
xmlSchemaTypeNegativeIntegerDef = xmlSchemaInitBasicType("negativeInteger");;
|
||||||
|
xmlSchemaTypeLongDef = xmlSchemaInitBasicType("long");;
|
||||||
|
xmlSchemaTypeIntDef = xmlSchemaInitBasicType("int");;
|
||||||
|
xmlSchemaTypeShortDef = xmlSchemaInitBasicType("short");;
|
||||||
|
xmlSchemaTypeByteDef = xmlSchemaInitBasicType("byte");;
|
||||||
|
xmlSchemaTypeNonNegativeIntegerDef = xmlSchemaInitBasicType("nonNegativeInteger");
|
||||||
|
xmlSchemaTypeUnsignedLongDef = xmlSchemaInitBasicType("unsignedLong");;
|
||||||
|
xmlSchemaTypeUnsignedIntDef = xmlSchemaInitBasicType("unsignedInt");;
|
||||||
|
xmlSchemaTypeUnsignedShortDef = xmlSchemaInitBasicType("insignedShort");;
|
||||||
|
xmlSchemaTypeUnsignedByteDef = xmlSchemaInitBasicType("unsignedByte");;
|
||||||
|
xmlSchemaTypePositiveIntegerDef = xmlSchemaInitBasicType("positiveInteger");
|
||||||
|
|
||||||
xmlSchemaTypesInitialized = 1;
|
xmlSchemaTypesInitialized = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user