My first forray into XSLT. I'm using VS 2012 to create an SSIS package to import XML data into an SQL table using XSLT to flatten some of the XML data. Upon executing the task, the output XML contains extra data that is not formed XML. I'm close, but I'm not sure how to get it right.
I tried to add the files, but I can't seem to get them into this space. . . and I can't add screen shots. I'm hoping after I post the question, I can attach the files. . .
Edit: Pasted Comments:
Input XML file ends like this
</PropertyReports>
</RVSCompleteReport>
</REPORT>
<SEARCH_NAMES ErrorInfo="">
<SEARCH_NAME>BALLANCE LAMBERT LISA</SEARCH_NAME>
<SEARCH_NAME>BALLANCELAMBERT LISA</SEARCH_NAME>
<SEARCH_NAME>BALLANCE-LAMBERT LISA</SEARCH_NAME>
<SEARCH_NAME>LAMBERT JACK</SEARCH_NAME>
<SEARCH_NAME>LAMBERT JOHN</SEARCH_NAME>
<SEARCH_NAME>LAMBERT JOHN AND LISA</SEARCH_NAME>
</SEARCH_NAMES>
</RvsStandardDelivery>
The Search names are being added to the output as unformatted
</RVSCompleteReport>
</REPORT>
BALLANCE LAMBERT LISABALLANCELAMBERT LISABALLANCE-LAMBERT
LISALAMBERT JACKLAMBERT JOHNLAMBERT JOHN AND LISALAMBERT
JOHN RLAMBERT JOHN R AND LISA
The XSLT is
<xsl:stylesheet version="1.0" xmlns:xsl="w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="RvsStandardDelivery/REPORT">
<REPORT>
<xsl:for-each select="RVSCompleteReport">
<RVSCompleteReport>
<OrdrNum>
<xsl:value-of select="ReportInfo/ordernumber"/>
</OrdrNum>
<borrowerName>
<xsl:value-of select="ReportInfo/borrowername"/>
</borrowerName>
<PropAdd>
<xsl:value-of select="ReportInfo/propertyaddress"/>
</PropAdd>
</RVSCompleteReport>
</xsl:for-each>
</REPORT>
</xsl:template>
</xsl:stylesheet>