int depth; /* current depth */
xmlDocPtr doc; /* current document */
xmlNodePtr node; /* current node */
- xmlDictPtr dict; /* the doc dictionnary */
+ xmlDictPtr dict; /* the doc dictionary */
int check; /* do just checkings */
int errors; /* number of errors found */
- int nodict; /* if the document has no dictionnary */
+ int nodict; /* if the document has no dictionary */
int options; /* options */
};
NULL, NULL, NULL, 0, 0,
"%s", msg);
}
-static void
+static void LIBXML_ATTR_FORMAT(3,0)
xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra)
{
ctxt->errors++;
NULL, NULL, NULL, 0, 0,
msg, extra);
}
-static void
+static void LIBXML_ATTR_FORMAT(3,0)
xmlDebugErr3(xmlDebugCtxtPtr ctxt, int error, const char *msg, const char *extra)
{
ctxt->errors++;
* @ctxt: the debug context
* @name: the name
*
- * Do debugging on the name, for example the dictionnary status and
+ * Do debugging on the name, for example the dictionary status and
* conformance to the Name production.
*/
static void
xmlDebugErr(ctxt, XML_CHECK_NO_NAME, "Name is NULL");
return;
}
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
if (xmlValidateName(name, 0)) {
xmlDebugErr3(ctxt, XML_CHECK_NOT_NCNAME,
"Name is not an NCName '%s'", (const char *) name);
}
+#endif
if ((ctxt->dict != NULL) &&
(!xmlDictOwns(ctxt->dict, name)) &&
((ctxt->doc == NULL) ||
((ctxt->doc->parseFlags & (XML_PARSE_SAX1 | XML_PARSE_NODICT)) == 0))) {
xmlDebugErr3(ctxt, XML_CHECK_OUTSIDE_DICT,
- "Name is not from the document dictionnary '%s'",
+ "Name is not from the document dictionary '%s'",
(const char *) name);
}
}
/* desactivated right now as it raises too many errors */
if (doc->type == XML_DOCUMENT_NODE)
xmlDebugErr(ctxt, XML_CHECK_NO_DICT,
- "Document has no dictionnary\n");
+ "Document has no dictionary\n");
#endif
ctxt->nodict = 1;
}
} else if (!strcmp(command, "save")) {
xmlShellSave(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "write")) {
- if ((arg == NULL) || (arg[0] == 0))
+ if (arg[0] == 0)
xmlGenericError(xmlGenericErrorContext,
"Write command requires a filename argument\n");
else
ctxt->node = (xmlNodePtr) ctxt->doc;
} else {
#ifdef LIBXML_XPATH_ENABLED
+ int l;
+
ctxt->pctxt->node = ctxt->node;
+ l = strlen(arg);
+ if ((l >= 2) && (arg[l - 1] == '/'))
+ arg[l - 1] = 0;
list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
#else
list = NULL;