{
int i;
- if (state == NULL || states == NULL) {
+ if (state == NULL) {
return (-1);
}
if (states->nbState >= states->maxState) {
}
ret = xmlSchemaValPredefTypeNode(typ, value2, &res2, ctxt2);
if (ret != 0) {
- if (res1 != (xmlSchemaValPtr) comp1)
+ if ((comp1 == NULL) && (res1 != NULL))
xmlSchemaFreeValue(res1);
return (-1);
}
+ if (res1 == NULL) {
+ return (-1);
+ }
ret = xmlSchemaCompareValues(res1, res2);
if (res1 != (xmlSchemaValPtr) comp1)
xmlSchemaFreeValue(res1);
}
/*
- * Apply 4.17 merging rules to defines and starts
+ * Apply 4.17 mergingd rules to defines and starts
*/
xmlRelaxNGCombineStart(ctxt, ret);
if (ret->defs != NULL) {
ctxt->define = NULL;
if (IS_RELAXNG(node, "grammar")) {
schema->topgrammar = xmlRelaxNGParseGrammar(ctxt, node->children);
- if (schema->topgrammar == NULL) {
- xmlRelaxNGFree(schema);
- return (NULL);
- }
} else {
xmlRelaxNGGrammarPtr tmp, ret;
schema->topgrammar = ret = xmlRelaxNGNewGrammar(ctxt);
if (schema->topgrammar == NULL) {
- xmlRelaxNGFree(schema);
- return (NULL);
+ return (schema);
}
/*
* Link the new grammar in the tree
}
}
/*
- * This is not an else since "include" is transformed
+ * Thisd is not an else since "include" is transformed
* into a div
*/
if (xmlStrEqual(cur->name, BAD_CAST "div")) {
if (ns != NULL)
xmlFree(ns);
/*
- * Since we are about to delete cur, if its nsDef is non-NULL we
+ * Since we are about to delete cur, if it's nsDef is non-NULL we
* need to preserve it (it contains the ns definitions for the
* children we just moved). We'll just stick it on to the end
* of cur->parent's list, since it's never going to be re-serialized
* (bug 143738).
*/
- if ((cur->nsDef != NULL) && (cur->parent != NULL)) {
+ if (cur->nsDef != NULL) {
xmlNsPtr parDef = (xmlNsPtr)&cur->parent->nsDef;
while (parDef->next != NULL)
parDef = parDef->next;
else if ((cur->type == XML_TEXT_NODE) ||
(cur->type == XML_CDATA_SECTION_NODE)) {
if (IS_BLANK_NODE(cur)) {
- if ((cur->parent != NULL) &&
- (cur->parent->type == XML_ELEMENT_NODE)) {
+ if (cur->parent->type == XML_ELEMENT_NODE) {
if ((!xmlStrEqual(cur->parent->name, BAD_CAST "value"))
&&
(!xmlStrEqual
return (ret);
list = list->next;
}
- } else if (define->type == XML_RELAXNG_CHOICE) {
- xmlRelaxNGDefinePtr list;
-
- list = define->nameClass;
- while (list != NULL) {
- ret = xmlRelaxNGAttributeMatch(ctxt, list, prop);
- if (ret == 1)
- return (1);
- if (ret < 0)
- return (ret);
- list = list->next;
- }
- return (0);
} else {
TODO}
return (1);
oldstate = ctxt->state;
for (i = 0; i < nbgroups; i++) {
ctxt->state = xmlRelaxNGCopyValidState(ctxt, oldstate);
- if (ctxt->state == NULL) {
- ret = -1;
- break;
- }
group = partitions->groups[i];
if (lasts[i] != NULL) {
last = lasts[i]->next;