#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; \
*
* macro to flag unimplemented blocks
*/
-#define TODO \
+#define TODO \
xmlGenericError(xmlGenericErrorContext, \
"Unimplemented block at %s:%d\n", \
__FILE__, __LINE__);
int flags; /* specific to this schematron */
void *_private; /* unused by the library */
- xmlDictPtr dict; /* the dictionnary used internally */
+ xmlDictPtr dict; /* the dictionary used internally */
const xmlChar *title; /* the title if any */
FILE *outputFile; /* if using XML_SCHEMATRON_OUT_FILE */
xmlBufferPtr outputBuffer; /* if using XML_SCHEMATRON_OUT_BUFFER */
+#ifdef LIBXML_OUTPUT_ENABLED
xmlOutputWriteCallback iowrite; /* if using XML_SCHEMATRON_OUT_IO */
xmlOutputCloseCallback ioclose;
+#endif
void *ioctx;
/* error reporting data */
const char *buffer;
int size;
- xmlDictPtr dict; /* dictionnary for interned string names */
+ xmlDictPtr dict; /* dictionary for interned string names */
int nberrors;
int err;
* @msg: the error message
* @str1: extra data
* @str2: extra data
- *
+ *
* Handle a parser error
*/
-static void
+static void LIBXML_ATTR_FORMAT(4,0)
xmlSchematronPErr(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr node, int error,
const char *msg, const xmlChar * str1, const xmlChar * str2)
{
if (schema->namespaces != NULL)
xmlFree((char **) schema->namespaces);
-
+
xmlSchematronFreeRules(schema->rules);
xmlSchematronFreePatterns(schema->patterns);
xmlDictFree(schema->dict);
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;
* to be deallocated by teh caller
*/
static xmlChar *
-xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
+xmlSchematronFormatReport(xmlSchematronValidCtxtPtr ctxt,
xmlNodePtr test, xmlNodePtr cur) {
xmlChar *ret = NULL;
xmlNodePtr child, node;
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);
* 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;
* 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;
(cur->type != XML_DTD_NODE))
return(cur);
}
-
+
do {
cur = cur->parent;
if (cur == NULL) break;
* 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
/**
* xmlSchematronValidateDoc:
* @ctxt: the schema validation context
- * @instance: the document instace tree
+ * @instance: the document instace tree
*
* Validate a tree instance against the schematron
*
}
rule = rule->next;
}
-
+
cur = xmlSchematronNextNode(cur);
}
} else {
* 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;
}
rule = rule->patnext;
}
-
+
cur = xmlSchematronNextNode(cur);
}
pattern = pattern->next;