Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Ansi Unix Ansi UnixTo: NULL Date: 8/3/2005 4:40:00 PM I'm exporting data from database to a fixed width text file.
Here is the process:
Get the data from the database into a dataset.
Apply a xslt transform to xml in dataset
Write the string to a file.
When viewing the file using TextPad the file type = Unix and the Code set =
ansi.
I want the file type to equal PC. I don't know why it is unix.
I have tried converting the encoding to ASCII but I don't think that is
where the problem is and it doesn't help anyway.
Any help will be greatly appreciated.
Here is the xslt transform:
<!DOCTYPE root [
<!ELEMENT COLUMN_DATA ANY>
<!ATTLIST COLUMN_DATA SSN ID #REQUIRED>
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="8859-1"/>
<xsl:preserve-space elements="*" />
<xsl:template match="Table">
<xsl:apply-templates select="Client_Number"/>
<xsl:apply-templates select="Filler_0"/>
<xsl:apply-templates select="Name"/>
<xsl:apply-templates select="Optional"/>
<xsl:apply-templates select="Address"/>
<xsl:apply-templates select="City"/>
<xsl:apply-templates select="State"/>
<xsl:apply-templates select="Zip"/>
<xsl:apply-templates select="Service"/>
<xsl:apply-templates select="Transmittal_Number"/>
<xsl:apply-templates select="Filler_1"/>
<xsl:apply-templates select="Debtor_Reference"/>
<xsl:apply-templates select="LastDepositDate"/>
<xsl:apply-templates select="AccountBalance"/>
<xsl:apply-templates select="Filler_2"/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="Client_Number">
<xsl:value-of select='substring(concat(.," "), 1, 5)'/>
</xsl:template>
<xsl:template match="Filler_0">
<xsl:value-of select='substring(concat(.," "), 1, 3)'/>
</xsl:template>
<xsl:template match="Name">
<xsl:value-of select='substring(concat(.,"
"), 1, 30)'/>
</xsl:template>
<xsl:template match="Optional">
<xsl:value-of select='substring(concat(.,"
"), 1, 30)'/>
</xsl:template>
<xsl:template match="Address">
<xsl:value-of select='substring(concat(.,"
"), 1, 30)'/>
</xsl:template>
<xsl:template match="City">
<xsl:value-of select='substring(concat(.," "), 1, 15)'/>
</xsl:template>
<xsl:template match="State">
<xsl:value-of select='substring(concat(.," "), 1, 2)'/>
</xsl:template>
<xsl:template match="Zip">
<xsl:value-of select='substring(concat(.," "), 1, 5)'/>
</xsl:template>
<xsl:template match="Service">
<xsl:value-of select='substring(concat(.," "), 1, 1)'/>
</xsl:template>
<xsl:template match="Transmittal_Number">
<xsl:value-of select='substring(concat(.," "), 1, 10)'/>
</xsl:template>
<xsl:template match="Filler_1">
<xsl:value-of select='substring(concat(.," "), 1, 1)'/>
</xsl:template>
<xsl:template match="Debtor_Reference">
<xsl:value-of select='substring(concat(.," "), 1, 15)'/>
</xsl:template>
<xsl:template match="LastDepositDate">
<xsl:value-of select='substring(concat(.," "), 1, 6)'/>
</xsl:template>
<xsl:template match="AccountBalance">
<xsl:value-of select='substring(concat(.," "), 1, 8)'/>
</xsl:template>
<xsl:template match="Filler_2">
<xsl:value-of select='substring(concat(.," "), 1, 9)'/>
</xsl:template>
</xsl:stylesheet>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
