0

my xml file starts like so:

<?xml version="1.0" encoding="ISO-8859-1"?> <Invoice Version="5.0"> </Invoice>

For simplicty:

the XSD starts off like this:

<xsd:schema xmlns="urn:cidx:names:specification:ces:schema:all:5:0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:cidx:names:specification:ces:schema:all:5:0">

I want to validate the xml file against the .xsd

I looked into this and it seems that I need to declare the .xsd in the xml file.

So I tried that:

<Invoice Version="5.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:SchemaLocation="http://www.w3schools.com file:///c:/Users/jpublic/Desktop/CIDX.xsd">

That doesn't seem to work... I'm sure it's something to do with the declaration being wrong wrong wrong but i'm very new to xml.

I'm trying to validate via notepad++ plugin XML tools Plugin 2.3.2 When I click Validate now it asks me where the file exists and once i pick it via the file open dialog box it give me this error:

Validation of current file using XML schema:

ERROR: Element 'Invoice': No matching global declaration available for the validation root.

Thanks!

Update:

Okay, so that allows it to find the file now it complains that every element in not expected i.e. TaxOrDutyTotals': This element is not expected. Expected is:

( {urn:cidx:names:specification:ces:schema:all:5:0}TaxOrDuty )

. I presume that means that it's not in the .xsd but i see it here:

<xsd:element name="TaxOrDutyTotals" type="TaxOrDutyTotalsType"/>

update 2:

