Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For some reason when I export to excel using a xsl file, the numbers are not
coming out correctly. Here is the code: <?xml version="1.0" encoding="UTF-8"? <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2004/10/xpath-datatypes" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" <xsl:output method="text"/ <xsl:template match="/"Cusip <xsl:for-each select="REPORT/POS/POS_ROW" <xsl:text </xsl:text <xsl:value-of select="normalize-space(CUSIP)"/ </xsl:for-each </xsl:template </xsl:stylesheet The Cusip should be 00000129 but it is coming out 129. All of the zeros are getting surpressed. Any idea why? Thanks in advance for your help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't understand xsl files so I don't know how to correct yor problem, but
the reason the zeros are being suppressed is because that is whay Excel does with leading zeros. I you can enter the data as text instead of a number, that will cure the problem. To illustrate this, format a cell as Text and type a number in it. The leading zeros will be retained. -- Ian -- "Charlie" wrote in message ... For some reason when I export to excel using a xsl file, the numbers are not coming out correctly. Here is the code: <?xml version="1.0" encoding="UTF-8"? <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2004/10/xpath-datatypes" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" <xsl:output method="text"/ <xsl:template match="/"Cusip <xsl:for-each select="REPORT/POS/POS_ROW" <xsl:text </xsl:text <xsl:value-of select="normalize-space(CUSIP)"/ </xsl:for-each </xsl:template </xsl:stylesheet The Cusip should be 00000129 but it is coming out 129. All of the zeros are getting surpressed. Any idea why? Thanks in advance for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Importing XML using Stylesheet doesn't allow refreshing | Excel Discussion (Misc queries) | |||
Protect Cell Formatting including Conditional Formatting | Excel Discussion (Misc queries) | |||
expanding custom formatting without removing existing cell formatting? | Excel Worksheet Functions | |||
Opening XML file with an XSL stylesheet | Excel Discussion (Misc queries) | |||
Auto-generation of pivot table from XSL stylesheet | Excel Programming |