Public Class frmValidate Public Target_XML As String Private Sub btnValidate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnValidate.Click Try Dim Validator As New XmlValidator() Dim Errors As List(Of String) Dim RawXml As String Const MY_XSD As String = "C:\Sample\Tras_V7_09.xsd" Using Reader As New StreamReader(Target_XML) RawXml = Reader.ReadToEnd() End Using With Validator .SchemaSettings.ProhibitDtd = False .Schemas.Add(MY_XSD) Errors = .ValidateXml(RawXml) End With Me.txtErrors.Text = "Errors:" & Errors.Count & vbCrLf & vbCrLf For Each Err As String In Errors Me.txtErrors.Text &= Err & vbCrLf Next MsgBox("Complete") Catch ex As Exception msgError(ex.Message, "XML Validate") End Try End Sub End Class
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE