SSIS 2012, XML Source Editor, Generate XSD.. returns errmsg 'Data at the root level is invalid. Line 1, position 1.

{ Warning:  SQL/SSIS expert, XML N00b }

Hi All

Looking for either an answer to 'How to I get around the below error', or a work-around.

I have an XML file (below) where I am being asked to flatten it and import into SQL Server.
<FlightInfo>
    <FlightKey>
        <Alc>SCX</Alc>
        <Number>0117</Number>
        <STD>2014-06-30T11:00:00Z</STD>
        <OriginIcao>KMSP</OriginIcao>
    </FlightKey>
    <Compute Timestamp="2014-06-30 09:09:00">
        <Fuels Unit="LBS">
            <Pre>27151</Pre>
            <Release>10651</Release>
            <Tankerage>16500</Tankerage>
            <Burn>3830</Burn>
            <Arrival>22996</Arrival>
            <Costs>
                <Origin Currency="USD" Quantity="USG">3.11</Origin>
                <Destination Currency="USD" Quantity="USG">4.00</Destination>
                <Savings Currency="USD">2098.98</Savings>
            </Costs>
        </Fuels>
        <Dispatcher>JOHNNY ROCKET</Dispatcher>
    </Compute>
</FlightInfo>

Open in new window

In SSIS when I open an XML Source Editor, add the path, and hit the 'Generate XSD..' button I receive an error message 'Data at the root level is invalid.  Line 1, position 1. xml-source-editor-data-at-the-root-level
LVL 66
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Figured it out.  Made a copy of the .xml file and pasted it as sample.xml, then added <?xml version="1.0"?> to the top of it, saved, used that as the XML Location, and I was able to generate an .xsd file.

Will leave the question open for any professionals to suggest better ways of doing this.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.