Página 1 de 1

Error Schemas validity

Publicado: Vie May 19, 2017 3:55 pm
por droid
Buen dia.

Al intentar validar un xml de nomina 1.2 me aparece mensaje de error, quien me puede ayudar?

xmllint --noout --schema nomina12.xsd 005155.xml

005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante': No matching global declaration available for the validation root.
005155.xml fails to validate


Gracias de antemano.

Re: Error Schemas validity

Publicado: Vie May 19, 2017 4:06 pm
por fortiz
Hola droid

El comando debe de ser

Código: Seleccionar todo

xmllint --noout --schema cfdv33.xsd 005155.xml
y dentro del cfdv33.xsd haces el import a la definición de la nomina

Código: Seleccionar todo

 <xs:import namespace="http://www.sat.gob.mx/nomina12" schemaLocation="nomina12.xsd"/>
Tanto el cfdv33.xsd como el nomina12.xsd deben de estar en el mismo directorio

Re: Error Schemas validity

Publicado: Vie May 19, 2017 4:47 pm
por droid
@fortiz, ahora me envia esta lista de errores, usando el comando xmllint --noout --schema cfdv33.xsd 005155.xml

Código: Seleccionar todo

005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'version': The attribute 'version' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'serie': The attribute 'serie' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'folio': The attribute 'folio' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'fecha': The attribute 'fecha' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'tipoDeComprobante': The attribute 'tipoDeComprobante' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'formaDePago': The attribute 'formaDePago' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'metodoDePago': The attribute 'metodoDePago' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'noCertificado': The attribute 'noCertificado' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'subTotal': The attribute 'subTotal' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'descuento': The attribute 'descuento' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'total': The attribute 'total' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'certificado': The attribute 'certificado' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante', attribute 'sello': The attribute 'sello' is not allowed.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante': The attribute 'Version' is required but missing.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante': The attribute 'Fecha' is required but missing.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante': The attribute 'Sello' is required but missing.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante': The attribute 'NoCertificado' is required but missing.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante': The attribute 'Certificado' is required but missing.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante': The attribute 'SubTotal' is required but missing.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante': The attribute 'Total' is required but missing.
005155.xml:6: element Comprobante: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Comprobante': The attribute 'TipoDeComprobante' is required but missing.
005155.xml:7: element Emisor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Emisor', attribute 'rfc': The attribute 'rfc' is not allowed.
005155.xml:7: element Emisor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Emisor', attribute 'nombre': The attribute 'nombre' is not allowed.
005155.xml:7: element Emisor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Emisor': The attribute 'Rfc' is required but missing.
005155.xml:7: element Emisor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Emisor': The attribute 'RegimenFiscal' is required but missing.
005155.xml:7: element Emisor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Emisor': Character content is not allowed, because the content type is empty.
005155.xml:7: element Emisor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Emisor': Element content is not allowed, because the content type is empty.
005155.xml:10: element Receptor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Receptor', attribute 'rfc': The attribute 'rfc' is not allowed.
005155.xml:10: element Receptor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Receptor', attribute 'nombre': The attribute 'nombre' is not allowed.
005155.xml:10: element Receptor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Receptor': The attribute 'Rfc' is required but missing.
005155.xml:10: element Receptor: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Receptor': The attribute 'UsoCFDI' is required but missing.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto', attribute 'cantidad': The attribute 'cantidad' is not allowed.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto', attribute 'unidad': The attribute 'unidad' is not allowed.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto', attribute 'descripcion': The attribute 'descripcion' is not allowed.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto', attribute 'valorUnitario': The attribute 'valorUnitario' is not allowed.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto', attribute 'importe': The attribute 'importe' is not allowed.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto': The attribute 'ClaveProdServ' is required but missing.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto': The attribute 'Cantidad' is required but missing.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto': The attribute 'ClaveUnidad' is required but missing.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto': The attribute 'Descripcion' is required but missing.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto': The attribute 'ValorUnitario' is required but missing.
005155.xml:12: element Concepto: Schemas validity error : Element '{http://www.sat.gob.mx/cfd/3}Concepto': The attribute 'Importe' is required but missing.
005155.xml:20: element Nomina: Schemas validity error : Element '{http://www.sat.gob.mx/nomina12}Nomina': No matching global element declaration available, but demanded by the strict wildcard.
005155.xml fails to validate

Re: Error Schemas validity

Publicado: Vie May 19, 2017 4:51 pm
por fortiz
Por las minúsculas que veo estas generado 3.2 no 3.3, ¿es correcto?

En ese caso usa el cfdv32.xsd

checa mis archivos de aqui https://github.com/fortiz/sat/tree/master/xsd

Re: Error Schemas validity

Publicado: Lun May 22, 2017 9:43 am
por droid
Listo, ya esta funcionando con cfdv32.xsd, tambien modifique mi xml ya que tenia http://www.sat.gob.mx/nomina12 y aun enviaba error, le quite el http://
<nomina12:Nomina xmlns:nomina12="www.sat.gob.mx/nomina12" Version="1.2"

Gracias @fortiz

Re: Error Schemas validity

Publicado: Lun May 29, 2017 7:50 am
por droid
Buen dia,

Respecto al mensaje anterior donde indico que removí el http:// , ahora, sí deseo obtener la cadena original con el comando de linux xsltproc manda mensaje de error, entonces manualmente le agrego el http;// en la misma linea
<nomina12:Nomina xmlns:nomina12="http://www.sat.gob.mx/nomina12"
y con eso si me genera la cadena original.

Como manejan ustedes esta situacion? cual es el URL que debe de llevar?

Gracias de antemano.