All I have is: "You can call SetInvalidityHandler(IInvalidityHandler inHandler). This will cause each validity error to be reported to your supplied handler. The error is reported by way of a (poorly named) StaticError object. This wraps a Java ValidationFailure object."
I have tried: (yes, it is vb, c# responses are also fine)
Delegate Sub ValidationCallBack(errH As Saxon.Api.IInvalidityHandler)
Dim IIH As Saxon.Api.IInvalidityHandler 'very suss on this line
then a sub;
Sub ValidationCallBackEvent(errH As Saxon.Api.IInvalidityHandler)
dim k as integer
k=0 'F9 here
End Sub
then a sub containing;
Dim deleg As New ValidationCallBack(AddressOf ValidationCallBackEvent)
Dim processor = New Processor(True)
Dim sXsdPathUri As String = "c:\temp\the.xsd"
Dim sXmlPathUri As String = "c:\temp\the.xml"
processor.SetProperty("http://saxon.sf.net/feature/timing", "true")
processor.SetProperty("http://saxon.sf.net/feature/validation-warnings", "false")
Dim manager As SchemaManager = processor.SchemaManager
Dim schemaUri As System.Uri
schemaUri = New System.Uri(sXsdPathUri)
manager.Compile(schemaUri)
Dim validator As SchemaValidator = manager.NewSchemaValidator
Dim settings As System.Xml.XmlReaderSettings = New System.Xml.XmlReaderSettings
settings.DtdProcessing = System.Xml.DtdProcessing.Ignore
Dim inputFileName As String = New Uri(sXmlPathUri).ToString()
Dim xmlReader As System.Xml.XmlReader = System.Xml.XmlReader.Create(inputFileName, settings)
validator.SetSource(xmlReader)
validator.SetInvalidityHandler(IIH) 'suss; but it needs a Saxon.Api.IInvalidityHandler..
validator.Run()
Try
validator.Run()
sResult = "Valid!!"
Catch ex As Exception
Dim err As StaticError
For Each err In validator.ErrorList 'still goes here
It's not erroring but neither is the ValidationCallBackEvent being raised so clearly my plumbing is incorrect.
Any ideas? thanks!