天天看點

How to make the SSIS load infopath XML files into DB?

Infopath is a good choice for quick designing questionnaire and collecting the information back. Yet you may meet challenge when you wanna import the pile of the XML files into DB because the XML files includes more than one namespaces, which SSIS XML source can not handle.

One of the possible solutions is to use XML task in SSIS to remove the namespaces in XML files. Here lists some clues for the ones who meet the same problem with me.

XML task-->xslt (import an xls stylesheet file)

<?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>

繼續閱讀