XML Load Error

  • Hello everyone,  I'm attempting to connect to an xml file so I can later load it to a SQL DB, but haven't really been able to get beyond just connecting to it with the XML Source.  So, here's a test xml file I'm currently working with that I got from a client:

    <Shipper Reference #>418492</Shipper Reference #>
    <Booking Number>14132390</Booking Number>
    <Service Type>OCEAN TO OCEAN (CY TO CY)</Service Type>
    <Plant>TEST PLANT</Plant>
    <Place of Delivery>TAICHUNG, TAIWAN</Place of Delivery>
    <Carrier Name>TEST LINE</Carrier Name>
    <First Day In>2021-02-03</First Day In>
    <Doc Cut Date>2021-02-11</Doc Cut Date>
    <Port Cut Date>2021-02-12</Port Cut Date>
    <Departure Date>2021-02-17</Departure Date>
    <Vessel Name>TEST VESSEL</Vessel Name>
    <Voyage>1080-002W</Voyage>
    <Drayage Name>TEST DRAYAGE</Drayage Name>
    <Consignee>TEST CONSIGNEE</Consignee>

    So it errors when I try to Generate the XSD off their xml filed.  Error message is:

    '#' is an unexpected token.  The expected token is '=', Line 1 position 20

    I was thinking it just didn't like the # so I removed it for testing purposes.  Got the same error only with the > this time:

    '>' is an unexpected token.  The expected token is '=', Line 1 position 20

    Is there maybe something I'm doing on my end when I try to connect to it?  Or is my client just structuring the xml incorrectly?  If so, I wanted to be able to communicate back to them what is wrong with the file.  Just trying to figure out what it is so I can give them the correct information.

    Any help would be appreciated.

    Thanks!

    Strick

  • Element names may not have spaces in them.

    When the parser looks at <Shipper Reference> it sees an element named Shipper and an attribute named Reference, for which it is expecting a value, like <Shipper Reference="1">.

    Use <Shipper_Reference> or <ShipperReference> (and <Booking_Number>, <Service_Type>, etc.) or something like that.

    Eddie Wuerch
    MCM: SQL

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply