| 304 | } |
| 305 | |
| 306 | XN_C_API XnStatus xnContextRunXmlScriptEx(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors, XnNodeHandle* phScriptNode) |
| 307 | { |
| 308 | XnStatus nRetVal = XN_STATUS_OK; |
| 309 | |
| 310 | XN_VALIDATE_INPUT_PTR(pContext); |
| 311 | XN_VALIDATE_INPUT_PTR(xmlScript); |
| 312 | XN_VALIDATE_OUTPUT_PTR(phScriptNode); |
| 313 | |
| 314 | *phScriptNode = NULL; |
| 315 | |
| 316 | XnNodeHandle hScriptNode; |
| 317 | nRetVal = xnCreateScriptNode(pContext, XN_SCRIPT_FORMAT_XML, &hScriptNode); |
| 318 | XN_IS_STATUS_OK(nRetVal); |
| 319 | |
| 320 | nRetVal = xnLoadScriptFromString(hScriptNode, xmlScript); |
| 321 | if (nRetVal != XN_STATUS_OK) |
| 322 | { |
| 323 | xnProductionNodeRelease(hScriptNode); |
| 324 | return (nRetVal); |
| 325 | } |
| 326 | |
| 327 | nRetVal = xnScriptNodeRun(hScriptNode, pErrors); |
| 328 | if (nRetVal != XN_STATUS_OK) |
| 329 | { |
| 330 | xnProductionNodeRelease(hScriptNode); |
| 331 | return (nRetVal); |
| 332 | } |
| 333 | |
| 334 | *phScriptNode = hScriptNode; |
| 335 | |
| 336 | return (XN_STATUS_OK); |
| 337 | } |
| 338 | |
| 339 | XN_C_API XnStatus xnContextRunXmlScript(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors) |
| 340 | { |
no test coverage detected