CSV cvc-datatype-valid.1.2.1:''不是' double'的有效值。 CSV文件错误

时间:2018-04-23 12:25:32

标签: xml file csv input invoice

我在读取csv文件时出错,在此文件中我存储的值必须是特定数据类型才能生成发票(称为facturae或电子账单),所以问题是我得到错误:

cvc-datatype-valid.1.2.1: '' is not a valid value for 'double' error

这是csv文件(我使用;作为此文件中的分隔符,我们可以将其称为数据库,因为它包含生成5个发票所需的值),我得到错误:

enter image description here

背景:我使用xml文件作为模板,其中包含的字段将替换为您在csv文件中看到的值,

我在stackoverflow中的其他线程中看到类似的错误,但我没有发现问题,我读到错误是由于空字段,我注意我在csv中没有空字段文件,在其他人谈论"作为文本分隔符,我不太了解它。

任何帮助都会受到重视。谢谢。

PD:我想你不会遇到csv文件的问题,有些字段是西班牙文,它是一个示例发票,重要的是格式和数据类型

生成的一个xml发票(我使用c ++代码将数据库中的信息(csv文件)与模板中的字段(xml文件)混合),我认为它是&#39 ;与此无关:)

    <fe:Facturae xmlns:fe="http://www.facturae.es/Facturae/2009/v3.2/Facturae" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.facturae.es/Facturae/2009/v3.2/Facturae">
  <FileHeader>
    <SchemaVersion>3.2</SchemaVersion>
    <Modality>I</Modality>
    <InvoiceIssuerType>EM</InvoiceIssuerType>
    <Batch>
      <BatchIdentifier>125</BatchIdentifier>
      <InvoicesCount>185</InvoicesCount>
      <TotalInvoicesAmount>
        <TotalAmount>98.27</TotalAmount>
      </TotalInvoicesAmount>
      <TotalOutstandingAmount>
        <TotalAmount>98.27</TotalAmount>
      </TotalOutstandingAmount>
      <TotalExecutableAmount>
        <TotalAmount>98.27</TotalAmount>
      </TotalExecutableAmount>
      <InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
    </Batch>
  </FileHeader>
  <Parties>
    <SellerParty>
      <TaxIdentification>
        <PersonTypeCode>J</PersonTypeCode>
        <ResidenceTypeCode>R</ResidenceTypeCode>
        <TaxIdentificationNumber>28.22</TaxIdentificationNumber>
      </TaxIdentification>
      <LegalEntity>
        <CorporateName>36.84</CorporateName>
        <RegistrationData/>
        <AddressInSpain>
          <Address>
          29.6
          </Address>
          <PostCode>31565</PostCode>
          <Town>33</Town>
          <Province>35</Province>
          <CountryCode>ESP</CountryCode>
        </AddressInSpain>
        <ContactDetails>
          <Telephone>37</Telephone>
          <ElectronicMail>39</ElectronicMail>
          <ContactPersons>41</ContactPersons>
        </ContactDetails>
      </LegalEntity>
    </SellerParty>
    <BuyerParty>
      <TaxIdentification>
        <PersonTypeCode>J</PersonTypeCode>
        <ResidenceTypeCode>R</ResidenceTypeCode>
        <TaxIdentificationNumber>434</TaxIdentificationNumber>
      </TaxIdentification>
      <AdministrativeCentres>
        <AdministrativeCentre>
            <CentreCode>45</CentreCode>
            <RoleTypeCode>01</RoleTypeCode>
            <Name>47</Name>
            <AddressInSpain>
                <Address>C/ </Address>
                <PostCode>98034</PostCode>
                <Town>Le Havre</Town>
                <Province>Tenerife</Province>
                <CountryCode>ESP</CountryCode>
            </AddressInSpain>
            <CentreDescription>92.5</CentreDescription>
        </AdministrativeCentre>
        <AdministrativeCentre>
            <CentreCode>90.65</CentreCode>
            <RoleTypeCode>02</RoleTypeCode>
            <Name>88</Name>
            <AddressInSpain>
                <Address>C/ </Address>
                <PostCode>84865</PostCode>
                <Town>Dover</Town>
                <Province>Calais</Province>
                <CountryCode>ESP</CountryCode>
            </AddressInSpain>
            <CentreDescription>Alien</CentreDescription>
        </AdministrativeCentre>
        <AdministrativeCentre>
            <CentreCode>568</CentreCode>
            <RoleTypeCode>03</RoleTypeCode>
            <Name>35</Name>
            <AddressInSpain>
                <Address>C/ </Address>
                <PostCode>93107</PostCode>
                <Town>Valencia</Town>
                <Province>Castellon</Province>
                <CountryCode>ESP</CountryCode>
            </AddressInSpain>
            <CentreDescription>96543</CentreDescription>
            </AdministrativeCentre>
        </AdministrativeCentres>
      <LegalEntity>
        <CorporateName>Juan</CorporateName>
        <RegistrationData/>
        <AddressInSpain>
          <Address>
          Suecia
          </Address>
          <PostCode>34885</PostCode>
          <Town>Palermo</Town>
          <Province>Sicilia</Province>
          <CountryCode>ESP</CountryCode>
        </AddressInSpain>
        <ContactDetails>
          <ContactPersons>658476806</ContactPersons>
        </ContactDetails>
      </LegalEntity>
    </BuyerParty>
  </Parties>
  <Invoices>
    <Invoice>
      <InvoiceHeader>
        <InvoiceNumber>1</InvoiceNumber>
        <InvoiceSeriesCode/>
        <InvoiceDocumentType>FC</InvoiceDocumentType>
        <InvoiceClass>OO</InvoiceClass>
      </InvoiceHeader>
      <InvoiceIssueData>
        <IssueDate>2018-04-22</IssueDate>
        <OperationDate>2018-04-21</OperationDate>
        <InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
        <TaxCurrencyCode>EUR</TaxCurrencyCode>
        <LanguageName>es</LanguageName>
      </InvoiceIssueData>
      <TaxesOutputs>
        <Tax>
          <TaxTypeCode>03</TaxTypeCode>
          <TaxRate>7.00</TaxRate>
          <TaxableBase>
            <TotalAmount>843.25</TotalAmount>
          </TaxableBase>
          <TaxAmount>
            <TotalAmount>158.00</TotalAmount>
          </TaxAmount>
          <EquivalenceSurchargeAmount>
            <TotalAmount>0.00</TotalAmount>
          </EquivalenceSurchargeAmount>
        </Tax>
      </TaxesOutputs>
      <InvoiceTotals>
        <TotalGrossAmount>843.25</TotalGrossAmount>
        <TotalGrossAmountBeforeTaxes>843.25</TotalGrossAmountBeforeTaxes>
        <TotalTaxOutputs>158.00</TotalTaxOutputs>
        <TotalTaxesWithheld>0.00</TotalTaxesWithheld>
        <InvoiceTotal>98.27</InvoiceTotal>
        <TotalOutstandingAmount>98.27</TotalOutstandingAmount>
        <TotalExecutableAmount>98.27</TotalExecutableAmount>
      </InvoiceTotals>
      <Items>
        <InvoiceLine>
          <IssuerTransactionReference/>
          <ItemDescription>  </ItemDescription>
          <Quantity></Quantity>
          <UnitOfMeasure>01</UnitOfMeasure>
          <UnitPriceWithoutTax>843.250000</UnitPriceWithoutTax>
          <TotalCost>843.250000</TotalCost>
          <GrossAmount>843.250000</GrossAmount>
          <TaxesOutputs>
            <Tax>
              <TaxTypeCode>03</TaxTypeCode>
              <TaxRate>7.00</TaxRate>
              <TaxableBase>
                <TotalAmount>843.25</TotalAmount>
              </TaxableBase>
              <TaxAmount>
                <TotalAmount>158.00</TotalAmount>
              </TaxAmount>
              <EquivalenceSurchargeAmount>
                <TotalAmount>0.00</TotalAmount>
              </EquivalenceSurchargeAmount>
            </Tax>
          </TaxesOutputs>
          <AdditionalLineItemInformation/>
        </InvoiceLine>
        <InvoiceLine>
          <IssuerTransactionReference/>
          <ItemDescription>  </ItemDescription>
          <Quantity></Quantity>
          <UnitOfMeasure>01</UnitOfMeasure>
          <UnitPriceWithoutTax>843.250000</UnitPriceWithoutTax>
          <TotalCost>843.250000</TotalCost>
          <GrossAmount>843.250000</GrossAmount>
          <TaxesOutputs>
            <Tax>
              <TaxTypeCode>03</TaxTypeCode>
              <TaxRate>7.00</TaxRate>
              <TaxableBase>
                <TotalAmount>843.25</TotalAmount>
              </TaxableBase>
              <TaxAmount>
                <TotalAmount>158.00</TotalAmount>
              </TaxAmount>
              <EquivalenceSurchargeAmount>
                <TotalAmount>0.00</TotalAmount>
              </EquivalenceSurchargeAmount>
            </Tax>
          </TaxesOutputs>
          <AdditionalLineItemInformation/>
        </InvoiceLine>
      </Items>
      <PaymentDetails>
        <Installment>
          <InstallmentDueDate>2018-04-22</InstallmentDueDate>
          <InstallmentAmount>98.27</InstallmentAmount>
          <PaymentMeans>04</PaymentMeans>
          <AccountToBeCredited>
            <IBAN></IBAN>
          </AccountToBeCredited>
        </Installment>
      </PaymentDetails>
      <AdditionalData>
        <InvoiceAdditionalInformation>Facturae generado por los alumnos </InvoiceAdditionalInformation>
      </AdditionalData>
    </Invoice>
  </Invoices>
</fe:Facturae>

0 个答案:

没有答案