Code Snippet
Private Sub validarXML(ByVal XML As XmlDocument)
XML.Schemas.Add("http://www.portalfiscal.inf.br/nfe",Server.MapPath(".") & "XSD\leiauteNFe_v1.10.xsd")
Dim myevent As ValidationEventHandler = New ValidationEventHandler(AddressOf ValidationEvent)
XML.Validate(myevent)
End Sub
Private Sub ValidationEvent(ByVal sender As Object, ByVal e As ValidationEventArgs)
resultadoValidacao = New StringBuilder
Select Case e.Severity
Case XmlSeverityType.Error
resultadoValidacao.AppendLine("Error: " & e.Message)
Case XmlSeverityType.Warning
resultadoValidacao.AppendLine("Warning: " & e.Message)
End Select
End Sub