How to create a semi-colon seperated file using XSL
-
Hello, I have written a XSL which is to read the data from a DTO and write to a .CSV file with the following format. I am not able to create semi-colon values and also the padding format written is not being reflected in the output file. Can anyone help in incorporating these formats. I am attaching my XSL here for the reference. Thanks for the same. -The file created is an excel file. The extension is “.CSV”. -The data are separated by the character semi-colon “;”. -Every data row end up with an end of row character and a carriage return character (CR/LF). -The end of the file is marked by an empty record row. In other words, the last row only contain semi-colon characters and all the fields are empty. If the data length is inferior to the data maximum size, a padding is done as following: - the numeric data are filled with “0” (zero) on the left (for example 003) - the alphanumeric data are filled with empty spaces “ “ <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dft="http://MyProj.Dto.CustomerSpecificExport/"> <xsl:output method="text" indent="yes" /> <xsl:template match="/dft:ArrayOfExportDataDto"> <xsl:apply-templates select="dft:ExportDataDto"/> </xsl:template> <xsl:template match="dft:ExportDataDto"> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="AgencyName" /> <xsl:with-param name="len" select="20" /> </xsl:call-template> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="CandidateName" /> <xsl:with-param name="len" select="20" /> </xsl:call-template> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="CandidateSurname" /> <xsl:with-param name="len" select="10" /> </xsl:call-template> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="BeginDate" /> <xsl:with-param name="len" select="10" /> <xsl:with-param name="pad" select="0" /> </xsl:call-template> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="InitialMissionEndDate" /> <xsl:with-param name="len" select="10" /> <xsl:with-param name="pad" select="0" /> </xsl:call-template> - <xsl:call-template name="pad-left"&
-
Hello, I have written a XSL which is to read the data from a DTO and write to a .CSV file with the following format. I am not able to create semi-colon values and also the padding format written is not being reflected in the output file. Can anyone help in incorporating these formats. I am attaching my XSL here for the reference. Thanks for the same. -The file created is an excel file. The extension is “.CSV”. -The data are separated by the character semi-colon “;”. -Every data row end up with an end of row character and a carriage return character (CR/LF). -The end of the file is marked by an empty record row. In other words, the last row only contain semi-colon characters and all the fields are empty. If the data length is inferior to the data maximum size, a padding is done as following: - the numeric data are filled with “0” (zero) on the left (for example 003) - the alphanumeric data are filled with empty spaces “ “ <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dft="http://MyProj.Dto.CustomerSpecificExport/"> <xsl:output method="text" indent="yes" /> <xsl:template match="/dft:ArrayOfExportDataDto"> <xsl:apply-templates select="dft:ExportDataDto"/> </xsl:template> <xsl:template match="dft:ExportDataDto"> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="AgencyName" /> <xsl:with-param name="len" select="20" /> </xsl:call-template> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="CandidateName" /> <xsl:with-param name="len" select="20" /> </xsl:call-template> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="CandidateSurname" /> <xsl:with-param name="len" select="10" /> </xsl:call-template> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="BeginDate" /> <xsl:with-param name="len" select="10" /> <xsl:with-param name="pad" select="0" /> </xsl:call-template> - <xsl:call-template name="pad-right"> <xsl:with-param name="str" select="InitialMissionEndDate" /> <xsl:with-param name="len" select="10" /> <xsl:with-param name="pad" select="0" /> </xsl:call-template> - <xsl:call-template name="pad-left"&
RK11@2009 wrote:
I am not able to create semi-colon values
I don't see you ever writing semi-colons or line separators to the output?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p