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

Posted on 2014-08-05
Last Modified: 2016-02-11
{ 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.
    <Compute Timestamp="2014-06-30 09:09:00">
        <Fuels Unit="LBS">
                <Origin Currency="USD" Quantity="USG">3.11</Origin>
                <Destination Currency="USD" Quantity="USG">4.00</Destination>
                <Savings Currency="USD">2098.98</Savings>
        <Dispatcher>JOHNNY ROCKET</Dispatcher>

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
Question by:Jim Horn
    1 Comment
    LVL 65

    Accepted Solution

    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.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now