ValidateXml and XMLOK in FirmaSAT 5


FirmaSAT 5 introduces much stricter tests for XML validation, including checking that nodes are the correct data type and of permissible length.

This means that if you check an XML document using XMLOK or Sat.ValidateXml before signing and adding the certificado details, you will get an error:

>FirmaSAT XMLOK Muestra_v2-base.xml
STATUS: -28
ERRORDESCRIPTION: Error code -28: XML restriction is violated/XML restricción es violada: Bad attribute/atributo mal 
[Comprobante/@noCertificado]: '' is too short/es demasiado corto, minimum length/longitud mínima=20

In this case we have noCertificado="" in the base file ready to receive the certificate number. This is strictly an error as the XML schmema requires exactly 20 characters for this attribute.

To solve

  1. Use the SAT_XML_LOOSE/XmlOption.Loose option or -l with the command-line version. This will do the "old" check and show that the document is OK.
    >FirmaSAT XMLOK -l Muestra_v2-base.xml
    OK
    
  2. Or do the strict XMLOK check after you have done the signing.
    >FirmaSAT XMLOK Muestra_v2-signed.xml
    OK
    

Contact us

To contact us or comment on this page, please send us a message.

This page last updated 1 January 2012