1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-08-01 10:06:59 +03:00

Added the function xmlSchemaValidateOneElement to the XML Schema

* xmlschemas.c include/libxml/xmlschemas.h: Added the function
  xmlSchemaValidateOneElement to the XML Schema validation API,
  as proposed by Jeffrey Fink - see bug # 152073.
This commit is contained in:
Kasimier T. Buchcik
2004-09-08 09:17:27 +00:00
parent 06500c8aa6
commit 5eba91f2d9
3 changed files with 31 additions and 0 deletions

View File

@ -14275,6 +14275,28 @@ xmlSchemaValidateElement(xmlSchemaValidCtxtPtr ctxt, xmlNodePtr elem)
return (ctxt->err);
}
/**
* xmlSchemaValidateOneElement:
* @ctxt: a schema validation context
* @elem: an element node
*
* Validate a branch of a tree, starting with the given @elem.
*
* Returns 0 if the element and its subtree is valid, a positive error
* code number otherwise and -1 in case of an internal or API error.
*/
int
xmlSchemaValidateOneElement(xmlSchemaValidCtxtPtr ctxt, xmlNodePtr elem)
{
if ((ctxt == NULL) || (elem == NULL))
return (-1);
ctxt->doc = elem->doc;
ctxt->err = 0;
ctxt->nberrors = 0;
return (xmlSchemaValidateElement(ctxt, elem));
}
/**
* xmlSchemaValidateDocument:
* @ctxt: a schema validation context