Developer forum

Forum » Development » Import/Export - generates some empty lines in my output

Import/Export - generates some empty lines in my output


Reply

Hey folks,

 

I have a problem with the Import/Export module, and i hope you guys can help me out.

 

What i've made so far is a pipeline that grabs an XML order file, generated with the "Export orders from DB to XML", and converts it to a CSV file.

My pipeline contains an XML source, a XSLT Transformer and a Local file destination.

 

 

It seems to work great with one little exception....

I get a blank line after each order.

 

My XSLT looks like below, and i crammed everything into on line, to se if that removed the blank line, but it's still there.

 

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
 <xsl:output method="text" encoding="UTF-8"/> 
 <xsl:template match="/"><xsl:apply-templates select="/Orders/Order"/></xsl:template>
 <xsl:template match="/Orders/Order"><xsl:variable name="OrderID" select="OrderID"/><xsl:variable name="OrderCustomerName" select="OrderCustomerName"/><xsl:variable name="OrderCustomerAddress" select="OrderCustomerAddress"/><xsl:variable name="OrderCustomerAddress2" select="OrderCustomerAddress2"/><xsl:variable name="OrderCustomerZip" select="OrderCustomerZip"/><xsl:variable name="OrderCustomerCity" select="OrderCustomerCity"/><xsl:variable name="OrderCustomerCountry" select="OrderCustomerCountry"/><xsl:for-each select="OrderLines/OrderLine">"";"";"<xsl:value-of select="$OrderID"/>|<xsl:value-of select="OrderLineID"/>";"";"<xsl:value-of select="$OrderCustomerName"/>";"<xsl:value-of select="$OrderCustomerAddress"/>";"<xsl:value-of select="$OrderCustomerAddress2"/>";"<xsl:value-of select="$OrderCustomerZip"/><xsl:text> </xsl:text><xsl:value-of select="$OrderCustomerCity"/>";"<xsl:value-of select="$OrderCustomerZip"/>";"<xsl:value-of select="$OrderCustomerCountry"/>";"";"<xsl:value-of select="OrderLineQuantity"/>";"";"";"<xsl:value-of select="OrderLineProductNumber"/>";"<xsl:value-of select="OrderLineProductVariantText"/>";"";"";""<xsl:text>
</xsl:text></xsl:for-each></xsl:template>
</xsl:stylesheet>

 

Does anyone have a solution for this problem, or use the Import/Export module to get Orders out as CSV.

Any suggestions are much appreciated :)

 

</martin>

 


Replies

 

You must be logged in to post in the forum