Importing XML and SSIS

  • Hi all and tia for any help. Here's my problem. I have a requirement to  ETL a vendor's XML file. The problem, the XML file contains mulitple XSD's and multiple name spaces (one record has 44 internal name spaces plus 3 external ones). If I try to use either of the vendor's xsd's I get "A component does not have any inputs or outputs". If I try to generate an xsd I get "Unable to infer XSD from file. XML contains multiple namespaces". What can I do to import this data?

    dab

  • This was removed by the editor as SPAM

  • The solution to this problem can found here:

    http://www.resquel.com/ssb/2008/08/08/FightingWithTheSSISXMLSource.aspx

    The .xsd file is not formatted correctly.

  • SSIS has an XML task that can do the transformation. Add the XML task to an SSIS Control Flow and edit it. Change the OperationType property value to XSLT, the SourceType to File connection and the Source to your source file that has the problem.

    Set the SaveOperationResult property to True and expand the OperationResult branch. Set DestinationType to File Connection and the Destination to a new XML file.

    Add the following to a new file and save it with an xslt file extension.

    <?xml version="1.0" encoding="utf-8" ?>

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output method="xml" indent="no" />

    <xsl:template match="/|comment()|processing-instruction()">

    <xsl:copy>

    <xsl:apply-templates />

    </xsl:copy>

    </xsl:template>

    <xsl:template match="*">

    <xsl:element name="{local-name()}">

    <xsl:apply-templates select="@*|node()" />

    </xsl:element>

    </xsl:template>

    <xsl:template match="@*">

    <xsl:attribute name="{local-name()}">

    <xsl:value-of select="." />

    </xsl:attribute>

    </xsl:template>

    </xsl:stylesheet>

    This code comes from the following article, which also gives more information about cleaning up a source XML file:

    Back in the XML task, set the SecondOperandType to File connection and the Second Operand to your new XSLT file.

    When you run the XML task, it will take your original file and apply the transformation rules defined in the XSLT file. The results will be saved in your new XML file. This task only needs to be run once for the original XML file. When you look at the new file, you’ll see the same data as in the original, but without namespace references.

Viewing 4 posts - 1 through 3 (of 3 total)

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