.xsd

    ?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid XML Studio 1.0.8.0 (http://www.liquid-technologies.com) -->
<xsd:schema xmlns="urn:cidx:names:specification:ces:schema:all:5:0" targetNamespace="urn:cidx:names:specification:ces:schema:all:5:0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:simpleType name="cidxBoolean">
    <xsd:restriction base="cidxToken">
      <xsd:enumeration value="0"/>
      <xsd:enumeration value="1"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="cidxDateTime">
    <xsd:restriction base="xsd:dateTime"/>
  </xsd:simpleType>
  <xsd:simpleType name="cidxString">
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="cidxToken">
    <xsd:restriction base="xsd:token">
      <xsd:minLength value="1"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="cidxListTaxOrDutyQualifier">
    <xsd:restriction base="xsd:NMTOKEN">
      <xsd:enumeration value="VAT"/>
      <xsd:enumeration value="Duty"/>
      <xsd:enumeration value="Fee"/>
      <xsd:enumeration value="Tax"/>
    </xsd:restriction>
  </xsd:simpleType>
<xsd:simpleType name="cidxListTaxOrDutyQualifier">
    <xsd:restriction base="xsd:NMTOKEN">
      <xsd:enumeration value="VAT"/>
      <xsd:enumeration value="Duty"/>
      <xsd:enumeration value="Fee"/>
      <xsd:enumeration value="Tax"/>
    </xsd:restriction>
  </xsd:simpleType>
<xsd:element name="Allowances" type="AllowancesType"/>
  <xsd:complexType name="AllowancesType">
    <xsd:sequence>
      <xsd:element ref="AllowanceChargeIndicator"/>
      <xsd:element ref="AllowanceChargeType"/>
      <xsd:element ref="AllowanceChargeAmount"/>
      <xsd:element minOccurs="0" maxOccurs="unbounded" ref="TaxOrDuty"/>
      <xsd:element ref="AllowanceChargeCode"/>
      <xsd:element ref="AllowanceChargeDescription"/>
      <xsd:element minOccurs="0" ref="AllowanceChargeRateInformation"/>
    </xsd:sequence>
  </xsd:complexType>
<xsd:element name="InvoiceTotals" type="InvoiceTotalsType"/>
  <xsd:complexType name="InvoiceTotalsType">
    <xsd:sequence>
      <xsd:element minOccurs="0" ref="TotalLineItems"/>
      <xsd:element minOccurs="0" ref="LineItemTotalAmount"/>
      <xsd:element minOccurs="0" ref="ShippingTotalAmount"/>
      <xsd:element minOccurs="0" maxOccurs="unbounded" ref="Allowances"/>
      <xsd:element ref="InvoiceTotal"/>
      <xsd:element minOccurs="0" maxOccurs="unbounded" ref="TaxOrDutyTotals"/>
    </xsd:sequence>
  </xsd:complexType>
 <xsd:element name="LineItemTaxableTotal" type="LineItemTaxableTotalType"/>
  <xsd:complexType name="LineItemTaxableTotalType">
    <xsd:sequence>
      <xsd:element ref="MonetaryAmount"/>
      <xsd:element minOccurs="0" maxOccurs="unbounded" ref="TaxOrDuty"/>
    </xsd:sequence>
  </xsd:complexType>
<xsd:element name="Shipping" type="ShippingType"/>
  <xsd:complexType name="ShippingType">
    <xsd:sequence>
      <xsd:element ref="MonetaryAmount"/>
      <xsd:element minOccurs="0" maxOccurs="unbounded" ref="TaxOrDuty"/>
    </xsd:sequence>
  </xsd:complexType>
 <xsd:element name="TaxLocation" type="TaxLocationType"/>
  <xsd:element name="TaxOrDuty" type="TaxOrDutyType"/>
  <xsd:complexType name="TaxOrDutyType">
    <xsd:sequence>
      <xsd:element ref="TaxTypeCode"/>
      <xsd:element ref="TaxLocation"/>
      <xsd:choice>
        <xsd:element ref="Exempt"/>
        <xsd:element maxOccurs="unbounded" ref="NonExempt"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="TaxOrDutyQualifier" type="cidxListTaxOrDutyQualifier" use="required"/>
  </xsd:complexType>
  <xsd:element name="TaxOrDutyTotals" type="TaxOrDutyTotalsType"/>
  <xsd:complexType name="TaxOrDutyTotalsType">
    <xsd:sequence>
      <xsd:element ref="TaxTypeCode"/>
      <xsd:element ref="TaxLocation"/>
      <xsd:element ref="ExemptTotal"/>
      <xsd:element maxOccurs="unbounded" ref="NonExemptTotals"/>
    </xsd:sequence>
    <xsd:attribute name="TaxOrDutyQualifier" type="cidxListTaxOrDutyQualifier" use="required"/>
  </xsd:complexType>
  <xsd:element name="TaxRate" type="TaxRateType"/>
  <xsd:element name="TaxTypeCode" type="TaxTypeCodeType"/>
  <xsd:complexType name="TaxTypeCodeType">
    <xsd:simpleContent>
      <xsd:extension base="cidxToken">
        <xsd:attribute fixed="ANSI-ASC-X12-963" name="Domain" type="cidxToken"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>
</xsd:schema>

.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
  <Invoice Version="5.0" xsi:SchemaLocation="file:///c:/Users/someperson/Desktop/CIDX.xsd urn:cidx:names:specification:ces:schema:all:5:0" xmlns = "urn:cidx:names:specification:ces:schema:all:5:0">
     <Header>
        <ThisDocumentIdentifier>
           <DocumentIdentifier>RE12345</DocumentIdentifier>
        </ThisDocumentIdentifier>
        <ThisDocumentDateTime>
           <DateTime DateTimeQualifier="On">2013-10-15T10:00:00Z</DateTime>
        </ThisDocumentDateTime>
        <From>
           <PartnerInformation>
              <PartnerName>Partner Gumby</PartnerName>
              <PartnerIdentifier Agency="D-U-N-S">123456789</PartnerIdentifier>
           </PartnerInformation>
        </From>
        <To>
           <PartnerInformation>
              <PartnerName>awesome</PartnerName>
              <PartnerIdentifier Agency="D-U-N-S">123456787</PartnerIdentifier>
           </PartnerInformation>
        </To>
     </Header>
     <InvoiceBody>
        <InvoiceProperties>
           <InvoiceNumber>
              <DocumentReference>
                 <DocumentIdentifier>RE12345</DocumentIdentifier>
              </DocumentReference>
           </InvoiceNumber>
           <InvoiceType InvoiceQualifier="Original">Debit</InvoiceType>
           <InvoiceDate>
              <DateTime DateTimeQualifier="On">2013-04-17T00:00:00Z</DateTime>
           </InvoiceDate>
           <GrossInvoiceAmount>
              <MonetaryAmount>
                 <MonetaryValue>1186.80</MonetaryValue>
                 <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
              </MonetaryAmount>
           </GrossInvoiceAmount>
           <ReferenceInformation ReferenceType="PurchaseOrderNumber">
              <DocumentReference>
                 <DocumentIdentifier>100000001</DocumentIdentifier>
              </DocumentReference>
           </ReferenceInformation>
           <ReferenceInformation ReferenceType="BookingNumber">
              <DocumentReference>
                 <DocumentIdentifier>E07</DocumentIdentifier>
              </DocumentReference>
           </ReferenceInformation>
           <ReferenceInformation ReferenceType="DeliveryNoteNumber">
              <DocumentReference>
                 <DocumentIdentifier>LS1234</DocumentIdentifier>
                 <DateTime DateTimeQualifier="On">2013-04-02T00:00:00Z</DateTime>
              </DocumentReference>
           </ReferenceInformation>
           <PrimaryCurrency>
              <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
           </PrimaryCurrency>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*SupplierTaxNumber:01/234/5678/9</SpecialInstructions>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*SupplierCommRegNo:132435</SpecialInstructions>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*SupplierCommCourt:John Q. Public</SpecialInstructions>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*QSSKZ:QS</SpecialInstructions>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*TaxCode:AN</SpecialInstructions>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*ExportSign:1</SpecialInstructions>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*HeaderText:woot! I</SpecialInstructions>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*BankCountryKey:US</SpecialInstructions>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*IBAN:000</SpecialInstructions>
           <SpecialInstructions InstructionType="CustomerRequiredInstructions">*SWIFT:bleh</SpecialInstructions>
           <InvoiceTotals>
              <TotalLineItems>2</TotalLineItems>
              <LineItemTotalAmount>
                 <MonetaryAmount>
                    <MonetaryValue>1186.80</MonetaryValue>
                    <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                 </MonetaryAmount>
              </LineItemTotalAmount>
              <Allowances>
                 <AllowanceChargeIndicator>A</AllowanceChargeIndicator>
                 <AllowanceChargeType>A</AllowanceChargeType>
                 <AllowanceChargeAmount>
                    <PricingLumpSum>
                       <MonetaryAmount>
                          <MonetaryValue>12.00</MonetaryValue>
                          <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                       </MonetaryAmount>
                    </PricingLumpSum>
                 </AllowanceChargeAmount>
                 <AllowanceChargeCode Domain="ANSI-ASC-X12-1300">F050</AllowanceChargeCode>
                 <AllowanceChargeDescription>some work</AllowanceChargeDescription>
              </Allowances>
              <Allowances>
                 <AllowanceChargeIndicator>C</AllowanceChargeIndicator>
                 <AllowanceChargeType>C</AllowanceChargeType>
                 <AllowanceChargeAmount>
                    <PricingLumpSum>
                       <MonetaryAmount>
                          <MonetaryValue>12.00</MonetaryValue>
                          <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                       </MonetaryAmount>
                    </PricingLumpSum>
                 </AllowanceChargeAmount>
                 <AllowanceChargeCode Domain="ANSI-ASC-X12-1300">F050</AllowanceChargeCode>
                 <AllowanceChargeDescription>Some Work</AllowanceChargeDescription>
              </Allowances>
              <Allowances>
                 <AllowanceChargeIndicator>C</AllowanceChargeIndicator>
                 <AllowanceChargeType>C</AllowanceChargeType>
                 <AllowanceChargeAmount>
                    <PricingLumpSum>
                       <MonetaryAmount>
                          <MonetaryValue>0.58</MonetaryValue>
                          <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                       </MonetaryAmount>
                    </PricingLumpSum>
                 </AllowanceChargeAmount>
                 <AllowanceChargeCode Domain="ANSI-ASC-X12-1300">D210</AllowanceChargeCode>
                 <AllowanceChargeDescription>Fun</AllowanceChargeDescription>
              </Allowances>
              <InvoiceTotal>
                 <MonetaryAmount>
                    <MonetaryValue>1326.85</MonetaryValue>
                    <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                 </MonetaryAmount>
              </InvoiceTotal>
              <TaxOrDutyTotals TaxOrDutyQualifier="Tax">
                 <TaxTypeCode Domain="ANSI-ASC-X12-963">TX</TaxTypeCode>
                 <TaxLocation>DE</TaxLocation>
                 <ExemptTotal>
                    <MonetaryAmount>
                       <MonetaryValue>0</MonetaryValue>
                       <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                    </MonetaryAmount>
                 </ExemptTotal>
                 <NonExemptTotals>
                    <TaxRate>7.00</TaxRate>
                    <TaxableAmountTotal>
                       <MonetaryAmount>
                          <MonetaryValue>712.08</MonetaryValue>
                          <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                       </MonetaryAmount>
                    </TaxableAmountTotal>
                    <TaxAmountTotal>
                       <MonetaryAmount>
                          <MonetaryValue>49.85</MonetaryValue>
                          <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                       </MonetaryAmount>
                    </TaxAmountTotal>
                 </NonExemptTotals>
                 <NonExemptTotals>
                    <TaxRate>19.00</TaxRate>
                    <TaxableAmountTotal>
                       <MonetaryAmount>
                          <MonetaryValue>474.72</MonetaryValue>
                          <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                       </MonetaryAmount>
                    </TaxableAmountTotal>
                    <TaxAmountTotal>
                       <MonetaryAmount>
                          <MonetaryValue>90.20</MonetaryValue>
                          <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                       </MonetaryAmount>
                    </TaxAmountTotal>
                 </NonExemptTotals>
              </TaxOrDutyTotals>
           </InvoiceTotals>
           <PaymentTerms>
              <PaymentTermsOfSale>
                 <TermsOfSaleDescription>Bis 01.05.2013 </TermsOfSaleDescription>
                 <NetDaysDue>30</NetDaysDue>
                 <PaymentDueDate>
                      <DateTime DateTimeQualifier="On">2013-05-01T00:00:00Z</DateTime>
                 </PaymentDueDate>
              </PaymentTermsOfSale>
              <PaymentTermsBasisDate>
                 <DateTime DateTimeQualifier="On">2013-04-01T00:00:00Z</DateTime>
              </PaymentTermsBasisDate>
              <Discounts>
                 <PercentDiscount>3.00</PercentDiscount>
                 <DaysDue>14</DaysDue>
              </Discounts>
           </PaymentTerms>
           <DeliveryTerms>
              <DeliveryTermsCode Domain="Incoterms-2000">abc</DeliveryTermsCode>
              <DeliveryTermsLocation>front</DeliveryTermsLocation>
           </DeliveryTerms>
        </InvoiceProperties>
        <InvoicePartners>
           <Buyer>
              <PartnerInformation>
                 <PartnerName>banana</PartnerName>
                 <PartnerName>Accounting</PartnerName>
                 <PartnerIdentifier Agency="AssignedByBuyer">0050</PartnerIdentifier>
                 <AddressInformation>
                    <AddressLine>asdfasf. 38</AddressLine>
                    <CityName>asdfs</CityName>
                    <PostalCode>45261</PostalCode>
                    <PostalCountry>US</PostalCountry>
                 </AddressInformation>
                 <TaxInformation>
                    <TaxIdentifierNumber>DE149145247</TaxIdentifierNumber>
                 </TaxInformation>
              </PartnerInformation>
           </Buyer>
           <Seller>
              <PartnerInformation>
                 <PartnerName>Name Lieferant</PartnerName>
                 <PartnerIdentifier Agency="AssignedByBuyer">23456789</PartnerIdentifier>
                 <AddressInformation>
                    <AddressLine>Strasse Lieferant</AddressLine>
                    <CityName>Ort Lieferant</CityName>
                    <PostalCode>PLZ 12345</PostalCode>
                    <PostalCountry>DE</PostalCountry>
                 </AddressInformation>
                 <TaxInformation>
                    <TaxIdentifierNumber>DE123456789</TaxIdentifierNumber>
                 </TaxInformation>
                 <AccountInformation>
                    <AccountHolderName>Kontoinhaber</AccountHolderName>
                    <FinancialInstitutionIdentification>
                        <FinancialInstitutionName>Name Some Bank</FinancialInstitutionName>
                        <FinancialInstitutionDFINumber>11111111111</FinancialInstitutionDFINumber>
                        <AccountNumber>11111111111111111</AccountNumber>
                    </FinancialInstitutionIdentification>
                 </AccountInformation>
              </PartnerInformation>
           </Seller>
           <OtherPartner PartnerRole="Receiver">
              <PartnerInformation>
                 <PartnerName>Name banana</PartnerName>
                 <PartnerIdentifier Agency="AssignedBySeller">000</PartnerIdentifier>
                 <AddressInformation>
                    <AddressLine>WE Strasse</AddressLine>
                    <CityName>WE Ort</CityName>
                    <PostalCode>68790</PostalCode>
                    <PostalCountry>DE</PostalCountry>
                 </AddressInformation>
              </PartnerInformation>
           </OtherPartner>
           <OtherPartner PartnerRole="ShipFrom">
              <PartnerInformation>
                 <PartnerName>ShipFrom</PartnerName>
                 <PartnerIdentifier Agency="AssignedBySeller">000</PartnerIdentifier>
                 <AddressInformation>
                    <CityName>City</CityName>
                    <PostalCountry>DE</PostalCountry>
                 </AddressInformation>
              </PartnerInformation>
           </OtherPartner>
           <OtherPartner PartnerRole="ShipTo">
              <PartnerInformation>
                 <PartnerName>ShipTo</PartnerName>
                 <PartnerIdentifier Agency="AssignedBySeller">000</PartnerIdentifier>
                 <AddressInformation>
                    <CityName>City</CityName>
                    <PostalCountry>GB</PostalCountry>
                 </AddressInformation>
              </PartnerInformation>
           </OtherPartner>
        </InvoicePartners>
        <InvoiceDetails>
           <InvoiceLineItem>
              <LineNumber>1</LineNumber>
              <ProductIdentification>
                 <ProductIdentifier Agency="AssignedBySeller">12345678</ProductIdentifier>
                 <ProductDescription>bonanza 1</ProductDescription>
              </ProductIdentification>
              <ProductQuantity>
                 <Measurement>
                    <MeasurementValue>2.000</MeasurementValue>
                    <UnitOfMeasureCode Domain="UN-Rec-20">PCE</UnitOfMeasureCode>
                 </Measurement>
              </ProductQuantity>
              <Pricing PriceType="NetPrice">
                 <PricingPerUnit>
                    <MonetaryAmount>
                       <MonetaryValue>237.36</MonetaryValue>
                       <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                    </MonetaryAmount>
                    <PriceBasis>
                       <Measurement>
                          <MeasurementValue>1</MeasurementValue>
                          <UnitOfMeasureCode Domain="UN-Rec-20">PCE</UnitOfMeasureCode>
                       </Measurement>
                    </PriceBasis>
                 </PricingPerUnit>
              </Pricing>
              <PurchaseOrderInformation>
                 <DocumentReference>
                    <DocumentIdentifier>100000001</DocumentIdentifier>
                    <ReferenceItem>10</ReferenceItem>
                 </DocumentReference>
              </PurchaseOrderInformation>
              <ReferenceInformation ReferenceType="DeliveryNoteNumber">
                 <DocumentReference>
                    <DocumentIdentifier>LS1234</DocumentIdentifier>
                    <DateTime DateTimeQualifier="On">2013-04-02T00:00:00Z</DateTime>
                 </DocumentReference>
              </ReferenceInformation>
              <ReferenceInformation ReferenceType="SalesOrderReference">
                 <DocumentReference>
                    <DocumentIdentifier>2013000002</DocumentIdentifier>
                    <ReferenceItem>30</ReferenceItem>
                 </DocumentReference>
              </ReferenceInformation>
              <OtherPartner PartnerRole="ShipFrom">
                 <PartnerInformation>
                    <PartnerName>ShipFrom</PartnerName>
                    <PartnerIdentifier Agency="AssignedBySeller">000</PartnerIdentifier>
                    <AddressInformation>
                       <CityName>City</CityName>
                       <PostalCountry>US</PostalCountry>
                    </AddressInformation>
                 </PartnerInformation>
              </OtherPartner>
              <OtherPartner PartnerRole="ShipTo">
                 <PartnerInformation>
                    <PartnerName>ShipTo</PartnerName>
                    <PartnerIdentifier Agency="AssignedByBuyer">1630</PartnerIdentifier>
                    <AddressInformation>
                       <CityName>City</CityName>
                       <PostalCountry>US</PostalCountry>
                    </AddressInformation>
                 </PartnerInformation>
              </OtherPartner>
              <SpecialInstructions InstructionType="CustomerRequiredInstructions">*TXJCD:NY</SpecialInstructions>
              <SpecialInstructions InstructionType="CustomerRequiredInstructions">*TaxCode:AN</SpecialInstructions>
              <LineItemTaxableTotal>
                 <MonetaryAmount>
                    <MonetaryValue>474.72</MonetaryValue>
                    <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                 </MonetaryAmount>
                 <TaxOrDuty TaxOrDutyQualifier="Tax">
                    <TaxTypeCode Domain="ANSI-ASC-X12-963">TX</TaxTypeCode>
                    <TaxLocation>US</TaxLocation>
                    <NonExempt>
                       <TaxRate>19.00</TaxRate>
                       <TaxableAmount>
                          <MonetaryAmount>
                             <MonetaryValue>474.72</MonetaryValue>
                             <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                          </MonetaryAmount>
                       </TaxableAmount>
                       <TaxAmount>
                          <MonetaryAmount>
                             <MonetaryValue>90.20</MonetaryValue>
                             <CurrencyCode Domain="ISO-4217">EUR</CurrencyCode>
                          </MonetaryAmount>
                       </TaxAmount>
                    </NonExempt>
                 </TaxOrDuty>
              </LineItemTaxableTotal>
           </InvoiceLineItem>
        </InvoiceDetails>
</InvoiceBody>

okay lets try this.

Toofgib
  • 15
  • 4
  • Please provide a [**Minimal, *Complete*, and Verifiable Example (MCVE)**](http://stackoverflow.com/help/mcve) that exhibits the problem. Thanks. – kjhughes May 13 '15 at 00:16

2 Answers2

0

try the following:

<Invoice Version="5.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:SchemaLocation="file:///c:/Users/jpublic/Desktop/CIDX.xsd urn:cidx:names:specification:ces:schema:all:5:0" xmlns = "urn:cidx:names:specification:ces:schema:all:5:0">
//....
</Invoice>
Kachna
  • 2,921
  • 2
  • 20
  • 34
  • Okay, so that allows it to find the file now it complains that every element in not expected i.e. TaxOrDutyTotals': This element is not expected. Expected is ( {urn:cidx:names:specification:ces:schema:all:5:0}TaxOrDuty ). I presume that means that it's not in the .xsd but i see it here: '' – Toofgib May 12 '15 at 21:31
  • Please update your question with the complete xsd file – Kachna May 12 '15 at 21:46
  • I'm not sure I can publish it being that it came from a vendor... I would be okay emailing it to you. – Toofgib May 12 '15 at 21:58
  • That's not how this site works. Prune down the vendor XSD to a minimal one that exhibits the problem and post that along with a similarly pruned XML file. It's not just about getting your question answered but also about providing info that's useful to future readers as well. Emailing files would totally defeat the benefit to others. Thanks. – kjhughes May 13 '15 at 00:17
  • i assume that the problem is related to the use of namespaces. in your xml file: use the attribute xmlns= "urn:cidx:names:specification:ces:schema:all:5:0" in the element Invoice. – Kachna May 13 '15 at 10:44
  • I have updated the question with both files that exibit the first problem – Toofgib May 13 '15 at 15:46
  • I am having issues getting a minimal version of the .xsd b/c I don't know enough to figure out what I need. – Toofgib May 13 '15 at 16:57
0

This XSD is wrong. It has many errorrs.

This part is repeated...

<xsd:simpleType name="cidxListTaxOrDutyQualifier">
    <xsd:restriction base="xsd:NMTOKEN">
      <xsd:enumeration value="VAT"/>
      <xsd:enumeration value="Duty"/>
      <xsd:enumeration value="Fee"/>
      <xsd:enumeration value="Tax"/>
    </xsd:restriction>
  </xsd:simpleType>

No TaxLocationType and TaxRateType

<xsd:element name="TaxLocation" type="TaxLocationType" />

<xsd:element name="TaxRate" type="TaxRateType" />

Where is ref items...?

<xsd:element ref="AllowanceChargeIndicator"/>
      <xsd:element ref="AllowanceChargeType"/>
      <xsd:element ref="AllowanceChargeAmount"/>

I think if you write a correct xsd it will work. cheers

Coderzz
  • 55
  • 7