MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlSchematronRegisterVariables

Function xmlSchematronRegisterVariables

ThirdParty/libxml2/vtklibxml2/schematron.c:1899–1925  ·  view source on GitHub ↗

* xmlSchematronRegisterVariables: * @ctxt: the schema validation context * @let: the list of let variables * @instance: the document instance tree * @cur: the current node * * Registers a list of let variables to the current context of @cur * * Returns -1 in case of errors, otherwise 0 */

Source from the content-addressed store, hash-verified

1897 * Returns -1 in case of errors, otherwise 0
1898 */
1899static int
1900xmlSchematronRegisterVariables(xmlSchematronValidCtxtPtr vctxt,
1901 xmlXPathContextPtr ctxt,
1902 xmlSchematronLetPtr let,
1903 xmlDocPtr instance, xmlNodePtr cur)
1904{
1905 xmlXPathObjectPtr let_eval;
1906
1907 ctxt->doc = instance;
1908 ctxt->node = cur;
1909 while (let != NULL) {
1910 let_eval = xmlXPathCompiledEval(let->comp, ctxt);
1911 if (let_eval == NULL) {
1912 xmlSchematronVErr(vctxt, XML_ERR_INTERNAL_ERROR,
1913 "Evaluation of compiled expression failed\n",
1914 NULL);
1915 return -1;
1916 }
1917 if(xmlXPathRegisterVariableNS(ctxt, let->name, NULL, let_eval)) {
1918 xmlSchematronVErr(vctxt, XML_ERR_INTERNAL_ERROR,
1919 "Registering a let variable failed\n", NULL);
1920 return -1;
1921 }
1922 let = let->next;
1923 }
1924 return 0;
1925}
1926
1927/**
1928 * xmlSchematronUnregisterVariables:

Callers 1

xmlSchematronValidateDocFunction · 0.85

Calls 2

xmlXPathCompiledEvalFunction · 0.85

Tested by

no test coverage detected