saving txt file is adding extra character in the first row

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
I am using C# and XSLT to produce a txt file. The data comes from an xml file.
The txt file generated looks ok when I open it in notepad. However when I edit it using the DOS editor I see that some characters are added to the beggining of the first row. This is what it looks like:
 000000000000000000000000739201207230003ANCF6010739
Then when I load the file into the system it is recused since those characters deslocate the header.
Could someone please shed some light? how these characters are being inserted there?
This is the C# code and xslt I am using to build the header:
<pre class="prettyprint XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(Server.MapPath("XSLT/ANC601.xslt"));

var pathTxt = "V:/ANC601/Old " + DateTime.Now.Year.ToString() + "/" + ancName;
System.Threading.Thread.Sleep(50);

xslt.Transform("P:/LONSHRALL/ANC601/XMLFiles/Temp.xml", pathTxt);[/code]
XLST
<pre class="prettyprint <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform

<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>

<xsl:template match="/
<xsl:apply-templates select = "SienaReport"/>
</xsl:template>

<xsl:template match="SienaReport
<xsl:apply-templates select = "ImagesDataGroup"/>
</xsl:template>

<xsl:template match = "ImagesDataGroup
<!-- W-COD-CHVE-HDER -->
<xsl:text></xsl:text>
//Characters are inserted here<br/> <xsl:text>00000000000000000000000</xsl:text>
<xsl:text></xsl:text>

------
------[/code]
Cheers,
C



View the full article
 
Back
Top