Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incluída mensagem para saber de onde veio o erro #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/OpenAC.Net.DFe.Core/XmlSchemaValidation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
namespace OpenAC.Net.DFe.Core;

/// <summary>
/// Classe estatica para valida��o de xml usando schema.
/// Classe estatica para validação de xml usando schema.
/// </summary>
public static class XmlSchemaValidation
{
Expand All @@ -57,15 +57,15 @@ public static bool ValidarXml(string arquivoXml, string schema, out string[] err

if (string.IsNullOrEmpty(arquivoXml))
{
errorList.Add("Arquivo Xml n�o encontrado.");
errorList.Add("Arquivo Xml não encontrado.");
erros = errorList.ToArray();
avisos = avisosList.ToArray();
return false;
}

if (!File.Exists(schema))
{
errorList.Add("Arquivo de Schema n�o encontrado.");
errorList.Add("Arquivo de Schema não encontrado.");
erros = errorList.ToArray();
avisos = avisosList.ToArray();
return false;
Expand All @@ -88,7 +88,7 @@ public static bool ValidarXml(string arquivoXml, string schema, out string[] err
break;
}

// Erro na valida��o do schema XSD
// Erro na validação do schema XSD
if (args.Exception != null)
{
// ReSharper disable once AccessToModifiedClosure
Expand Down Expand Up @@ -116,7 +116,7 @@ public static bool ValidarXml(string arquivoXml, string schema, out string[] err
}
catch (Exception exception)
{
errorList.Add(exception.Message);
errorList.Add("Erro ao validar schema:" + exception.Message);
}

erros = errorList.ToArray();
Expand All @@ -126,4 +126,4 @@ public static bool ValidarXml(string arquivoXml, string schema, out string[] err

return (erros.Length < 1);
}
}
}