Hi,
We are using NMatrix.Schematron to validate HL7 CCD documents. We have used .sch file as schema and xml file to validate (.sch file has templates). Schematron validates xml file all the time. But in the following situation it fails,
if .sch file has assert test as
<assert test= "document('voc.xml')/systems/system[@codeSystemName='SNOMED CT'][@group='AlertStatusCode']/code[@value = current()/cda:value/@code]">The value for Observation / value in an alert status observation SHALL be selected from ValueSet 2.16.840.1.113883.1.11.20.3 AlertStatusCode STATIC 20061017.</assert>
we are getting XPathException: Unrecognized extension function namespace: prefix='', namespace URI=''.
Stack Trace: " at GotDotNet.Exslt.ExsltContext.ResolveFunction(String prefix, String name, XPathResultType[] argTypes)\r\n at MS.Internal.Xml.XPath.FunctionQuery.SetXsltContext(XsltContext context)\r\n at MS.Internal.Xml.XPath.BaseAxisQuery.SetXsltContext(XsltContext context)\r\n at MS.Internal.Xml.XPath.BaseAxisQuery.SetXsltContext(XsltContext context)\r\n at MS.Internal.Xml.XPath.FilterQuery.SetXsltContext(XsltContext input)\r\n at MS.Internal.Xml.XPath.BaseAxisQuery.SetXsltContext(XsltContext context)\r\n at MS.Internal.Xml.XPath.FilterQuery.SetXsltContext(XsltContext input)\r\n at MS.Internal.Xml.XPath.CompiledXpathExpr.SetContext(XmlNamespaceManager nsManager)\r\n at NMatrix.Schematron.EvaluableExpression.SetContext(XmlNamespaceManager nsManager) in D:\\CCD\\Schematron\\src\\EvaluableExpression.cs:line 87\r\n at NMatrix.Schematron.SchemaLoader.LoadAsserts(Rule rule, XPathNavigator context) in D:\\CCD\\Schematron\\src\\SchemaLoader.cs:line 198\r\n at NMatrix.Schematron.SchemaLoader.LoadRules(Pattern pattern, XPathNavigator context) in D:\\CCD\\Schematron\\src\\SchemaLoader.cs:line 170\r\n at NMatrix.Schematron.SchemaLoader.LoadPatterns() in D:\\CCD\\Schematron\\src\\SchemaLoader.cs:line 135\r\n at NMatrix.Schematron.SchemaLoader.LoadSchema(XPathNavigator source) in D:\\CCD\\Schematron\\src\\SchemaLoader.cs:line 50\r\n at NMatrix.Schematron.Schema.Load(XPathNavigator schema) in D:\\CCD\\Schematron\\src\\Schema.cs:line 100\r\n at NMatrix.Schematron.Validator.AddSchema(XmlReader reader) in D:\\CCD\\Schematron\\src\\Validator.cs:line 288\r\n at NMatrix.Schematron.Validator.AddSchema(TextReader reader) in D:\\CCD\\Schematron\\src\\Validator.cs:line 222\r\n at WinTest.Home.btnExecute_Click(Object sender, EventArgs e) in D:\\CCD\\Schematron\\samples\\WinForms\\Home.cs:line 418\r\n at System.Windows.Forms.Control.OnClick(EventArgs e)\r\n at System.Windows.Forms.Button.OnClick(EventArgs e)\r\n at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)\r\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.ButtonBase.WndProc(Message& m)\r\n at System.Windows.Forms.Button.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at WinTest.Home.Main() in D:\\CCD\\Schematron\\samples\\WinForms\\Home.cs:line 362\r\n at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"
Let me know the solution to fix this issue.
Thanks in advance.