Unable to infer the xsd from the xml file. The xml contains multiple namespaces.

Thirston Third 21 Reputation points
2022-02-03T23:33:38.863+00:00

I'm importing an xml file using the XML Source task in SSIS. When I click on the Generate XSD it's giving me an error.

Unable to infer the xsd from the xml file. The xml contains multiple namespaces.

This is what my xml file look like.

<x:dataset>
<y:row attribute1='IDvalue' attribute2='value' attribute3='value' />
<y:row attribute1='IDvalue' attribute2='value' attribute3='value' />
<y:row attribute1='IDvalue' attribute2='value' attribute3='value' />
<y:row attribute1='IDvalue' attribute2='value' attribute3='value' />
</x:dataset>

I think it needs to look like this.

<x:dataset>
<y:row/>
<attribute1='IDvalue'/>
<attribute2='value'/>
<attribute3='value'/>
</y:row>
<y:row/>
<attribute1='IDvalue'/>
<attribute2='value'/>
<attribute3='value'/>
</y:row>
<y:row/>
<attribute1='IDvalue'/>
<attribute2='value'/>
<attribute3='value'/>
</y:row>
<y:row/>
<attribute1='IDvalue'/>
<attribute2='value'/>
<attribute3='value'/>
</y:row>
</x:dataset>

How do you format the XML file?

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,451 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 32,506 Reputation points
    2022-02-04T02:25:16.167+00:00

    Hi @Thirston Third ,

    I'm not familiar with XML.

    Someone mentioned that you may strip out the namespaces from xml files.

    Check these links to see if it is helpful.

    https://social.msdn.microsoft.com/Forums/en-US/2fde216c-01ab-42a5-8b43-52f5f42d35bc/multiple-namespaces-in-an-xml-document?forum=sqlintegrationservices

    https://www.sqlservercentral.com/forums/topic/importing-xml-and-ssis

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Olaf Helper 40,656 Reputation points
    2022-02-07T10:47:45.633+00:00

    The xml contains multiple namespaces.

    There are two namespace, "x" and "y", but they are nowhere define, so it's invalid (uncomplete) XML.

    0 comments No comments