* 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 */
| 1897 | * Returns -1 in case of errors, otherwise 0 |
| 1898 | */ |
| 1899 | static int |
| 1900 | xmlSchematronRegisterVariables(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: |
no test coverage detected