Hello,
is there someone that can help me about the syntactic form of the file XML for the italian "FATTURA PA"?
From 2017/01/01 is changed the file's form (rel 1.2), and the file created by my procedure is not accepted from the SDI system (outcome: "error 0200 - file not conform to format - The published version invoiceis not present among those admitted").
The file header contains (I carry a snippet):

<?xml version="1.0" encoding="UTF-8"?> 
<p:FatturaElettronica versione="1.2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:p="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2" xmlns:xsi="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"> 
     <FatturaElettronicaHeader> 
          <DatiTrasmissione>
            ...

Can you help me to understand where is the error?
Thanks in advance
Antonio BIANCA

Dani AI

Generated

Breve sintesi e cause probabili (collegamento a quanto scritto da ): l'errore 0200 viene quasi sempre da elementi che non vengono riconosciuti dallo schema. Nel frammento che hai mostrato ci sono due punti critici frequentemente fatali: la dichiarazione di xsi deve essere l'URI dello XML Schema Instance (non il riferimento allo xmldsig) e l'attributo versione del nodo radice deve usare il token previsto dallo XSD per 1.2 (ad es. FPA12 o FPR12), non 1.2. (w3.org)

Esempio compatto di intestazione corretta (usa o i prefissi p: su tutti i nodi dello schema, o una default namespace coerente; non mischiare):

<?xml version="1.0" encoding="UTF-8"?>
<p:FatturaElettronica xmlns:p="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2"
                      xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      versione="FPR12"
                      xsi:schemaLocation="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 http://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.2/Schema_del_file_xml_FatturaPA_versione_1.2.xsd">
  <p:FatturaElettronicaHeader>
    <p:DatiTrasmissione>
      ...

L'intestazione sopra mostra le tre correzioni essenziali: xmlns:xsi corretto, xsi:schemaLocation che punta allo XSD ufficiale e gli elementi qualificati con lo stesso namespace. Esempi e header simili sono usati nelle risorse operative per FatturaPA. (docs.autofattura.ai)

Controlli pratici e workflow di debug: 1) validare localmente contro lo XSD v1.2 (es. xmllint --noout --schema Schema_del_file_xml_FatturaPA_versione_1.2.xsd fattura.xml) per visualizzare gli errori XSD; 2) correggere namespace/versione fino a superare la validazione XSD; 3) togliere BOM, verificare UTF-8 e che FormatoTrasmissione sia coerente con versione; 4) infine usare lo strumento di verifica FatturaPA/SDI per testare l'invio reale. Procedere per passi evita confusione tra errori di formato e di firma. (libraries.io)

Note finali e insidie comuni: valori numerici formattati male (es. aliquota 22 invece di 22.00), elementi obbligatori vuoti, e firma non valida sono cause ricorrenti dopo che la struttura XML รจ corretta. Seguire l'ordine: namespace/versione โ†’ validazione XSD โ†’ firma โ†’ invio SDI. Riferimento per casi reali e messaggi di scarto simili. (forum.italia.it)

(Collegamento ai post: la tua osservazione iniziale e il suggerimento di sono corretti; per le prime modifiche da verificare sono proprio quelle indicate sopra.)

Hi,

as the error states the format of the invoice is not recognized by their system, you are showing only the namespaces in the header of the XML document. The document must conform to these namespaces. So if the namespace xlmns:p defines nodes like <p:FatturaElettronica> the following:

<FatturaElettronicaHeader> 
      <DatiTrasmissione>

Will probably be:

<p:FatturaElettronicaHeader> 
      <p:DatiTrasmissione>

Ans so on. Verify if there are nodes that are breaking these rules. If you have difficulties, please share a full example of this document and the related documentation.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.