--- embedaddon/libxml2/schematron.c 2012/02/21 23:37:58 1.1.1.1 +++ embedaddon/libxml2/schematron.c 2014/06/15 19:53:29 1.1.1.2 @@ -53,7 +53,7 @@ static const xmlChar *xmlOldSchematronNs = SCT_OLD_NS; #define NEXT_SCHEMATRON(node) \ while (node != NULL) { \ - if ((node->type == XML_ELEMENT_NODE ) && (node->ns != NULL) && \ + if ((node->type == XML_ELEMENT_NODE ) && (node->ns != NULL) && \ ((xmlStrEqual(node->ns->href, xmlSchematronNs)) || \ (xmlStrEqual(node->ns->href, xmlOldSchematronNs)))) \ break; \ @@ -65,7 +65,7 @@ static const xmlChar *xmlOldSchematronNs = SCT_OLD_NS; * * macro to flag unimplemented blocks */ -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); @@ -240,7 +240,7 @@ xmlSchematronPErrMemory(xmlSchematronParserCtxtPtr ctx * @msg: the error message * @str1: extra data * @str2: extra data - * + * * Handle a parser error */ static void @@ -568,7 +568,7 @@ xmlSchematronFree(xmlSchematronPtr schema) if (schema->namespaces != NULL) xmlFree((char **) schema->namespaces); - + xmlSchematronFreeRules(schema->rules); xmlSchematronFreePatterns(schema->patterns); xmlDictFree(schema->dict); @@ -826,9 +826,9 @@ xmlSchematronAddNamespace(xmlSchematronParserCtxtPtr c ctxt->namespaces = tmp; ctxt->maxNamespaces *= 2; } - ctxt->namespaces[2 * ctxt->nbNamespaces] = + ctxt->namespaces[2 * ctxt->nbNamespaces] = xmlDictLookup(ctxt->dict, ns, -1); - ctxt->namespaces[2 * ctxt->nbNamespaces + 1] = + ctxt->namespaces[2 * ctxt->nbNamespaces + 1] = xmlDictLookup(ctxt->dict, prefix, -1); ctxt->nbNamespaces++; ctxt->namespaces[2 * ctxt->nbNamespaces] = NULL; @@ -1288,7 +1288,7 @@ xmlSchematronReportOutput(xmlSchematronValidCtxtPtr ct * to be deallocated by teh caller */ static xmlChar * -xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt, +xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt, xmlNodePtr test, xmlNodePtr cur) { xmlChar *ret = NULL; xmlNodePtr child, node; @@ -1314,7 +1314,7 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ct xmlFree(path); } - if ((node->ns == NULL) || (node->ns->prefix == NULL)) + if ((node->ns == NULL) || (node->ns->prefix == NULL)) ret = xmlStrcat(ret, node->name); else { ret = xmlStrcat(ret, node->ns->prefix); @@ -1365,7 +1365,7 @@ xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ct * been done. */ static void -xmlSchematronReportSuccess(xmlSchematronValidCtxtPtr ctxt, +xmlSchematronReportSuccess(xmlSchematronValidCtxtPtr ctxt, xmlSchematronTestPtr test, xmlNodePtr cur, xmlSchematronPatternPtr pattern, int success) { if ((ctxt == NULL) || (cur == NULL) || (test == NULL)) return; @@ -1445,7 +1445,7 @@ xmlSchematronReportSuccess(xmlSchematronValidCtxtPtr c * called from the validation engine when starting to check a pattern */ static void -xmlSchematronReportPattern(xmlSchematronValidCtxtPtr ctxt, +xmlSchematronReportPattern(xmlSchematronValidCtxtPtr ctxt, xmlSchematronPatternPtr pattern) { if ((ctxt == NULL) || (pattern == NULL)) return; @@ -1572,7 +1572,7 @@ xmlSchematronNextNode(xmlNodePtr cur) { (cur->type != XML_DTD_NODE)) return(cur); } - + do { cur = cur->parent; if (cur == NULL) break; @@ -1589,7 +1589,7 @@ xmlSchematronNextNode(xmlNodePtr cur) { * xmlSchematronRunTest: * @ctxt: the schema validation context * @test: the current test - * @instance: the document instace tree + * @instance: the document instace tree * @cur: the current node in the instance * * Validate a rule against a tree instance at a given position @@ -1653,7 +1653,7 @@ xmlSchematronRunTest(xmlSchematronValidCtxtPtr ctxt, /** * xmlSchematronValidateDoc: * @ctxt: the schema validation context - * @instance: the document instace tree + * @instance: the document instace tree * * Validate a tree instance against the schematron * @@ -1697,7 +1697,7 @@ xmlSchematronValidateDoc(xmlSchematronValidCtxtPtr ctx } rule = rule->next; } - + cur = xmlSchematronNextNode(cur); } } else { @@ -1705,14 +1705,14 @@ xmlSchematronValidateDoc(xmlSchematronValidCtxtPtr ctx * Process all contexts one at a time */ pattern = ctxt->schema->patterns; - + while (pattern != NULL) { xmlSchematronReportPattern(ctxt, pattern); /* * TODO convert the pattern rule to a direct XPath and * compute directly instead of using the pattern matching - * over the full document... + * over the full document... * Check the exact semantic */ cur = root; @@ -1728,7 +1728,7 @@ xmlSchematronValidateDoc(xmlSchematronValidCtxtPtr ctx } rule = rule->patnext; } - + cur = xmlSchematronNextNode(cur); } pattern = pattern->next;